fix: use-query-param replaceIn instead of pushIn#60
fix: use-query-param replaceIn instead of pushIn#60Birkbjo wants to merge 1 commit intodevelopmentfrom
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.
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.