mitodl / mitxonline

BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Adding course topics #2210

Closed annagav closed 3 months ago

annagav commented 3 months ago

What are the relevant tickets?

Fix https://github.com/mitodl/hq/issues/4110

Description (What does it do?)

Adding topics in MITx Online. The ability to create delete topics through the cms, and add them to courses.

Populates topics with existing department names. I don't think it is necessary, but this is how it was done in mitxpro. And I think it is nice to have some topics to begin with.

Screenshots (if appropriate):

Screenshot 2024-05-16 at 8 53 26 AM

How can this be tested?

Run migrations Run the app, go to the cms and make sure you can see Course Topics. Click on it and try to add or delete a course topic.

Go to Course page add topic to a course page.

Also view http://mitxonline.odl.local:8013/api/v2/parent_course_topics/

collinpreston commented 3 months ago

@annagav hey, my fault, but I think you will need to update this branch from main in order for the application to properly load. Related to: https://github.com/mitodl/mitxonline/pull/2213

pdpinch commented 3 months ago

Can we pre-populate the topics with the ones from this spreadsheet: https://docs.google.com/spreadsheets/d/1Euu4ezPKeYkiTThvmxB5vFONFNG4fOULNW42F6qLuFI/edit?pli=1#gid=431773359

annagav commented 3 months ago

Can we pre-populate the topics with the ones from this spreadsheet: https://docs.google.com/spreadsheets/d/1Euu4ezPKeYkiTThvmxB5vFONFNG4fOULNW42F6qLuFI/edit?pli=1#gid=431773359

Should the first row be included?

pdpinch commented 3 months ago

Yeah, it's a hierarchy. The first row are the top-level topics. The other ones are children.

annagav commented 3 months ago

@collinpreston make sure reverse all three migrations before checking out the changes: ./manage.py migrate cms 0035 ./manage.py migrate courses 0050

annagav commented 3 months ago

Looks good. I would just check whether Programs should also have Topics.

Following the example in xpro, no programs don't have topics.