OBPIH-6938 Checkbox state and indicator persist across location changes#5037
Merged
awalkowiak merged 3 commits intodevelopfrom Feb 14, 2025
Merged
OBPIH-6938 Checkbox state and indicator persist across location changes#5037awalkowiak merged 3 commits intodevelopfrom
awalkowiak merged 3 commits intodevelopfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5037 +/- ##
============================================
+ Coverage 7.76% 7.84% +0.07%
- Complexity 860 876 +16
============================================
Files 620 625 +5
Lines 42760 42813 +53
Branches 10373 10376 +3
============================================
+ Hits 3321 3358 +37
- Misses 38945 38952 +7
- Partials 494 503 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
alannadolny
reviewed
Feb 12, 2025
src/js/hooks/useTableCheckboxes.js
Outdated
Comment on lines
53
to
55
| if (checkedCheckboxes.length > 0 | ||
| || headerCheckboxState.value | ||
| || headerCheckboxState.indeterminate) { |
Collaborator
There was a problem hiding this comment.
isn't it enough to check just the length of checked checkboxes? Why do we need to check the value and indeterminate state?
Collaborator
Author
There was a problem hiding this comment.
yes, it doesn't really make sense. I will fix it
alannadolny
reviewed
Feb 13, 2025
Comment on lines
52
to
58
| useEffect(() => { | ||
| if (checkedCheckboxes.length > 0) { | ||
| setCheckedCheckboxes([]); | ||
| setHeaderCheckboxState({ indeterminate: false, value: false }); | ||
| } | ||
| }, [currentLocation?.id]); | ||
|
|
Collaborator
There was a problem hiding this comment.
Add a comment about the purpose of this useEffect. If you want you can also move these two lines to a function called resetCheckboxes for better readability
kchelstowski
approved these changes
Feb 13, 2025
SebastianLib
added a commit
that referenced
this pull request
Feb 19, 2025
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.
✨ Description of Change
Link to GitHub issue or Jira ticket:
Description:
📷 Screenshots & Recordings (optional)