-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: use-query-param replaceIn instead of pushIn #60
base: development
Are you sure you want to change the base?
Conversation
🚀 Deployed on https://pr-60--dhis2-data-entry.netlify.app |
Not sure what to do about the test, since hook should not really be tested outside of a functional component... Trying to fix the test by fixing the signature of the mocked |
const [paramValue, setParamValue] = useQueryParam(name, schema) | ||
const isValidSelection = useIsValidSelection() |
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.
How does it know whether it's a valid selection before the change has been pushed to use-query-param
.
So for example a data set has a default cat combo, when the data set id and the org unit id is already present and the user selects a period, when the logic reaches this point, the useIsValidSelection
hook doesn't know about the period id yet, does it?
Regarding the test:
That should get the test assing already, then I suggest to also add a separate test for |
This seems like it would be a very nice improvement to add @Birkbjo. Are we deferring this due to time constraints? |
@Birkbjo could you just write a quick explanation on why this is neither continued nor merged? Couple of sentences should suffice |
By @Birkbjo:
|
Hi! Due to a lack of activity on this issue over time (180 days) it seems to be stale. If still relevant, please provide information that moves it forward, e.g. additional information, a pull request with suggested changes, or a reason to keep it open. Any activity will keep it open, otherwise it will be closed automatically in 30 days. Thanks! 🤖 |
While making selections in the context-selection, the history stack is "spammed" with new entries when making initial selections. This changes it so new entries are only pushed when it's a valid selection - reducing entries in the history that are not really useful.