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: Migrate result variant provider #1440

Merged
merged 18 commits into from
Apr 8, 2024

Conversation

annacv
Copy link
Contributor

@annacv annacv commented Apr 2, 2024

The branch will be updated after result variant selector is validated/merged, so it should be reviewed afterward.

Migrate the result variant provider component:

  • Replaced XProvide decorator with Vue native one.
  • Provide keys as refs to react to selector component changes.
  • Set the result as a ComputedRef to make it watchable (setting it as a ref is not enough, as props are not reactive by default).
  • Update result variant selector component by removing ref type from selectResultVariant, as it is not a ref, but a function that checks a ref (selectedVariants).

Pull request template

Proceed to Vue 3 migration.

Motivation and context

  • Dependencies. If any, specify:
  • Open issue. If applicable, link: EMP-3793

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to not work as expected)
  • Change requires a documentation update

What is the destination branch of this PR?

  • Main
  • Other. Specify:

How has this been tested?

It can be tested by using a local build inside oysho's customer's setup and checking result component behavior & events in Vue DevTools:

  • When a color variant is selected, the result's image is updated accordingly and the click event is fired with correct metadata (color's id, name and image).
  • When a size is selected (hovering the add2Cart button a size's variants would be displayed), the SizeAdd2Cart event is fired with the correct metadata (the result and the size objects with the corresponding color and size information).

Tests performed according to testing guidelines:

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review on my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@annacv annacv requested a review from a team as a code owner April 2, 2024 10:12
@annacv annacv changed the title Feature/emp 3793 migrate result variant provider Feature: Migrate result variant provider Apr 2, 2024
@lauramargar lauramargar merged commit b981d9b into main Apr 8, 2024
4 checks passed
@lauramargar lauramargar deleted the feature/EMP-3793-Migrate-result-variant-provider branch April 8, 2024 13:53
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