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

Use vuex #4

Merged
merged 18 commits into from Dec 4, 2018

Conversation

Projects
None yet
3 participants
@nicklasisraelsson
Member

nicklasisraelsson commented Dec 3, 2018

Start storing all app state in a vuex store.

This replaces the EpiDataModexMixin and the $epi and $app properties to create a "single source of truth" for the site.

nicklasisraelsson and others added some commits Nov 13, 2018

Install vuex
Feature: CMS-11254
Store model in vuex
PageComponentSelector starts to use the store for its model handling
outside of the EpiDataModelMixin.

The vuex store piggybacks on the epiDataModelMixin for the async data
fetching for now.

Feature: CMS-11254
Fix console error on LandingPage
We got an error because there was a timing issue between when the local
model instance from EpiDataModelMixin was available and when the store
had set its modelLoaded event to true.

Feature: CMS-11254
Handle contentSaved event using the store
This also required us to move the epiContext object into the store.

Feature: CMS-11254
Move the model out of epiDataModelMixin
Instead the top components will own it for now until each component can
read what it needs from the store.

Feature: CMS-11254
Remove epiDataModelMixin
The last remaining functionality of the mixin is moved into the
epiContext file.

Feature: CMS-11254
Store the URL in the store
Updating the URL in the store will also update the model. Now we can
stop using URL as a prop on PageComponentSelector.

Feature: CMS-11254
Create vuex modules for the different states
The $epi and $app is moved into the store and stored as their own
modules. The model handling is moved into a 'content' module.

Feature: CMS-11254
Add and update documentation
Feature: CMS-11254
Rename to simplify comparison
Rename the new vuex modules to make it easier to compare between
"pre" and "post" vuex store.

Feature: CMS-11254
Remove url state from store
Instead we will use the model's url.

Feature: CMS-11254
Fix time travel debugging in vuex
Use vuex-router-sync to keep route state in store to be able to use time
travel debugging with a working routing. Without this package the time
travel worked except that the url in the browser was never updated.

It also enables us to reuse the query string parameter from the route
object in the store when updating the model by content link.

Feature: CMS-11254
Update documentation texts
Feature: CMS-11254
Move constants into each store module
Capital case action types

Also updated the action types to use capital casing.

Also updated components to use mapMutation vuex helper.

Feature: CMS-11254
Update imports to be consistent across whole app
Remove .js and use @/Scripts everywhere.

Feature: CMS-11254
@valdisiljuconoks

This comment has been minimized.

Collaborator

valdisiljuconoks commented Dec 3, 2018

this looks very nais

@seriema

seriema approved these changes Dec 4, 2018

Looks good! Squash and merge 🚀

@nicklasisraelsson nicklasisraelsson merged commit b470cb8 into master Dec 4, 2018

@nicklasisraelsson nicklasisraelsson deleted the feature/CMS-11254-use-vuex branch Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment