Skip to content
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

Open Editors in a Modal (library components only) [FC-0062] #1357

Merged
merged 12 commits into from
Oct 8, 2024

Conversation

bradenmacdonald
Copy link
Contributor

Description

Implements #1321

This PR changes the built-in editors so that in libraries they open in a modal, with the library partially visible behind them. Because we still have to support the legacy unit page as default, editing content in courses will continue to use the full screen editor.

Screenshots:

Editing a library component Editing a course component (no change)
Screenshot 1 Screenshot 2

Testing instructions

Try the various (Text, Problem, Video) editors in libraries as well as in courses, and make sure there are no regressions.

Other information

Includes changes from #1345 - merge that one first.

Private ref: FAL-3861.

@bradenmacdonald bradenmacdonald added the FC Relates to an Axim Funded Contribution project label Oct 3, 2024
@bradenmacdonald bradenmacdonald requested a review from a team as a code owner October 3, 2024 01:18
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 3, 2024
@openedx-webhooks
Copy link

Thanks for the pull request, @bradenmacdonald!

What's next?

Please work through the following steps to get your changes 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.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/2u-tnl. Tag them in a comment and let them know that your changes are ready for review.

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.

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 93.28859% with 10 lines in your changes missing coverage. Please review.

Project coverage is 92.98%. Comparing base (9c1fd5a) to head (e8f87ba).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/editors/EditorPage.tsx 64.28% 5 Missing ⚠️
src/editors/containers/EditorContainer/index.tsx 94.11% 3 Missing ⚠️
...onents/SelectTypeModal/SelectTypeWrapper/index.tsx 95.45% 1 Missing ⚠️
...rary-authoring/components/ComponentEditorModal.tsx 94.11% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1357   +/-   ##
=======================================
  Coverage   92.97%   92.98%           
=======================================
  Files        1036     1034    -2     
  Lines       19457    19490   +33     
  Branches     4126     4135    +9     
=======================================
+ Hits        18090    18122   +32     
- Misses       1302     1303    +1     
  Partials       65       65           

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

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.

@bradenmacdonald This change looks great, but it's not letting me edit library problem blocks anymore? I don't see a modal pop up when I click "edit" for these. Editing problems in a course works fine, as does editing library html and video blocks.

Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

Hi @bradenmacdonald.
The code is looking good!

I found a bug while trying to edit a Problem in the "blank" state. The content is rendered at the bottom of the page instead of in the modal.
image

Edit: Ops.. It seems to be the same bug that @pomegranited reported.

src/editors/EditorPage.tsx Show resolved Hide resolved
@openedx openedx deleted a comment from openedx-webhooks Oct 3, 2024
@bradenmacdonald
Copy link
Contributor Author

@rpenido @pomegranited Thanks for catching that bug. It should be fixed now :)

@bradenmacdonald bradenmacdonald force-pushed the braden/editors-in-modal branch from 59194e6 to 2bc53e0 Compare October 3, 2024 20:52
Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work, @bradenmacdonald!

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@bradenmacdonald
Copy link
Contributor Author

@ChrisChV Could you please review as CC? Also @pomegranited this is ready for a second review.

@bradenmacdonald bradenmacdonald force-pushed the braden/editors-in-modal branch from 8710ee9 to e8f87ba Compare October 4, 2024 18:09
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.

👍 Works great, thank you @bradenmacdonald !

  • I tested this on course and library blocks of type video, text, and problem
  • I read through the code
  • I checked for accessibility issues by using my keyboard to navigate
  • Includes documentation for added parameters and functionality
  • User-facing strings are extracted for translation

@ChrisChV ChrisChV merged commit 8c125df into openedx:master Oct 8, 2024
8 checks passed
@ChrisChV ChrisChV deleted the braden/editors-in-modal branch October 8, 2024 02:04
@bradenmacdonald
Copy link
Contributor Author

Thanks everyone!

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.

5 participants