Skip to content

fix: Broken CSS styles of ora2 block editor [FC-0076] #36220

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

Merged
merged 19 commits into from
Apr 22, 2025

Conversation

ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented Feb 4, 2025

Description

  • It was this error 'Uncaught TypeError: el.timepicker is not a function' while rendering the editor. It's fixed adding the timepicker pluging in xblock_v2/xblock_iframe.html
  • Added '.openassessment_cancel_button' and '.openassessment_save_button' as action buttons.
  • Use openassessment manifest.json to load css from dist

Supporting information

Testing instructions

Deadline

ASAP

Other information

N/A

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

openedx-webhooks commented Feb 4, 2025

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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.

@ChrisChV ChrisChV marked this pull request as draft February 4, 2025 22:53
ChrisChV and others added 4 commits March 15, 2025 20:03
- It was this error 'Uncaught TypeError: el.timepicker is not a function' while rendering the editor.
    It's fixed adding the timepicker pluging in `xblock_v2/xblock_iframe.html`
- Added '.openassessment_cancel_button' and '.openassessment_save_button' as action buttons.
@DanielVZ96 DanielVZ96 force-pushed the chris/FAL-3992-fix-ora2 branch from 6e4f191 to bd4dee7 Compare March 16, 2025 01:09
@DanielVZ96
Copy link
Contributor

@ChrisChV I also added the open assessment styles so that it can display properly. I had to add a ton of css and maybe it can be reduced somehow.

@ChrisChV ChrisChV changed the title fix: Save and cancel button of ora2 block editor fix: Save and cancel button of ora2 block editor [FC-0076] Apr 14, 2025
@ChrisChV ChrisChV marked this pull request as ready for review April 14, 2025 18:23
Copy link
Contributor Author

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

  • I tested this: I followed the testing instructions
  • I read through the code and considered the security, stability and performance implications of the changes.
  • I tested that the UI can be used with a keyboard only (tab order, keyboard controls).
  • Includes tests for bugfixes and/or features added.
  • Includes documentation
  • Includes fixtures that create objects required for manual testing.

Copy link
Contributor

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Approved because this is working great! But I have questions about why, and whether we're including enough files from the ORA2 manifest.

Comment on lines 124 to 136
openassessment_path = Path(openassessment.__path__[0])
oa_manifest_path = openassessment_path / "xblock" / "static" / "dist" / "manifest.json"

if oa_manifest_path.exists():
with open(oa_manifest_path, "r") as f:
oa_manifest = json.load(f)
new_oa_manifest = {
'oa_ltr_css': oa_manifest.get("openassessment-ltr.css", ""),
'oa_ltr_js': oa_manifest.get("openassessment-ltr.js", ""),
'oa_editor_textarea_js': oa_manifest.get("openassessment-editor-textarea.js", ""),
'oa_editor_tinymce_js': oa_manifest.get("openassessment-editor-tinymce.js", ""),
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested openedx/edx-ora2#2272 without this change and I see that it fixes the Authoring MFE's ORA2 editor experience. But I don't understand how it works -- don't find any code that uses these terms oa_manifest or oa_editor_textarea_js?

  • Why is it ok to expose only the LTR resources (and not the RTL ones)? Don't we need both?
  • Why don't we need the other resources in the manifest.json?
  • Why don't we have to do this for other XBlocks?

Some comments would help :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pomegranited

don't find any code that uses these terms oa_manifest or oa_editor_textarea_js?

They are used in xblock_iframe.html (ref1, ref2)

Why is it ok to expose only the LTR resources (and not the RTL ones)? Don't we need both?

When we add the RTL style, it automatically applies that style (right-to-left reading) regardless of the language. I wasn't entirely sure how to place that conditional, so I think we should leave a comment so it can be done in a future task. @DanielVZ96 Could you add this comment?

Why don't we need the other resources in the manifest.json?

Two reasons: they are being renamed so they can be used in the template (the template does not accept scripts) and this files are only being used for the studio view (editor). @DanielVZ96 Could you add a comment for this?

Why don't we have to do this for other XBlocks?

The other Xblocks don't need extra files like these, ORA2 has a complicated UI that needed all these files to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the comment @ChrisChV @pomegranited

@ChrisChV ChrisChV changed the title fix: Save and cancel button of ora2 block editor [FC-0076] fix: Broken CSS styles of ora2 block editor [FC-0076] Apr 18, 2025
@ChrisChV
Copy link
Contributor Author

In 0eb286b I bump the ora2 version and in b35fe96 I added the ora2 block in LIBRARY_ENABLED_BLOCKS

@ChrisChV ChrisChV enabled auto-merge (squash) April 22, 2025 20:48
@ChrisChV ChrisChV merged commit 54ec998 into openedx:master Apr 22, 2025
48 checks passed
@ChrisChV ChrisChV deleted the chris/FAL-3992-fix-ora2 branch April 22, 2025 21:08
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Apr 22, 2025
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

tonybusa pushed a commit to tonybusa/edx-platform that referenced this pull request Apr 23, 2025
* It was this error 'Uncaught TypeError: el.timepicker is not a function' while rendering the editor. It's fixed adding the timepicker pluging in xblock_v2/xblock_iframe.html
* Added '.openassessment_cancel_button' and '.openassessment_save_button' as action buttons.
* Use openassessment manifest.json to load css from dist
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label May 12, 2025
UsamaSadiq pushed a commit that referenced this pull request May 14, 2025
* It was this error 'Uncaught TypeError: el.timepicker is not a function' while rendering the editor. It's fixed adding the timepicker pluging in xblock_v2/xblock_iframe.html
* Added '.openassessment_cancel_button' and '.openassessment_save_button' as action buttons.
* Use openassessment manifest.json to load css from dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants