Skip to content

feat: display editors as modals #1838

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 2 commits into from
Apr 25, 2025

Conversation

DanielVZ96
Copy link
Contributor

@DanielVZ96 DanielVZ96 commented Apr 19, 2025

Description

Currently in libraries editing a component opens a modal without navigating into other urls, but in course units you get redirected to a new page to edit the block and then back to the unit page.

This PRs refactors the logic so that editing components in courses opens modals instead of redirecting.. Currently it is keeping the editing urls in order to not break any other flows such as the video upload page.

image

Supporting information

Issue: #1644

Testing instructions

  1. make sure you are using MFE editors: tutor dev run lms ./manage.py lms shell -c "from waffle.models import Flag; Flag.objects.update_or_create(name='contentstore.new_studio_mfe.use_new_unit_page', defaults={'everyone': True})"
  2. In any course, create components of multiple types and make sure they can be added and edited correctly
  3. Pay special attention to the video editor which has multiple steps in the video creation/edit workflow.

Other information

Private-Ref

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

openedx-webhooks commented Apr 19, 2025

Thanks for the pull request, @DanielVZ96!

This repository is currently maintained by @openedx/2u-tnl.

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.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Apr 19, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 23, 2025
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.78%. Comparing base (b30a1c8) to head (0e4d1be).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1838      +/-   ##
==========================================
+ Coverage   93.77%   93.78%   +0.01%     
==========================================
  Files        1146     1146              
  Lines       23905    23898       -7     
  Branches     5043     5160     +117     
==========================================
- Hits        22416    22412       -4     
+ Misses       1421     1409      -12     
- Partials       68       77       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Hi @DanielVZ96 The VideoEditor code was much more complicated than it needed to be -- the VideoGallery and VideoSelectors are only used in the Content > Video page, not when editing VideoXBlocks. So I reverted changes to that code.

This is working now, but there are a couple bugs we'll need to fix as part of follow-up PRs:

  1. Duplicating a block opens the block editor, but shows page not found.
  2. The course optimizer helper relies on the editor page endpoints removed here.
    So we need another way to trigger the editor modal for a given block.

👍

  • I tested this by adding and editing all the default and advanced types of XBlocks.
  • I read through the code
  • I checked for accessibility issues by using my keyboard to navigate
  • Includes documentation
  • User-facing strings are extracted for translation

@ChrisChV ChrisChV marked this pull request as ready for review April 25, 2025 18:22
@ChrisChV
Copy link
Contributor

ChrisChV commented Apr 25, 2025

This is working now, but there are a couple bugs we'll need to fix as part of follow-up PRs:

  • Duplicating a block opens the block editor, but shows page not found.

I made a small fix in 9161f92, the editor is now displayed, but I found the following bugs:

  • The editor points to the block being duplicated, not the block that has just been created. But this bug already existed before these changes.
  • The new block editor opens as a template inside the iframe. This issue also existed before these changes.

I agree that they can be done in part as a follow-up PR.

CC @DanielVZ96

@ChrisChV ChrisChV force-pushed the dvz/modal-editor-only branch from 9161f92 to 3348877 Compare April 25, 2025 18:35
@ChrisChV ChrisChV enabled auto-merge (squash) April 25, 2025 18:36
@ChrisChV ChrisChV force-pushed the dvz/modal-editor-only branch from 3348877 to 5777ae4 Compare April 25, 2025 19:16
@ChrisChV ChrisChV merged commit dbb1a99 into openedx:master Apr 25, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Apr 25, 2025
@pomegranited pomegranited deleted the dvz/modal-editor-only branch April 29, 2025 01:11
DanielVZ96 added a commit to open-craft/frontend-app-authoring that referenced this pull request May 21, 2025
ChrisChV pushed a commit that referenced this pull request May 22, 2025
* feat: display editors as modals  (#1838)

* fix: do open editor of new xblock when duplicating (#1887)

Fixes bug where after duplicating an xblock, the editor modal of the old xblock is being open instead of the new copied xblock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants