Merged
Conversation
added 14 commits
July 29, 2020 15:46
We use Object.freeze to create an enum. The EnumItem returned via the Enum package wasn't serializable by Redux and was awkward to use. A javascript object is easier to use.
ResourceListView used to only handle title, now it handles data and loading. It takes in failed, but does nothing with it currently.
ResourceList.js was moved and expanded to only handle logic relevent to the view layer.
resourceTypes will be used across different components and lives better tied with the API rather than a single component.
The NavSlice data will be extended to include view types. It would be strange for this information to be hardcoded in the Nav rather than the higher level App.
Currently fetchResources just returns a resolved Promise and is essentially a mock. I could have mocked it in App.js but decided to put it in the API to connect everything correctly.
The NavSection was extended to include its own view information. This allows for the views to be dynamic. Currently we have two views, Empty which is jsut an empty Box and ResourceList. The ResourceAPI is passed into every version, though that should be changed.
This allows it to be added to the rootReducer in reducers/. It's already in there but would fail because App wasn't exporting.
ResourceSlice was using the old resourceTypes before it was moved. * this commit also does a very small line swap for cleaner formatting
ResourceList connects the ResourceSlice with the ResourceListView. Since we use Nav to handle making a component active, we use the factory method version of binding props and dispatch. This also changes index.js slightly to make ResourceList the default export rather than ResourceListView
In the NavSections, if view is not set, we set it to empty by default.
We don't need it to be draggable, and it simplifies things to make it not draggable. I was unable to get mount() to work either when having draggable enabled, and didn't make much progress on solving.
Prior to this, all props were being passed from ResourceList to ResourceListView. Passing only the required props makes things easier to test and leaves less room for error in the view.
We mount the ResourceList in a ReduxWrapper to connect a test store to it. We then make sure that fetch is called onComponentMount and that the props are being connected properly and passed down to ResourceListView.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.