-
David Joy authored
* Extensive refactor of application data management. - “course-blocks” and “course-meta” are replaced with “courseware” module. This obscures the difference between the two from the application itself. - a generic “model-store” module is used to store all course, section, sequence, and unit data in a normalized way, agnostic to the metadata vs. blocks APIs. - SequenceContainer has been removed, and it’s work is just done in CourseContainer instead. - UI components are - in general - more responsible for deciding their own behavior during data loading. If they want to show a spinner or nothing, it’s up to their discretion. - The API layer is responsible for normalizing data into a form the app will want to use, prior to putting it into the model store. * Organizing into some more sub-modules. - Bookmarks becomes it’s own module. - SequenceNavigation becomes another one. * More modularization of data directories. - Moving model-store up to the top. - Moving fetchCourse and fetchSequence up to the top-level data directory, since they’re used by both courseware and outline. - Moving getBlockCompletion and updateSequencePosition into the courseware/data directory, since they pertain to that page. * Normalizing on using the word “title” * Using history.replace instead of history.push This fixes TNL-7125 * Allowing sub-components to use hooks and redux This reduces the amount of data we need to pass around, and lets us move some complexity to more natural modules. * Fixing bug where enrollment alert is shown for undefined isEnrolled The enrollment alert would inadvertently be shown if a user navigated from the outline to the course. This was because it interpreted an undefined “isEnrolled” flag as false. Instead, we should wait for the isEnrolled flag to be explicitly true or false. * Organizing modules. - Renaming “outline” to “course-home”. - Moving sequence and sequence-navigation modules under the course module. * Some final application organization and ADR write-ups. * Final refactoring - Favoring passing data by ID and looking it up in the store with useModel. - Moving headers into course-header directory. * Updating ADRs. Splitting model-store information out into its own ADR.