Skip to content
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(cat-combo-table): prevent filter from unmounting data-elements #186

Merged
merged 3 commits into from
Sep 22, 2022

Conversation

Birkbjo
Copy link
Member

@Birkbjo Birkbjo commented Sep 19, 2022

Fixes TECH-1217

Filtering out dataElements removes them from the tree, and thus clears the state of the fields. Instead this uses display: none to prevent the nodes from being unmounted. This also seems to improve the filtering performance, as we prevent fields from unsubscribing and resubscribing to RFF and other hooks.

Not sure if this has any unintended side-effects, but I haven't seen any from my limited testing.

Edit: Might need to come back to this. It might make sense to move "syncing"-state to a react-final-form mutator. Will research more when looking at #182 .

Codesandbox with a similar use-case: https://codesandbox.io/s/7k742qpo36?file=/index.js

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Sep 19, 2022

🚀 Deployed on https://pr-186--dhis2-data-entry.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify September 19, 2022 22:41 Inactive
@Birkbjo Birkbjo force-pushed the fix/TECH-1217/keep-field-state-filter branch from 96e1956 to 8645166 Compare September 19, 2022 22:43
@Birkbjo Birkbjo force-pushed the fix/TECH-1217/keep-field-state-filter branch from 8645166 to e060b9e Compare September 19, 2022 22:44
@dhis2-bot dhis2-bot temporarily deployed to netlify September 19, 2022 22:47 Inactive
@Birkbjo Birkbjo marked this pull request as draft September 19, 2022 22:59
@Birkbjo Birkbjo marked this pull request as ready for review September 22, 2022 16:18
@dhis2-bot dhis2-bot temporarily deployed to netlify September 22, 2022 16:21 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify September 22, 2022 16:49 Inactive
@Birkbjo Birkbjo merged commit f767dce into development Sep 22, 2022
dhis2-bot added a commit that referenced this pull request Sep 22, 2022
# [100.0.0](v99.0.0...v100.0.0) (2022-09-22)

### Bug Fixes

* **cat-combo-table:** prevent filter from unmounting data-elements ([#186](#186)) ([f767dce](f767dce))
* **completion:** do not validate when offline ([454fe6d](454fe6d))
* **completion:** set loading to true when starting incompleting ([7e92323](7e92323))
* **completion mutation:** extract variables correctly after refactoring ([ced05c7](ced05c7))
* **form completion:** check for empty responses ([fd9c2c2](fd9c2c2))
* address post-rebase bugs ([a37c460](a37c460))
* **form completion:** cancel open mutations when (in-)completing ([5d66744](5d66744))
* add mutation key-factory ([7268141](7268141))
* completion onMutate and setDefault ([1a6f0ce](1a6f0ce))
* remove loading from completion ([4e4ff13](4e4ff13))
* **form completion error alert message:** correct & translate message ([2f18af2](2f18af2))
* typo ([466fe22](466fe22))

### chore

* **release:** release v100.0.0 ([f59bc94](f59bc94))

### Features

* **completion:** respect "validCompleteOnly" flag on data sets ([41ca259](41ca259))
* add completion functionality ([2540111](2540111))
* reduce org-unit-tree network traffic and support prefetching ([#187](#187)) ([4ce86ac](4ce86ac))

### BREAKING CHANGES

* **release:** move to v100 versioning scheme
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants