openedx / frontend-lib-content-components

[Moved to openedx/frontend-app-course-authoring] A library of high-level components for content handling (viewing, editing, etc. of HTML, video, problems, etc.), to be shared by multiple MFEs.
GNU Affero General Public License v3.0
11 stars 33 forks source link

feat: add conditional for new parser beta testing #496

Closed KristinAoki closed 3 months ago

KristinAoki commented 3 months ago

Description

This PR sets up future work for a new OLX parser. Since releasing the react based problem editor, there have been various bugs that come from the OLX parser not catching all the nuanced tags. Currently the default experience for the editor is the visual (TinyMCE) editor. The problem is navigated to the advanced editor if it uses an advanced problem tags, has multiple questions in a problem, and a non-default tag or attribute is found. This approach requires updates to the problem editor parser each time a new tag or attribute is brought to the developers attention so that the content that it is referencing is not lost by accidentally rendering the wrong editor. To simply the need for constant updates for new tags or attributes, the new OLX parser will have a specific list of tags and attributes that are allowed in the visual editor. The array of supported tags and attributes will generated from the Read The Docs site. If there is a tag or attribute that is not in the supported list the advanced problem editor will be displayed to ensure that no OLX was lost when between the last save and opening of the problem.

To confirm the new parser is an improvement, we need a conditional statement based on waffle flag that will control which users will have the problem editor with the new parser or the current parser. This change impacts "Authors" and "Developers".

Supporting information

JIRA Tickets: TNL-11667 🔒 and TNL-11694 🔒

Testing instructions

  1. Open a course
  2. Create a new problem block
  3. Confirm that the problem can be opened and edited
  4. Save the problem
  5. Reopen the problem
  6. Confirm that the problem can be opened and edited

Deadline

None

Other information

This PR is dependent of edx-platform PR #35184

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.90%. Comparing base (9bce0a3) to head (60433cb). Report is 1 commits behind head on main.

Files Patch % Lines
...editors/containers/ProblemEditor/data/OLXParser.js 0.00% 3 Missing :warning:
src/editors/data/redux/thunkActions/problem.js 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #496 +/- ## ========================================== - Coverage 88.97% 88.90% -0.08% ========================================== Files 248 248 Lines 4545 4552 +7 Branches 936 944 +8 ========================================== + Hits 4044 4047 +3 - Misses 468 472 +4 Partials 33 33 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.