Skip to content

Commit

Permalink
fixup! fixup! feat: Add support for toggling more parts of the progre…
Browse files Browse the repository at this point in the history
…ss page on or off.
  • Loading branch information
xitij2000 committed Oct 28, 2024
1 parent 45a4cf4 commit 6a4d495
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
28 changes: 20 additions & 8 deletions src/pages-and-resources/progress/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const ProgressSettings = ({ onClose }) => {
...otherCourseSettings,
progressPage: {
showGrades: values.showGrades,
showGradeBreakdown: values.showGradeBreakdown,
showGradeSummary: values.showGradeSummary,
showGradeDetails: values.showGradeDetails,
showRelatedLinks: values.showRelatedLinks,
showCertificateStatus: values.showCertificateStatus,
},
Expand All @@ -41,14 +42,16 @@ const ProgressSettings = ({ onClose }) => {
initialValues={{
enableProgressGraph: !disableProgressGraph,
showGrades: otherCourseSettings?.progressPage?.showGrades ?? true,
showGradeBreakdown: otherCourseSettings?.progressPage?.showGradeBreakdown ?? true,
showGradeSummary: otherCourseSettings?.progressPage?.showGradeSummary ?? true,
showGradeDetails: otherCourseSettings?.progressPage?.showGradeDetails ?? true,
showRelatedLinks: otherCourseSettings?.progressPage?.showRelatedLinks ?? true,
showCertificateStatus: otherCourseSettings?.progressPage?.showCertificateStatus ?? true,
}}
validationSchema={{
enableProgressGraph: Yup.boolean(),
showGrades: Yup.boolean(),
showGradeBreakdown: Yup.boolean(),
showGradeSummary: Yup.boolean(),
showGradeDetails: Yup.boolean(),
showRelatedLinks: Yup.boolean(),
showCertificateStatus: Yup.boolean(),
}}
Expand Down Expand Up @@ -78,13 +81,22 @@ const ProgressSettings = ({ onClose }) => {
checked={values.showGrades}
/>
<FormSwitchGroup
id="show-grade-breakdown"
name="showGradeBreakdown"
label={intl.formatMessage(messages.showGradeBreakdownLabel)}
helpText={intl.formatMessage(messages.showGradeBreakdownHelp)}
id="show-grade-summary"
name="showGradeSummary"
label={intl.formatMessage(messages.showGradeSummaryLabel)}
helpText={intl.formatMessage(messages.showGradeSummaryHelp)}
onChange={handleChange}
onBlur={handleBlur}
checked={values.showGradeBreakdown}
checked={values.showGradeSummary}
/>
<FormSwitchGroup
id="show-grade-details"
name="showGradeDetails"
label={intl.formatMessage(messages.showGradeDetailsLabel)}
helpText={intl.formatMessage(messages.showGradeDetailsHelp)}
onChange={handleChange}
onBlur={handleBlur}
checked={values.showGradeDetails}
/>
<FormSwitchGroup
id="show-related-links"
Expand Down
20 changes: 14 additions & 6 deletions src/pages-and-resources/progress/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ const messages = defineMessages({
id: 'course-authoring.pages-resources.progress.show-grades.help',
defaultMessage: 'If enabled, students can see their grades on the progress page.',
},
showGradeBreakdownLabel: {
id: 'course-authoring.pages-resources.progress.show-grade-breakdown.label',
defaultMessage: 'Show Grade Breakdown',
showGradeSummaryLabel: {
id: 'course-authoring.pages-resources.progress.show-grade-summary.label',
defaultMessage: 'Show Grade Summary',
},
showGradeBreakdownHelp: {
id: 'course-authoring.pages-resources.progress.show-grade-breakdown.help',
defaultMessage: 'If enabled, students can see a summary and detailed breakdown of their grades on the progress page.',
showGradeSummaryHelp: {
id: 'course-authoring.pages-resources.progress.show-grade-summary.help',
defaultMessage: 'If enabled, students can see a summary of their grades on the progress page.',
},
showGradeDetailsLabel: {
id: 'course-authoring.pages-resources.progress.show-grade-details.label',
defaultMessage: 'Show Grade Details',
},
showGradeDetailsHelp: {
id: 'course-authoring.pages-resources.progress.show-grade-details.help',
defaultMessage: 'If enabled, students can see details of their grades on the progress page.',
},
showRelatedLinksLabel: {
id: 'course-authoring.pages-resources.progress.show-related-links.label',
Expand Down

0 comments on commit 6a4d495

Please sign in to comment.