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

Refactor the user vuex module #3095

Closed
1 of 11 tasks
pkarw opened this issue Jun 21, 2019 · 5 comments
Closed
1 of 11 tasks

Refactor the user vuex module #3095

pkarw opened this issue Jun 21, 2019 · 5 comments
Assignees
Labels
3: Medium complexity feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can QA rejected Testers will add this label when something is still wrong
Milestone

Comments

@pkarw
Copy link
Collaborator

pkarw commented Jun 21, 2019

What is the motivation for adding / enhancing this feature?

In order to prepare VS for 2.0 release we're refactoring some vuex modules in order to keep the good practices:

  • remove state write operations from the actions,
  • replace state read operations with vuex getters,
  • preferably migrate from events-based logic to vuex actions,
  • remove notifications from vuex (spawnNotification),
  • remove rootStore references,
  • extract network calls to data-resolveres (as introduced in the [WIP] Refactor catalog module #2890)

What are the acceptance criteria

  • resetPassword, login, register, update, me, getOrdersHistory network calls refactoed to helpers + then to data-resolvers
  • remove callback_event event's based logic - use just the then(helperFnc) instead
  • try to remove spawnNotification move the notifications one level higher (to the UI)
  • replace all rootStore calls with the context instead (for example context.rootState)
  • remove the calls to history and me from login (it should be extremly simple) - the sessionAfterAuthorized should be called instead - by some observer (plugin?) on the user token
  • replace all fetch calls with Task api calls

Can you complete this feature request by yourself?

  • YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a normal feature request. This should be available on https://test.storefrontcloud.io and then after tests this can be added to next Vue Storefront version. In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • (Pick this option only if you're sure) This is an important improvement request for current Release Candidate version on https://next.storefrontcloud.io and should be placed in next RC version. In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • (Pick this option only if you're sure) This is a critical improvement request for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version. In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Additional information

@pkarw pkarw added feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can 3: Medium complexity labels Jun 21, 2019
@pkarw pkarw added this to the 2.0-rc milestone Jun 21, 2019
@andrzejewsky andrzejewsky self-assigned this Jul 17, 2019
@patzick patzick added the QA - Ready for tests This is notification for testers, that improvement is ready to be tested and verified. label Jul 23, 2019
@patzick patzick closed this as completed Jul 23, 2019
@alinadivante
Copy link
Collaborator

@andrzejewsky Two things to fix:

  1. When user registers new account, there is info "You are logged in" but he isn't logged in.
    image
    Expected results:
    User should be automatically logged in (it works on https://demo.storefrontcloud.io)

  2. When I change manually token in dev console (shop/user/current-token) and open again my account and refresh page - there is info "Consumer is not authorized to access self" but user is still logged in.
    image

Expected results:
shop/user/current-token should be replaced with the valid user token from Magento.
"Consumer is not authorized to access self" error shouldn't occur.

@alinadivante alinadivante reopened this Jul 23, 2019
@alinadivante alinadivante added QA rejected Testers will add this label when something is still wrong and removed QA - Ready for tests This is notification for testers, that improvement is ready to be tested and verified. labels Jul 23, 2019
@pkarw pkarw modified the milestones: 2.0-rc, 1.11.0-rc.1 Jul 23, 2019
@pkarw
Copy link
Collaborator Author

pkarw commented Jul 23, 2019

starting point for this issue (it's not related directly to refactor): https://github.com/DivanteLtd/vue-storefront/blob/76211f7d036a04b6db5eda31d1402753e5c58372/core/lib/sync/task.ts#L78

@pkarw
Copy link
Collaborator Author

pkarw commented Jul 23, 2019

Related: #3237

@pkarw
Copy link
Collaborator Author

pkarw commented Jul 23, 2019

@andrzejewsky
Copy link
Contributor

Fixed here: #3271 everything should works now.

@pkarw pkarw closed this as completed Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Medium complexity feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can QA rejected Testers will add this label when something is still wrong
Projects
None yet
Development

No branches or pull requests

4 participants