* refactor: Moving PageLoading up to the top
This way it can be used on both the courseware and outline pages.
* Adding index.js files to data directories, and PropTypes data shapes
- The course-blocks and course-meta data directories now have index files so their exports can be imported from that, rather than reaching into specific files in the directories.
- Also added “shapes” for use in React Components that use PropTypes for the course blocks data structure, and the course metadata data structure.
* Simplifying/refactoring CourseContainer rendering a bit.
* Adding course outline page.
This page is not complete.
- It contains the ‘outline’ itself with links to the Sequences in the course.
- It contains a very basic stab at displaying dates - they’re not even formatted.
- It shows logistration and enrollment alerts for anonymous and unenrolled users.
It does not include any other content in the right-hand sidebar. It also doesn’t include a welcome message, or perhaps any number of other features on the page. This is effectively an initial implementation for discovering how much data we’re missing from our APIs. It should not be used as-is by any means.
The two functions removed here are duplicated (and actually used from) course-blocks/api.js. Think it was just a refactoring oversight from a few weeks ago.
* build: bumping version of frontend-platform
We’re going to need to use the new getLoginRedirectUrl helper.
* Adding custom alerts for anonymous and unenrolled users.
- Anonymous users are prompted to sign in or register.
- Unenrolled users are prompted to enroll.
The alerts themselves are lazy-loaded as necessary, like the ContentLock component.
This PR also adds `customAlerts` to the AlertList, allowing an application to specify custom components to be shown as Alerts for a given alert code.
* refactor: Renaming enrollmentIsActive to isEnrolled
As per review feedback that the former wasn’t clear.
* If the user does not have access to the course, then redirect to the course outline.
In a subsequent PR, if this API call is made on the course outline page in the MFE, we’ll need to be able to prevent the redirect. But that view of the MFE doesn’t exist yet.
* Moving course outline redirect logic into CourseContainer.
This way, depending on the page calling fetchCourseMetadata, we can make an intelligent choice about whether we want to redirect, show a message, etc. By redirecting in the API call handler, then we took that choice away from ourselves.