mitodl / ocw-studio

Open Source Courseware authoring tool
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Route different content types to correct edit pages #2169

Closed pt2302 closed 2 months ago

pt2302 commented 2 months ago

What are the relevant tickets?

Closes https://github.com/mitodl/ocw-studio/issues/2132 and closes https://github.com/mitodl/hq/issues/2917.

Description (What does it do?)

This PR adds functionality to route URLs in OCW Studio of the form /sites/<site-name>/content/<content-uuid> to /sites/<site-name>/type/<content-type>/edit/<content-uuid>, which correctly brings up the Edit <Content> dialog for different types of content. It also updates any links added in CKEditor to generate links of the form /sites/<site-name>/content/<content-uuid> expected by the rerouter functionality that has been implemented in this PR.

How can this be tested?

For a course with different types of content, including Pages, Video Galleries, External Resources, etc., try to add links to these in a page. Verify that clicking on the link brings up an option to edit the given content. Also verify that this has not impacted the functionality for editing Resources, which were the only content type this was functioning for previously.