Skip to content

[draft] Provide a JsonCompatible adapter for RichTextValue objects#1584

Open
erral wants to merge 2 commits into
mainfrom
erral-issue-1583
Open

[draft] Provide a JsonCompatible adapter for RichTextValue objects#1584
erral wants to merge 2 commits into
mainfrom
erral-issue-1583

Conversation

@erral

@erral erral commented Feb 13, 2023

Copy link
Copy Markdown
Member

Fixes #1583

@mister-roboto

Copy link
Copy Markdown

@erral thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@netlify

netlify Bot commented Feb 13, 2023

Copy link
Copy Markdown

Deploy Preview for plone-restapi canceled.

Name Link
🔨 Latest commit 29d679a
🔍 Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/63ea6980242d520008290caa

@netlify

netlify Bot commented Feb 13, 2023

Copy link
Copy Markdown

Deploy Preview for plone-restapi canceled.

Name Link
🔨 Latest commit 127d596
🔍 Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/63ea693863815c000827eb05

@jensens

jensens commented Feb 14, 2023

Copy link
Copy Markdown
Member

Your solution provides only the rendered safe-HTML. But what if we want to get the raw data from the field, for an editor or alike? This could be any content type as raw, i.e. markdown. I do not think this implementation is enough. I would expect something like a dict with output, raw and its configured types, i.e something like:

{
    "output": {
        "data": "<p>foo<p>",
        "type": "text/safe-html",
    "raw": {
        "data": "foo",
        "data": "text/plain",
}

@erral

erral commented Feb 14, 2023

Copy link
Copy Markdown
Member Author

This is the initial draft.

I first checked what happens when you add a simple HTML as a default value of the RichText field. I will test further with some other values.

@jensens

jensens commented Feb 14, 2023

Copy link
Copy Markdown
Member

OK! Since this is not a draft PR nor labels were applied, my understanding was like it is ready for review.

@erral erral changed the title Provide a JsonCompatible adapter for RichTextValue objects [draft] Provide a JsonCompatible adapter for RichTextValue objects Jan 16, 2025
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.

Provide IJsonCompatible adapter for RichTextValue objects

4 participants