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: tinymce render outside of editors #1254

Conversation

KristinAoki
Copy link
Member

Description

This bug was introduced via #1208. The cause of this bug was that state has two different definitions when trying to TinyMceWidget outside of the editors. One definition of state was an empty object coming from the editors redux store. The second definition of state had the required variables (images, lmsEndpointUrl, studioEndpointUrl, learningContextId, and isLibrary). The former loaded last so component tried to render referencing an empty object.

To fix the bug, <TinyMceWidget /> was refactored to not use the redux store to fetch images, lmsEndpointUrl, studioEndpointUrl, learningContextId or isLibrary. Now images,learningContextId and isLibrary are passed down from a parent component, and lmsEndpointUrl and studioEndpointUrl referenced from the config value.

This change impacts the Course Author
Before:
Screenshot 2024-09-04 at 12 00 28 PM

After:
Screenshot 2024-09-04 at 12 14 31 PM

Testing instructions

Updates testing

  1. Open the Updates page for a course
  2. Add a new update
  3. Confirm that you can add a new update
  4. Edit an existing update
  5. Confirm that you can edit existing update
  6. Edit handouts confirm that you can edit handouts

Schedule and details testing

  1. Open the schedules and details page
  2. Confirm that the page loads
  3. Scroll to the "Course overview"
  4. Confirm that section loads as expected

Text editor testing

  1. Open a text component for editing
  2. Confirm that the editor opens and content loads as expected

Problem editor testing

  1. Open a multi select problem for editing
  2. Confirm that the editor opens and content loads as expected
  3. Add feedback to one of the answer choices
  4. Add a hint
  5. Click "Save"
  6. In the unit page view, complete the problem
  7. Confirm that feedback and hint display as expected
  8. Re-open the problem editor
  9. Confirm that the editor opens and content loads as expected

@KristinAoki KristinAoki requested a review from a team as a code owner September 4, 2024 16:16
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

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

Project coverage is 92.22%. Comparing base (735d978) to head (a185cc8).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/generic/WysiwygEditor.jsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1254      +/-   ##
==========================================
- Coverage   92.22%   92.22%   -0.01%     
==========================================
  Files        1008     1008              
  Lines       18514    18511       -3     
  Branches     3948     3894      -54     
==========================================
- Hits        17074    17071       -3     
  Misses       1373     1373              
  Partials       67       67              

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

@KristinAoki KristinAoki enabled auto-merge (squash) September 4, 2024 18:22
@KristinAoki KristinAoki requested review from bradenmacdonald and removed request for a team September 5, 2024 15:11
Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

Thanks for figuring out and fixing that!

@KristinAoki KristinAoki merged commit dcf05cd into master Sep 5, 2024
6 of 7 checks passed
@KristinAoki KristinAoki deleted the KristinAoki/refactor-TinyMceWidget-without-mapStateToProps branch September 5, 2024 20:18
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