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
Default to summary when toggling from standards view of csf to non-csf #32437
Conversation
// currentView is Standards. If so re-set currentView to Summary since | ||
// Standards doesn't apply. | ||
const isCSFBefore = | ||
prevProps.scriptData && !prevProps.scriptData.excludeCsfColumnInLegend; |
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.
Should we rename excludeCsfColumnInLegend
since we are using it for more than just that?
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.
This is a pull-the-string-unravel-the-sweater-situation because I think we can actually eliminate excludeCsfColumnInLegend
as a script property in favor of curriculum_umbrella == CSF
. That seems worth doing and timely but also big enough to be its own work item, so I'll tackle that then circle back to make complementary changes here.
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 for tackling that @Erin007 !
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.
#32470 is out for review
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.
Looks good! Just one question
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.
I agree with Dani's suggestion to rename that variable, but otherwise looks good to me!
if ( | ||
prevProps.currentView === ViewType.STANDARDS && | ||
isCSFBefore && | ||
!isCSFAfter |
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.
great catch! I like what you did here, but I think you can make it a bit simpler and not look at the previous state:
const isCSF =
this.props.scriptData && !this.props.scriptData.excludeCsfColumnInLegend;
if (
this.props.currentView === ViewType.STANDARDS &&
!isCSF
spec
LP-957 Part 2
The Standards view of the Progress tab of the Teacher Dashboard is only relevant to CSF courses. In #32430 I handle hiding/showing the standards button in the toggle based on whether the script selected is a CSF course. In this PR, I handle the case where a teacher switches from a CSF course to a non-CSF course while in the Standards view. The Standards view is irrelevant for non-CSF courses so we default the teacher to the Summary view in this case.