-
Notifications
You must be signed in to change notification settings - Fork 524
Fix regression for archived sections #70231
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a regression where archived sections were incorrectly displayed on student dashboards due to the missing hidden property in the summarize_for_participant method. The fix restores the hidden property to the returned hash, updates existing test data to include this property, and adds a new unit test to prevent future regressions.
Key Changes
- Restored the
hiddenproperty to thesummarize_for_participantmethod in the Section model - Updated all existing test fixtures to include the
hidden: falseproperty for consistency - Added new test case and fixture data to verify that archived sections (with
hidden: true) are properly filtered from student views
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dashboard/app/models/sections/section.rb | Adds the hidden property back to the hash returned by summarize_for_participant |
| apps/test/unit/templates/studioHomepages/homepagesTestData.js | Updates test fixtures to include the hidden: false property for all non-archived sections |
| apps/test/unit/templates/studioHomepages/fakeSectionUtils.js | Adds hidden: false to existing section fixtures and introduces a new archivedSections fixture |
| apps/test/unit/templates/studioHomepages/ParticipantSectionsTest.jsx | Adds new test case to verify archived sections are not displayed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
carl-codeorg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
etaderhold
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
367e4c2 to
a9c388e
Compare
- Fix regression where archived sections are showing up in student
dashboard
- Add hidden property back to section data passed to the frontend
- Re-add property in existing tests
- Add new unit test to cover functionality
Signed-off-by: Nick Lathe <nick.lathe@code.org>
52e1cb3 to
1302c90
Compare
This PR fixes a regression introduced in 66957 that removed the
hiddenproperty from being included in the return hash of the newsummarize_for_participantmethod. That property is eventually evaluated in the ParticipantSections component. This resulted in sections archived by teachers still showing up in student dashboards, in the Classroom Section table.This PR addresses the regression with the following:
hiddenproperty to the hash returned bysummarize_for_participanthiddenproperty to existing testsScreenshots
Teacher archives section

Student view without the hidden property, archived section still included

Student view with hidden property added, archived section no longer included

Links
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Creation Checklist: