Skip to content

Html button in text component editor backport #2064

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

Conversation

tonybusa
Copy link
Contributor

@tonybusa tonybusa commented Jun 2, 2025

Description

Backport: #1869 and #2043

Supporting information

Fixes: openedx/wg-build-test-release#466

Testing instructions

Go to Section > Subsection > Unit (Text)
Click on the "text" button in the Add Components panel
Text editor opens in a modal
Click on the text editor HTML functions

Other Information

The CodeEditor hook createCodeMirrorDomNode is doing a lookup on CODEMIRROR_LANGUAGES but we never set the lang on the component. Since this is referenced in the project to be specifically an HTML editor, I hardcoded the "html" string to the prop for the lookup to succeed. Otherwise, there is a new change on master that includes the default as xml() (this wasn't included in the current teak release).
See default here: https://github.com/tonybusa/frontend-app-authoring/blob/html-button-in-text-component-editor/src/editors/sharedComponents/CodeEditor/hooks.js#L103

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 2, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @tonybusa!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@mariajgrimaldi
Copy link
Member

mariajgrimaldi commented Jun 3, 2025

@tonybusa: thank you so much! But I think we need to change the base from master to release/teak. Let me know!

@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Jun 3, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Jun 3, 2025
@mphilbrick211
Copy link

@tonybusa flagging Maria's comment above, thanks!

@bradenmacdonald bradenmacdonald changed the base branch from master to release/teak June 24, 2025 09:44
@mariajgrimaldi
Copy link
Member

I just tested this locally and it's working as expected (sorry for the cut view):

Screencast.from.24-06-25.15.17.52.webm

The only thing I noticed with the editor was that when pressing "save" I had to manually close the modal view, not sure if that's the expected behavior. After noticing this, I went to the Teak sandbox to check whether this worked the same there, and couldn't replicate it. Also, in the teak sandbox, the HTML button is working correctly. I'm not sure if maybe this commit was backported already by tutor?

@bradenmacdonald
Copy link
Contributor

@mariajgrimaldi You should not have to manually close the modal if you've already clicked save. That seems like a regression.

And yeah, it seems like this was already backported in #2065 . I'm not sure why this PR was duplicated. Should we just close it?

@mariajgrimaldi
Copy link
Member

Oh, I didn't realize 🫣. Thank you! Yes, let's close it.

I couldn't reproduce the modal issue on the teak sandbox, though. I'll update my teak branch and test again.

@github-project-automation github-project-automation bot moved this from In Eng Review to Done in Contributions Jun 24, 2025
@mariajgrimaldi
Copy link
Member

It's working! So no regression :)

Thank you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[UI Issue] <TC_Author_53>: <HTML button is broken>
5 participants