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

Use prosemirror-editor #500

Merged
merged 8 commits into from
Nov 17, 2023
Merged

Use prosemirror-editor #500

merged 8 commits into from
Nov 17, 2023

Conversation

rhystmills
Copy link
Contributor

@rhystmills rhystmills commented Oct 19, 2023

Co-authored with @samanthagottlieb

What does this change?

This PR replaces Scribe editors in tagmanager with a ProseMirror editor provided by the prosemirror-editor package, created for this purpose.

We're replacing Scribe because it's deprecated and introduces vulnerabilities into our projects.

The new editor also introduces hover and disabled states for the buttons, plus additional disabled styles when the entire editor is disabled.

Before After
image image

How to test

  1. Run this project locally according to the instructions in the readme or deploy to CODE (CODE probably will be be less painful).
  2. Edit an existing contributor tag to see the rich text editor use for the Description/Profile field. Try the formatting options.
  3. Save the tag. Are your changes persisted on refresh?
  4. If you're feeling thorough: open the network tab and clear the requests. Edit the tag's rich text, and save the changes. A POST request should go to the url similar to https://tagmanager.local.dev-gutools.co.uk/api/tag/12345. Does the description sent in that request look valid? Is the bold text serialised as <b> tags and the italic text as <i> tags? (It should). Are new paragraphs serialised as new <p> tags? (They should).
  5. Try removing your tag edit CODE permissions. Wait a minute or two and see if they apply (the editor should be disabled if you see a warning that you don't have tag edit permissions)

@rhystmills rhystmills marked this pull request as ready for review October 25, 2023 11:47
@rhystmills rhystmills marked this pull request as draft October 25, 2023 11:48
@rhystmills rhystmills force-pushed the rm/prosemirror-editor branch from a9f66c3 to 9605a4d Compare November 14, 2023 13:04
@rhystmills rhystmills marked this pull request as ready for review November 15, 2023 12:56
@davidfurey
Copy link
Member

  • 1. Tested in CODE
  • 2. Edit an existing contributor tag to see the rich text editor use for the Description/Profile field. Try the formatting options.
  • 3. Save the tag. Are your changes persisted on refresh?
  • 4. If you're feeling thorough: open the network tab and clear the requests. Edit the tag's rich text, and save the changes. A POST request should go to the url similar to https://tagmanager.local.dev-gutools.co.uk/api/tag/12345. Does the description sent in that request look valid? Is the bold text serialised as <b> tags and the italic text as <i> tags? (It should). Are new paragraphs serialised as new <p> tags? (They should).
  • 5. Try removing your tag edit CODE permissions. Wait a minute or two and see if they apply (the editor should be disabled if you see a warning that you don't have tag edit permissions)

@rhystmills rhystmills merged commit efd6e0a into main Nov 17, 2023
1 check passed
@rhystmills rhystmills deleted the rm/prosemirror-editor branch November 17, 2023 14:50
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