Skip to content

Commit

Permalink
Merge pull request #351 from appsembler/bryan/frontend-handle-slash-s…
Browse files Browse the repository at this point in the history
…ep-course-ids

Handle old, slash-separated course ids and course-vX:... style
  • Loading branch information
bryanlandia authored May 31, 2021
2 parents d3f5f4e + c3df86f commit 1cee763
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 1cee763

Please sign in to comment.