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(slate): fix multiple SlateEditor editing the same field in a form #5813

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

razvanMiu
Copy link
Contributor

@razvanMiu razvanMiu commented Feb 29, 2024

closes #5790

Copy link

netlify bot commented Feb 29, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 7eb236b
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/6602d48f50b4cf0007d3cfc0

Copy link

netlify bot commented Feb 29, 2024

Deploy Preview for volto canceled.

Name Link
🔨 Latest commit 7eb236b
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/6602d48fd66a0a0008ddc291

@razvanMiu
Copy link
Contributor Author

razvanMiu commented Mar 26, 2024

@sneridagh Looks like this pr fails because of a less file import in unit tests. It seams that the less file is not mocked so probably there is a configuration issue for jest?

FAIL __tests__/volto-slate/deserialize.test.js
  ● Test suite failed to run

    /home/runner/work/volto/volto/packages/volto-slate/src/editor/less/editor.less:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){@import 'globals.less';
                                                                                             ^

    SyntaxError: Invalid or unexpected token

      23 | import isHotkey from 'is-hotkey';
      24 |
    > 25 | import '@plone/volto-slate/editor/less/editor.less';
         | ^
      26 |
      27 | import Toolbar from '@plone/volto-slate/editor/ui/Toolbar';
      28 |

      at Runtime.createScriptFromCode (../../node_modules/.pnpm/jest-runtime@26.6.3/node_modules/jest-runtime/build/index.js:1350:14)
      at Object.<anonymous> (../volto-slate/src/editor/SlateEditor.jsx:25:1)
      at Object.<anonymous> (../volto-slate/src/editor/index.js:3:1)
      at Object.<anonymous> (../volto-slate/src/index.js:3:1)
      at Object.<anonymous> (__tests__/volto-slate/deserialize.test.js:7:1)

Copy link
Member

@sneridagh sneridagh left a comment

Choose a reason for hiding this comment

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

@razvanMiu Why did you change the import to be absolute? We should not do this unless it's a shadow-able module.
The rest LGTM.

@tiberiuichim @ichim-david Can I have a review from you too, please?

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.

Backport fix needed for multiple SlateEditor editing the same field in a form
3 participants