Getting ready to deploy to staging.
Adding a staging course link. Fixing some errors that occurred when using the demo/staging course links.
This commit is contained in:
@@ -17,6 +17,17 @@ import LearningSequencePage from './learning-sequence/LearningSequencePage';
|
||||
import './index.scss';
|
||||
import './assets/favicon.ico';
|
||||
|
||||
function courseLinks() {
|
||||
return (
|
||||
<main className="m-3">
|
||||
<ul>
|
||||
<li><Link to="/course/course-v1:edX+DemoX+Demo_Course">Visit Demo Course</Link></li>
|
||||
<li><Link to="/course/course-v1:UBCx+Water201x_2+2T2015">Visit Staging Course</Link></li>
|
||||
</ul>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
subscribe(APP_READY, () => {
|
||||
ReactDOM.render(
|
||||
<AppProvider>
|
||||
@@ -25,12 +36,7 @@ subscribe(APP_READY, () => {
|
||||
<CourseTabsNavigation activeTabSlug="course" />
|
||||
</div>
|
||||
<Switch>
|
||||
{/* Staging: course-v1:UBCx+Water201x_2+2T2015 */}
|
||||
<Route
|
||||
exact
|
||||
path="/"
|
||||
render={() => <Link to="/course/course-v1%3AedX%2BDemoX%2BDemo_Course/block-v1:edX+DemoX+Demo_Course+type@sequential+block@edx_introduction/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_0270f6de40fc">Visit Demo Course</Link>}
|
||||
/>
|
||||
<Route exact path="/" render={courseLinks} />
|
||||
<Route path="/course" component={LearningSequencePage} />
|
||||
</Switch>
|
||||
<Footer />
|
||||
|
||||
@@ -58,9 +58,11 @@ function CourseContainer(props) {
|
||||
const { models, courseId } = useLoadCourse(courseUsageKey);
|
||||
|
||||
useEffect(() => {
|
||||
if (!sequenceId) {
|
||||
// TODO: This will not work right now.
|
||||
const { activeSequenceId } = models[courseId];
|
||||
if (courseId && !sequenceId) {
|
||||
// TODO: This is temporary until we get an actual activeSequenceId into the course model data.
|
||||
const course = models[courseId];
|
||||
const chapter = models[course.children[0]];
|
||||
const activeSequenceId = chapter.children[0];
|
||||
history.push(`/course/${courseUsageKey}/${activeSequenceId}`);
|
||||
}
|
||||
}, [courseUsageKey, courseId, sequenceId]);
|
||||
|
||||
@@ -119,8 +119,11 @@ SequenceContainer.propTypes = {
|
||||
})).isRequired,
|
||||
courseId: PropTypes.string.isRequired,
|
||||
sequenceId: PropTypes.string.isRequired,
|
||||
unitId: PropTypes.string.isRequired,
|
||||
unitId: PropTypes.string,
|
||||
intl: intlShape.isRequired,
|
||||
};
|
||||
|
||||
SequenceContainer.defaultProps = {
|
||||
unitId: null,
|
||||
};
|
||||
export default injectIntl(SequenceContainer);
|
||||
|
||||
Reference in New Issue
Block a user