Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plan for backend changes to support Units in Libraries #1697

Open
16 tasks
bradenmacdonald opened this issue Feb 26, 2025 · 4 comments
Open
16 tasks

Plan for backend changes to support Units in Libraries #1697

bradenmacdonald opened this issue Feb 26, 2025 · 4 comments

Comments

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Feb 26, 2025

Sketching out the backend work remaining until the backend will fully support the Epic 12: Units in Libraries epic, and the bare-bones version of Epic 14: Units can be published and reused in courses

Learning Core tasks

edx-platform Libraries REST API tasks

Unclear tasks

Tasks that can be done at the same time as the frontend ticket

edx-platform REST API tasks for using units in courses

@bradenmacdonald
Copy link
Contributor Author

@ormsbee @kdmccormick @pomegranited Based on my work with our "Units/Containers" prototype so far, here's my attempt to plan the remaining backend work required for the units epic. Can you please review, and let me know your thoughts - especially if I've missed anything or included anything uncessary?

@bradenmacdonald
Copy link
Contributor Author

bradenmacdonald commented Feb 26, 2025

Oh, in particular I'm looking for feedback on:

  • Decide on / implement opaque key format for structures (like units) in libraries.
  • combining containers into the publishing app

More details on both are above in the main description.

@pomegranited
Copy link
Contributor

pomegranited commented Feb 27, 2025

@bradenmacdonald This is looking great!

I think we're missing backend support for these two use cases, but everything else looks covered above:

...Also update the "GET unit" endpoint to return whether or not the unit has unpublished changes and whether or not it contains unpublished changes (among its children).

  1. This GET endpoint can't just return a boolean flag -- we also need to list which children have unpublished changes, to support Need interim publish confirmation modal for components #1188 (this issue is listed as not part of Teak in my notes, but is still in the epic Epic 12: Units can be created and edited in Libraries #1594)

  2. Is there a requirement to be able to search/filter "all Units that have unpublished changes in their children"?
    If so, we'll need to make sure the Unit publish_status field in Meilisearch reflects this full unpublished status for the container and its children.

Basic CRUD REST Endpoint for units in libraries. Allow creating a unit, viewing units in library and search results, setting/changing the title, and deleting the unit. No ability to add components yet. Enforce permisisons. Set a "friendly" slug based on the title.

When we do add support for components in units, the "DELETE unit" endpoint also needs to handle re-parenting its child components into the library (if that step is required), a la #1622. This is also mentioned in #1628.

Implement a mechanism for storing #1640 (visibility, discussions_enabled) - see Slack discussion

My notes say this requirement been removed from MVP/Teak?

@bradenmacdonald
Copy link
Contributor Author

bradenmacdonald commented Feb 27, 2025

@pomegranited Thanks!

I think we're missing backend support for these two use cases, but everything else looks covered above:

I've updated the wording of the "Update API" story above to explicitly mention re-ordering. It covers removal too (already did): "Allow re-ordering and removing components via the update API."

1. we also need to list which children have unpublished changes, to support Need interim publish confirmation modal for components #1188

I'm a bit reluctant to add that to the "GET unit" API, because it would be a more expensive thing to compute. But we can look at adding a separate API for it if needed. We may also be able to get away with just querying the search index, which should have that information already and already will provide it along with the component titles etc. I will add a note about this above though as a potential story.

2. If so, we'll need to make sure the Unit publish_status field in Meilisearch reflects this full unpublished status for the container and its children.

I think we should do that in any case, so I've noted it above.

When we do add support for components in units, the "DELETE unit" endpoint also needs to handle re-parenting its child components into the library (if that step is required), a la #1622. This is also mentioned in #1628.

I don't think we need any re-parenting. My understanding is that all components will always be visible both in their unit(s) (if any) and separately in the library. When you delete the unit, the child component is still visible separately in the library just as it always was, with no action required on our part.

Implement a mechanism for storing #1640 (visibility, discussions_enabled) - see Slack discussion

My notes say this requirement been removed from MVP/Teak?

Yeah it may very well be - we're still discussing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In grooming
Development

No branches or pull requests

2 participants