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

fix: text editor opening blank with no images #492

Merged

Conversation

KristinAoki
Copy link
Member

Description

This PR fixes issues the following issues introduced by #490:

  • When no images or no static images need to be changed, the text and problem editors did not load previously saved content
  • When saving images with the raw text editor and advanced problem editor, the images when not load and show the broken src icon. After re-opening the editor, the src would be incorrectly formatted and not show the original static url

Testing

Testing raw editor

  1. Open an existing raw html block
  2. Confirm that the html loads
  3. Add an image using the "Studio URL"
  4. Add an image using the "Web URL"
  5. Click "Save"
  6. Confirm that the images are viewable on the unit page
  7. Re-open the block
  8. Confirm the image srcs are the same as originally saved
  9. Click "Save"
  10. Confirm that the images are still viewable
  11. Add a new raw html block
  12. Confirm that the default content loads

Testing text editor

  1. Open an existing html block with no images
  2. Confirm that text loads
  3. Click "Cancel"
  4. Open an existing html block with images
  5. Confirm that the text and images load
  6. Click "Save"
  7. Confirm that the images load in block preview on the unit page
  8. Add a new text block
  9. Confirm that the editor loads

Testing problem editor

  1. Open an existing problem block with no images
  2. Confirm that problem loads
  3. Click "Cancel"
  4. Open an problem html block with images
  5. Confirm that the problem and images load
  6. Switch to the advanced editor
  7. Confirm that all relative paths are use /static/
  8. Click "Save"
  9. Confirm that the images load in block preview on the unit page
  10. Add a new problem block
  11. Select any of the basic problems
  12. Confirm that the editor loads

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.98%. Comparing base (2678234) to head (8d23e17).
Report is 1 commits behind head on main.

Files Patch % Lines
...rc/editors/sharedComponents/TinyMceWidget/hooks.js 94.44% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #492      +/-   ##
==========================================
+ Coverage   88.86%   88.98%   +0.11%     
==========================================
  Files         248      248              
  Lines        4535     4547      +12     
  Branches      934      941       +7     
==========================================
+ Hits         4030     4046      +16     
+ Misses        474      468       -6     
- Partials       31       33       +2     

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

Copy link
Contributor

@rayzhou-bit rayzhou-bit left a comment

Choose a reason for hiding this comment

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

lgtm! I tested with inserting tables as well which was also an issue before.

@KristinAoki KristinAoki merged commit b6ff623 into main Jul 10, 2024
10 checks passed
@KristinAoki KristinAoki deleted the KristinAoki/fix-tinymce-opening-blank-with-no-images branch July 10, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants