Skip to content

React Quill replaced with Draftjs in Dashboard's Txt Widget - #9673

Closed
mumairr wants to merge 3 commits into
geosolutions-it:masterfrom
mumairr:Fix-#9627-Replace-Quill-editor-with-Draftjs-editor-in-Dashboard-Text-widget
Closed

mumairr wants to merge 3 commits into
geosolutions-it:masterfrom
mumairr:Fix-#9627-Replace-Quill-editor-with-Draftjs-editor-in-Dashboard-Text-widget

Conversation

@mumairr

@mumairr mumairr commented Oct 29, 2023

Copy link
Copy Markdown
Contributor

Description

React Quill editor has been replaced with Draftjs in Dashboard Text Wigets

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

Fix #9627

What is the new behavior?

Draftjs added, allows embedding of PDFs or any link, plus allow upload of image rather than a link via props option

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@tdipisa tdipisa added this to the 2024.01.00 milestone Oct 30, 2023
@tdipisa tdipisa added enhancement Dashboard Tasks related to dashboard Widgets labels Oct 30, 2023
@tdipisa
tdipisa requested a review from allyoucanmap October 30, 2023 08:52

@allyoucanmap allyoucanmap left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The implementation seems good, just few notes:

  • we will need to backport this to the version 2022.02.xx supported by geonode-mapstore-client so we should make sure that it will work also on that branch. I think CompactRichTextEditor.jsx does not exist on 2022.02.xx so just remember to include it in the backport if needed
  • please add unit test to cover at least the requirement of the issue. We should ensure the embedded option is available
  • @giohappy one of the requirement is also to allow configurable font families but I don't see it implemented here. We could decide to split this task if so a separated issue needs to be created

// it will increase the size of the map too much
uploadEnabled: false,
// allows to set enable imge upload on/off via props
uploadEnabled: props.uploadEnabled || false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we allowing to upload images here? I think this is creating embedded base 64 images and I don't think it's a requirement of the task

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As per comments above, I guess image upload was disallowed for Geo-Stories only due to size issue (map + images), so decided to introduce a prop (false by default) if image upload needs to be allowed or just an embedded link

@mumairr mumairr closed this Nov 2, 2023
@mumairr
mumairr deleted the Fix-#9627-Replace-Quill-editor-with-Draftjs-editor-in-Dashboard-Text-widget branch November 2, 2023 13:54
@giohappy

giohappy commented Nov 3, 2023

Copy link
Copy Markdown
Collaborator

@giohappy one of the requirement is also to allow configurable font families but I don't see it implemented here. We could decide to split this task if so a separated issue needs to be created

Custom fonts wasn't a requirement. I guess it was added as a bonus, but we can leave it out if it doesn't come for free.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Quill editor with Draftjs editor in Dashboard's Text widget

4 participants