feat: support adding custom editors to Studio [BB-4060] - #27466
Conversation
|
Thanks for the pull request, @Agrendalath! I've created OSPR-5764 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
|
@Agrendalath Thank you for your contribution. Please let me know once it is ready for our review. |
eee964a to
2ca90fd
Compare
0x29a
left a comment
There was a problem hiding this comment.
👍
- I checked that sandbox deployed using commit from this PR, has theme and custom editor installed, and tested that icon can be changed from studio.
- I read through the code.
|
@natabene, this is ready for your review. |
2ca90fd to
26267ce
Compare
|
@natabene Can I review this? @Agrendalath The PR is relatively simple, but I find the PR description here a bit complex. Could you perhaps include an example screenshot of the "custom editors" that this allows, and explain why someone might want a "custom editor" ? The "Background" part can be removed or moved to the end. |
|
@Agrendalath @bradenmacdonald Thank you both. I would prefer for someone from TNL to also have a look. |
|
📣 💥 Heads-up: You must either rebase onto master or merge master into your branch to avoid breaking the build. We recently removed diff-quality and introduced lint-amnesty. This means that the automated quality check that has run on your branch doesn't work the same way it will on master. If you have introduced any quality failures, they might pass on the PR but then break the build on master. This branch has been detected to not have commit 2e33565 as an ancestor. Here's how to see for yourself: If you have any questions, please reach out to the Architecture team (either #edx-shared-architecture on Open edX Slack or #architecture on edX internal). |
338873b to
ac42390
Compare
|
@natabene, are there any updates on this? |
|
@Agrendalath No, no updates. |
|
Hi @natabene , have TNL had a chance to look at this OSPR? CC @Agrendalath @bradenmacdonald |
|
I am afraid not. |
|
Can someone help me understand the implications of this in terms of what studio would now support with this change? The ability to add actions to the elements o the course outline powered exclusively by theme level resources? Are there any specific examples of when this would be valuable to use? The modal example seems to be for an icon switcher at the unit level? |
We have three changes here:
Yes, that's correct. We're using these extension points and a simple plugin to add unit-level icon editors with a theme.
|
|
I had not been following the |
|
@ormsbee, unfortunately, we don't have an ADR for them. For now, we have added them to the platform's extension points as a "Trial" plugin type. In openedx/edx-django-utils#64, we were discussing a proper way of documenting them but concluded that we can decide about their final form once we start using them for more scenarios and change their status to "Adopted". |
|
jenkins run django-3.2/python |
|
jenkins run all |
|
Can you try rebasing please? |
166789f to
1e4a4eb
Compare
|
@ormsbee, the tests are currently failing on the |
1e4a4eb to
26f5f5c
Compare
This: 1. Introduces a variable for the Course Outline view in Studio. A custom theme can override it to add new editors. 2. Exports a function for creating new editor modals. A custom theme can use it to create editors without adding boilerplate code. 3. Adds a pluggable override for XBlock fields that are passed to the Studio. Without this, custom editors in Studio cannot retrieve values of XBlock fields.
|
Your PR has finished running tests. There were no failures. |
|
@ormsbee, the tests are green now. |
|
@Agrendalath 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
Description
This:
A custom theme can override it to add new editors.
A custom theme can use it to create editors without adding boilerplate code.
A plugin can inject a custom field here.
An example custom editor can look like this. The fa-eye icon is a button for opening it.

Jira
OSPR-5764
Sandbox
https://pr27466.sandbox.opencraft.hosting
Prerequisites
Testing instructions
lms/envs/private.py:cms/envs/private.py:fa-eyeicon next to one of the verticals and change the icon. Visit this page in LMS to see that the icon has been changed.Deadline
It would be great if this could make it to some iteration of Lilac.
Reviewers
Background
This is a follow-up to #21433. That PR initially:
iconfield added directly to theVerticalBlockclass. We have changed the approach and decided to add it via a mixin. Unfortunately, this makes the fields write-only for Studio, because the custom field cannot be passed to thecreate_xblock_infofunction.Settings