Skip to content

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

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 12 commits into from
May 20, 2025

Conversation

DanielVZ96
Copy link
Contributor

@DanielVZ96 DanielVZ96 commented May 1, 2025

Description

Fixes bug where after duplicating an xblock, the editor modal of the old xblock is being open instead of the new copied xblock.

Supporting information

Testing instructions

  1. Only the MFE modal is open
  2. The MFE modal is pointing to the new xblock.

Other information

Private-ref

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

openedx-webhooks commented May 1, 2025

Thanks for the pull request, @DanielVZ96!

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.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions May 1, 2025
@DanielVZ96 DanielVZ96 changed the title fix: do not open editor of xblock being duplicated fix: do open editor of new xblock when duplicating May 1, 2025
Copy link

codecov bot commented May 1, 2025

Codecov Report

Attention: Patch coverage is 98.07692% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.80%. Comparing base (65aca04) to head (f16834b).
Report is 37 commits behind head on master.

Files with missing lines Patch % Lines
src/course-unit/xblock-container-iframe/index.tsx 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1887      +/-   ##
==========================================
+ Coverage   93.77%   93.80%   +0.02%     
==========================================
  Files        1146     1154       +8     
  Lines       23898    24106     +208     
  Branches     5042     5104      +62     
==========================================
+ Hits        22411    22612     +201     
- Misses       1419     1426       +7     
  Partials       68       68              

☔ 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.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions May 1, 2025
@mphilbrick211 mphilbrick211 requested a review from a team May 1, 2025 17:44
@DanielVZ96 DanielVZ96 marked this pull request as draft May 2, 2025 23:39
@DanielVZ96
Copy link
Contributor Author

moving this to draft as we may need some changes to support video gallery based on openedx/edx-platform#36641 (comment)

@pomegranited
Copy link
Contributor

@DanielVZ96 It's ok to fix just the block duplication issues here, and use a separate PR for the video gallery fixes.
I'm seeing some weird stuff when I try to duplicate even a Text block -- when editing the new block, and after saving changes, it's like the whole Authoring MFE is iframed inside itself.

Duplicate.block.iframe.in.iframe.mp4

@mphilbrick211 mphilbrick211 moved this from Ready for Review to Waiting on Author in Contributions May 12, 2025
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.

👍 This is working! Thank you @DanielVZ96 .

  • I tested this on my tutor dev stack with fix: open mfe modal editor of new duplicated xblock edx-platform#36641
    • duplicated blocks in a course -- opens a modal to edit the duplicated block.
    • with new_core_editors.use_video_gallery_flow flag enabled, created a video block, and ensured the video gallery is shown. I couldn't test the full edx-val pipeline on my local dev stack, though.
    • with new_core_editors.use_video_gallery_flow flag disabled, created a video block, and ensured the normal video editing modal is shown.
  • I read through the code
  • I checked for accessibility issues by using my keyboard to navigate
  • Includes documentation N/A
  • User-facing strings are extracted for translation N/A

Copy link
Contributor

@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 added some comments

@DanielVZ96 DanielVZ96 marked this pull request as ready for review May 14, 2025 20:19
@ChrisChV ChrisChV merged commit 1568067 into openedx:master May 20, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions May 20, 2025
@pomegranited pomegranited deleted the dvz/fix-unit-xblock-duplicate branch May 21, 2025 00:49
DanielVZ96 added a commit to open-craft/frontend-app-authoring that referenced this pull request May 21, 2025
Fixes bug where after duplicating an xblock, the editor modal of the old xblock is being open instead of the new copied xblock.
DanielVZ96 added a commit to open-craft/frontend-app-authoring that referenced this pull request May 21, 2025
Fixes bug where after duplicating an xblock, the editor modal of the old xblock is being open instead of the new copied xblock.
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.

Duplicating a component opens an editor for original rather than the copy Duplicating a component opens an editor for original rather than the copy
4 participants