plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
470 stars 638 forks source link

Draft-js Links on text fields of ContentType #1221

Closed giuliaghisini closed 4 years ago

giuliaghisini commented 4 years ago
tisto commented 4 years ago

@giuliaghisini could you imagine to write a Cypress test that shows this problem (and fails)? It bugs me that we don't catch regressions like this. You can basically just copy over this test:

https://github.com/plone/volto/blob/master/cypress/integration/block-text.js

And apply it for the news item (or any other content object that does not use the blocks layout/editor).

@robgietema any idea what causes this?

giuliaghisini commented 4 years ago

yess. I created a new branch #draftjs-link-in-contenttype. I'm going to write test now..

giuliaghisini commented 4 years ago

pushed failing cypress test

tisto commented 4 years ago

@giuliaghisini thank you! Would you mind adding a link here to the PR?

cekk commented 4 years ago

We've found the problem: this commit

Basically LinkEntity checks if the user is logged-in or not and creates a different component (router link or standard ).

On wysiwyg editor it breaks because the editor try to generate html with renderToStaticMarkup that's now wrapped into a redux Provider.

@robgietema any ideas on how to fix/avoid this problem?