Fix Filter Panel Persistence Bug (CRASM-3719)#1486
Open
hawkishpolicy wants to merge 4 commits intodevelopfrom
Open
Fix Filter Panel Persistence Bug (CRASM-3719)#1486hawkishpolicy wants to merge 4 commits intodevelopfrom
hawkishpolicy wants to merge 4 commits intodevelopfrom
Conversation
- Previous addition of onClose logic to panel prop prevented panel from closing when user clicked outside of it.
- Removed onClose prop to restore default behavior.
- Added new helper function to determine if filter model is empty.
- Refactored shouldTriggerFilterUpdate to account for a filter model that had values but was deleted to be empty.
- This allows user to clear a filter value and send for a generic "all" call.
- Updated onFilterModelChange flow to set filters in this order:
1. Clean filter model.
2. Set filters to cleaned model.
3. Check if cleaned model is empty; if so, set HasActiveFilters to false.
4. Call shouldTriggerFilterUpdate with previous filters and cleaned model to determine if fetch is needed.
5. If not, return early.
6. If filter timeout exists, clear it.
7. If filter model is empty, set filters to empty object to fetch all data. Return early.
8. Otherwise, set timeout to update filters, set isLoading, and setPagination after 500 milliseconds.
- Added new unit tests for getActiveItems utility function. - Refactored existing unit tests for shouldTriggerFilterUpdate to cover user deleting filter values and need a genreric "all" call.
- now inline with design spec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Filter Panel Persistence Bug (CRASM-3719)
🗣 Description
💭 Motivation and context
🧪 Testing
✅ Pre-approval checklist
bump_versionscript if this repository is versioned and the changes in this PR warrant a version bump.✅ Pre-merge checklist
✅ Post-merge checklist