forked from openedx/frontend-app-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
course_revision
number as Course Version
to the outline…
… page. Needed a way to apply a version number to a course to ensure that the learner has a specific version of the course. This was a request from the `Choose Aerospace` administers to ensure that the schools are using the latest version. Adding this number into the course is found on the Schedule & Details page Course Details section (new field highlighted below).
- Loading branch information
Showing
5 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; | ||
|
||
import messages from '../messages'; | ||
import { useModel } from '../../../generic/model-store'; | ||
|
||
function CourseRevision({ courseId, intl }) { | ||
const { | ||
courseRevision, | ||
} = useModel('outline', courseId); | ||
|
||
if (!courseRevision) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<section className="mb-4"> | ||
<h2 className="h4">{intl.formatMessage(messages.revision)}</h2> | ||
<span>{courseRevision}</span> | ||
</section> | ||
); | ||
} | ||
|
||
CourseRevision.propTypes = { | ||
courseId: PropTypes.string.isRequired, | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
export default injectIntl(CourseRevision); |