-
Notifications
You must be signed in to change notification settings - Fork 16
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/276 avoid multiple api calls #362
Conversation
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.
Since datasetRepository.getAll and and datasetRepository.getTotalDatasetsCount are not longer being used we can remove all the related code
- methods from the repository
- associated use cases
- Integration tests
- Repository mocks used in the stories
tests/component/sections/collection/datasets-list/DatasetsList.spec.tsx
Outdated
Show resolved
Hide resolved
tests/component/sections/collection/datasets-list/DatasetsList.spec.tsx
Outdated
Show resolved
Hide resolved
thanks @MellyGray I made the changes you requested |
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.
LGTM!
QA ✅, there are no repeated calls to the api now, I also disabled React.StrictMode to actually see one call in dev mode, nice work @ekraffmiller ! |
…-calls Refactor/276 avoid multiple api calls
What this PR does / why we need it:
Updates useDatasets.tsx to make one API call, to get both datasetList and totalDatasetsCount
Which issue(s) this PR closes:
Special notes for your reviewer:
I commented out an assertion in DatasetsList.spec.tsx, because it is failing, even though the cy.stub() that it is testing is called with the correct parameters. I'm not sure why it is failing.
Suggestions on how to test this:
Run the DatasetsList.spec.tsx component test, which uses useDatasets.tsx. To test how it works in the app, turn off infinite scrolling by updating config.ts in the collections directory, and test that the Collections page works as expected.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
no
Is there a release notes update needed for this change?:
Additional documentation: