diff --git a/Makefile b/Makefile index 932cce7b5d..8ee803fdc6 100644 --- a/Makefile +++ b/Makefile @@ -398,3 +398,7 @@ start-test-acceptance-server-detached: ## Start Test Acceptance Server Main Fixt .PHONY: stop-test-acceptance-server-detached stop-test-acceptance-server-detached: ## Stop Test Acceptance Server Main Fixture (docker container) in a detached (daemon) mode docker kill plone-client-acceptance-server + +# include local overrides if present +-include Makefile.local +-include ../../../Makefile.local \ No newline at end of file diff --git a/api/buildout.cfg b/api/buildout.cfg index 823c5ae050..b2bbf75f69 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.10.1/versions.cfg + http://dist.plone.org/release/6.0.11/versions.cfg version-constraints.cfg versions.cfg parts = instance plonesite site-packages test robot-server diff --git a/apps/plone/package.json b/apps/plone/package.json index 2a76a9b856..3f362f211c 100644 --- a/apps/plone/package.json +++ b/apps/plone/package.json @@ -249,30 +249,34 @@ "@loadable/babel-plugin": "5.13.2", "@loadable/webpack-plugin": "5.15.2", "@plone/scripts": "workspace:*", - "@plone/types": "workspace:*", + "@plone/types": "1.0.0-alpha.11", "@plone/volto-coresandbox": "workspace:*", "@sinonjs/fake-timers": "^6.0.1", - "@storybook/addon-actions": "^6.5.15", - "@storybook/addon-controls": "6.5.15", - "@storybook/addon-docs": "^6.5.15", - "@storybook/addon-essentials": "^6.5.15", - "@storybook/addon-links": "^6.5.15", + "@storybook/addon-actions": "^8.0.4", + "@storybook/addon-controls": "^8.0.4", + "@storybook/addon-docs": "^8.0.4", + "@storybook/addon-essentials": "^8.0.4", + "@storybook/addon-links": "^8.0.4", + "@storybook/addon-webpack5-compiler-babel": "^3.0.3", "@storybook/builder-webpack5": "^6.5.15", "@storybook/manager-webpack5": "^6.5.15", - "@storybook/react": "^6.5.15", + "@storybook/react": "^8.0.4", + "@storybook/react-webpack5": "^8.0.4", + "@storybook/theming": "^8.0.4", "@testing-library/cypress": "10.0.1", "@testing-library/jest-dom": "6.4.2", "@testing-library/react": "14.2.0", "@testing-library/react-hooks": "8.0.1", "@types/jest": "^29.5.8", + "@types/loadable__component": "^5.13.9", "@types/lodash": "^4.14.201", "@types/react": "^18", "@types/react-dom": "^18", "@types/react-router-dom": "^5.3.3", "@types/react-test-renderer": "18.0.7", "@types/uuid": "^9.0.2", - "@typescript-eslint/eslint-plugin": "7.1.1", - "@typescript-eslint/parser": "7.1.1", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "autoprefixer": "10.4.8", "axe-core": "4.4.2", "babel-loader": "9.1.0", @@ -288,16 +292,17 @@ "cypress-axe": "1.5.0", "cypress-file-upload": "5.0.8", "deep-freeze": "0.0.1", - "eslint": "8.49.0", - "eslint-config-prettier": "9.1.0", - "eslint-config-react-app": "7.0.1", - "eslint-import-resolver-alias": "1.1.2", - "eslint-import-resolver-babel-plugin-root-import": "1.1.1", - "eslint-plugin-import": "2.29.1", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-react-app": "^7.0.1", + "eslint-import-resolver-alias": "^1.1.2", + "eslint-import-resolver-babel-plugin-root-import": "^1.1.1", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-prettier": "5.1.3", - "eslint-plugin-react": "7.33.2", - "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-react": "^7.34.1", + "eslint-plugin-react-hooks": "^4.6.0", "full-icu": "1.4.0", "glob": "7.1.6", "html-webpack-plugin": "5.5.0", @@ -331,8 +336,9 @@ "release-it": "^17.1.1", "semver": "^7.5.4", "start-server-and-test": "1.14.0", + "storybook": "^8.0.4", "style-loader": "3.3.1", - "stylelint": "16.2.1", + "stylelint": "^16.3.1", "stylelint-config-idiomatic-order": "10.0.0", "stylelint-prettier": "5.0.0", "svg-loader": "0.0.2", @@ -342,10 +348,10 @@ "ts-jest": "^26.4.2", "ts-loader": "9.4.4", "tsconfig": "*", - "typescript": "5.2.2", + "typescript": "^5.4.2", "use-trace-update": "1.3.2", "wait-on": "6.0.0", - "webpack": "5.76.1", + "webpack": "5.90.1", "webpack-bundle-analyzer": "4.10.1", "webpack-dev-server": "4.11.1", "webpack-node-externals": "3.0.0", diff --git a/apps/plone/src/addons/volto-volto-project/package.json b/apps/plone/src/addons/volto-volto-project/package.json index 7aefb7b746..3a01e12350 100644 --- a/apps/plone/src/addons/volto-volto-project/package.json +++ b/apps/plone/src/addons/volto-volto-project/package.json @@ -29,7 +29,7 @@ "eslint-config-react-app": "7.0.1", "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-import": "2.28.1", - "eslint-plugin-jsx-a11y": "6.7.1", + "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-prettier": "5.0.0", "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", diff --git a/docs/source/release-notes/index.md b/docs/source/release-notes/index.md index fefadc3e0a..02881dd926 100644 --- a/docs/source/release-notes/index.md +++ b/docs/source/release-notes/index.md @@ -17,6 +17,20 @@ myst: +## 18.0.0-alpha.30 (2024-05-02) + +### Bugfix + +- Fix image disappears after pressing the Enter key on title field in image content-type. @iFlameing [#5973](https://github.com/plone/volto/issues/5973) +- Defines the last 4 parameters of the `asyncConnect` function with optional. @wesleybl [#5985](https://github.com/plone/volto/issues/5985) +- Fix server side sidebar rendering @sneridagh [#5993](https://github.com/plone/volto/issues/5993) + +### Internal + +- Update to use Plone 6.0.11 @sneridagh [#5989](https://github.com/plone/volto/issues/5989) +- Flexibilize the pins for all ESlint deps, in Volto and generators @sneridagh [#5991](https://github.com/plone/volto/issues/5991) +- Cleaned up useless injectIntl in DefaultView @pnicolli [#5994](https://github.com/plone/volto/issues/5994) + ## 18.0.0-alpha.29 (2024-04-26) ### Feature diff --git a/packages/generator-volto/CHANGELOG.md b/packages/generator-volto/CHANGELOG.md index dcda9f5386..db42b27c09 100644 --- a/packages/generator-volto/CHANGELOG.md +++ b/packages/generator-volto/CHANGELOG.md @@ -8,6 +8,12 @@ +## 9.0.0-alpha.15 (2024-05-02) + +### Internal + +- Flexibilize the pins for all ESlint deps, in Volto and generators @sneridagh [#5991](https://github.com/plone/volto/issues/5991) + ## 9.0.0-alpha.14 (2024-03-24) ### Internal diff --git a/packages/generator-volto/generators/addon/templates/.eslintrc b/packages/generator-volto/generators/addon/templates/.eslintrc index 9d9dc1186f..614f0b0e77 100644 --- a/packages/generator-volto/generators/addon/templates/.eslintrc +++ b/packages/generator-volto/generators/addon/templates/.eslintrc @@ -27,7 +27,8 @@ ], "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", - "react/react-in-jsx-scope": "off" + "react/react-in-jsx-scope": "off", + "jsx-a11y/label-has-associated-control": "off" }, "globals": { "root": true, diff --git a/packages/generator-volto/generators/addon/templates/package.json b/packages/generator-volto/generators/addon/templates/package.json index db047966c9..bdbeb4e730 100644 --- a/packages/generator-volto/generators/addon/templates/package.json +++ b/packages/generator-volto/generators/addon/templates/package.json @@ -24,15 +24,15 @@ "devDependencies": { "@plone/scripts": "^3.5.0", "@babel/eslint-parser": "7.23.10", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-config-react-app": "7.0.1", - "eslint-plugin-flowtype": "8.0.3", - "eslint-plugin-import": "2.29.1", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-react-app": "^7.0.1", + "eslint-plugin-flowtype": "^8.0.3", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-prettier": "5.1.3", - "eslint-plugin-react": "7.33.2", - "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0", "postcss-less": "6.0.0", "postcss-scss": "4.0.9", "prettier": "3.2.5", diff --git a/packages/generator-volto/news/5785.bugfix b/packages/generator-volto/news/5785.bugfix new file mode 100644 index 0000000000..9acdc451eb --- /dev/null +++ b/packages/generator-volto/news/5785.bugfix @@ -0,0 +1 @@ +Disable `jsx-a11y/label-has-associated-control` so that we can use `eslint-plugin-jsx-a11y` version 6.8.0 if it's pulled by other dependencies. @ichim-david \ No newline at end of file diff --git a/packages/generator-volto/package.json b/packages/generator-volto/package.json index 8818151028..ac886405a0 100644 --- a/packages/generator-volto/package.json +++ b/packages/generator-volto/package.json @@ -10,7 +10,7 @@ } ], "license": "MIT", - "version": "9.0.0-alpha.14", + "version": "9.0.0-alpha.15", "repository": { "type": "git", "url": "git+https://github.com/plone/generator-volto.git" diff --git a/packages/registry/.eslintrc.js b/packages/registry/.eslintrc.js index 92e60e8a55..b60637a973 100644 --- a/packages/registry/.eslintrc.js +++ b/packages/registry/.eslintrc.js @@ -54,6 +54,9 @@ module.exports = { 'plugin:import/recommended', 'plugin:import/typescript', ], + rules: { + '@typescript-eslint/no-explicit-any': 0, + }, }, // Node diff --git a/packages/registry/news/6002.bugfix b/packages/registry/news/6002.bugfix new file mode 100644 index 0000000000..9ef8144c11 --- /dev/null +++ b/packages/registry/news/6002.bugfix @@ -0,0 +1 @@ +Fix type for component registry components @sneridagh diff --git a/packages/registry/src/index.ts b/packages/registry/src/index.ts index d71a56560a..932f84bc01 100644 --- a/packages/registry/src/index.ts +++ b/packages/registry/src/index.ts @@ -27,7 +27,7 @@ export type ConfigData = { }; type GetComponentResult = { - component: React.ComponentType; + component: React.ComponentType; }; export type ConfigType = InstanceType; diff --git a/packages/volto/.eslintrc b/packages/volto/.eslintrc index 7526c17615..3e28cbddef 100644 --- a/packages/volto/.eslintrc +++ b/packages/volto/.eslintrc @@ -27,7 +27,8 @@ ], "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", - "react/react-in-jsx-scope": "off" + "react/react-in-jsx-scope": "off", + "jsx-a11y/label-has-associated-control": "off" }, "settings": { "import/resolver": { diff --git a/packages/volto/.release-it.json b/packages/volto/.release-it.json index c4823d538e..256642d302 100644 --- a/packages/volto/.release-it.json +++ b/packages/volto/.release-it.json @@ -3,7 +3,7 @@ "../scripts/prepublish.js": {} }, "hooks": { - "before:bump": ["pnpm i18n", "pnpm build:types"], + "before:bump": ["pnpm i18n", "pnpm build:types", "git add types"], "after:bump": [ "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}", "make copyreleasenotestodocs" diff --git a/packages/volto/CHANGELOG.md b/packages/volto/CHANGELOG.md index fefadc3e0a..02881dd926 100644 --- a/packages/volto/CHANGELOG.md +++ b/packages/volto/CHANGELOG.md @@ -17,6 +17,20 @@ myst: +## 18.0.0-alpha.30 (2024-05-02) + +### Bugfix + +- Fix image disappears after pressing the Enter key on title field in image content-type. @iFlameing [#5973](https://github.com/plone/volto/issues/5973) +- Defines the last 4 parameters of the `asyncConnect` function with optional. @wesleybl [#5985](https://github.com/plone/volto/issues/5985) +- Fix server side sidebar rendering @sneridagh [#5993](https://github.com/plone/volto/issues/5993) + +### Internal + +- Update to use Plone 6.0.11 @sneridagh [#5989](https://github.com/plone/volto/issues/5989) +- Flexibilize the pins for all ESlint deps, in Volto and generators @sneridagh [#5991](https://github.com/plone/volto/issues/5991) +- Cleaned up useless injectIntl in DefaultView @pnicolli [#5994](https://github.com/plone/volto/issues/5994) + ## 18.0.0-alpha.29 (2024-04-26) ### Feature diff --git a/packages/volto/cypress/support/commands.js b/packages/volto/cypress/support/commands.js index 6ae8849820..f8ba71f310 100644 --- a/packages/volto/cypress/support/commands.js +++ b/packages/volto/cypress/support/commands.js @@ -716,11 +716,10 @@ Cypress.Commands.add('clearSlate', (selector) => { return cy .get(selector) .focus() - .click({ force: true }) // fix sporadic failure this element is currently animating - .wait(1000) - .type('{selectAll}') - .wait(1000) - .type('{backspace}'); + .click({ force: true }) + .type('{selectAll}', { delay: 20 }) + .type('{backspace}', { delay: 20 }) + .wait(200); }); Cypress.Commands.add('getSlate', (createNewSlate = false) => { @@ -784,6 +783,15 @@ Cypress.Commands.add('typeInSlate', { prevSubject: true }, (subject, text) => { ); }); +Cypress.Commands.add( + 'typeWithDelay', + { prevSubject: 'element' }, + (subject, text, options) => { + const delay = options && options.delay ? options.delay : 20; + cy.wrap(subject).type(text, { delay }); + }, +); + Cypress.Commands.add('lineBreakInSlate', { prevSubject: true }, (subject) => { return ( cy @@ -873,7 +881,9 @@ Cypress.Commands.add('addNewBlock', (blockName, createNewSlate = false) => { }); Cypress.Commands.add('navigate', (route = '') => { - return cy.window().its('appHistory').invoke('push', route); + cy.intercept('GET', '**/*').as('navGetCall'); + cy.window().its('appHistory').invoke('push', route); + cy.wait('@navGetCall'); }); Cypress.Commands.add('store', () => { diff --git a/packages/volto/cypress/tests/core/basic/locking.js b/packages/volto/cypress/tests/core/basic/locking.js index c47ddff1f1..d414667777 100644 --- a/packages/volto/cypress/tests/core/basic/locking.js +++ b/packages/volto/cypress/tests/core/basic/locking.js @@ -96,15 +96,16 @@ describe('Document locking', () => { cy.visit('/logout'); cy.wait('@logout'); + cy.findByRole('alert') + .get('.toast-inner-content') + .should('contain', 'You have been logged out'); + cy.get('.toast-dismiss-action').click(); // As another editor I can see the locked document cy.autologin('editor2', 'password'); cy.visit('/document'); cy.wait('@content'); - - cy.findByRole('alert') - .get('.toast-inner-content') - .contains('This item was locked by Editor 1 on'); + cy.get('.toolbar-body').should('be.visible'); // As another editor I can unlock the document cy.findByLabelText('Unlock').click(); @@ -114,14 +115,11 @@ describe('Document locking', () => { cy.findByLabelText('Edit').click(); // As another editor I can edit the document - cy.clearSlateTitle().type('New title by Editor 2'); + cy.clearSlateTitle().typeWithDelay('New title by Editor 2'); cy.get('#toolbar-save').click(); - // cy.waitForResourceToLoad('document'); cy.wait('@saveDoc'); cy.wait('@getDoc'); - // cy.pause(); - cy.url().should('eq', Cypress.config().baseUrl + '/document'); cy.contains('New title by Editor 2'); cy.get('h1.documentFirstHeading').should('not.be.empty'); diff --git a/packages/volto/cypress/tests/core/blocks/listing/blocks-listing.js b/packages/volto/cypress/tests/core/blocks/listing/blocks-listing.js index 87580ff787..c16f2c95e7 100644 --- a/packages/volto/cypress/tests/core/blocks/listing/blocks-listing.js +++ b/packages/volto/cypress/tests/core/blocks/listing/blocks-listing.js @@ -1077,38 +1077,42 @@ describe('Listing Block Tests', () => { cy.wait('@save'); cy.wait('@content'); - // The wait is needed to solve the flakyness introduced because that component - // is removed momentarilly from the DOM when saving - cy.wait(1000); //test second pagination click - cy.get('.ui.pagination.menu a[value="2"]').first().click(); + cy.get('.ui.pagination.menu a[value="2"]') + .first() + .should('be.visible') + .click(); //test f5 cy.reload(); cy.isInHTML({ parent: '.listing-item', content: 'My Folder 3' }); cy.url().should('include', '=2'); // const listing2 = cy.get('.ui.pagination.menu').last(); //test third pagination click on second listing - cy.get('.ui.pagination.menu a[value="3"]').first().click(); + cy.get('.ui.pagination.menu a[value="3"]') + .first() + .should('be.visible') + .click(); //test f5 cy.reload(); cy.isInHTML({ parent: '.listing-item', content: 'My Folder 3' }); cy.url().should('include', '=2'); cy.url().should('include', '=3'); //on logo click go to home page and remove ?page=2 from path - cy.get('.logo').first().click(); + cy.get('.logo').first().should('be.visible').click(); cy.url().should('not.include', '=2'); cy.url().should('not.include', '=3'); - // we need to wait for the page to load otherwise we navigate /my-page - // followed by / from the logo click - cy.wait(1000); - cy.navigate('/my-page'); - cy.wait(1000); - cy.get('.ui.pagination.menu a[value="2"]').first().click({ force: true }); - cy.get('.ui.pagination.menu a[value="3"]').first().click({ force: true }); + cy.get('.ui.pagination.menu a[value="2"]') + .first() + .should('be.visible') + .click({ force: true }); + cy.get('.ui.pagination.menu a[value="3"]') + .first() + .should('be.visible') + .click({ force: true }); cy.go(-1); - cy.wait(1000); + cy.wait('@content'); cy.isInHTML({ parent: '.listing-item', content: 'My Folder 3' }); cy.url().should('not.include', '=3'); cy.go(-1); diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index ae5579927f..c49f46036f 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -1459,6 +1459,11 @@ msgstr "Arxiu" msgid "Filename" msgstr "Nom de l'arxiu" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Fitxers pujats: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3751,6 +3756,11 @@ msgstr "Total d'objectes actius i no actius" msgid "Total comments" msgstr "Total de comentaris" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Total fitxers per carregar: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3979,11 +3989,6 @@ msgstr "Pengeu una imatge principal al camp de contingut 'Imatge principal'." msgid "Upload files" msgstr "Carregueu fitxers" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Carregant fitxers" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/de/LC_MESSAGES/volto.po b/packages/volto/locales/de/LC_MESSAGES/volto.po index 41c93762f1..f42b1f850c 100644 --- a/packages/volto/locales/de/LC_MESSAGES/volto.po +++ b/packages/volto/locales/de/LC_MESSAGES/volto.po @@ -1458,6 +1458,11 @@ msgstr "Datei" msgid "Filename" msgstr "Dateiname" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Hochgeladene Dateien: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3750,6 +3755,11 @@ msgstr "Anzahl aktive und nicht-aktive Objekte" msgid "Total comments" msgstr "Anzahl Komentare" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Gesamtzahl der hochzuladenden Dateien: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3976,11 +3986,6 @@ msgstr "Laden Sie ein Lead-Bild im Feld 'Lead-Bild' hoch." #. Default: "Upload files" #: components/manage/Contents/ContentsUploadModal msgid "Upload files" -msgstr "Datei hochladen" - -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" msgstr "Dateien hochladen" #. Default: "Uploading image" diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index 7804879208..351091e13d 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -1453,6 +1453,11 @@ msgstr "" msgid "Filename" msgstr "" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3745,6 +3750,11 @@ msgstr "" msgid "Total comments" msgstr "" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3973,11 +3983,6 @@ msgstr "" msgid "Upload files" msgstr "" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index 395afdfd49..9ea8879da5 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -1460,6 +1460,11 @@ msgstr "Vista de archivo" msgid "Filename" msgstr "Nombre del archivo" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Archivos subidos: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3752,6 +3757,11 @@ msgstr "Número de objetos activos y no activos" msgid "Total comments" msgstr "Comentarios totales" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Total de archivos para cargar: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3980,11 +3990,6 @@ msgstr "Cargar una imagen principal en el campo 'Imagen Principal'." msgid "Upload files" msgstr "Cargar archivos" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Cargando archivos" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index 1678b97357..2909158221 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -1460,6 +1460,11 @@ msgstr "Fitxategiaren bista" msgid "Filename" msgstr "Fitxategi izena" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Igotako fitxategiak: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3752,6 +3757,11 @@ msgstr "Objektu aktibo eta ez-aktiboak" msgid "Total comments" msgstr "Erantzun kopurua" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Igotzeko fitxategiak guztira: {totalFiles} " + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3980,11 +3990,6 @@ msgstr "Kargatu irudia" msgid "Upload files" msgstr "Kargatu fitxategiak" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Fitxategiak kargatzen" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index 400bdbc90c..9e38934475 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -1458,6 +1458,11 @@ msgstr "Tiedostonäkymä" msgid "Filename" msgstr "Tiedostonimi" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Lähetetyt tiedostot: {uploadedFiles} " + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3750,6 +3755,11 @@ msgstr "Aktiivisten ja ei-aktiivisten kohteiden määrä" msgid "Total comments" msgstr "Kommentteja" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Kaikkien ladattavien tiedostojen määrä: {totalFiles} " + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3978,11 +3988,6 @@ msgstr "Tallenna nostokuva sisällön 'Nostokuva'-kentään" msgid "Upload files" msgstr "Lähetä palvelimelle tiedostoja" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Lähetetään tiedostoja" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index dd042b9143..f7c4e31855 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -1460,6 +1460,11 @@ msgstr "Vue fichier" msgid "Filename" msgstr "Nom du fichier" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Fichiers téléchargés : {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3752,6 +3757,11 @@ msgstr "Total des objets actifs et non actifs" msgid "Total comments" msgstr "Nombre de commentaires" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Nombre total de fichiers à uploader: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3980,11 +3990,6 @@ msgstr "Téléchargez une image de garde dans le champ «Image de garde»." msgid "Upload files" msgstr "Télécharger des fichiers" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Téléchargement de fichiers" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index d9fea77b71..8e5222dc91 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -1453,6 +1453,11 @@ msgstr "Vista file" msgid "Filename" msgstr "Nome del file" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "File caricati: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3745,6 +3750,11 @@ msgstr "Totale degli oggetti attivi e non attivi" msgid "Total comments" msgstr "Totale dei commenti" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Numero totale di file da caricare: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3973,11 +3983,6 @@ msgstr "Carica un'Immagine di testata nel campo del contenuto." msgid "Upload files" msgstr "Carica file" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Caricamento dei files" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/ja/LC_MESSAGES/volto.po b/packages/volto/locales/ja/LC_MESSAGES/volto.po index 7ebf883d72..5ccc2ae8c0 100644 --- a/packages/volto/locales/ja/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ja/LC_MESSAGES/volto.po @@ -1458,6 +1458,11 @@ msgstr "" msgid "Filename" msgstr "ファイル名" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "アップロードされたファイル: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3750,6 +3755,11 @@ msgstr "オブジェクトの総数" msgid "Total comments" msgstr "コメント計" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "アップロードするファイル合計: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3978,11 +3988,6 @@ msgstr "リード画像をコンテンツのフィールドにアップロード msgid "Upload files" msgstr "アップロードファイル" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "ファイルをアップロードしています" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/nl/LC_MESSAGES/volto.po b/packages/volto/locales/nl/LC_MESSAGES/volto.po index 821a97b1fb..9cb6168525 100644 --- a/packages/volto/locales/nl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nl/LC_MESSAGES/volto.po @@ -1457,6 +1457,11 @@ msgstr "" msgid "Filename" msgstr "Bestandsnaam" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Geüploade bestanden: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3749,6 +3754,11 @@ msgstr "" msgid "Total comments" msgstr "" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Totaal aantal te uploaden bestanden: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3977,11 +3987,6 @@ msgstr "" msgid "Upload files" msgstr "Bestanden uploaden" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Bestanden uploaden" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/pt/LC_MESSAGES/volto.po b/packages/volto/locales/pt/LC_MESSAGES/volto.po index 528f7cfd10..fa63f79e92 100644 --- a/packages/volto/locales/pt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt/LC_MESSAGES/volto.po @@ -1458,6 +1458,11 @@ msgstr "" msgid "Filename" msgstr "Nome de ficheiro" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Arquivos enviados: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3750,6 +3755,11 @@ msgstr "" msgid "Total comments" msgstr "" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Total de ficheiros para carregar: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3978,11 +3988,6 @@ msgstr "" msgid "Upload files" msgstr "Enviar ficheiros" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Enviando ficheiros" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po index ad44c4e9d5..a8e7d81cb0 100644 --- a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po @@ -1459,6 +1459,11 @@ msgstr "Visão de Arquivo" msgid "Filename" msgstr "Nome do arquivo" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Arquivos carregados: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3751,6 +3756,11 @@ msgstr "Total de objetos ativos e não ativos" msgid "Total comments" msgstr "Total de comentários" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Total de arquivos para upload: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3979,11 +3989,6 @@ msgstr "Enviar uma imagem para o campo de imagem principal." msgid "Upload files" msgstr "Enviar arquivos" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Enviando arquivos" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index 02eec7298d..2ababcbc53 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -1453,6 +1453,11 @@ msgstr "" msgid "Filename" msgstr "Nume fișier" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "Fișiere încărcate: {uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3745,6 +3750,11 @@ msgstr "Total obiecte active și inactive" msgid "Total comments" msgstr "Total comentarii" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "Numărul total de fișiere de încărcat: {totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3973,11 +3983,6 @@ msgstr "Încărcați o imagine de start în câmpul de conținut 'Imagine de sta msgid "Upload files" msgstr "Încărcați fișiere" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "Încărcarea fișierelor" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/volto.pot b/packages/volto/locales/volto.pot index f0525ab267..82a00408e7 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-03-06T08:38:38.161Z\n" +"POT-Creation-Date: 2024-05-03T06:54:04.407Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -1455,6 +1455,11 @@ msgstr "" msgid "Filename" msgstr "" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3747,6 +3752,11 @@ msgstr "" msgid "Total comments" msgstr "" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3975,11 +3985,6 @@ msgstr "" msgid "Upload files" msgstr "" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index 8b5f5165a6..2f53f62d3e 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -1459,6 +1459,11 @@ msgstr "文件视图" msgid "Filename" msgstr "文件名" +#. Default: "Files uploaded: {uploadedFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Files uploaded: {uploadedFiles}" +msgstr "已上载的文件:{uploadedFiles}" + #. Default: "Filter" #: helpers/MessageLabels/MessageLabels msgid "Filter" @@ -3751,6 +3756,11 @@ msgstr "活动和非活动对象的总数" msgid "Total comments" msgstr "全部评论" +#. Default: "Total files to upload: {totalFiles}" +#: components/manage/Contents/ContentsUploadModal +msgid "Total files to upload: {totalFiles}" +msgstr "总计需上传的文件:{totalFiles}" + #. Default: "Total number of objects in each cache" #: components/manage/Controlpanels/DatabaseInformation msgid "Total number of objects in each cache" @@ -3979,11 +3989,6 @@ msgstr "" msgid "Upload files" msgstr "上传文件" -#. Default: "Uploading files" -#: components/manage/Contents/ContentsUploadModal -msgid "Uploading files" -msgstr "上传文件中" - #. Default: "Uploading image" #: components/manage/Blocks/Image/Edit msgid "Uploading image" diff --git a/packages/volto/news/5620.bugfix b/packages/volto/news/5620.bugfix new file mode 100644 index 0000000000..da0033b853 --- /dev/null +++ b/packages/volto/news/5620.bugfix @@ -0,0 +1 @@ +Replaced the spinner with a progress bar that shows the number of files being uploaded (Uploading x files out of y), and positioned the progress bar properly, while uploading a large number of files. @victorchrollo14 diff --git a/packages/volto/news/5785.bugfix b/packages/volto/news/5785.bugfix new file mode 100644 index 0000000000..9acdc451eb --- /dev/null +++ b/packages/volto/news/5785.bugfix @@ -0,0 +1 @@ +Disable `jsx-a11y/label-has-associated-control` so that we can use `eslint-plugin-jsx-a11y` version 6.8.0 if it's pulled by other dependencies. @ichim-david \ No newline at end of file diff --git a/packages/volto/news/5997.internal b/packages/volto/news/5997.internal new file mode 100644 index 0000000000..d4e8836668 --- /dev/null +++ b/packages/volto/news/5997.internal @@ -0,0 +1 @@ +Allow `Makefile` options to be modified by a `Makefile.local` file if present. @ichim-david \ No newline at end of file diff --git a/packages/volto/news/5998.internal b/packages/volto/news/5998.internal new file mode 100644 index 0000000000..ccb5323741 --- /dev/null +++ b/packages/volto/news/5998.internal @@ -0,0 +1,3 @@ +Modified `locking` and `block-listing` cypress tests +to use more `assertions` instead of wait times in order to improve +the reliability of the tests. @ichim-david \ No newline at end of file diff --git a/packages/volto/news/5999.bugfix b/packages/volto/news/5999.bugfix new file mode 100644 index 0000000000..949e8b88f7 --- /dev/null +++ b/packages/volto/news/5999.bugfix @@ -0,0 +1 @@ +Fix 301 and 302 redirects. @robgietema \ No newline at end of file diff --git a/packages/volto/package.json b/packages/volto/package.json index 8174d67031..8584d0fcac 100644 --- a/packages/volto/package.json +++ b/packages/volto/package.json @@ -9,7 +9,7 @@ } ], "license": "MIT", - "version": "18.0.0-alpha.29", + "version": "18.0.0-alpha.30", "repository": { "type": "git", "url": "git@github.com:plone/volto.git" @@ -326,16 +326,16 @@ "cypress-file-upload": "5.0.8", "deep-freeze": "0.0.1", "eslint": "^8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-config-react-app": "7.0.1", - "eslint-import-resolver-alias": "1.1.2", - "eslint-import-resolver-babel-plugin-root-import": "1.1.1", + "eslint-config-prettier": "^9.1.0", + "eslint-config-react-app": "^7.0.1", + "eslint-import-resolver-alias": "^1.1.2", + "eslint-import-resolver-babel-plugin-root-import": "^1.1.1", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-react-hooks": "^4.6.0", "full-icu": "1.4.0", "html-webpack-plugin": "5.5.0", "identity-obj-proxy": "3.0.0", diff --git a/packages/volto/src/actions/content/content.js b/packages/volto/src/actions/content/content.js index 145a3a031f..fd97dfb89b 100644 --- a/packages/volto/src/actions/content/content.js +++ b/packages/volto/src/actions/content/content.js @@ -14,10 +14,24 @@ import { LOCK_CONTENT, UNLOCK_CONTENT, LINK_INTEGRITY_CHECK, + UPDATE_UPLOADED_FILES, } from '@plone/volto/constants/ActionTypes'; import { nestContent } from '@plone/volto/helpers'; import config from '@plone/volto/registry'; +/** + * update uploaded files count function + * @function updateUploadedFiles + * @param {number} number of files uploaded + * @returns {Object} update uploaded files action + */ +export function updateUploadedFiles(uploadedFiles) { + return { + type: UPDATE_UPLOADED_FILES, + uploadedFiles: uploadedFiles, + }; +} + /** * Create content function. * @function createContent diff --git a/packages/volto/src/actions/content/content.test.js b/packages/volto/src/actions/content/content.test.js index d1e876f155..73ad7d9ec8 100644 --- a/packages/volto/src/actions/content/content.test.js +++ b/packages/volto/src/actions/content/content.test.js @@ -8,6 +8,7 @@ import { sortContent, lockContent, unlockContent, + updateUploadedFiles, } from './content'; import { CREATE_CONTENT, @@ -18,6 +19,7 @@ import { RESET_CONTENT, LOCK_CONTENT, UNLOCK_CONTENT, + UPDATE_UPLOADED_FILES, } from '@plone/volto/constants/ActionTypes'; describe('Content action', () => { @@ -307,4 +309,16 @@ describe('Content action', () => { expect(action.request[1].path).toEqual(`${urls[1]}/@lock`); }); }); + + describe('Uploaded Files action', () => { + describe('updateUploadedFiles', () => { + it('should create an action to update the number of uploaded files', () => { + const uploadedFiles = 5; + const action = updateUploadedFiles(uploadedFiles); + + expect(action.type).toEqual(UPDATE_UPLOADED_FILES); + expect(action.uploadedFiles).toEqual(5); + }); + }); + }); }); diff --git a/packages/volto/src/actions/index.js b/packages/volto/src/actions/index.js index bbd33b79a1..21c58372de 100644 --- a/packages/volto/src/actions/index.js +++ b/packages/volto/src/actions/index.js @@ -37,6 +37,7 @@ export { lockContent, unlockContent, linkIntegrityCheck, + updateUploadedFiles, } from '@plone/volto/actions/content/content'; export { getControlpanel, diff --git a/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx b/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx index cc9e0f22c9..4290a3d95f 100644 --- a/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx @@ -13,11 +13,11 @@ import { Header, Icon, Image, - Loader, Modal, Table, Segment, Input, + Progress, } from 'semantic-ui-react'; import loadable from '@loadable/component'; import { concat, filter, map } from 'lodash'; @@ -40,6 +40,14 @@ const messages = defineMessages({ defaultMessage: '{count, plural, one {Upload {count} file} other {Upload {count} files}}', }, + filesUploaded: { + id: 'Files uploaded: {uploadedFiles}', + defaultMessage: 'Files uploaded: {uploadedFiles}', + }, + totalFilesToUpload: { + id: 'Total files to upload: {totalFiles}', + defaultMessage: 'Total files to upload: {totalFiles}', + }, }); const SUBREQUEST = 'batch-upload'; @@ -65,6 +73,7 @@ class ContentsUploadModal extends Component { open: PropTypes.bool.isRequired, onOk: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, + uploadedFiles: PropTypes.number, multiple: PropTypes.bool, minSize: PropTypes.number, maxSize: PropTypes.number, @@ -88,9 +97,9 @@ class ContentsUploadModal extends Component { this.onSubmit = this.onSubmit.bind(this); this.state = { files: [], + totalFiles: 0, }; } - /** * Component will receive props * @method componentWillReceiveProps @@ -120,6 +129,7 @@ class ContentsUploadModal extends Component { index !== parseInt(event.target.getAttribute('value'), 10), ), }); + this.setState((prevState) => ({ totalFiles: prevState.totalFiles - 1 })); } /** @@ -142,6 +152,8 @@ class ContentsUploadModal extends Component { this.setState({ files: concat(this.state.files, validFiles), }); + + this.setState({ totalFiles: validFiles.length }); }; /** @@ -154,8 +166,8 @@ class ContentsUploadModal extends Component { this.setState({ files: [], }); + this.setState({ totalFiles: 0 }); } - /** * Name change handler * @method onChangeFileName @@ -234,13 +246,23 @@ class ContentsUploadModal extends Component {
+ - - - +
+ + {this.props.intl.formatMessage(messages.filesUploaded, { + uploadedFiles: this.props.uploadedFiles, + })} +
+ {this.props.intl.formatMessage(messages.totalFilesToUpload, { + totalFiles: this.state.totalFiles, + })} +
+
({ request: state.content.subrequests?.[SUBREQUEST] || {}, + uploadedFiles: state.content.uploadedFiles, }), { createContent }, ), diff --git a/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx b/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx index 58d6897fc3..f963dfb1ff 100644 --- a/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx +++ b/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx @@ -16,6 +16,11 @@ const SidebarPopup = (props) => { onClose(); }; + const [isClient, setIsClient] = React.useState(false); + React.useEffect(() => { + setIsClient(true); + }, []); + React.useEffect(() => { document.addEventListener('mousedown', handleClickOutside, false); return () => { @@ -48,24 +53,25 @@ const SidebarPopup = (props) => { unmountOnExit > <> - {createPortal( - , - document.body, - )} + {isClient && + createPortal( + , + document.body, + )} diff --git a/packages/volto/src/components/manage/Sidebar/__snapshots__/SidebarPopup.test.jsx.snap b/packages/volto/src/components/manage/Sidebar/__snapshots__/SidebarPopup.test.jsx.snap index 8144871def..bae18f16ee 100644 --- a/packages/volto/src/components/manage/Sidebar/__snapshots__/SidebarPopup.test.jsx.snap +++ b/packages/volto/src/components/manage/Sidebar/__snapshots__/SidebarPopup.test.jsx.snap @@ -8,29 +8,7 @@ exports[`sidebar popup is not rendered when the block is not selected 1`] = ` timeout={500} unmountOnExit={true} > - - Object { - "$$typeof": Symbol(react.portal), - "children": , - "containerInfo": , - "implementation": null, - "key": null, - } - + `; @@ -43,29 +21,7 @@ exports[`sidebar popup is rendered when the block is selected 1`] = ` timeout={500} unmountOnExit={true} > - - Object { - "$$typeof": Symbol(react.portal), - "children": , - "containerInfo": , - "implementation": null, - "key": null, - } - + `; diff --git a/packages/volto/src/components/manage/Widgets/FileWidget.jsx b/packages/volto/src/components/manage/Widgets/FileWidget.jsx index 112ac04647..e21cde8c60 100644 --- a/packages/volto/src/components/manage/Widgets/FileWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/FileWidget.jsx @@ -178,6 +178,7 @@ const FileWidget = (props) => { )} {value && (