You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.
This is related to controlling the demo from the meta level, switching roles etc.
Will be setting up the router to go to home from clicking the title
Role switcher will show up depending on if demo session is logged in or not
Role switcher items will fire off two actions, switchRole and createNewManager
And then we can put an external link on the github icon
Since this requires hooking up to redux, wrapping in a HoC to pass the state/actions, and firing off api calls etc it can be a chance for you to learn how that stuff works.
The text was updated successfully, but these errors were encountered:
Update on this: I've finished the Role Switcher component to accept the role data and fire off corresponding functions from props.
Now I am finishing up refactoring the demos reducer to properly mold the api call data into the state and associate users with their store.
The data fetching action is kicked off by entering the route now, instead of the component being mounted.
I just have to finish up writing in the login piece that is fired off after the demo gets called (which is mostly just refactoring since I have most of it)
Then I can hook them up and we should be good. I think it will take another day and it should be done.
Addresses story #2 and task #5
The dashboard page currently doesn't call the getAdminData. I'll hook that up next to a real lifecycle or action.
Here is what everything looks like:
![screen recording 2016-09-08 at 04 48 pm](https://cloud.githubusercontent.com/assets/8884298/18371523/8d6ef1f0-75fa-11e6-812d-cfc0ad53b272.gif)
## Other changes in this PR
- Tests now inject the tap event plugin, so that MUI components dont spit out errors
- Test config removes extra quotes from stringified json strings.
### Demo Data Flow
- demo module now handles fetching data associated with a demo session and logs in to the supplychainmanager automatically
- Dashboard component no longer manages data fetching on route loading, instead it is handled properly within the route itself.
- CreateDemo saga now simply creates a demo and changes the route (In a future task, I want to have it manage adding one retail manager automatically so that demos always begin with that role as a default)
### Mock API / stronger saga tests
- Sagas tests now make use of state changes from actually calling the reducer, which requires proper data passed in....meaning I needed a way to mock the API calls. I made a mock file that gives back faker data in the shape we currently expect from the API.
What this allows, is for saga tests to properly fail if things change in the way data is passed around and modified (whereas before, we just generated made up objects and so it worked in test, but not in the running app)
The Saga tests look a bit more confusing, but are WAY more solid now. Writing and testing complex async actions has never been fun, but this makes them accurate and stable, which is the real win.
Story #2
This is related to controlling the demo from the meta level, switching roles etc.
switchRole
andcreateNewManager
Since this requires hooking up to redux, wrapping in a HoC to pass the state/actions, and firing off api calls etc it can be a chance for you to learn how that stuff works.
The text was updated successfully, but these errors were encountered: