From 0265fc2edb2eecb220c87e0391ed802812a0887c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Fri, 10 Nov 2023 09:49:11 +0100 Subject: [PATCH 01/12] Backport upgrade to slate for 17.x (#5387) Co-authored-by: Tiberiu Ichim Co-authored-by: iFlameing Co-authored-by: David Glick --- .../volto-slate/06-block-slate-format-link.js | 28 ++++++++ .../volto-slate/27-block-slate-paste-html.js | 2 +- news/5291.bugfix | 1 + news/5291.internal | 1 + package.json | 6 +- packages/volto-slate/package.json | 10 +-- .../__snapshots__/TextBlockEdit.test.js.snap | 9 +-- .../src/blocks/Text/keyboard/joinBlocks.js | 9 ++- .../volto-slate/src/editor/SlateEditor.jsx | 4 +- .../src/editor/plugins/Link/extensions.js | 45 +++++++------ packages/volto-slate/src/slate-react.js | 26 ++++++++ packages/volto-slate/src/utils/selection.js | 11 ++-- razzle.config.js | 3 + .../manage/Blocks/Description/Edit.jsx | 2 +- .../__snapshots__/Edit.test.jsx.snap | 1 - src/components/manage/Blocks/Title/Edit.jsx | 2 +- .../Title/__snapshots__/Edit.test.jsx.snap | 1 - .../manage/TextLineEdit/TextLineEdit.jsx | 2 +- .../__snapshots__/TextLineEdit.test.jsx.snap | 3 - theme/themes/pastanaga/extras/blocks.less | 9 +++ yarn.lock | 64 +++++++++++++------ 21 files changed, 165 insertions(+), 74 deletions(-) create mode 100644 news/5291.bugfix create mode 100644 news/5291.internal create mode 100644 packages/volto-slate/src/slate-react.js diff --git a/cypress/tests/core/volto-slate/06-block-slate-format-link.js b/cypress/tests/core/volto-slate/06-block-slate-format-link.js index 39db6ff30a..84466f323d 100644 --- a/cypress/tests/core/volto-slate/06-block-slate-format-link.js +++ b/cypress/tests/core/volto-slate/06-block-slate-format-link.js @@ -97,4 +97,32 @@ describe('Block Tests: Links', () => { cy.get('[id="page-document"] p a').contains('Colorless green ideas'); cy.get('[id="page-document"] p a').contains('sleep furiously'); }); + + it('As editor I can add a link and pressing enter does not add another link in the next block', function () { + // https://github.com/plone/volto/pull/5186 + cy.get('#toolbar').click(); + cy.getSlate().type('Colorless green ideas sleep furiously'); + + cy.log('Create a Link'); + + cy.setSlateSelection('ideas', 'furiously'); + cy.clickSlateButton('Add link'); + + cy.get('.slate-toolbar .link-form-container input').type( + 'https://google.com{enter}', + ); + cy.getSlate().should('have.descendants', 'a.slate-editor-link'); + cy.getSlate().type('{rightarrow}').type('{enter}'); + cy.getSlate().type('Hello').type('{enter}'); + + cy.toolbarSave(); + + cy.log('Then the page view should contain a link'); + cy.get('.ui.container p').contains('Colorless green ideas sleep furiously'); + // It should be only one, it will fail if there are two + cy.get('.ui.container p a') + .should('have.text', 'ideas sleep furiously') + .and('have.attr', 'href') + .and('include', 'https://google.com'); + }); }); diff --git a/cypress/tests/core/volto-slate/27-block-slate-paste-html.js b/cypress/tests/core/volto-slate/27-block-slate-paste-html.js index c31baa15ee..e0f69fac04 100644 --- a/cypress/tests/core/volto-slate/27-block-slate-paste-html.js +++ b/cypress/tests/core/volto-slate/27-block-slate-paste-html.js @@ -42,6 +42,6 @@ is simply dummy text of the printing and typesetting industry. // Save cy.toolbarSave(); - cy.get('[id="page-document"] p a').should('have.length', 1); + cy.get('[id="page-document"] p a').should('have.length', 0); }); }); diff --git a/news/5291.bugfix b/news/5291.bugfix new file mode 100644 index 0000000000..3297fd6e5c --- /dev/null +++ b/news/5291.bugfix @@ -0,0 +1 @@ +Fix empty link element left hanging when hit enter at end of link. @iFlameing @tiberiuichim \ No newline at end of file diff --git a/news/5291.internal b/news/5291.internal new file mode 100644 index 0000000000..57ec897c5d --- /dev/null +++ b/news/5291.internal @@ -0,0 +1 @@ +Added shim to keep working with value instead of initialValue after Slate upgrade @davisagli diff --git a/package.json b/package.json index df799f1cdc..e13207b542 100644 --- a/package.json +++ b/package.json @@ -386,9 +386,9 @@ "semantic-ui-less": "2.4.1", "semantic-ui-react": "2.0.3", "serialize-javascript": "3.1.0", - "slate": "0.84.0", - "slate-hyperscript": "0.81.3", - "slate-react": "0.83.2", + "slate": "0.100.0", + "slate-hyperscript": "0.100.0", + "slate-react": "0.98.4", "start-server-and-test": "1.14.0", "style-loader": "3.3.1", "stylelint": "15.10.3", diff --git a/packages/volto-slate/package.json b/packages/volto-slate/package.json index 1d4eb00e6b..37e8666462 100644 --- a/packages/volto-slate/package.json +++ b/packages/volto-slate/package.json @@ -18,10 +18,10 @@ "is-url": "1.2.4", "jsdom": "^16.6.0", "react-intersection-observer": "^8.32.0", - "slate": "^0.71.0", - "slate-history": "^0.66.0", - "slate-hyperscript": "^0.67.0", - "slate-react": "^0.71.0", + "slate": "0.100.0", + "slate-history": "0.100.0", + "slate-hyperscript": "0.100.0", + "slate-react": "0.98.4", "weak-key": "^1.0.2" }, "devDependencies": { @@ -40,4 +40,4 @@ "lint:fix": "../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'", "i18n": "mv .i18n.babel.config.js babel.config.js; rm -rf build/messages && NODE_ENV=production node src/i18n.js; mv babel.config.js .i18n.babel.config.js" } -} \ No newline at end of file +} diff --git a/packages/volto-slate/src/blocks/Text/__snapshots__/TextBlockEdit.test.js.snap b/packages/volto-slate/src/blocks/Text/__snapshots__/TextBlockEdit.test.js.snap index 694a2140c4..138581d982 100644 --- a/packages/volto-slate/src/blocks/Text/__snapshots__/TextBlockEdit.test.js.snap +++ b/packages/volto-slate/src/blocks/Text/__snapshots__/TextBlockEdit.test.js.snap @@ -20,7 +20,7 @@ exports[`TextBlockEdit renders w/o errors 1`] = ` data-slate-editor="true" data-slate-node="value" spellcheck="false" - style="position: relative; outline: none; white-space: pre-wrap; word-wrap: break-word; min-height: 0px;" + style="position: relative; white-space: pre-wrap; word-wrap: break-word;" tabindex="0" zindex="-1" > @@ -34,13 +34,6 @@ exports[`TextBlockEdit renders w/o errors 1`] = ` class="" data-slate-leaf="true" > - - Type text… - {selected ? ( diff --git a/packages/volto-slate/src/editor/plugins/Link/extensions.js b/packages/volto-slate/src/editor/plugins/Link/extensions.js index df5d706589..2a493c3c72 100644 --- a/packages/volto-slate/src/editor/plugins/Link/extensions.js +++ b/packages/volto-slate/src/editor/plugins/Link/extensions.js @@ -1,33 +1,38 @@ +import { Text, Transforms, Element } from 'slate'; // Editor, import { SIMPLELINK } from '@plone/volto-slate/constants'; import { jsx } from 'slate-hyperscript'; import { deserialize } from '@plone/volto-slate/editor/deserialize'; -export const withSimpleLink = (editor) => { - // const { insertData, insertText, isInline } = editor; +const nodeToText = (node) => { + if (Text.isText(node)) { + return node.text.trim(); + } else { + return node.children.map(nodeToText).join(''); + } +}; - const { isInline } = editor; +export const withSimpleLink = (editor) => { + const { isInline, normalizeNode } = editor; editor.isInline = (element) => { return element && element.type === SIMPLELINK ? true : isInline(element); }; - // editor.insertText = (text) => { - // if (text && isUrl(text)) { - // wrapLink(editor, text); - // } else { - // insertText(text); - // } - // }; - // - // editor.insertData = (data) => { - // const text = data.getData('text/plain'); - // - // if (text && isUrl(text)) { - // wrapLink(editor, text); - // } else { - // insertData(data); - // } - // }; + editor.normalizeNode = (entry) => { + const [node, path] = entry; + const isTextNode = Text.isText(node); + const isElementNode = Element.isElement(node); + const isLinkTypeNode = node.type === SIMPLELINK; + + // delete childless link nodes + if (!isTextNode && isElementNode && isLinkTypeNode && !nodeToText(node)) { + Transforms.removeNodes(editor, { at: path }); + return; + } + + return normalizeNode(entry); + }; + return editor; }; diff --git a/packages/volto-slate/src/slate-react.js b/packages/volto-slate/src/slate-react.js new file mode 100644 index 0000000000..6eb830413b --- /dev/null +++ b/packages/volto-slate/src/slate-react.js @@ -0,0 +1,26 @@ +import { Slate as OrigSlate } from '@slate-react'; + +// Components +export { Editable, DefaultPlaceholder } from '@slate-react'; + +export { DefaultElement } from '@slate-react'; +export { DefaultLeaf } from '@slate-react'; + +// Hooks +export { useEditor } from '@slate-react'; +export { useSlateStatic } from '@slate-react'; +export { useFocused } from '@slate-react'; +export { useReadOnly } from '@slate-react'; +export { useSelected } from '@slate-react'; +export { useSlate, useSlateWithV } from '@slate-react'; +export { useSlateSelector } from '@slate-react'; +export { useSlateSelection } from '@slate-react'; + +// Plugin +export { ReactEditor } from '@slate-react'; +export { withReact } from '@slate-react'; + +export const Slate = (props) => { + const initialValue = props.initialValue || props.value; + return OrigSlate({ ...props, initialValue }); +}; diff --git a/packages/volto-slate/src/utils/selection.js b/packages/volto-slate/src/utils/selection.js index f8293cd326..71e78b262d 100644 --- a/packages/volto-slate/src/utils/selection.js +++ b/packages/volto-slate/src/utils/selection.js @@ -1,7 +1,7 @@ -import { castArray } from 'lodash'; +import { castArray, cloneDeep } from 'lodash'; import { Editor, Transforms, Range, Node } from 'slate'; import { ReactEditor } from 'slate-react'; -import { isCursorInList } from '@plone/volto-slate/utils'; +import { isCursorInList, makeEditor } from '@plone/volto-slate/utils'; import { LI } from '@plone/volto-slate/constants'; import config from '@plone/volto/registry'; @@ -155,7 +155,8 @@ export function getFragmentFromStartOfSelectionToEndOfEditor( } // immer doesn't like editor.savedSelection - const newEditor = { children: editor.children }; + const newEditor = makeEditor(); + newEditor.children = cloneDeep(editor.children); return Editor.fragment(newEditor, range); } @@ -174,7 +175,9 @@ export function getFragmentFromBeginningOfEditorToStartOfSelection( // immer doesn't like editor.savedSelection // TODO: there's a bug here related to splitting lists - const newEditor = { children: editor.children }; + const newEditor = makeEditor(); + newEditor.children = cloneDeep(editor.children); + return Editor.fragment( newEditor, Editor.range( diff --git a/razzle.config.js b/razzle.config.js index 02d260852b..42e27a71ed 100644 --- a/razzle.config.js +++ b/razzle.config.js @@ -242,6 +242,9 @@ const defaultModify = ({ // avoids including lodash multiple times. // semantic-ui-react uses lodash-es, everything else uses lodash 'lodash-es': path.dirname(require.resolve('lodash')), + // workaround for backwards-incompatible change in slate-react + '@slate-react': path.dirname(require.resolve('slate-react')), + 'slate-react$': `${registry.voltoPath}/packages/volto-slate/src/slate-react`, }; const [addonsThemeLoaderVariablesPath, addonsThemeLoaderMainPath] = diff --git a/src/components/manage/Blocks/Description/Edit.jsx b/src/components/manage/Blocks/Description/Edit.jsx index 503fa7f569..5899e4e1e0 100644 --- a/src/components/manage/Blocks/Description/Edit.jsx +++ b/src/components/manage/Blocks/Description/Edit.jsx @@ -160,7 +160,7 @@ export const DescriptionBlockEdit = (props) => { { return
; } return ( - + { return
; } return ( - + =0.65.3" - checksum: cc3ba04d14e20c66eee5e5b0ca2d60fe92c0d38caf9b412153453d42f32d90bce61d57e3a00b2a4c30a7b15408bf8b14132871fd3c00f75de6ca4b49387637fe + checksum: 25c88fea4b9c6a8a57b2b6d5b1151190af815e84ebed76f43cc3c13b4831f26f55196a2a85a832692f3b6c9937aa9e75ee5db92fa603522c3ebdeecc692ff908 languageName: node linkType: hard -"slate-react@npm:0.83.2": - version: 0.83.2 - resolution: "slate-react@npm:0.83.2" +"slate-react@npm:0.98.4": + version: 0.98.4 + resolution: "slate-react@npm:0.98.4" dependencies: + "@juggle/resize-observer": ^3.4.0 "@types/is-hotkey": ^0.1.1 "@types/lodash": ^4.14.149 direction: ^1.0.3 @@ -23468,18 +23490,18 @@ __metadata: react: ">=16.8.0" react-dom: ">=16.8.0" slate: ">=0.65.3" - checksum: 0c18b9dfeab9d0e3baf5b22efb2df3216be326da886bdddab5ccce3d5291cc44229664f582a86936ba51d61efcdb80d13f75dbe5fe4b903f27b3bf5baa6fff48 + checksum: d47c01e92595870585879fd0a6fcbda7825e5ea3a4a22eca6704a2b6b91a2db4fb45c9f0ba6be648dceb5fca71211163c2fb0901614754feb448da583fee584c languageName: node linkType: hard -"slate@npm:0.84.0": - version: 0.84.0 - resolution: "slate@npm:0.84.0" +"slate@npm:0.100.0": + version: 0.100.0 + resolution: "slate@npm:0.100.0" dependencies: - immer: ^9.0.6 + immer: ^10.0.3 is-plain-object: ^5.0.0 tiny-warning: ^1.0.3 - checksum: d74de16a40571b2513dbd96efee8fe891909357a7011131f8fae738a0eace5b3c7c2da1c0ebfb1ffe66c8c933507ca618772fb607fbc9e44aa5158d3d874c5a2 + checksum: 2e12f46e5147c4d000995769041d51fa18735d28b4c734d43c48931daf01c164e820631e54ec355fc4d5d09f9fff6687782412d01f6841b6078c753fd61e60e4 languageName: node linkType: hard From 8eb7d3c1301d3713c18f7841fd345246bca6e78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Fri, 10 Nov 2023 10:20:44 +0100 Subject: [PATCH 02/12] Backports 17.5.0 (#5388) Co-authored-by: Roel Bruggink --- Makefile | 4 +- README.md | 1 - api/buildout.cfg | 5 +- cypress/tests/core/content/content.js | 2 +- locales/ca/LC_MESSAGES/volto.po | 20 +- locales/de/LC_MESSAGES/volto.po | 20 +- locales/en/LC_MESSAGES/volto.po | 20 +- locales/es/LC_MESSAGES/volto.po | 20 +- locales/eu/LC_MESSAGES/volto.po | 20 +- locales/fi/LC_MESSAGES/volto.po | 20 +- locales/fr/LC_MESSAGES/volto.po | 20 +- locales/it/LC_MESSAGES/volto.po | 20 +- locales/ja/LC_MESSAGES/volto.po | 20 +- locales/nl/LC_MESSAGES/volto.po | 20 +- locales/pt/LC_MESSAGES/volto.po | 20 +- locales/pt_BR/LC_MESSAGES/volto.po | 20 +- locales/ro/LC_MESSAGES/volto.po | 20 +- locales/volto.pot | 22 +- locales/zh_CN/LC_MESSAGES/volto.po | 20 +- news/5234.feature | 2 + news/5384.internal | 1 + packages/scripts/backportpr.js | 17 +- src/components/manage/Contents/Contents.jsx | 404 ++++++++++++-------- theme/themes/pastanaga/extras/contents.less | 2 +- 24 files changed, 413 insertions(+), 327 deletions(-) create mode 100644 news/5234.feature create mode 100644 news/5384.internal diff --git a/Makefile b/Makefile index c7fd1ef26b..dfd3dd9a09 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,8 @@ MAKEFLAGS+=--no-builtin-rules # Project settings INSTANCE_PORT=8080 -DOCKER_IMAGE=plone/server-dev:6.0.7 -DOCKER_IMAGE_ACCEPTANCE=plone/server-acceptance:6.0.7 +DOCKER_IMAGE=plone/server-dev:6.0.8 +DOCKER_IMAGE_ACCEPTANCE=plone/server-acceptance:6.0.8 KGS= NODEBIN = ./node_modules/.bin SCRIPTSPACKAGE = ./packages/scripts diff --git a/README.md b/README.md index 2d10c4ea5f..5a9615ab06 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,6 @@ On Plone 5, Volto is currently tested with the following packages pinned to spec - plone.rest 2.0.0 - plone.volto 4.0.3 - ## Volto in Production Volto is actively developed since 2017 and used in production since 2018 on the following websites: diff --git a/api/buildout.cfg b/api/buildout.cfg index ba6b83d85d..6b63ef467e 100644 --- a/api/buildout.cfg +++ b/api/buildout.cfg @@ -1,7 +1,7 @@ [buildout] index = https://pypi.org/simple/ extends = - http://dist.plone.org/release/6.0.6/versions.cfg + http://dist.plone.org/release/6.0.8/versions.cfg version-constraints.cfg versions.cfg parts = instance plonesite site-packages test robot-server @@ -16,8 +16,9 @@ show-picked-versions = true [sources] plone.volto = git https://github.com/plone/plone.volto.git branch=main -plone.rest = git git@github.com:plone/plone.rest.git branch=master +plone.rest = git git@github.com:plone/plone.rest.git branch=main plone.restapi = git https://github.com/plone/plone.restapi.git pushurl=git@github.com:plone/plone.restapi.git branch=main +plone.app.linkintegrity = git https://github.com/plone/plone.app.linkintegrity.git pushurl=git@github.com:plone/plone.app.linkintegrity.git branch=master [instance] recipe = plone.recipe.zope2instance diff --git a/cypress/tests/core/content/content.js b/cypress/tests/core/content/content.js index da5e9a4091..29e910deac 100644 --- a/cypress/tests/core/content/content.js +++ b/cypress/tests/core/content/content.js @@ -86,7 +86,7 @@ describe('Add Content Tests', () => { cy.findByLabelText('/my-page').children('td').eq(1).click(); cy.get('.top-menu-menu .delete').click(); - cy.get('.modal.active').contains('View broken links list'); + cy.get('.modal.active').contains('View links and references to this item'); cy.get('.actions').contains('Delete').click(); }); diff --git a/locales/ca/LC_MESSAGES/volto.po b/locales/ca/LC_MESSAGES/volto.po index 7e3dcf33e0..f3d3edb93a 100644 --- a/locales/ca/LC_MESSAGES/volto.po +++ b/locales/ca/LC_MESSAGES/volto.po @@ -1019,6 +1019,11 @@ msgstr "" msgid "Deleted" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3688,11 +3693,6 @@ msgstr "Aquesta és una còpia de treball de {title}" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4101,16 +4101,16 @@ msgstr "URL del vídeo" msgid "View" msgstr "veure" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Veure els canvis" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 501400c73c..84ba8d9887 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -1016,6 +1016,11 @@ msgstr "" msgid "Deleted" msgstr "Gelöscht" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3685,11 +3690,6 @@ msgstr "Das ist eine Arbeitskopie von {title}" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4098,16 +4098,16 @@ msgstr "Video URL" msgid "View" msgstr "Anzeigen" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Änderungen anzeigen" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 50dce32990..7e4344a1fb 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -1010,6 +1010,11 @@ msgstr "" msgid "Deleted" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3679,11 +3684,6 @@ msgstr "" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4092,16 +4092,16 @@ msgstr "" msgid "View" msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 595636eec5..5b17e0dbd6 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -1021,6 +1021,11 @@ msgstr "¿Eliminar este elemento?" msgid "Deleted" msgstr "Eliminado" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3690,11 +3695,6 @@ msgstr "Es una copia de trabajo de {title}" msgid "This item is also a folder." msgstr "Este elemento también es una carpeta." -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "Este elemento está referenciado por otros elementos. Al eliminarlo, {brokenReferences} {variation} se romperá." - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4103,16 +4103,16 @@ msgstr "URL del vídeo" msgid "View" msgstr "Ver" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "Ver la lista de enlaces rotos" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Mostrar los cambios" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/eu/LC_MESSAGES/volto.po b/locales/eu/LC_MESSAGES/volto.po index f7e40a10b4..4c2ea10da7 100644 --- a/locales/eu/LC_MESSAGES/volto.po +++ b/locales/eu/LC_MESSAGES/volto.po @@ -1017,6 +1017,11 @@ msgstr "" msgid "Deleted" msgstr "Ezabatuta" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3686,11 +3691,6 @@ msgstr "Hau {title} elementuaren lan-bertsioa da" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4099,16 +4099,16 @@ msgstr "Bideoaren URLa" msgid "View" msgstr "Ikusi" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Aldaketak ikusi" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/fi/LC_MESSAGES/volto.po b/locales/fi/LC_MESSAGES/volto.po index 71412b10c2..ddb227b866 100644 --- a/locales/fi/LC_MESSAGES/volto.po +++ b/locales/fi/LC_MESSAGES/volto.po @@ -1021,6 +1021,11 @@ msgstr "" msgid "Deleted" msgstr "Poistettu" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3690,11 +3695,6 @@ msgstr "" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4103,16 +4103,16 @@ msgstr "Videon URL" msgid "View" msgstr "Näytä" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Näytä muutokset" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index 49959616bd..4cba5dc88b 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -1027,6 +1027,11 @@ msgstr "" msgid "Deleted" msgstr "Supprimé" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3696,11 +3701,6 @@ msgstr "Il sagit d'une copie de travail de {title}" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4109,16 +4109,16 @@ msgstr "URL de la vidéo" msgid "View" msgstr "Vue" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Voir les changements" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index e62c2bad73..0f6e7c02f7 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -1010,6 +1010,11 @@ msgstr "" msgid "Deleted" msgstr "Cancellato" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3679,11 +3684,6 @@ msgstr "Questa è una copia di lavoro di {title}" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4092,16 +4092,16 @@ msgstr "URL del video" msgid "View" msgstr "Visualizza" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Mostra le modifiche" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/ja/LC_MESSAGES/volto.po b/locales/ja/LC_MESSAGES/volto.po index 287a210940..cf3718cbc9 100644 --- a/locales/ja/LC_MESSAGES/volto.po +++ b/locales/ja/LC_MESSAGES/volto.po @@ -1018,6 +1018,11 @@ msgstr "" msgid "Deleted" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3687,11 +3692,6 @@ msgstr "" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4100,16 +4100,16 @@ msgstr "ビデオURL" msgid "View" msgstr "表示" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "表示" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/nl/LC_MESSAGES/volto.po b/locales/nl/LC_MESSAGES/volto.po index c35ced2486..8e7650a3a4 100644 --- a/locales/nl/LC_MESSAGES/volto.po +++ b/locales/nl/LC_MESSAGES/volto.po @@ -1029,6 +1029,11 @@ msgstr "" msgid "Deleted" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3698,11 +3703,6 @@ msgstr "" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4111,16 +4111,16 @@ msgstr "" msgid "View" msgstr "Bekijken" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Bekijk wijzigingen" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/pt/LC_MESSAGES/volto.po b/locales/pt/LC_MESSAGES/volto.po index 53828a292f..11823cee15 100644 --- a/locales/pt/LC_MESSAGES/volto.po +++ b/locales/pt/LC_MESSAGES/volto.po @@ -1018,6 +1018,11 @@ msgstr "" msgid "Deleted" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3687,11 +3692,6 @@ msgstr "" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4100,16 +4100,16 @@ msgstr "" msgid "View" msgstr "Ver" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Ver modificações" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/pt_BR/LC_MESSAGES/volto.po b/locales/pt_BR/LC_MESSAGES/volto.po index 1f84d64b30..c2ffa3f7a8 100644 --- a/locales/pt_BR/LC_MESSAGES/volto.po +++ b/locales/pt_BR/LC_MESSAGES/volto.po @@ -1020,6 +1020,11 @@ msgstr "" msgid "Deleted" msgstr "Removida" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3689,11 +3694,6 @@ msgstr "Esta é uma cópia de trabalho de {title}" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4102,16 +4102,16 @@ msgstr "URL do vídeo" msgid "View" msgstr "Visão" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Ver mudanças" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/ro/LC_MESSAGES/volto.po b/locales/ro/LC_MESSAGES/volto.po index ae607d5d64..fdf65c0d5f 100644 --- a/locales/ro/LC_MESSAGES/volto.po +++ b/locales/ro/LC_MESSAGES/volto.po @@ -1010,6 +1010,11 @@ msgstr "" msgid "Deleted" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3679,11 +3684,6 @@ msgstr "Aceasta este o copie de lucru a {title}" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4092,16 +4092,16 @@ msgstr "URL-ul video" msgid "View" msgstr "Vizualizare" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "Vizualizare modificări" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/volto.pot b/locales/volto.pot index b243ad1a4c..de8180098c 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-10-02T11:59:20.013Z\n" +"POT-Creation-Date: 2023-10-09T09:36:27.737Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -1012,6 +1012,11 @@ msgstr "" msgid "Deleted" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3685,11 +3690,6 @@ msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4098,16 +4098,16 @@ msgstr "" msgid "View" msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/locales/zh_CN/LC_MESSAGES/volto.po b/locales/zh_CN/LC_MESSAGES/volto.po index 50a87152f1..91748b7e32 100644 --- a/locales/zh_CN/LC_MESSAGES/volto.po +++ b/locales/zh_CN/LC_MESSAGES/volto.po @@ -1016,6 +1016,11 @@ msgstr "" msgid "Deleted" msgstr "已删除" +#: components/manage/Contents/Contents +# defaultMessage: Deleting this item breaks {brokenReferences} {variation}. +msgid "Deleting this item breaks {brokenReferences} {variation}." +msgstr "" + #: components/manage/Widgets/QuerystringWidget # defaultMessage: Depth msgid "Depth" @@ -3685,11 +3690,6 @@ msgstr "这是{title}的一个工作副本" msgid "This item is also a folder." msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken. -msgid "This item is referenced by other items. By deleting it {brokenReferences} {variation} will be broken." -msgstr "" - #: components/manage/LockingToastsFactory/LockingToastsFactory # defaultMessage: This item was locked by {creator} on {date} msgid "This item was locked by {creator} on {date}" @@ -4098,16 +4098,16 @@ msgstr "视频URL" msgid "View" msgstr "" -#: components/manage/Contents/Contents -# defaultMessage: View broken links list -msgid "View broken links list" -msgstr "" - #: components/manage/History/History # defaultMessage: View changes msgid "View changes" msgstr "" +#: components/manage/Contents/Contents +# defaultMessage: View links and references to this item +msgid "View links and references to this item" +msgstr "" + #: components/manage/History/History # defaultMessage: View this revision msgid "View this revision" diff --git a/news/5234.feature b/news/5234.feature new file mode 100644 index 0000000000..22c4976878 --- /dev/null +++ b/news/5234.feature @@ -0,0 +1,2 @@ +List plone.app.linkintegrity breaches with links to the pages in the delete confirmation modal. +@jaroel \ No newline at end of file diff --git a/news/5384.internal b/news/5384.internal new file mode 100644 index 0000000000..5f7665948d --- /dev/null +++ b/news/5384.internal @@ -0,0 +1 @@ +Update internal Plone version to 6.0.8 @sneridagh diff --git a/packages/scripts/backportpr.js b/packages/scripts/backportpr.js index ec85b0e756..51a9c614c1 100644 --- a/packages/scripts/backportpr.js +++ b/packages/scripts/backportpr.js @@ -43,7 +43,8 @@ function getPRInfo(pr) { } function execCommand(command) { - execSync(command, (error, stdout, stderr) => { + return execSync(command, (error, stdout, stderr) => { + console.log(stdout); if (error) { console.log(`error: ${error.message}`); return; @@ -52,17 +53,23 @@ function execCommand(command) { console.log(`stderr: ${stderr}`); return; } + return stdout; }); } async function main(params) { const PRInfo = await getPRInfo(pr); - execCommand(`git pull`); - execCommand(`git co -b ${PRInfo.branchName}__16`); + // const currentBranch = execCommand( + // `git rev-parse --abbrev-ref HEAD`, + // ).toString(); + // execCommand(`git co -b ${PRInfo.branchName}__${currentBranch.split('.')[0]}`); + + // Now we do that in the same PR execCommand(`git cherry-pick ${PRInfo.mergeCommit}`); - execCommand(`git push`); - execCommand(`git co 16.x.x`); + + // execCommand(`git push`); + // execCommand(`git co $(git rev-parse --abbrev-ref HEAD)`); } main(); diff --git a/src/components/manage/Contents/Contents.jsx b/src/components/manage/Contents/Contents.jsx index e4ce494288..d5276e0e5c 100644 --- a/src/components/manage/Contents/Contents.jsx +++ b/src/components/manage/Contents/Contents.jsx @@ -411,7 +411,8 @@ class Contents extends Component { showWorkflow: false, itemsToDelete: [], containedItemsToDelete: [], - brokenReferences: [], + brokenReferences: 0, + breaches: [], showAllItemsToDelete: true, items: this.props.items, filter: '', @@ -450,20 +451,37 @@ class Contents extends Component { const linkintegrityInfo = await this.props.linkIntegrityCheck( map(this.state.itemsToDelete, (item) => this.getFieldById(item, 'UID')), ); - let containedItems = 0; - let brokenReferencesCount = 0; + const containedItems = linkintegrityInfo + .map((result) => result.items_total ?? 0) + .reduce((acc, value) => acc + value, 0); + const breaches = linkintegrityInfo.flatMap((result) => + result.breaches.map((source) => ({ + source: source, + target: result, + })), + ); + const source_by_uid = breaches.reduce( + (acc, value) => acc.set(value.source.uid, value.source), + new Map(), + ); + const by_source = breaches.reduce((acc, value) => { + if (acc.get(value.source.uid) === undefined) { + acc.set(value.source.uid, new Set()); + } + acc.get(value.source.uid).add(value.target); + return acc; + }, new Map()); - linkintegrityInfo.forEach((item) => { - containedItems += item.items_total ?? 0; - brokenReferencesCount += item.breaches.length; - }); this.setState({ containedItemsToDelete: containedItems, - brokenReferences: brokenReferencesCount, - brokenLinksList: - linkintegrityInfo.length === 1 - ? linkintegrityInfo[0]['@id'] + '/links-to-item' - : null, + brokenReferences: by_source.size, + linksAndReferencesViewLink: linkintegrityInfo.length + ? linkintegrityInfo[0]['@id'] + '/links-to-item' + : null, + breaches: Array.from(by_source, (entry) => ({ + source: source_by_uid.get(entry[0]), + targets: Array.from(entry[1]), + })), showAllItemsToDelete: this.state.itemsToDelete.length < this.deleteItemsToShowThreshold, }); @@ -1188,7 +1206,11 @@ class Contents extends Component {
-

- {this.state.itemsToDelete.length > 1 ? ( - this.state.containedItemsToDelete > 0 ? ( - <> - - {this.state.containedItemsToDelete} - - ), - variation: ( - - {this.state.containedItemsToDelete === - 1 ? ( - - ) : ( - - )} - - ), - }} - /> - {this.state.brokenReferences > 0 && ( - <> -
- - {this.state.brokenReferences} - - ), - variation: ( - - {this.state.brokenReferences === - 1 ? ( - - ) : ( - - )} - - ), - }} - /> - - )} - - ) : ( - <> - {this.state.brokenReferences > 0 && ( - <> - - {this.state.brokenReferences} - - ), - variation: ( - - {this.state.brokenReferences === - 1 ? ( - - ) : ( - - )} - - ), - }} - /> - - )} - - ) - ) : this.state.containedItemsToDelete > 0 ? ( + {this.state.itemsToDelete.length > 1 ? ( + this.state.containedItemsToDelete > 0 ? ( <> @@ -1336,8 +1258,41 @@ class Contents extends Component { <>
+ {this.state.brokenReferences} + + ), + variation: ( + + {this.state.brokenReferences === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + + )} + + ) : ( + <> + {this.state.brokenReferences > 0 && ( + <> + @@ -1361,62 +1316,183 @@ class Contents extends Component { ), }} /> -

+ + )} + + ) + ) : this.state.containedItemsToDelete > 0 ? ( + <> + + {this.state.containedItemsToDelete} + + ), + variation: ( + + {this.state.containedItemsToDelete === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + {this.state.brokenReferences > 0 && ( + <> +
+ {this.state.brokenReferences} + ), + variation: ( + + {this.state.brokenReferences === 1 ? ( + + ) : ( + + )} + + ), + }} + /> +
+ +
    + {this.state.breaches.map((breach) => ( +
  • + + {breach.source.title} + {' '} + refers to{' '} + {breach.targets + .map((target) => ( + + {target.title} + + )) + .reduce((result, item) => ( + <> + {result}, {item} + + ))} +
  • + ))} +
+ {this.state.linksAndReferencesViewLink && ( -
- - )} - - ) : this.state.brokenReferences > 0 ? ( - <> - {this.state.brokenReferences} - ), - variation: ( - - {this.state.brokenReferences === 1 ? ( - - ) : ( - - )} - - ), - }} - /> -
+ )} +
+ + )} + + ) : this.state.brokenReferences > 0 ? ( + <> + {this.state.brokenReferences} + ), + variation: ( + + {this.state.brokenReferences === 1 ? ( + + ) : ( + + )} + + ), + }} + /> +
+ +
    + {this.state.breaches.map((breach) => ( +
  • + + {breach.source.title} + {' '} + refers to{' '} + {breach.targets + .map((target) => ( + + {target.title} + + )) + .reduce((result, item) => ( + <> + {result}, {item} + + ))} +
  • + ))} +
+ {this.state.linksAndReferencesViewLink && ( -
- - ) : null} -

+ )} +
+ + ) : null}
} onCancel={this.onDeleteCancel} @@ -2219,7 +2295,7 @@ export default compose( asyncConnect([ { key: 'actions', - // Dispatch async/await to make the operation syncronous, otherwise it returns + // Dispatch async/await to make the operation synchronous, otherwise it returns // before the promise is resolved promise: async ({ location, store: { dispatch } }) => await dispatch(listActions(getBaseUrl(location.pathname))), diff --git a/theme/themes/pastanaga/extras/contents.less b/theme/themes/pastanaga/extras/contents.less index e2b4f84d5c..5fe512465b 100644 --- a/theme/themes/pastanaga/extras/contents.less +++ b/theme/themes/pastanaga/extras/contents.less @@ -193,7 +193,7 @@ word-break: break-all; } - .broken-links-list-link-wrapper { + .broken-links-list { margin-top: 30px; } } From e4dc41211a0c1d535720e0d6c77eadd3b4cda0ce Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Fri, 10 Nov 2023 10:54:41 +0100 Subject: [PATCH 03/12] Release 17.5.0 --- CHANGELOG.md | 16 ++++++++++++++++ docs/source/release-notes/index.md | 16 ++++++++++++++++ news/5234.feature | 2 -- news/5291.bugfix | 1 - news/5291.internal | 1 - news/5384.internal | 1 - package.json | 2 +- packages/volto-slate/package.json | 4 ++-- 8 files changed, 35 insertions(+), 8 deletions(-) delete mode 100644 news/5234.feature delete mode 100644 news/5291.bugfix delete mode 100644 news/5291.internal delete mode 100644 news/5384.internal diff --git a/CHANGELOG.md b/CHANGELOG.md index 19cd7aeabf..7eded23b55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,22 @@ myst: +## 17.5.0 (2023-11-10) + +### Feature + +- List plone.app.linkintegrity breaches with links to the pages in the delete confirmation modal. + @jaroel [#5234](https://github.com/plone/volto/issues/5234) + +### Bugfix + +- Fix empty link element left hanging when hit enter at end of link. @iFlameing @tiberiuichim [#5291](https://github.com/plone/volto/issues/5291) + +### Internal + +- Added shim to keep working with value instead of initialValue after Slate upgrade @davisagli [#5291](https://github.com/plone/volto/issues/5291) +- Update internal Plone version to 6.0.8 @sneridagh [#5384](https://github.com/plone/volto/issues/5384) + ## 17.4.0 (2023-11-04) ### Feature diff --git a/docs/source/release-notes/index.md b/docs/source/release-notes/index.md index 19cd7aeabf..7eded23b55 100644 --- a/docs/source/release-notes/index.md +++ b/docs/source/release-notes/index.md @@ -17,6 +17,22 @@ myst: +## 17.5.0 (2023-11-10) + +### Feature + +- List plone.app.linkintegrity breaches with links to the pages in the delete confirmation modal. + @jaroel [#5234](https://github.com/plone/volto/issues/5234) + +### Bugfix + +- Fix empty link element left hanging when hit enter at end of link. @iFlameing @tiberiuichim [#5291](https://github.com/plone/volto/issues/5291) + +### Internal + +- Added shim to keep working with value instead of initialValue after Slate upgrade @davisagli [#5291](https://github.com/plone/volto/issues/5291) +- Update internal Plone version to 6.0.8 @sneridagh [#5384](https://github.com/plone/volto/issues/5384) + ## 17.4.0 (2023-11-04) ### Feature diff --git a/news/5234.feature b/news/5234.feature deleted file mode 100644 index 22c4976878..0000000000 --- a/news/5234.feature +++ /dev/null @@ -1,2 +0,0 @@ -List plone.app.linkintegrity breaches with links to the pages in the delete confirmation modal. -@jaroel \ No newline at end of file diff --git a/news/5291.bugfix b/news/5291.bugfix deleted file mode 100644 index 3297fd6e5c..0000000000 --- a/news/5291.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix empty link element left hanging when hit enter at end of link. @iFlameing @tiberiuichim \ No newline at end of file diff --git a/news/5291.internal b/news/5291.internal deleted file mode 100644 index 57ec897c5d..0000000000 --- a/news/5291.internal +++ /dev/null @@ -1 +0,0 @@ -Added shim to keep working with value instead of initialValue after Slate upgrade @davisagli diff --git a/news/5384.internal b/news/5384.internal deleted file mode 100644 index 5f7665948d..0000000000 --- a/news/5384.internal +++ /dev/null @@ -1 +0,0 @@ -Update internal Plone version to 6.0.8 @sneridagh diff --git a/package.json b/package.json index e13207b542..0f3eb53721 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ } ], "license": "MIT", - "version": "17.4.0", + "version": "17.5.0", "repository": { "type": "git", "url": "git@github.com:plone/volto.git" diff --git a/packages/volto-slate/package.json b/packages/volto-slate/package.json index 37e8666462..e76e5a0289 100644 --- a/packages/volto-slate/package.json +++ b/packages/volto-slate/package.json @@ -1,6 +1,6 @@ { "name": "@plone/volto-slate", - "version": "17.4.0", + "version": "17.5.0", "description": "Slate.js integration with Volto", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", @@ -40,4 +40,4 @@ "lint:fix": "../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'", "i18n": "mv .i18n.babel.config.js babel.config.js; rm -rf build/messages && NODE_ENV=production node src/i18n.js; mv babel.config.js .i18n.babel.config.js" } -} +} \ No newline at end of file From d28396b30a62724eeade957467cff6d10c2a49f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Sat, 25 Nov 2023 22:28:05 +0100 Subject: [PATCH 04/12] Backports for 17.5.1 (#5441) Co-authored-by: Wagner Trezub <60133113+Wagner3UB@users.noreply.github.com> Co-authored-by: Mauro Amico Co-authored-by: ichim-david Co-authored-by: Rob Gietema Co-authored-by: iRohitSingh <61353484+iRohitSingh@users.noreply.github.com> --- locales/ca/LC_MESSAGES/volto.po | 5 ++ locales/de/LC_MESSAGES/volto.po | 5 ++ locales/en/LC_MESSAGES/volto.po | 5 ++ locales/es/LC_MESSAGES/volto.po | 5 ++ locales/eu/LC_MESSAGES/volto.po | 5 ++ locales/fi/LC_MESSAGES/volto.po | 5 ++ locales/fr/LC_MESSAGES/volto.po | 5 ++ locales/it/LC_MESSAGES/volto.po | 5 ++ locales/ja/LC_MESSAGES/volto.po | 5 ++ locales/nl/LC_MESSAGES/volto.po | 5 ++ locales/pt/LC_MESSAGES/volto.po | 5 ++ locales/pt_BR/LC_MESSAGES/volto.po | 5 ++ locales/ro/LC_MESSAGES/volto.po | 5 ++ locales/volto.pot | 9 +- locales/zh_CN/LC_MESSAGES/volto.po | 5 ++ news/5335.bugfix | 1 + news/5418.feature | 2 + news/5429.bugfix | 1 + news/5433.feature | 1 + .../BlockChooser/BlockChooserSearch.jsx | 7 +- .../__snapshots__/BlockChooser.test.jsx.snap | 4 +- .../BlockChooserSearch.test.jsx.snap | 2 +- .../ContentMetadataTags.jsx | 85 ++++++++---------- src/components/theme/Sitemap/Sitemap.jsx | 90 +++++++++---------- src/helpers/Api/APIResourceWithAuth.js | 2 +- .../themes/pastanaga/elements/input.overrides | 15 +++- .../themes/pastanaga/elements/input.variables | 3 - theme/themes/pastanaga/extras/blocks.less | 16 ++-- 28 files changed, 192 insertions(+), 116 deletions(-) create mode 100644 news/5335.bugfix create mode 100644 news/5418.feature create mode 100644 news/5429.bugfix create mode 100644 news/5433.feature diff --git a/locales/ca/LC_MESSAGES/volto.po b/locales/ca/LC_MESSAGES/volto.po index f3d3edb93a..00d481190b 100644 --- a/locales/ca/LC_MESSAGES/volto.po +++ b/locales/ca/LC_MESSAGES/volto.po @@ -632,6 +632,11 @@ msgstr "Clar" msgid "Clear filters" msgstr "Esborra filtres" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 84ba8d9887..c57f2a3efd 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -629,6 +629,11 @@ msgstr "Löschen" msgid "Clear filters" msgstr "Filter entfernen" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 7e4344a1fb..f71ceb2589 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -623,6 +623,11 @@ msgstr "" msgid "Clear filters" msgstr "" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 5b17e0dbd6..1f2b3c64e7 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -634,6 +634,11 @@ msgstr "Limpiar" msgid "Clear filters" msgstr "Limpiar filtros" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/eu/LC_MESSAGES/volto.po b/locales/eu/LC_MESSAGES/volto.po index 4c2ea10da7..3f4a58ce09 100644 --- a/locales/eu/LC_MESSAGES/volto.po +++ b/locales/eu/LC_MESSAGES/volto.po @@ -630,6 +630,11 @@ msgstr "Garbitu" msgid "Clear filters" msgstr "Garbitu filtroak" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/fi/LC_MESSAGES/volto.po b/locales/fi/LC_MESSAGES/volto.po index ddb227b866..6d1a02dfc0 100644 --- a/locales/fi/LC_MESSAGES/volto.po +++ b/locales/fi/LC_MESSAGES/volto.po @@ -634,6 +634,11 @@ msgstr "Tyhjennä" msgid "Clear filters" msgstr "Tyhjennä suodattimet" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index 4cba5dc88b..4ac9afa567 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -640,6 +640,11 @@ msgstr "Effacer" msgid "Clear filters" msgstr "Effacer les filtres" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index 0f6e7c02f7..8c5c4e147b 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -623,6 +623,11 @@ msgstr "Annulla" msgid "Clear filters" msgstr "Azzera filtri" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "Cancella ricerca" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/ja/LC_MESSAGES/volto.po b/locales/ja/LC_MESSAGES/volto.po index cf3718cbc9..9fad210d48 100644 --- a/locales/ja/LC_MESSAGES/volto.po +++ b/locales/ja/LC_MESSAGES/volto.po @@ -631,6 +631,11 @@ msgstr "クリア" msgid "Clear filters" msgstr "" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/nl/LC_MESSAGES/volto.po b/locales/nl/LC_MESSAGES/volto.po index 8e7650a3a4..949d70690e 100644 --- a/locales/nl/LC_MESSAGES/volto.po +++ b/locales/nl/LC_MESSAGES/volto.po @@ -642,6 +642,11 @@ msgstr "" msgid "Clear filters" msgstr "" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/pt/LC_MESSAGES/volto.po b/locales/pt/LC_MESSAGES/volto.po index 11823cee15..6586878c29 100644 --- a/locales/pt/LC_MESSAGES/volto.po +++ b/locales/pt/LC_MESSAGES/volto.po @@ -631,6 +631,11 @@ msgstr "" msgid "Clear filters" msgstr "" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/pt_BR/LC_MESSAGES/volto.po b/locales/pt_BR/LC_MESSAGES/volto.po index c2ffa3f7a8..8a63dd4b0a 100644 --- a/locales/pt_BR/LC_MESSAGES/volto.po +++ b/locales/pt_BR/LC_MESSAGES/volto.po @@ -633,6 +633,11 @@ msgstr "Limpar" msgid "Clear filters" msgstr "Limpar filtros" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "Limpar pesquisa" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/ro/LC_MESSAGES/volto.po b/locales/ro/LC_MESSAGES/volto.po index fdf65c0d5f..6126f79036 100644 --- a/locales/ro/LC_MESSAGES/volto.po +++ b/locales/ro/LC_MESSAGES/volto.po @@ -623,6 +623,11 @@ msgstr "Curațați" msgid "Clear filters" msgstr "Curațați filtrele" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/volto.pot b/locales/volto.pot index de8180098c..1cfe98274c 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,9 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-10-09T09:36:27.737Z\n" + +"POT-Creation-Date: 2023-10-20T14:42:17.848Z\n" + "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -625,6 +627,11 @@ msgstr "" msgid "Clear filters" msgstr "" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/locales/zh_CN/LC_MESSAGES/volto.po b/locales/zh_CN/LC_MESSAGES/volto.po index 91748b7e32..6e56115951 100644 --- a/locales/zh_CN/LC_MESSAGES/volto.po +++ b/locales/zh_CN/LC_MESSAGES/volto.po @@ -629,6 +629,11 @@ msgstr "清除" msgid "Clear filters" msgstr "清除过滤器" +#: components/manage/BlockChooser/BlockChooserSearch +# defaultMessage: Clear search +msgid "Clear search" +msgstr "" + #: components/theme/View/ImageView # defaultMessage: Click to download full sized image msgid "Click to download full sized image" diff --git a/news/5335.bugfix b/news/5335.bugfix new file mode 100644 index 0000000000..99ee97e40d --- /dev/null +++ b/news/5335.bugfix @@ -0,0 +1 @@ +Searchbox and clear button inside blocks-chooser with visible focus and fixed the clear button label - @Wagner3UB \ No newline at end of file diff --git a/news/5418.feature b/news/5418.feature new file mode 100644 index 0000000000..50c7e6ea9b --- /dev/null +++ b/news/5418.feature @@ -0,0 +1,2 @@ +Use container from component registry in sitemap component and also refactor the class +to functional component. @iRohitSingh \ No newline at end of file diff --git a/news/5429.bugfix b/news/5429.bugfix new file mode 100644 index 0000000000..04e4535dc7 --- /dev/null +++ b/news/5429.bugfix @@ -0,0 +1 @@ +Fix image paths in development mode. @robgietema \ No newline at end of file diff --git a/news/5433.feature b/news/5433.feature new file mode 100644 index 0000000000..af0d43fd17 --- /dev/null +++ b/news/5433.feature @@ -0,0 +1 @@ +Improvements and completeness of the ContentMetadataTags component @ericof @sneridagh diff --git a/src/components/manage/BlockChooser/BlockChooserSearch.jsx b/src/components/manage/BlockChooser/BlockChooserSearch.jsx index 390e240027..73875ea0e7 100644 --- a/src/components/manage/BlockChooser/BlockChooserSearch.jsx +++ b/src/components/manage/BlockChooser/BlockChooserSearch.jsx @@ -9,6 +9,10 @@ const messages = defineMessages({ id: 'Search', defaultMessage: 'Search', }, + clear: { + id: 'Clear search', + defaultMessage: 'Clear search', + }, }); const BlockChooserSearch = ({ onChange, searchValue }) => { @@ -27,7 +31,6 @@ const BlockChooserSearch = ({ onChange, searchValue }) => { onChange={(event) => onChange(event.target.value)} name="SearchableText" value={searchValue} - transparent autoComplete="off" placeholder={intl.formatMessage(messages.search)} title={intl.formatMessage(messages.search)} @@ -36,7 +39,7 @@ const BlockChooserSearch = ({ onChange, searchValue }) => { {searchValue && (