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: Allow RichTextEditor and its components to support readOnly state from draftjs editor #1884

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

adityasabnis
Copy link
Member

@adityasabnis adityasabnis commented Oct 15, 2024

This change leverages Editor's ReadOnly state https://draftjs.org/docs/api-reference-editor#readonly

Description

Accept disabled prop from the component and pass it down to add the moving part of the RichText Editor
When in readOnly state, all the moving part of the RTE should be non-editable. That includes text/ styling / attachments / attachment preview removal

Does this PR introduce a breaking change?

  • Yes
  • No

Manual testing step?

  • Check RTE story
  • Toggle disabled state

Tested:
- New ReadOnly RTE in DW
- Existing Review and Send RTE in DW

Screenshots (if appropriate):

Screen.Recording.2024-10-15.at.3.04.37.pm.mov

@adityasabnis adityasabnis self-assigned this Oct 15, 2024
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.73%. Comparing base (350eeec) to head (de6f45b).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1884   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files          94       94           
  Lines        1865     1868    +3     
  Branches      552      552           
=======================================
+ Hits         1860     1863    +3     
  Misses          5        5           

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

@adityasabnis adityasabnis changed the title fix: add readOnly rte state fix: Allow RichTextEditor and its components to support readOnly state from draftjs editor Oct 15, 2024
Copy link

sonarcloud bot commented Oct 15, 2024

Copy link
Contributor

@pphminions pphminions left a comment

Choose a reason for hiding this comment

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

LGTM 📓

@pphminions
Copy link
Contributor

merging 🚀

@pphminions pphminions merged commit 2578c44 into master Oct 15, 2024
10 checks passed
@pphminions pphminions deleted the rte-read-only branch October 15, 2024 23:39
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.

3 participants