-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve catalog container usability #968
Conversation
76881e5
to
5231fd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some changes then we can merge
assets/js/state/catalog_new.js
Outdated
const initialState = { | ||
loading: true, | ||
data: [], | ||
error: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to have error: true|false
and errorMessage
, what do you think?
f49efac
to
600f3e9
Compare
Hey @dottorblaster , |
600f3e9
to
d35fd4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and even included some improvements to use the new wanda api code, so we have a centralized api usage
I forgot to tell you about that, you did the right thing!
Description
Make the
CatalogContainer
usage a bit more generic. This will help us to reuse this component in other places where the catalog data is queried from wanda.In order to achieve that, I have added a new reducer, selector and saga combo. This helps on testing side as well.
How was this tested?
Reducers, selectors and sagas tests added. In order to test the latest one, I have added the
axios-mock-adapter
to mock the api calls.Here some references on how to test redux code (official docs):
https://redux.js.org/usage/writing-tests
https://redux-saga.js.org/docs/advanced/Testing/