Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add migration step for Currency Switcher #7397

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

pauloiankoski
Copy link
Contributor

@pauloiankoski pauloiankoski commented May 28, 2024

Resolves GIVE-679

Description

This pull request adds a new FormMigration step that migrates Currency Switcher settings from v2 forms to v3.

Affects

Form Migration

Testing Instructions

  1. Create a v2 form
  2. Customize Currency Switcher settings
  3. Migrate that form to v3
  4. Ensure the settings have been migrated properly

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@pauloiankoski pauloiankoski marked this pull request as ready for review May 28, 2024 01:45
Comment on lines 989 to 1007
public function getCurrencySwitcherStatus(): string
{
return $this->getMeta('cs_status');
}

/**
* @unreleased
*/
public function getCurrencySwitcherMessage(): string
{
return $this->getMeta('cs_message');
}

/**
* @unreleased
*/
public function getCurrencySwitcherDefaultCurrency(): string
{
return $this->getMeta('give_cs_default_currency');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add default values for these? That's the tricky part with meta as we want to expect a return type but it's also possible for the meta to not exist.

Please also updated TestFormMetaDecorator 😄

Copy link
Contributor Author

@pauloiankoski pauloiankoski Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved: f01762d and a997594

*/
public function process()
{
$status = $this->formV2->getCurrencySwitcherStatus();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this v2 status need to be used in v3 form settings to determine global or customize?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. This is a 1-to-1 setting.

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, looks good 👍

Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed manual QA tests.

@pauloiankoski pauloiankoski merged commit b31096b into develop Jun 21, 2024
20 checks passed
@pauloiankoski pauloiankoski deleted the feature/currency-switcher-migration branch June 21, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants