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

Fixed issue with module state when extending the module Store #3618

Merged

Conversation

ResuBaka
Copy link
Collaborator

@ResuBaka ResuBaka commented Sep 25, 2019

Related issues

closes #

Short description and why it's useful

The first one was that an null value in an state was changed to an object.
The second one was that now an null value was not changed to an object we
need to change the null to an object when we try to change the type the
original state.

Here some examples:

// Old code:

state: {
  current: null
  hello: null
}

// State from extend module: 

state: {
  hello: { hello: 'world' }
}

// After extend
state: {
  current: {}
  hello: { hello: 'world' }
}

// New code:

state: {
  current: null
  hello: null
}

// State from extend module: 

state: {
  hello: { hello: 'world' }
}

// After extend
state: {
  current: null
  hello: { hello: 'world' }
}

Screenshots of visual changes before/after (if there are any)

Which environment this relates to

Check your case. In case of any doubts please read about Release Cycle

  • Test version (https://test.storefrontcloud.io) - this is a new feature or improvement for Vue Storefront. I've created branch from develop branch and want to merge it back to develop
  • RC version (https://next.storefrontcloud.io) - this is a stabilisation fix for Release Candidate of Vue Storefront. I've created branch from release branch and want to merge it back to release
  • Stable version (https://demo.storefrontcloud.io) - this is an important fix for current stable version. I've created branch from hotfix or master branch and want to merge it back to hotfix

Upgrade Notes and Changelog

  • No upgrade steps required (100% backward compatibility and no breaking changes)
  • I've updated the Upgrade notes and Changelog on how to port existing VS sites with this new feature

IMPORTANT NOTICE - Remember to update CHANGELOG.md with description of your change

Contribution and currently important rules acceptance

The first one was that an null value in an state was changed to an object.
The second one was that now an null value was not changed to an object we
need to change the null to an object when we try to change the type the
original state.
@ResuBaka
Copy link
Collaborator Author

ResuBaka commented Sep 25, 2019

I think we should write some test cases around that logic as there may be some other cases where it could break.
So we should create an issue for writing some test.

@ResuBaka ResuBaka changed the title Fixed two issues Fixed issue with module state when extending the module Store Sep 25, 2019
@pkarw pkarw requested review from filrak and patzick September 25, 2019 11:03
Copy link
Collaborator

@pkarw pkarw left a comment

Choose a reason for hiding this comment

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

Makes sense for me; thanks!

Copy link
Collaborator

@pspaczek pspaczek left a comment

Choose a reason for hiding this comment

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

looks good, thanks @ResuBaka

@patzick patzick merged commit 4f190a5 into vuestorefront:develop Sep 25, 2019
@patzick patzick added this to the 1.11.0-rc.1 milestone Sep 25, 2019
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.

4 participants