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

Provide a JsonCompatible adapter for RichTextValue objects #1584

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erral
Copy link
Sponsor Member

@erral erral commented Feb 13, 2023

Fixes #1583

@mister-roboto
Copy link

@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
Copy link

netlify bot commented Feb 13, 2023

Deploy Preview for plone-restapi canceled.

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

@netlify
Copy link

netlify bot commented Feb 13, 2023

Deploy Preview for plone-restapi canceled.

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

@jensens
Copy link
Sponsor Member

jensens commented Feb 14, 2023

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
Copy link
Sponsor Member Author

erral commented Feb 14, 2023

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
Copy link
Sponsor Member

jensens commented Feb 14, 2023

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

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
3 participants