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

Fixes table display bug when collection has one attribute and it is hidden #1836

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

eireland
Copy link
Contributor

@eireland eireland commented Mar 6, 2025

Fix is by showing the hidden attribute, which automatically makes copllection visible.

…idden. Fix is by showing the hidden attribute.
@eireland eireland requested a review from kswenson March 6, 2025 17:45
@eireland eireland marked this pull request as ready for review March 6, 2025 17:45
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.13%. Comparing base (1536b83) to head (6285d7a).
Report is 40 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1836      +/-   ##
==========================================
+ Coverage   85.51%   86.13%   +0.62%     
==========================================
  Files         649      649              
  Lines       33276    33287      +11     
  Branches     9293     8770     -523     
==========================================
+ Hits        28455    28671     +216     
+ Misses       4463     4458       -5     
+ Partials      358      158     -200     
Flag Coverage Δ
cypress 73.41% <90.90%> (+0.90%) ⬆️
jest 55.58% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Copy link

cypress bot commented Mar 6, 2025

codap-v3    Run #6547

Run Properties:  status check passed Passed #6547  •  git commit 307af44eca: Merge pull request #1836 from concord-consortium/CODAP-41-show-single-hidden-lev...
Project codap-v3
Branch Review main
Run status status check passed Passed #6547
Run duration 06m 43s
Commit git commit 307af44eca: Merge pull request #1836 from concord-consortium/CODAP-41-show-single-hidden-lev...
Committer Evangeline Ireland
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 51
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 245
View all changes introduced in this branch ↗︎

Copy link
Member

@kswenson kswenson left a comment

Choose a reason for hiding this comment

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

See comments below for details/suggestions.

Comment on lines 36 to 39
// if attribute is the only attribute in the collection and it is hidden, make the attribute visible
if (attrs.length === 1 && caseMetadata?.isHidden(attrs[0].id)) {
caseMetadata?.setIsHidden(attrs[0].id, false)
}
Copy link
Member

Choose a reason for hiding this comment

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

Couple of issues:

  • The case table is not the right place to address an issue that doesn't require the case table. (Attributes can be hidden from other components, e.g. the case card.)
  • The accessor function of a reaction is just for returning values to the action function, not for actually changing models.
  • The number of attributes isn't important. The relevant test is whether all remaining attributes in a collection are hidden, in which case they should all be shown.

I suspect that a reaction that is installed in the afterCreate() of the SharedCaseMetadata would make the most sense.

…ttributes as a reaction in the SharedCaseMetadata model
@eireland eireland requested a review from kswenson March 7, 2025 23:29
Copy link
Member

@kswenson kswenson left a comment

Choose a reason for hiding this comment

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

👍 LGTM -- just a couple of final suggested tweaks.

@eireland eireland merged commit 307af44 into main Mar 11, 2025
20 of 21 checks passed
@eireland eireland deleted the CODAP-41-show-single-hidden-levels branch March 11, 2025 18:03
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.

2 participants