Skip to content

OBPIH-6938 Checkbox state and indicator persist across location changes#5037

Merged
awalkowiak merged 3 commits intodevelopfrom
OBPIH-6938
Feb 14, 2025
Merged

OBPIH-6938 Checkbox state and indicator persist across location changes#5037
awalkowiak merged 3 commits intodevelopfrom
OBPIH-6938

Conversation

@SebastianLib
Copy link
Collaborator

✨ Description of Change

A concise summary of what is being changed. Please provide enough context for reviewers to be able to understand the change and why it is necessary. If the issue/ticket already provides enough information, you can put "See ticket" as the description.

Link to GitHub issue or Jira ticket:

Description:


📷 Screenshots & Recordings (optional)

If this PR contains a UI change, consider adding one or more screenshots here or link to a screen recording to help reviewers visualize the change. Otherwise, you can remove this section.

@github-actions github-actions bot added the domain: frontend Changes or discussions relating to the frontend UI label Feb 11, 2025
@codecov
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 7.84%. Comparing base (f957398) to head (2b4b98e).
Report is 203 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 53 to 55
if (checkedCheckboxes.length > 0
|| headerCheckboxState.value
|| headerCheckboxState.indeterminate) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it enough to check just the length of checked checkboxes? Why do we need to check the value and indeterminate state?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it doesn't really make sense. I will fix it

Comment on lines 52 to 58
useEffect(() => {
if (checkedCheckboxes.length > 0) {
setCheckedCheckboxes([]);
setHeaderCheckboxState({ indeterminate: false, value: false });
}
}, [currentLocation?.id]);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@awalkowiak awalkowiak merged commit ede7862 into develop Feb 14, 2025
9 checks passed
@awalkowiak awalkowiak deleted the OBPIH-6938 branch February 14, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: frontend Changes or discussions relating to the frontend UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants