fix: render proper visibility message on self-paced course type (backport) (#1713)
This commit is contained in:
@@ -223,6 +223,7 @@ const ConfigureModal = ({
|
||||
category={category}
|
||||
isSubsection={isSubsection}
|
||||
showWarning={visibilityState === VisibilityTypes.STAFF_ONLY}
|
||||
isSelfPaced={isSelfPaced}
|
||||
/>
|
||||
</Tab>
|
||||
<Tab eventKey="advanced" title={intl.formatMessage(messages.advancedTabTitle)}>
|
||||
|
||||
@@ -11,6 +11,7 @@ const VisibilityTab = ({
|
||||
category,
|
||||
showWarning,
|
||||
isSubsection,
|
||||
isSelfPaced,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const visibilityTitle = COURSE_BLOCK_NAMES[category]?.name;
|
||||
@@ -53,6 +54,13 @@ const VisibilityTab = ({
|
||||
setFieldValue('showCorrectness', e.target.value);
|
||||
};
|
||||
|
||||
const hideDueMessage = {
|
||||
hideContentLabel: isSelfPaced ? messages.hideContentAfterEnd : messages.hideContentAfterDue,
|
||||
hideContentDescription: (
|
||||
isSelfPaced ? messages.hideContentAfterEndDescription : messages.hideContentAfterDueDescription
|
||||
),
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<h5 className="mt-4 text-gray-700">
|
||||
@@ -72,9 +80,10 @@ const VisibilityTab = ({
|
||||
</Form.Radio>
|
||||
<Form.Text><FormattedMessage {...messages.showEntireSubsectionDescription} /></Form.Text>
|
||||
<Form.Radio value="hideDue">
|
||||
<FormattedMessage {...messages.hideContentAfterDue} />
|
||||
<FormattedMessage {...hideDueMessage.hideContentLabel} />
|
||||
</Form.Radio>
|
||||
<Form.Text><FormattedMessage {...messages.hideContentAfterDueDescription} /></Form.Text>
|
||||
<Form.Text><FormattedMessage {...hideDueMessage.hideContentDescription} />
|
||||
</Form.Text>
|
||||
<Form.Radio value="hide">
|
||||
<FormattedMessage {...messages.hideEntireSubsection} />
|
||||
</Form.Radio>
|
||||
@@ -130,6 +139,11 @@ VisibilityTab.propTypes = {
|
||||
category: PropTypes.string.isRequired,
|
||||
showWarning: PropTypes.bool.isRequired,
|
||||
isSubsection: PropTypes.bool.isRequired,
|
||||
isSelfPaced: PropTypes.bool,
|
||||
};
|
||||
|
||||
VisibilityTab.defaultProps = {
|
||||
isSelfPaced: false,
|
||||
};
|
||||
|
||||
export default injectIntl(VisibilityTab);
|
||||
|
||||
@@ -139,6 +139,14 @@ const messages = defineMessages({
|
||||
id: 'course-authoring.course-outline.configure-modal.visibility-tab.hide-content-after-due-description',
|
||||
defaultMessage: 'After the subsection\'s due date has passed, learners can no longer access its content. The subsection is not included in grade calculations.',
|
||||
},
|
||||
hideContentAfterEnd: {
|
||||
id: 'course-authoring.course-outline.configure-modal.visibility-tab.hide-content-after-end',
|
||||
defaultMessage: 'Hide content after end date',
|
||||
},
|
||||
hideContentAfterEndDescription: {
|
||||
id: 'course-authoring.course-outline.configure-modal.visibility-tab.hide-content-after-end-description',
|
||||
defaultMessage: 'After the course\'s end date has passed, learners can no longer access its content. The subsection is not included in grade calculations.',
|
||||
},
|
||||
hideEntireSubsection: {
|
||||
id: 'course-authoring.course-outline.configure-modal.visibility-tab.hide-entire-subsection',
|
||||
defaultMessage: 'Hide entire subsection',
|
||||
|
||||
Reference in New Issue
Block a user