diff --git a/docs/source/contributing/developing-core.md b/docs/source/contributing/developing-core.md index eb79d97c8a..44b387b761 100644 --- a/docs/source/contributing/developing-core.md +++ b/docs/source/contributing/developing-core.md @@ -71,9 +71,9 @@ Volto has the following folder structure. ``` -## Development pre-requisites +## Development prerequisites -To set up a Volto core development environment, your system must satisfy the following pre-requisites. +To set up a Volto core development environment, your system must satisfy the following prerequisites. ```{include} ./install-operating-system.md ``` @@ -330,13 +330,6 @@ By default, the use of TypeScript is required in Plone frontend libraries, Volto The monorepository consists of several core libraries. -### Volto project generator - -`@plone/generator-volto` is a Yeoman generator that helps you set up Volto via command line. -It generates all the boilerplate needed to start developing a Plone Volto project. -It is used by [CookieCutter Plone Starter](https://github.com/collective/cookiecutter-plone-starter), the recommended way to set up Plone projects. -The generator features an `addon` template for scaffolding Volto add-ons in your projects. - ### Registry `@plone/registry` provides support for building an add-on registry and infrastructure for JavaScript and TypeScript-based apps. @@ -354,6 +347,17 @@ Used by Volto, you can also use it in other JavaScript frameworks and environmen `@plone/volto-slate` is the glue package that provides support for the Slate library in Volto. +### Volto project generator + +`@plone/generator-volto` is a Yeoman generator that helps you set up Volto via command line. +It generates all the boilerplate needed to start developing a Plone Volto project. +It is used by [CookieCutter Plone Starter](https://github.com/collective/cookiecutter-plone-starter), the recommended way to set up Plone projects. +The generator features an `addon` template for scaffolding Volto add-ons in your projects. + +```{deprecated} 18.0.0-alpha.43 +For Volto 18, `@plone/generator-volto` is replaced by [Cookieplone](https://github.com/plone/cookieplone). +``` + ## Supported frontends @@ -362,7 +366,7 @@ Volto is the default frontend, and is React-based. Classic UI is the Python-based, server-side rendered frontend. In Volto's `apps` folder, you'll find a Volto project scaffolding that uses Volto as a library. -This is the same as that which you'll have when you run the Volto generator or `cookiecutter-plone-starter`. +This is the same as that which you'll have when you follow the instructions in {doc}`plone:install/create-project`). ## Experimental frontends diff --git a/docs/source/upgrade-guide/index.md b/docs/source/upgrade-guide/index.md index e2bac7815c..407cf8fe48 100644 --- a/docs/source/upgrade-guide/index.md +++ b/docs/source/upgrade-guide/index.md @@ -395,7 +395,7 @@ If you shadowed the module {file}`packages/volto/src/helpers/FormValidation/Form This prop must be assigned with the new prop passed down from the blocks engine `blocksErrors`. If not passed down, the block can't display any field validation error. -```tsx +```jsx // More component code above here const { @@ -451,7 +451,7 @@ The `Tags` component has been moved to the `belowContent` slot. It now receives the `content` property instead of the `tags` property. -{upgrade-18-cookieplone-label}= +(upgrade-18-cookieplone-label)= ### Cookieplone is now the recommended project and add-on generator for Volto 18 diff --git a/packages/client/news/6349.bugfix b/packages/client/news/6349.bugfix new file mode 100644 index 0000000000..47f5249e59 --- /dev/null +++ b/packages/client/news/6349.bugfix @@ -0,0 +1 @@ +Fixed client copy mutation, cleanup up move mutation for consistency @pnicolli diff --git a/packages/client/src/restapi/copymove/copy.test.tsx b/packages/client/src/restapi/copymove/copy.test.tsx index e278ad3d88..0c79277546 100644 --- a/packages/client/src/restapi/copymove/copy.test.tsx +++ b/packages/client/src/restapi/copymove/copy.test.tsx @@ -43,7 +43,7 @@ describe('[POST] Copy', () => { }); act(() => { - result.current.mutate({ data: copyData }); + result.current.mutate({ path: '/', data: copyData }); }); await waitFor(() => expect(result.current.isSuccess).toBe(true)); @@ -80,7 +80,7 @@ describe('[POST] Copy', () => { }); act(() => { - result.current.mutate({ data: copyMultipleData }); + result.current.mutate({ path: '/', data: copyMultipleData }); }); await waitFor(() => expect(result.current.isSuccess).toBe(true)); diff --git a/packages/client/src/restapi/copymove/copy.ts b/packages/client/src/restapi/copymove/copy.ts index 3935275dd5..bf300f958f 100644 --- a/packages/client/src/restapi/copymove/copy.ts +++ b/packages/client/src/restapi/copymove/copy.ts @@ -1,37 +1,35 @@ import { z } from 'zod'; import { ApiRequestParams, apiRequest } from '../../API'; -import { - PloneClientConfig, - PloneClientConfigSchema, -} from '../../validation/config'; +import { PloneClientConfig } from '../../validation/config'; import { copyMoveDataSchema as copyDataSchema } from '../../validation/copymove'; import { CopyMoveResponse as CopyResponse } from '@plone/types'; -export const copyArgsSchema = z.object({ - data: copyDataSchema, - config: PloneClientConfigSchema, -}); - -export type CopyArgs = z.infer; +export type CopyArgs = z.infer & { + config: PloneClientConfig; +}; export const copy = async ({ + path, data, config, }: CopyArgs): Promise => { - const validatedArgs = copyArgsSchema.parse({ + const validatedArgs = copyDataSchema.parse({ + path, data, - config, }); const options: ApiRequestParams = { + config, data: validatedArgs.data, - config: validatedArgs.config, }; - return apiRequest('post', '/@copy', options); + const copyPath = `${validatedArgs.path}/@copy`; + + return apiRequest('post', copyPath, options); }; export const copyMutation = ({ config }: { config: PloneClientConfig }) => ({ mutationKey: ['post', 'copy'], - mutationFn: ({ data }: Omit) => copy({ data, config }), + mutationFn: ({ path, data }: Omit) => + copy({ path, data, config }), }); diff --git a/packages/client/src/restapi/copymove/move.ts b/packages/client/src/restapi/copymove/move.ts index 3f9e3ceea7..6f1015caad 100644 --- a/packages/client/src/restapi/copymove/move.ts +++ b/packages/client/src/restapi/copymove/move.ts @@ -1,37 +1,29 @@ import { z } from 'zod'; import { ApiRequestParams, apiRequest } from '../../API'; -import { - PloneClientConfig, - PloneClientConfigSchema, -} from '../../validation/config'; +import { PloneClientConfig } from '../../validation/config'; import { copyMoveDataSchema as moveDataSchema } from '../../validation/copymove'; import { CopyMoveResponse as MoveResponse } from '@plone/types'; -export const MoveArgsSchema = z.object({ - path: z.string(), - data: moveDataSchema, - config: PloneClientConfigSchema, -}); - -export type MoveArgs = z.infer; +export type MoveArgs = z.infer & { + config: PloneClientConfig; +}; export const move = async ({ path, data, config, }: MoveArgs): Promise => { - const validatedArgs = MoveArgsSchema.parse({ + const validatedArgs = moveDataSchema.parse({ path, data, - config, }); const options: ApiRequestParams = { + config, data: validatedArgs.data, - config: validatedArgs.config, }; - const movePath = `/${validatedArgs.path}/@move`; + const movePath = `${validatedArgs.path}/@move`; return apiRequest('post', movePath, options); }; diff --git a/packages/client/src/validation/copymove.ts b/packages/client/src/validation/copymove.ts index ee27382a81..f712bd708a 100644 --- a/packages/client/src/validation/copymove.ts +++ b/packages/client/src/validation/copymove.ts @@ -1,5 +1,8 @@ import { z } from 'zod'; export const copyMoveDataSchema = z.object({ - source: z.union([z.string(), z.array(z.string())]), + path: z.string(), + data: z.object({ + source: z.union([z.string(), z.array(z.string())]), + }), }); diff --git a/packages/scripts/news/6354.documentation b/packages/scripts/news/6354.documentation new file mode 100644 index 0000000000..b643f0ac32 --- /dev/null +++ b/packages/scripts/news/6354.documentation @@ -0,0 +1 @@ +Added the configuration for VSCode not to reformat Markdown and MyST files. @aadityaforwork \ No newline at end of file diff --git a/packages/scripts/vscodesettings.js b/packages/scripts/vscodesettings.js index ebcc8cec08..2df03c41b8 100644 --- a/packages/scripts/vscodesettings.js +++ b/packages/scripts/vscodesettings.js @@ -13,9 +13,17 @@ if (fs.existsSync('.vscode')) { if (!vscodeSettingsJSON['eslint.workingDirectories']) { vscodeSettingsJSON['eslint.workingDirectories'] = [{ mode: 'auto' }]; +} - fs.writeFileSync( - '.vscode/settings.json', - `${stringify(vscodeSettingsJSON, null, 2)}`, - ); +if (!vscodeSettingsJSON['[markdown]']) { + vscodeSettingsJSON['[markdown]'] = { + 'editor.formatOnSave': false, + }; +} else { + vscodeSettingsJSON['[markdown]']['editor.formatOnSave'] = false; } + +fs.writeFileSync( + '.vscode/settings.json', + `${stringify(vscodeSettingsJSON, null, 2)}`, +); diff --git a/packages/volto-slate/news/6293.bugfix b/packages/volto-slate/news/6293.bugfix new file mode 100644 index 0000000000..ea8503c548 --- /dev/null +++ b/packages/volto-slate/news/6293.bugfix @@ -0,0 +1 @@ +Fetch `user` before pass it to the `restricted` function of the block settings. @wesleybl diff --git a/packages/volto-slate/src/blocks/Text/SlashMenu.jsx b/packages/volto-slate/src/blocks/Text/SlashMenu.jsx index 2a26c39cfe..9ec1612304 100644 --- a/packages/volto-slate/src/blocks/Text/SlashMenu.jsx +++ b/packages/volto-slate/src/blocks/Text/SlashMenu.jsx @@ -4,7 +4,7 @@ import { filter, isEmpty } from 'lodash'; import { Menu } from 'semantic-ui-react'; import { useIntl, FormattedMessage } from 'react-intl'; import { Icon } from '@plone/volto/components'; -import { useSelector } from 'react-redux'; +import { useUser } from '@plone/volto/hooks'; const emptySlateBlock = () => ({ value: [ @@ -111,7 +111,7 @@ const PersistentSlashMenu = ({ editor }) => { } = props; const disableNewBlocks = data?.disableNewBlocks || detached; - const user = useSelector((state) => state.users?.user); + const user = useUser(); const [slashMenuSelected, setSlashMenuSelected] = React.useState(0); diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index 9c21668d8f..593c2b4889 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -10,6 +10,10 @@ describe('Accessibility Tests', () => { it('Contact form has not a11y violations', () => { cy.navigate('/contact-form'); + cy.get('#field-name').click().type('input'); + cy.get('#field-from').click().type('something@domain.com'); + cy.get('#field-subject').click().type('input'); + cy.get('#field-message').click().type('input'); cy.checkA11y(); }); diff --git a/packages/volto/cypress/tests/core/blocks/blocks-table.js b/packages/volto/cypress/tests/core/blocks/blocks-table.js index 43c5f3ee26..97f00622e1 100644 --- a/packages/volto/cypress/tests/core/blocks/blocks-table.js +++ b/packages/volto/cypress/tests/core/blocks/blocks-table.js @@ -29,7 +29,7 @@ describe('Table Block Tests', () => { cy.get('.block-editor-slateTable [role=textbox]') .first() .click() - .should('have.css', 'outline', 'rgb(135, 143, 147) none 0px'); + .should('have.css', 'outline', 'rgba(0, 0, 0, 0.87) none 0px'); cy.get( '.celled.fixed.table thead tr th:first-child() [contenteditable="true"]', diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index 69687ab2b8..b17def638e 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -1938,6 +1938,11 @@ msgstr "Llenguatge" msgid "Language independent field." msgstr "" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/de/LC_MESSAGES/volto.po b/packages/volto/locales/de/LC_MESSAGES/volto.po index d35ff24b4c..bd271eca1a 100644 --- a/packages/volto/locales/de/LC_MESSAGES/volto.po +++ b/packages/volto/locales/de/LC_MESSAGES/volto.po @@ -1937,6 +1937,11 @@ msgstr "Sprache" msgid "Language independent field." msgstr "Sprachunabhängiges Feld." +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "Dies ist ein sprachunabhängiges Feld. Jeder Wert, den Sie hier eingeben, überschreibt das entsprechende Feld aller Mitglieder der Übersetzungsgruppe, wenn Sie dieses Formular speichern." + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index a5b40a7988..419d5717b1 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -1932,6 +1932,11 @@ msgstr "" msgid "Language independent field." msgstr "" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index 6e284bfd75..5fc3fb54ff 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -1939,6 +1939,11 @@ msgstr "Idioma" msgid "Language independent field." msgstr "Campo independiente de idioma." +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index b7c57b8ee1..77b052e284 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -1939,6 +1939,11 @@ msgstr "Hizkuntza" msgid "Language independent field." msgstr "Hizkuntzarekiko Independentea den eremua." +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index 16a81a822c..5db5c4cbee 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -1937,6 +1937,11 @@ msgstr "Kieli" msgid "Language independent field." msgstr "Kieliriippumaton kenttä" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index b405214240..4887b87ff4 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -1939,6 +1939,11 @@ msgstr "Langage" msgid "Language independent field." msgstr "Champ indépendant de la langue." +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/hi/LC_MESSAGES/volto.po b/packages/volto/locales/hi/LC_MESSAGES/volto.po index c21aa3608f..ced8be4109 100644 --- a/packages/volto/locales/hi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hi/LC_MESSAGES/volto.po @@ -1932,6 +1932,11 @@ msgstr "भाषा" msgid "Language independent field." msgstr "भाषा स्वतंत्र क्षेत्र।" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index fbdee8436e..060c5ba03e 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -589,7 +589,7 @@ msgstr "Modifiche salvate." #. Default: "Check this box to customize the title, description, or image of the target content item for this teaser. Leave it unchecked to show updates to the target content item if it is edited later." #: components/manage/Blocks/Teaser/schema msgid "Check this box to customize the title, description, or image of the target content item for this teaser. Leave it unchecked to show updates to the target content item if it is edited later." -msgstr "" +msgstr "Seleziona questa casella per personalizzare il titolo, la descrizione o l'immagine dell'oggetto di riferimento per questo teaser. Lascia la casella vuota per mostrare automaticamente gli aggiornamenti del contenuto se viene modificato in seguito." #. Default: "Checkbox" #: components/manage/Widgets/SchemaWidget @@ -874,7 +874,7 @@ msgstr "Password corrente" #. Default: "Customize teaser content" #: components/manage/Blocks/Teaser/schema msgid "Customize teaser content" -msgstr "" +msgstr "Personalizza il contenuto del teaser" #. Default: "Cut" #: components/manage/Actions/Actions @@ -986,7 +986,7 @@ msgstr "Elimina utente" #. Default: "Action deleted" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Delete action" -msgstr "Cancella azione" +msgstr "Elimina azione" #. Default: "Delete blocks" #: helpers/MessageLabels/MessageLabels @@ -1011,12 +1011,12 @@ msgstr "Elimina riga" #. Default: "Delete selected items?" #: components/manage/Contents/Contents msgid "Delete selected items?" -msgstr "" +msgstr "Vuoi cancellare l'elemento selezionato?" #. Default: "Delete this item?" #: components/manage/Contents/Contents msgid "Delete this item?" -msgstr "" +msgstr "Vuoi cancellare questo elemento?" #. Default: "Deleted" #: components/manage/Controlpanels/Rules/Rules @@ -1322,7 +1322,7 @@ msgstr "Inserisci il tuo username per la verifica." #. Default: "Entries" #: components/manage/Blocks/ToC/Schema msgid "Entries" -msgstr "" +msgstr "Elementi" #. Default: "Error" #: components/manage/Add/Add @@ -1353,7 +1353,7 @@ msgstr "Evento" #. Default: "Event end date must be on or after {startDateValueOrStartFieldName}" #: helpers/MessageLabels/MessageLabels msgid "Event end date must be on or after {startDateValueOrStartFieldName}" -msgstr "" +msgstr "La data di fine evento deve essere uguale o successiva al {startDateValueOrStartFieldName}" #. Default: "Event listing" #: config/Views @@ -1363,7 +1363,7 @@ msgstr "Elenco eventi" #. Default: "Event start date must be on or before {endDateValueOrEndFieldName}" #: helpers/MessageLabels/MessageLabels msgid "Event start date must be on or before {endDateValueOrEndFieldName}" -msgstr "" +msgstr "La data di inizio evento essere uguale o precedente al {endDateValueOrEndFieldName}" #. Default: "Event view" #: config/Views @@ -1605,7 +1605,7 @@ msgstr "Gruppo creato" #. Default: "Group deleted" #: helpers/MessageLabels/MessageLabels msgid "Group deleted" -msgstr "" +msgstr "Gruppo eliminato" #. Default: "Group roles updated" #: helpers/MessageLabels/MessageLabels @@ -1670,7 +1670,7 @@ msgstr "Nascondi i filtri" #. Default: "Hide title" #: components/manage/Blocks/ToC/Schema msgid "Hide title" -msgstr "" +msgstr "Nascondi il titolo" #. Default: "History" #: components/manage/History/History @@ -1863,12 +1863,12 @@ msgstr "Blocco non valido - Salvando, verrà rimosso" #. Default: "Invalid teaser source" #: components/manage/Blocks/Teaser/Data msgid "Invalid teaser source" -msgstr "" +msgstr "Sorgente non valida per il teaser" #. Default: "It is not allowed to define both the password and to request sending the password reset message by e-mail. You need to select one of them." #: helpers/MessageLabels/MessageLabels msgid "It is not allowed to define both the password and to request sending the password reset message by e-mail. You need to select one of them." -msgstr "" +msgstr "Non è consentito effettuare contemporaneamente l'inserimento della password e la richiesta dell'invio del messaggio di reimpostazione della password tramite e-mail. È necessario selezionare una di esse." #. Default: "Item batch size" #: components/manage/Widgets/QuerystringWidget @@ -1932,6 +1932,11 @@ msgstr "Lingua" msgid "Language independent field." msgstr "Campo indipendete dalla lingua" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" @@ -2007,7 +2012,7 @@ msgstr "Vista collegamento" #. Default: "Link settings" #: components/manage/Blocks/Image/schema msgid "Link settings" -msgstr "" +msgstr "Impostazioni Link" #. Default: "Link Title" #: components/manage/Blocks/Listing/schema @@ -2098,7 +2103,7 @@ msgstr "Nome utente" #. Default: "Logo of" #: components/theme/Logo/Logo msgid "Logo of" -msgstr "" +msgstr "Logo di" #. Default: "Logout" #: components/manage/Toolbar/PersonalTools @@ -2518,7 +2523,7 @@ msgstr "Ordine" #. Default: "Ordered" #: components/manage/Blocks/ToC/Schema msgid "Ordered" -msgstr "" +msgstr "Ordinato" #. Default: "Origin" #: components/manage/Blocks/LeadImage/LeadImageSidebar @@ -2782,7 +2787,7 @@ msgstr "Elementi collegati a questo contenuto in {relationship}" #. Default: "Refresh source content" #: components/manage/Blocks/Teaser/Data msgid "Refresh source content" -msgstr "" +msgstr "Ricarica il sorgente del contenuto" #. Default: "Register" #: components/theme/Anontools/Anontools @@ -3224,7 +3229,7 @@ msgstr "Invia una mail di conferma con un link per impostare la password." #. Default: "Server Error" #: components/theme/Error/ServerError msgid "Server Error" -msgstr "" +msgstr "Errore del Server" #. Default: "Set my password" #: components/theme/PasswordReset/PasswordReset @@ -3370,7 +3375,7 @@ msgstr "Piccolo" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." #: components/manage/Contents/Contents msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -msgstr "" +msgstr "Alcuni elementi sono anche una cartella. Eliminandoli eliminerai {containedItemsToDelete} {variation} dentro le cartelle." #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." #: components/manage/Contents/Contents @@ -3422,7 +3427,7 @@ msgstr "Ordinato" #. Default: "Sorted on" #: components/manage/Blocks/Search/components/SortOn msgid "Sorted on" -msgstr "" +msgstr "Ordina in base a" #. Default: "Source" #: components/manage/Blocks/HTML/Edit @@ -3472,7 +3477,7 @@ msgstr "Status" #. Default: "Sticky" #: components/manage/Blocks/ToC/Schema msgid "Sticky" -msgstr "" +msgstr "Persistente" #. Default: "Stop compare" #: components/manage/Multilingual/CompareLanguages @@ -3502,7 +3507,7 @@ msgstr "Oggetto" #. Default: "Submit" #: components/manage/AnchorPlugin/components/LinkButton/AddLinkForm msgid "Submit" -msgstr "" +msgstr "Invia" #. Default: "Success" #: components/manage/Actions/Actions @@ -3668,12 +3673,12 @@ msgstr "L'indirizzo del collegamento è:" #. Default: "The number of items must be greater than or equal to {minItems}" #: helpers/MessageLabels/MessageLabels msgid "The number of items must be greater than or equal to {minItems}" -msgstr "" +msgstr "Il numero di elementi deve essere maggiore o uguale a {minItems}" #. Default: "The number of items must be less than or equal to {maxItems}" #: helpers/MessageLabels/MessageLabels msgid "The number of items must be less than or equal to {maxItems}" -msgstr "" +msgstr "Il numero di elementi deve essere minore o uguale a {maxItems}" #. Default: "The provided alternative url already exists!" #: components/manage/Aliases/Aliases @@ -3694,7 +3699,7 @@ msgstr "La configurazione del sito è obsoleta e deve essere aggiornata." #. Default: "The value does not match the pattern {pattern}" #: helpers/MessageLabels/MessageLabels msgid "The value does not match the pattern {pattern}" -msgstr "" +msgstr "I valori non corrispondono al pattern {pattern}" #. Default: "The working copy was discarded" #: components/manage/Toolbar/More @@ -3709,18 +3714,18 @@ msgstr "{plonecms} è {copyright} 2000-{current_year} della {plonefoundation} ed #. Default: "There are no groups with the searched criteria" #: helpers/MessageLabels/MessageLabels msgid "There are no groups with the searched criteria" -msgstr "" +msgstr "Non ci sono gruppi con i criteri ricercati" #. Default: "There are no users with the searched criteria" #: helpers/MessageLabels/MessageLabels msgid "There are no users with the searched criteria" -msgstr "" +msgstr "Non ci sono utenti con i criteri ricercati" #. Default: "There are some errors." #: components/manage/Add/Add #: components/manage/Edit/Edit msgid "There are some errors." -msgstr "" +msgstr "Ci sono degli errori." #. Default: "There is a configuration problem on the backend" #: components/theme/CorsError/CorsError @@ -4003,7 +4008,7 @@ msgstr "Aggiorna" #. Default: "Update User" #: helpers/MessageLabels/MessageLabels msgid "Update User" -msgstr "" +msgstr "Aggiorna Utente" #. Default: "Update installed addons" #: components/manage/Controlpanels/AddonsControlpanel @@ -4101,7 +4106,7 @@ msgstr "Utente creato" #. Default: "User deleted" #: helpers/MessageLabels/MessageLabels msgid "User deleted" -msgstr "" +msgstr "Utente eliminato" #. Default: "User name" #: components/manage/Controlpanels/Users/UsersControlpanel @@ -4116,7 +4121,7 @@ msgstr "Ruoli utente aggiornati" #. Default: "User updated successfuly" #: helpers/MessageLabels/MessageLabels msgid "User updated successfuly" -msgstr "" +msgstr "Utente aggiornato con successo" #. Default: "Username" #: helpers/MessageLabels/MessageLabels @@ -4175,7 +4180,7 @@ msgstr "Mostra le modifiche" #. Default: "View links and references to this item" #: components/manage/Contents/Contents msgid "View links and references to this item" -msgstr "" +msgstr "Visualizza i collegamenti e i riferimenti a questo elemento" #. Default: "View this revision" #: components/manage/History/History @@ -4544,7 +4549,7 @@ msgstr "elimina intIds e ricrea le relazioni" #. Default: "
  • Regenerate intIds (tokens of relations in relation catalog)
  • Rebuild relations

Check the log for details!

Warning: If you have add-ons relying on intIds, you should not flush them.

" #: helpers/MessageLabels/MessageLabels msgid "flushAndRebuildRelationsHints" -msgstr "" +msgstr "
  • Rigenera intIds (i token delle relazioni nel catalogo delle relazioni)
  • Ricrea le relazioni

Controlla il log per i dettagli!

Attenzione: Se ci sono prodotti aggiuntivi che hanno bisogno degli intIds, non dovresti eliminarli.

" #. Default: "Head title" #: components/manage/Blocks/Teaser/schema @@ -4594,12 +4599,12 @@ msgstr "Pubblicato internamente" #. Default: "item" #: components/manage/Contents/Contents msgid "item" -msgstr "" +msgstr "elemento" #. Default: "items" #: components/manage/Contents/Contents msgid "items" -msgstr "" +msgstr "elementi" #. Default: "My email is" #: components/theme/PasswordReset/RequestPasswordReset @@ -4743,12 +4748,12 @@ msgstr "ricrea le relazioni" #. Default: "reference" #: components/manage/Contents/Contents msgid "reference" -msgstr "" +msgstr "riferimento" #. Default: "references" #: components/manage/Contents/Contents msgid "references" -msgstr "" +msgstr "riferimenti" #. Default: "results" #: components/theme/Search/Search @@ -4968,7 +4973,7 @@ msgstr "percorso di destinazione" #. Default: "Text" #: config/Blocks msgid "text" -msgstr "" +msgstr "Testo" #. Default: "Title" #: config/Blocks diff --git a/packages/volto/locales/ja/LC_MESSAGES/volto.po b/packages/volto/locales/ja/LC_MESSAGES/volto.po index 60d63a02e7..9a13ea1265 100644 --- a/packages/volto/locales/ja/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ja/LC_MESSAGES/volto.po @@ -1937,6 +1937,11 @@ msgstr "言語" msgid "Language independent field." msgstr "" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/nl/LC_MESSAGES/volto.po b/packages/volto/locales/nl/LC_MESSAGES/volto.po index c6330673c2..a7d79f4271 100644 --- a/packages/volto/locales/nl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nl/LC_MESSAGES/volto.po @@ -1936,6 +1936,11 @@ msgstr "Taal" msgid "Language independent field." msgstr "" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/pt/LC_MESSAGES/volto.po b/packages/volto/locales/pt/LC_MESSAGES/volto.po index f7350c0098..0c0d9f1b74 100644 --- a/packages/volto/locales/pt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt/LC_MESSAGES/volto.po @@ -1937,6 +1937,11 @@ msgstr "Idioma" msgid "Language independent field." msgstr "" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po index 36222ddb91..4957f58bff 100644 --- a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po @@ -1938,6 +1938,11 @@ msgstr "Idioma" msgid "Language independent field." msgstr "Campo independente da linguagem." +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index 4ccc25cc34..1eeefe866b 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -1932,6 +1932,11 @@ msgstr "Limba" msgid "Language independent field." msgstr "Câmp independent de limbă." +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/volto.pot b/packages/volto/locales/volto.pot index 7e870490fc..a700a289e7 100644 --- a/packages/volto/locales/volto.pot +++ b/packages/volto/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-08-10T17:00:27.117Z\n" +"POT-Creation-Date: 2024-09-19T10:10:37.548Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -1934,6 +1934,11 @@ msgstr "" msgid "Language independent field." msgstr "" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index cddef470f6..26986f3cb8 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -1938,6 +1938,11 @@ msgstr "语言" msgid "Language independent field." msgstr "语言独立字段" +#. Default: "This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form." +#: components/manage/Widgets/FormFieldWrapper +msgid "Language independent icon title" +msgstr "" + #. Default: "Large" #: components/manage/Widgets/ImageSizeWidget msgid "Large" diff --git a/packages/volto/news/ 6342.feature b/packages/volto/news/ 6342.feature new file mode 100644 index 0000000000..2c6681332a --- /dev/null +++ b/packages/volto/news/ 6342.feature @@ -0,0 +1 @@ +Updated Italian Italian translations. @gianniftp diff --git a/packages/volto/news/2487.bugfix b/packages/volto/news/2487.bugfix new file mode 100644 index 0000000000..41812d2d99 --- /dev/null +++ b/packages/volto/news/2487.bugfix @@ -0,0 +1 @@ +Increase specificity of table header style selector to properly override colors for better contrast @jackahl diff --git a/packages/volto/news/2570.bugfix b/packages/volto/news/2570.bugfix new file mode 100644 index 0000000000..490f159699 --- /dev/null +++ b/packages/volto/news/2570.bugfix @@ -0,0 +1,2 @@ +Change Form input:focus text color to the `textColor` value for a11y. +Add Cypress test for contact form inputs. @ThomasKindermann @tedw87 \ No newline at end of file diff --git a/packages/volto/news/6259.bugfix b/packages/volto/news/6259.bugfix new file mode 100644 index 0000000000..9a9158fcc6 --- /dev/null +++ b/packages/volto/news/6259.bugfix @@ -0,0 +1 @@ +- Fixed build style classnames in edit mode. Also use buildStyleClassNamesExtenders. @giuliaghisini diff --git a/packages/volto/news/6289.documentation b/packages/volto/news/6289.documentation new file mode 100644 index 0000000000..59d97b6da5 --- /dev/null +++ b/packages/volto/news/6289.documentation @@ -0,0 +1 @@ +Update references to cookiecutter-plone-starter in docs. @davisagli diff --git a/packages/volto/news/6293.bugfix b/packages/volto/news/6293.bugfix new file mode 100644 index 0000000000..ea8503c548 --- /dev/null +++ b/packages/volto/news/6293.bugfix @@ -0,0 +1 @@ +Fetch `user` before pass it to the `restricted` function of the block settings. @wesleybl diff --git a/packages/volto/news/6295.bugfix b/packages/volto/news/6295.bugfix new file mode 100644 index 0000000000..581fdd5089 --- /dev/null +++ b/packages/volto/news/6295.bugfix @@ -0,0 +1,2 @@ +- Join validation errors in one single toast and update errors from response. @cekk +- Toast content now has a
wrapper instead of a

. @cekk diff --git a/packages/volto/news/6297.feature b/packages/volto/news/6297.feature new file mode 100644 index 0000000000..e509917a3c --- /dev/null +++ b/packages/volto/news/6297.feature @@ -0,0 +1 @@ +Add language independent field icon. @iRohitSingh \ No newline at end of file diff --git a/packages/volto/news/6313.bugfix b/packages/volto/news/6313.bugfix new file mode 100644 index 0000000000..134d5727c5 --- /dev/null +++ b/packages/volto/news/6313.bugfix @@ -0,0 +1 @@ +Fixed toolbar buttons not having a focus outline. @JeffersonBledsoe diff --git a/packages/volto/news/6330.bugfix b/packages/volto/news/6330.bugfix new file mode 100644 index 0000000000..809f559863 --- /dev/null +++ b/packages/volto/news/6330.bugfix @@ -0,0 +1 @@ +Changed sidebar accordion text colour from @teal to @textColor. @JeffersonBledsoe diff --git a/packages/volto/news/6332.bugfix b/packages/volto/news/6332.bugfix new file mode 100644 index 0000000000..6b82b6cd5e --- /dev/null +++ b/packages/volto/news/6332.bugfix @@ -0,0 +1 @@ +Labels accessibility for ArrayWidget, SelectWidget, TokenWidget. @folix-01 diff --git a/packages/volto/news/6334.bugfix b/packages/volto/news/6334.bugfix new file mode 100644 index 0000000000..f7623395d6 --- /dev/null +++ b/packages/volto/news/6334.bugfix @@ -0,0 +1 @@ +Use lighter blue as link color in inverted tables to improve contrast for a11y @jackahl diff --git a/packages/volto/news/6360.documentation b/packages/volto/news/6360.documentation new file mode 100644 index 0000000000..f6a02c99e4 --- /dev/null +++ b/packages/volto/news/6360.documentation @@ -0,0 +1 @@ +- Fix the MyST syntax for the label `upgrade-18-cookieplone-label`. @stevepiercy diff --git a/packages/volto/news/6362.documentation b/packages/volto/news/6362.documentation new file mode 100644 index 0000000000..c37ab93222 --- /dev/null +++ b/packages/volto/news/6362.documentation @@ -0,0 +1 @@ +Fixed spelling of prerequisites. @stevepiercy diff --git a/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx b/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx index 80c5142e81..2ae878e5ba 100644 --- a/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx +++ b/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { useSelector } from 'react-redux'; +import { useUser } from '@plone/volto/hooks'; import PropTypes from 'prop-types'; import { filter, map, groupBy, isEmpty } from 'lodash'; import { Accordion, Button } from 'semantic-ui-react'; @@ -36,7 +36,7 @@ const BlockChooser = ({ contentType, }) => { const intl = useIntl(); - const user = useSelector((state) => state.users?.user); + const user = useUser(); const hasAllowedBlocks = !isEmpty(allowedBlocks); const filteredBlocksConfig = filter(blocksConfig, (item) => { diff --git a/packages/volto/src/components/manage/BlockChooser/BlockChooser.test.jsx b/packages/volto/src/components/manage/BlockChooser/BlockChooser.test.jsx index 447c20f61d..d2bd1bbe5a 100644 --- a/packages/volto/src/components/manage/BlockChooser/BlockChooser.test.jsx +++ b/packages/volto/src/components/manage/BlockChooser/BlockChooser.test.jsx @@ -4,6 +4,7 @@ import { Provider } from 'react-intl-redux'; import configureStore from 'redux-mock-store'; import BlockChooser from './BlockChooser'; import config from '@plone/volto/registry'; +import jwt from 'jsonwebtoken'; const blockSVG = {}; @@ -121,6 +122,9 @@ const store = mockStore({ locale: 'en', messages: {}, }, + userSession: { + token: jwt.sign({ fullname: 'John Doe' }, 'secret'), + }, }); describe('BlocksChooser', () => { diff --git a/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx b/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx index 31508127bf..5fd3ab2adb 100644 --- a/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx @@ -6,6 +6,7 @@ import { blockHasValue, buildStyleClassNamesFromData, buildStyleObjectFromData, + buildStyleClassNamesExtenders, } from '@plone/volto/helpers'; import dragSVG from '@plone/volto/icons/drag.svg'; import { Button } from 'semantic-ui-react'; @@ -61,7 +62,12 @@ const EditBlockWrapper = (props) => { ? data.required : includes(config.blocks.requiredBlocks, type); - const classNames = buildStyleClassNamesFromData(data.styles); + let classNames = buildStyleClassNamesFromData(data.styles); + classNames = buildStyleClassNamesExtenders({ + block, + data, + classNames, + }); const style = buildStyleObjectFromData(data.styles); // We need to merge the StyleWrapper styles with the draggable props from b-D&D diff --git a/packages/volto/src/components/manage/Form/Form.jsx b/packages/volto/src/components/manage/Form/Form.jsx index 8b108d7dde..41a4c3f97c 100644 --- a/packages/volto/src/components/manage/Form/Form.jsx +++ b/packages/volto/src/components/manage/Form/Form.jsx @@ -274,19 +274,22 @@ class Form extends Component { selected: null, }); } - - if (requestError && prevProps.requestError !== requestError) { + if (requestError) { errors = FormValidation.giveServerErrorsToCorrespondingFields(requestError); - activeIndex = FormValidation.showFirstTabWithErrors({ - errors, - schema: this.props.schema, - }); - - this.setState({ - errors, - activeIndex, - }); + if ( + !isEqual(prevProps.requestError, requestError) || + !isEqual(this.state.errors, errors) + ) { + activeIndex = FormValidation.showFirstTabWithErrors({ + errors, + schema: this.props.schema, + }); + this.setState({ + errors, + activeIndex, + }); + } } if (this.props.onChangeFormData) { @@ -563,13 +566,11 @@ class Form extends Component { } }); } - if (keys(errors).length > 0 || keys(blocksErrors).length > 0) { const activeIndex = FormValidation.showFirstTabWithErrors({ errors, schema: this.props.schema, }); - this.setState({ errors: { ...errors, @@ -580,14 +581,23 @@ class Form extends Component { if (keys(errors).length > 0) { // Changes the focus to the metadata tab in the sidebar if error - Object.keys(errors).forEach((err) => - toast.error( - , - ), + toast.error( + + {Object.keys(errors).map((err, index) => ( +

  • + + {this.props.schema.properties[err].title || err}: + {' '} + {errors[err]} +
  • + ))} + + } + />, ); this.props.setSidebarTab(0); } else if (keys(blocksErrors).length > 0) { @@ -714,7 +724,6 @@ class Form extends Component { const schema = this.removeBlocksLayoutFields(originalSchema); const Container = config.getComponent({ name: 'Container' }).component || SemanticContainer; - return this.props.visual ? ( // Removing this from SSR is important, since react-beautiful-dnd supports SSR, // but draftJS don't like it much and the hydration gets messed up diff --git a/packages/volto/src/components/manage/Toast/Toast.jsx b/packages/volto/src/components/manage/Toast/Toast.jsx index 96f4355656..558eb8bd44 100644 --- a/packages/volto/src/components/manage/Toast/Toast.jsx +++ b/packages/volto/src/components/manage/Toast/Toast.jsx @@ -29,7 +29,7 @@ const Toast = (props) => {
    {title &&

    {title}

    } -

    {content}

    +
    {content}
    ); @@ -37,7 +37,7 @@ const Toast = (props) => { Toast.propTypes = { title: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - content: PropTypes.string.isRequired, + content: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired, info: PropTypes.bool, success: PropTypes.bool, error: PropTypes.bool, diff --git a/packages/volto/src/components/manage/Toast/__snapshots__/Toast.test.jsx.snap b/packages/volto/src/components/manage/Toast/__snapshots__/Toast.test.jsx.snap index 1d65445606..3d01fb4fca 100644 --- a/packages/volto/src/components/manage/Toast/__snapshots__/Toast.test.jsx.snap +++ b/packages/volto/src/components/manage/Toast/__snapshots__/Toast.test.jsx.snap @@ -26,9 +26,9 @@ Array [

    I'm a title

    -

    +

    This is the content, lorem ipsum -

    +
    , ] `; diff --git a/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx b/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx index 2670cc84bc..dc361195b3 100644 --- a/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx @@ -314,6 +314,7 @@ class ArrayWidget extends Component { // small fix for https://github.com/clauderic/react-sortable-hoc/pull/352: getHelperDimensions={({ node }) => node.getBoundingClientRect()} id={`field-${this.props.id}`} + aria-labelledby={`fieldset-${this.props.fieldSet}-field-label-${this.props.id}`} key={this.props.id} isDisabled={this.props.disabled || this.props.isDisabled} className="react-select-container" diff --git a/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx b/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx index ee60438be4..732b4ba281 100644 --- a/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx +++ b/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx @@ -8,6 +8,8 @@ import { Form, Grid, Icon as IconOld, Label } from 'semantic-ui-react'; import { map } from 'lodash'; import cx from 'classnames'; import { defineMessages, injectIntl } from 'react-intl'; +import LanguageSVG from '@plone/volto/icons/language.svg'; +import { Icon } from '@plone/volto/components'; const messages = defineMessages({ edit: { @@ -22,6 +24,11 @@ const messages = defineMessages({ id: 'Language independent field.', defaultMessage: 'Language independent field.', }, + language_independent_icon_title: { + id: 'Language independent icon title', + defaultMessage: + 'This is a language independent field. Any value you enter here will overwrite the corresponding field of all members of the translation group when you save this form.', + }, }); /** * FormFieldWrapper component class. @@ -91,6 +98,9 @@ class FormFieldWrapper extends Component { noForInFieldLabel, multilingual_options, } = this.props; + + const languageIndependent = multilingual_options?.language_independent; + const wdg = ( <> {this.props.children} @@ -112,9 +122,7 @@ class FormFieldWrapper extends Component { description ? 'help' : '', className, `field-wrapper-${id}`, - multilingual_options?.language_independent - ? 'language-independent-field' - : null, + languageIndependent ? 'language-independent-field' : null, )} > @@ -133,6 +141,18 @@ class FormFieldWrapper extends Component { /> )} {title} + {languageIndependent && ( +
    + +
    + )} diff --git a/packages/volto/src/components/manage/Widgets/SelectWidget.jsx b/packages/volto/src/components/manage/Widgets/SelectWidget.jsx index 64b0cdea69..0c9d61e12f 100644 --- a/packages/volto/src/components/manage/Widgets/SelectWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/SelectWidget.jsx @@ -224,6 +224,7 @@ class SelectWidget extends Component { id={`field-${id}`} key={choices} name={id} + aria-labelledby={`fieldset-${this.props.fieldSet}-field-label-${id}`} menuShouldScrollIntoView={false} isDisabled={disabled} isSearchable={true} diff --git a/packages/volto/src/components/manage/Widgets/TokenWidget.jsx b/packages/volto/src/components/manage/Widgets/TokenWidget.jsx index b38de6897d..cad1f0bdcb 100644 --- a/packages/volto/src/components/manage/Widgets/TokenWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/TokenWidget.jsx @@ -173,6 +173,7 @@ class TokenWidget extends Component { { + const users = useSelector((state) => state.users); + const user = users?.user; + const userId = useSelector((state) => + state.userSession.token ? jwtDecode(state.userSession.token).sub : '', + ); + const dispatch = useDispatch(); + + useEffect(() => { + if (!user?.id && users?.get.loading === false) { + dispatch(getUser(userId)); + } + }, [dispatch, userId, user, users?.get.loading]); + + return user; +}; + +export default useUser; diff --git a/packages/volto/theme/themes/pastanaga/collections/form.overrides b/packages/volto/theme/themes/pastanaga/collections/form.overrides index 3d5ae5e965..680367e099 100644 --- a/packages/volto/theme/themes/pastanaga/collections/form.overrides +++ b/packages/volto/theme/themes/pastanaga/collections/form.overrides @@ -50,6 +50,7 @@ &:focus { border-radius: 0; + color: @textColor; } } diff --git a/packages/volto/theme/themes/pastanaga/collections/table.overrides b/packages/volto/theme/themes/pastanaga/collections/table.overrides index 477a761991..15181c1a05 100644 --- a/packages/volto/theme/themes/pastanaga/collections/table.overrides +++ b/packages/volto/theme/themes/pastanaga/collections/table.overrides @@ -6,7 +6,7 @@ } /* Headers */ -.ui.table th { +.ui.table thead th { padding: @headerVerticalPadding @headerHorizontalPadding; border-left: @headerDivider; background: @headerBackground; @@ -34,3 +34,8 @@ .ui.table tr:first-child > th:only-child { border-radius: @borderRadius @borderRadius 0em 0em; } + +/* inline link color*/ +.ui.table.inverted a { + color: @lightPrimaryColor; +} diff --git a/packages/volto/theme/themes/pastanaga/extras/main.less b/packages/volto/theme/themes/pastanaga/extras/main.less index 6b1bb30d5b..1062b14845 100644 --- a/packages/volto/theme/themes/pastanaga/extras/main.less +++ b/packages/volto/theme/themes/pastanaga/extras/main.less @@ -367,9 +367,10 @@ button { p { font-weight: 300; } - } - .toast-dismiss-action { + ul { + padding: 0; + } } .Toastify__toast--info { diff --git a/packages/volto/theme/themes/pastanaga/extras/toolbar.less b/packages/volto/theme/themes/pastanaga/extras/toolbar.less index 0d25297239..9b1d5e6f03 100644 --- a/packages/volto/theme/themes/pastanaga/extras/toolbar.less +++ b/packages/volto/theme/themes/pastanaga/extras/toolbar.less @@ -283,16 +283,28 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) { .toolbar-content, .toolbar { - button { + button, + a { // Default reset for button padding: 0; border: 0; background: transparent; + box-shadow: unset !important; // Some buttons have double outlines due to default styles. Safely disable those styles here. cursor: pointer; text-align: initial; + svg { + display: block; // SVGs are inline by default, causing the spacing to be odd + margin: 0; // Some SVGs have margin set by default styles. + } + &:focus-visible { - outline: 1px auto; + outline: 2px solid black; + outline-offset: 2px; + + &:has(.circled) { + border-radius: 50%; + } } } } diff --git a/packages/volto/theme/themes/pastanaga/extras/widgets.less b/packages/volto/theme/themes/pastanaga/extras/widgets.less index 5026708212..586e4df775 100644 --- a/packages/volto/theme/themes/pastanaga/extras/widgets.less +++ b/packages/volto/theme/themes/pastanaga/extras/widgets.less @@ -280,3 +280,15 @@ body.babel-view .field.language-independent-field { } } } + +// ### FormFieldWrapper ### +.language-independent-field .wrapper > label { + display: flex !important; + align-items: center; + justify-content: space-between; + + .languageIndependent-icon { + display: flex; + margin-left: 8px; + } +} diff --git a/packages/volto/theme/themes/pastanaga/modules/accordion.variables b/packages/volto/theme/themes/pastanaga/modules/accordion.variables index d3c1835b1a..ffa6fb712b 100644 --- a/packages/volto/theme/themes/pastanaga/modules/accordion.variables +++ b/packages/volto/theme/themes/pastanaga/modules/accordion.variables @@ -34,14 +34,14 @@ /* Styled Title */ @styledTitleFontWeight: @normal; -@styledTitleColor: @teal; +@styledTitleColor: @textColor; @styledTitleBorder: none; /* Styled Title States */ @styledTitleHoverBackground: @darkWhite; -@styledTitleHoverColor: @teal; +@styledTitleHoverColor: @textColor; @styledActiveTitleBackground: @darkWhite; -@styledActiveTitleColor: @teal; +@styledActiveTitleColor: @textColor; /* Styled Child Title States */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 013c2c131a..21d9875b8e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44371,4 +44371,4 @@ snapshots: zod@3.22.5: {} - zwitch@2.0.4: {} + zwitch@2.0.4: {} \ No newline at end of file diff --git a/styles/Vocab/Plone/reject.txt b/styles/Vocab/Plone/reject.txt index 1cefa812f0..81510d55a8 100644 --- a/styles/Vocab/Plone/reject.txt +++ b/styles/Vocab/Plone/reject.txt @@ -1,2 +1,3 @@ [^.]js NodeJS +[Pp]re-requisite