Skip to content

Commit

Permalink
Handle old, slash-separated course ids and course-vX:... style
Browse files Browse the repository at this point in the history
Allows Figures to run on sites with courses created in e.g., 2015
  • Loading branch information
bryanlandia committed May 31, 2021
1 parent d3f5f4e commit c3df86f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class App extends Component {
<Route exact path="/figures/courses" component={CoursesList} />
<Route exact path="/figures/learners-progress-overview" component={ProgressOverview} />
{(process.env.ENABLE_CSV_REPORTS === "enabled") && <Route exact path="/figures/csv-reports" component={CsvReports} />}
<Route path="/figures/course/:courseId" render={({ match }) => <SingleCourseContent courseId={match.params.courseId} />}/>
{/* course-v..-like course ids */}
<Route path="/figures/course/(?!(\/))" render={({ match }) => <SingleCourseContent courseId={match.params[0]} />}/>
{/* old slash-separated course id style */}
<Route path="/figures/course/:courseOrg/:courseNum/:courseRun" render={({ match }) => <SingleCourseContent courseId={`${match.params.courseOrg}/${match.params.courseNum}/${match.params.courseRun}`} />}/>
<Route path="/figures/user/:userId" render={({ match }) => <SingleUserContent userId={match.params.userId} />}/>
<Route path="/figures/report/:reportId" render={({ match }) => <SingleReportContent reportId={match.params.reportId} />}/>
<Route component={DashboardContent} />
Expand Down

0 comments on commit c3df86f

Please sign in to comment.