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

Edit Contentlet: Allow User to Toggle Between WYSIWYG and Code Field #28186

Closed
Tracked by #25445
fmontes opened this issue Apr 10, 2024 · 6 comments · Fixed by #29934, #30131 or #30172
Closed
Tracked by #25445

Edit Contentlet: Allow User to Toggle Between WYSIWYG and Code Field #28186

fmontes opened this issue Apr 10, 2024 · 6 comments · Fixed by #29934, #30131 or #30172

Comments

@fmontes
Copy link
Member

fmontes commented Apr 10, 2024

Parent

#25445

Task description

As a dotCMS user, I want to be able to switch between the WYSIWYG editor and the code editor in the content editing field, so that I can have more flexibility in how I input and edit content.

Acceptance Criteria

Users should be able to seamlessly switch between the WYSIWYG editor (tinymce) and the code editor (monaco editor) in the content editing field. The content should be retained and displayed correctly in both editor modes.

External Links

OLD Editor

image

New Editor

Screenshot 2024-09-03 at 1 43 02 PM

Assumptions & Initiation Needs

  • Users are familiar with both the WYSIWYG editor and the code editor.
  • The toggle button or option to switch between editors will be located within the content editing field for easy access.

Quality Assurance Notes & Workarounds

N/A

Sub-Tasks & Estimates

N/A

@fmontes fmontes changed the title Edit Content: Allow User to Toggle Between WYSIWYG and Code Field Edit Contentlet: Allow User to Toggle Between WYSIWYG and Code Field Apr 10, 2024
@oidacra oidacra self-assigned this Sep 3, 2024
@oidacra oidacra linked a pull request Sep 13, 2024 that will close this issue
3 tasks
github-merge-queue bot pushed a commit that referenced this issue Sep 18, 2024
### Parent Issue

#28186 

### Proposed Changes
* Add a Dropdown for switching from TinyMCE to Monaco editor
* Using Monaco Editor, add a dropdown to select the language

### Checklist
- [x] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)
@dsilvam dsilvam assigned dsilvam and unassigned oidacra Sep 18, 2024
@dsilvam
Copy link
Contributor

dsilvam commented Sep 19, 2024

Failed IQA:

We need to keep these two behaviors from the old Content Edit Screen:

  1. In the old Edit Content Screen we used to remember the selected mode, meaning if you chose "Code", then closed and re-opened the Edit Content, you'd be in "Code" mode again. Now we are always defaulting to WYSIWYG (no-code) mode regardless of the previous selection.
  2. Also in the old Edit Content Screen when switching from "Code" to "WYSIWYG" we used to show the following message because in fact your code can loose format when switching to WYSIWYG and then coming back to "Code". We're not showing anything upon performing the same switching in the new Content Edit

Image

@oidacra
Copy link
Member

oidacra commented Sep 26, 2024

Notes to QA: Monaco Editor Integration

Custom Configuration

  • Test monacoOptions properties to ensure users can custom-config the editor
    Image

Editor Selection and Language

  • When Code is selected:
    • Verify that the language selection dropdown appears
    • Ensure the dropdown is populated with correct language options

Content Persistence

  • Save content and reopen:
    • Verify the proper editor (TinyMCE/Monaco) is displayed
    • For Code content, check if the correct language is preselected in the dropdown

Editor Switching

  • If the editor has content, changing the editor should:
    • Trigger a confirmation dialog
    • Verify the dialog appears and warns about potential content changes

Language Support

  • Test language selection functionality
  • Verify syntax highlighting works correctly for various programming languages

@josemejias11 @dsilvam

@dsilvam dsilvam self-assigned this Sep 26, 2024
@dsilvam
Copy link
Contributor

dsilvam commented Sep 26, 2024

Failed IQA:

  • When you have multiple Wysiwyg fields and switch between Wysiwyg and Code, the popup is displayed three times, one for each of the fields instead only for the field being modified.
  • We should not show the popup when switching from Wysiwyg to Code but only from Code to Wysiwyg.
  • If you have more than one Wysiwyg field, it will remember the selection only for the first one.
  • Remove the "HTML" word from the message in the popup

@dsilvam dsilvam removed their assignment Sep 26, 2024
@oidacra oidacra linked a pull request Sep 27, 2024 that will close this issue
3 tasks
@oidacra
Copy link
Member

oidacra commented Sep 27, 2024

When you have multiple Wysiwyg fields and switch between Wysiwyg and Code, the popup is displayed three times, one for each of the fields instead only for the field being modified ✅

We should not show the popup when switching from Wysiwyg to Code but only from Code to Wysiwyg. ✅

If you have more than one Wysiwyg field, it will remember the selection only for the first one.
Not reproducible

Remove the "HTML" word from the message in the popup ✅

@github-actions github-actions bot mentioned this issue Sep 27, 2024
3 tasks
@dsilvam dsilvam self-assigned this Sep 27, 2024
@dsilvam
Copy link
Contributor

dsilvam commented Sep 27, 2024

Passed IQA:
All the reported issues are now fixed.

@josemejias11
Copy link
Contributor

Approved: Tested on trunk_324de85, Docker, macOS 14.5, FF v126.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment