From 3e0c4e1036d6161f48bf0171389a89d32fa42115 Mon Sep 17 00:00:00 2001 From: victor Date: Fri, 27 Sep 2024 23:09:43 +0530 Subject: [PATCH 1/3] fix issue #5423, add the tus upload feature with a new ui for uploading the files using the tus-uploady react library --- .../volto/locales/ca/LC_MESSAGES/volto.po | 63 +- .../volto/locales/de/LC_MESSAGES/volto.po | 63 +- .../volto/locales/en/LC_MESSAGES/volto.po | 61 +- .../volto/locales/es/LC_MESSAGES/volto.po | 63 +- .../volto/locales/eu/LC_MESSAGES/volto.po | 63 +- .../volto/locales/fi/LC_MESSAGES/volto.po | 63 +- .../volto/locales/fr/LC_MESSAGES/volto.po | 63 +- .../volto/locales/hi/LC_MESSAGES/volto.po | 63 +- .../volto/locales/it/LC_MESSAGES/volto.po | 63 +- .../volto/locales/ja/LC_MESSAGES/volto.po | 63 +- .../volto/locales/nl/LC_MESSAGES/volto.po | 61 +- .../volto/locales/pt/LC_MESSAGES/volto.po | 61 +- .../volto/locales/pt_BR/LC_MESSAGES/volto.po | 63 +- .../volto/locales/ro/LC_MESSAGES/volto.po | 63 +- packages/volto/locales/volto.pot | 63 +- .../volto/locales/zh_CN/LC_MESSAGES/volto.po | 63 +- packages/volto/package.json | 8 +- packages/volto/patches/5423.feature | 1 + .../components/manage/Contents/Contents.jsx | 82 +- .../manage/Contents/ContentsUploadPage.jsx | 664 ++++++++++ .../__snapshots__/Contents.test.jsx.snap | 27 +- .../src/components/manage/Contents/index.tsx | 7 + .../theme/Breadcrumbs/Breadcrumbs.jsx | 4 + .../src/components/theme/Footer/Footer.jsx | 6 + .../src/components/theme/Header/Header.jsx | 4 + packages/volto/src/config/server.js | 2 + .../volto/src/express-middleware/upload.js | 108 ++ packages/volto/src/routes.js | 9 +- .../themes/pastanaga/extras/contents.less | 136 ++ pnpm-lock.yaml | 1103 +++++++++++++++-- 30 files changed, 2985 insertions(+), 178 deletions(-) create mode 100644 packages/volto/patches/5423.feature create mode 100644 packages/volto/src/components/manage/Contents/ContentsUploadPage.jsx create mode 100644 packages/volto/src/express-middleware/upload.js diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index 69687ab2b8..013c1d34f8 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -392,6 +392,11 @@ msgstr "" msgid "Apply working copy" msgstr "Aplicar la còpia de treball" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -431,6 +436,7 @@ msgstr "" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -494,6 +500,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "Navegui" @@ -526,6 +533,7 @@ msgstr "No es pot editar el disseny per al tipus de contingut {type}{type}{type} kann nicht verändert werden, da das #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -540,6 +548,11 @@ msgstr "Layout für {type} kann nicht verändert werden, da das msgid "Cancel" msgstr "Abbrechen" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -695,6 +708,11 @@ msgstr "Kommentare" msgid "Compare" msgstr "Vergleichen" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -962,6 +980,7 @@ msgstr "Standard" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1130,6 +1149,11 @@ msgstr "Seite" msgid "Download Event" msgstr "Termindetails herunterladen" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1882,8 +1906,8 @@ msgstr "Batch-Anzahl" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "Objekt wurde erfolgreich verschoben." +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1957,6 +1981,11 @@ msgstr "Letztes Kommentierdatum" msgid "Last modified" msgstr "Letzte Änderung" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2356,6 +2385,11 @@ msgstr "Alle Relationen sind OK." msgid "No connection to the server" msgstr "Keine Verbindung zum Server" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3452,6 +3486,11 @@ msgstr "Aufsplitten" msgid "Start Date" msgstr "Anfangsdatum" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3732,6 +3771,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "Konfigurationsproblem im Backend" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4060,11 +4104,26 @@ msgstr "Laden Sie ein Lead-Bild im Feld 'Lead-Bild' hoch." msgid "Upload files" msgstr "Dateien hochladen" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "Bild hochladen" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index a5b40a7988..6f8405eb51 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -386,6 +386,11 @@ msgstr "" msgid "Apply working copy" msgstr "" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -425,6 +430,7 @@ msgstr "" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -488,6 +494,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "" @@ -520,6 +527,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -535,6 +543,11 @@ msgstr "" msgid "Cancel" msgstr "" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -690,6 +703,11 @@ msgstr "" msgid "Compare" msgstr "" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -957,6 +975,7 @@ msgstr "" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1125,6 +1144,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1877,7 +1901,7 @@ msgstr "" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." +msgid "Item succesfully moved." msgstr "" #. Default: "Item(s) copied." @@ -1952,6 +1976,11 @@ msgstr "" msgid "Last modified" msgstr "" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2351,6 +2380,11 @@ msgstr "" msgid "No connection to the server" msgstr "" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3447,6 +3481,11 @@ msgstr "" msgid "Start Date" msgstr "" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3727,6 +3766,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4055,11 +4099,26 @@ msgstr "" msgid "Upload files" msgstr "" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index 6e284bfd75..a17497973e 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -393,6 +393,11 @@ msgstr "Aplicar a subcarpetas" msgid "Apply working copy" msgstr "Aplicar copia de trabajo" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -432,6 +437,7 @@ msgstr "Reglas de contenido disponibles:" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -495,6 +501,7 @@ msgstr "Relaciones rotas" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "Navegue" @@ -527,6 +534,7 @@ msgstr "No se puede editar la plantilla de {type} porque el sop #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -542,6 +550,11 @@ msgstr "No se puede editar la plantilla de {type} porque el sop msgid "Cancel" msgstr "Cancelar" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -697,6 +710,11 @@ msgstr "Comentarios" msgid "Compare" msgstr "Comparar" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -964,6 +982,7 @@ msgstr "Vista por defecto" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1132,6 +1151,11 @@ msgstr "Vista de documento" msgid "Download Event" msgstr "Descargar evento" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1884,8 +1908,8 @@ msgstr "Número de elementos" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "Elemento movido correctamente." +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1959,6 +1983,11 @@ msgstr "Fecha de último comentario" msgid "Last modified" msgstr "Última modificación" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2358,6 +2387,11 @@ msgstr "No se encontraron relaciones rotas." msgid "No connection to the server" msgstr "No hay conexión con el servidor" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3454,6 +3488,11 @@ msgstr "División" msgid "Start Date" msgstr "Fecha de inicio" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3734,6 +3773,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "Hay un error de configuración en el servidor" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4062,11 +4106,26 @@ msgstr "Cargar una imagen principal en el campo 'Imagen Principal'." msgid "Upload files" msgstr "Cargar archivos" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "Cargando imagen" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index b7c57b8ee1..f26fb9c241 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -393,6 +393,11 @@ msgstr "Azpikarpetei aplikatu" msgid "Apply working copy" msgstr "Aplikatu lan-bertsioa" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -432,6 +437,7 @@ msgstr "Erabilgarri dauden eduki-erregelak:" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -495,6 +501,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "Arakatu" @@ -527,6 +534,7 @@ msgstr "Ezin da {type} elementu-motaren itxura aldatu, #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -542,6 +550,11 @@ msgstr "Ezin da {type} elementu-motaren itxura aldatu, msgid "Cancel" msgstr "Utzi" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -697,6 +710,11 @@ msgstr "Erantzunak" msgid "Compare" msgstr "Alderatu" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -964,6 +982,7 @@ msgstr "Defektuzko bista" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1132,6 +1151,11 @@ msgstr "Dokumentuaren bista" msgid "Download Event" msgstr "Deskargatu hitzorduaren fitxategia" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1884,8 +1908,8 @@ msgstr "Elementu-multzoaren tamaina" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "Elementua ongi mugitu da." +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1959,6 +1983,11 @@ msgstr "Azken komentarioaren data" msgid "Last modified" msgstr "Azken aldaketa" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2358,6 +2387,11 @@ msgstr "" msgid "No connection to the server" msgstr "Ez dago konexiorik zerbitzariarekin" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3454,6 +3488,11 @@ msgstr "Banatu" msgid "Start Date" msgstr "Hasiera-data" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3734,6 +3773,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "Zerbitzariak konfigurazio arazo bat du" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4062,11 +4106,26 @@ msgstr "Kargatu irudia" msgid "Upload files" msgstr "Kargatu fitxategiak" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "Irudia kargatzen" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index 16a81a822c..185ac20a39 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -391,6 +391,11 @@ msgstr "Kohdista alikansioihin" msgid "Apply working copy" msgstr "Kohdista työkopio" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -430,6 +435,7 @@ msgstr "Saatavilla olevat sisältösäännöt:" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -493,6 +499,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "Selaa" @@ -525,6 +532,7 @@ msgstr "Sisältötyypin {type} asettelua ei voi muokata, koska #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -540,6 +548,11 @@ msgstr "Sisältötyypin {type} asettelua ei voi muokata, koska msgid "Cancel" msgstr "Peruuta" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -695,6 +708,11 @@ msgstr "Kommentit" msgid "Compare" msgstr "Vertaile" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -962,6 +980,7 @@ msgstr "Oletusnäkymä" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1130,6 +1149,11 @@ msgstr "Dokumenttinäkymä" msgid "Download Event" msgstr "Lataa tapahtuma" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1882,8 +1906,8 @@ msgstr "Sivun koko" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "Sisällön siirto onnistui." +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1957,6 +1981,11 @@ msgstr "Viimeisin kommentti" msgid "Last modified" msgstr "Muokattu viimeksi" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2356,6 +2385,11 @@ msgstr "" msgid "No connection to the server" msgstr "Ei yhteyttä palvelimeen" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3452,6 +3486,11 @@ msgstr "Halkaise" msgid "Start Date" msgstr "Aloituspäivä" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3732,6 +3771,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "Taustapalvelussa havaittiin konfiguraatio-ongelma" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4060,11 +4104,26 @@ msgstr "Tallenna nostokuva sisällön 'Nostokuva'-kentään" msgid "Upload files" msgstr "Lähetä palvelimelle tiedostoja" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "Kuvaa ladataan" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index b405214240..258107d024 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -393,6 +393,11 @@ msgstr "Appliquer aux sous-dossiers" msgid "Apply working copy" msgstr "Appliquer la copie de travail" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -432,6 +437,7 @@ msgstr "Règles de contenu disponibles :" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -495,6 +501,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "Explore" @@ -527,6 +534,7 @@ msgstr "Impossible de modifier la mise en page pour le type de contenu { #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -542,6 +550,11 @@ msgstr "Impossible de modifier la mise en page pour le type de contenu { msgid "Cancel" msgstr "Annuler" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -697,6 +710,11 @@ msgstr "Commentaires" msgid "Compare" msgstr "Comparer" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -964,6 +982,7 @@ msgstr "Vue par défaut" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1132,6 +1151,11 @@ msgstr "Vue document" msgid "Download Event" msgstr "Télécharger l'événement" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1884,8 +1908,8 @@ msgstr "Nombre d'éléments du lot" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "Élément déplacé avec succès." +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1959,6 +1983,11 @@ msgstr "Date du dernier commentaire" msgid "Last modified" msgstr "Dernier modifié" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2358,6 +2387,11 @@ msgstr "" msgid "No connection to the server" msgstr "Aucune connexion avec le serveur" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3454,6 +3488,11 @@ msgstr "Divisé" msgid "Start Date" msgstr "Date de début" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3734,6 +3773,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "Il y a un problème de configuration sur le backend" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4062,11 +4106,26 @@ msgstr "Téléchargez une image de garde dans le champ «Image de garde»." msgid "Upload files" msgstr "Télécharger des fichiers" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "Chargement de l'image" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/hi/LC_MESSAGES/volto.po b/packages/volto/locales/hi/LC_MESSAGES/volto.po index c21aa3608f..edbfb8fa81 100644 --- a/packages/volto/locales/hi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hi/LC_MESSAGES/volto.po @@ -386,6 +386,11 @@ msgstr "उपफ़ोल्डर्स पर लागू करें" msgid "Apply working copy" msgstr "काम की प्रतिलिपि लागू करें" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -425,6 +430,7 @@ msgstr "उपलब्ध कंटेंट नियम:" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -488,6 +494,7 @@ msgstr "टूटे संबंध" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "ब्राउज़ करें" @@ -520,6 +527,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -535,6 +543,11 @@ msgstr "" msgid "Cancel" msgstr "रद्द करें" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -690,6 +703,11 @@ msgstr "टिप्पणियाँ" msgid "Compare" msgstr "तुलना" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -957,6 +975,7 @@ msgstr "डिफ़ॉल्ट दृश्य" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1125,6 +1144,11 @@ msgstr "दस्तावेज़ दृश्य" msgid "Download Event" msgstr "आयोजन डाउनलोड करें" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1877,8 +1901,8 @@ msgstr "आइटम बैच का आकार" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "वस्तु सफलतापूर्वक हटा दी गई।" +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1952,6 +1976,11 @@ msgstr "अंतिम टिप्पणी की तारीख" msgid "Last modified" msgstr "अंतिम संशोधन" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2351,6 +2380,11 @@ msgstr "कोई टूटी हुई संबंध नहीं मिल msgid "No connection to the server" msgstr "सर्वर से कोई कनेक्शन नहीं है" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3447,6 +3481,11 @@ msgstr "विभाजित करें" msgid "Start Date" msgstr "प्रारंभ तिथि" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3727,6 +3766,11 @@ msgstr "कुछ त्रुटियाँ हैं।" msgid "There is a configuration problem on the backend" msgstr "पीछे की ओर कॉन्फ़िगरेशन में समस्या है" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4055,11 +4099,26 @@ msgstr "'लीड इमेज' कंटेंट फ़ील्ड में msgid "Upload files" msgstr "फ़ाइलें अपलोड करें" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "इमेज अपलोड हो रहा है" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index fbdee8436e..e160197312 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -386,6 +386,11 @@ msgstr "Applica a sottocartelle" msgid "Apply working copy" msgstr "Applica la copia di lavoro" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -425,6 +430,7 @@ msgstr "Regole di contenuto disponibili:" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -488,6 +494,7 @@ msgstr "Relazioni corrotte" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "Sfoglia" @@ -520,6 +527,7 @@ msgstr "Non è possibile modificare il Layout per il tipo {type}{type}ブロックが有効で、かつブロックが有効で、かつ{type}< #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -541,6 +549,11 @@ msgstr "Não é possível editar layout para o tipo de conteúdo {type}< msgid "Cancel" msgstr "Cancelar" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -696,6 +709,11 @@ msgstr "Comentários" msgid "Compare" msgstr "Comparar" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -963,6 +981,7 @@ msgstr "Visão padrão" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1131,6 +1150,11 @@ msgstr "Visão do Documento" msgid "Download Event" msgstr "Baixar evento" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1883,8 +1907,8 @@ msgstr "Tamanho do lote de itens" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "Item movido com sucesso." +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1958,6 +1982,11 @@ msgstr "Data do último comentário" msgid "Last modified" msgstr "Última modificação" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2357,6 +2386,11 @@ msgstr "Nenhum relacionamento rompido foi encontrado" msgid "No connection to the server" msgstr "Sem conexão ao servidor" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3453,6 +3487,11 @@ msgstr "Dividir" msgid "Start Date" msgstr "Data de Início" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3733,6 +3772,11 @@ msgstr "Existem alguns erros." msgid "There is a configuration problem on the backend" msgstr "Há um problema de configuração no backend" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4061,11 +4105,26 @@ msgstr "Enviar uma imagem para o campo de imagem principal." msgid "Upload files" msgstr "Enviar arquivos" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "Enviando imagem" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index 4ccc25cc34..fba5c828e3 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -386,6 +386,11 @@ msgstr "" msgid "Apply working copy" msgstr "Aplicați o copie de lucru" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -425,6 +430,7 @@ msgstr "" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -488,6 +494,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "Răsfoiește" @@ -520,6 +527,7 @@ msgstr "Nu se poate edita aspectul pentru tipul de conținut {type}{type}\n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -388,6 +388,11 @@ msgstr "" msgid "Apply working copy" msgstr "" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -427,6 +432,7 @@ msgstr "" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -490,6 +496,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "" @@ -522,6 +529,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -537,6 +545,11 @@ msgstr "" msgid "Cancel" msgstr "" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -692,6 +705,11 @@ msgstr "" msgid "Compare" msgstr "" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -959,6 +977,7 @@ msgstr "" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1127,6 +1146,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1879,7 +1903,7 @@ msgstr "" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." +msgid "Item succesfully moved." msgstr "" #. Default: "Item(s) copied." @@ -1954,6 +1978,11 @@ msgstr "" msgid "Last modified" msgstr "" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2353,6 +2382,11 @@ msgstr "" msgid "No connection to the server" msgstr "" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3449,6 +3483,11 @@ msgstr "" msgid "Start Date" msgstr "" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3729,6 +3768,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4057,11 +4101,26 @@ msgstr "" msgid "Upload files" msgstr "" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index cddef470f6..6c1d77b286 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -392,6 +392,11 @@ msgstr "应用于子文件夹" msgid "Apply working copy" msgstr "申请工作副本" +#. Default: "Are you sure you want to abort the remaining file uploads?" +#: components/manage/Contents/ContentsUploadPage +msgid "Are you sure you want to abort the remaining file uploads?" +msgstr "" + #. Default: "Are you sure you want to delete this field?" #: components/manage/Widgets/SchemaWidget msgid "Are you sure you want to delete this field?" @@ -431,6 +436,7 @@ msgstr "可用的内容规则" #. Default: "Back" #: components/manage/Aliases/Aliases #: components/manage/Contents/Contents +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/AddonsControlpanel #: components/manage/Controlpanels/Aliases #: components/manage/Controlpanels/ContentType @@ -494,6 +500,7 @@ msgstr "" #. Default: "Browse" #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Sidebar/ObjectBrowserNav msgid "Browse" msgstr "浏览" @@ -526,6 +533,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add #: components/manage/Contents/ContentsUploadModal +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout #: components/manage/Controlpanels/ContentTypeSchema @@ -541,6 +549,11 @@ msgstr "" msgid "Cancel" msgstr "取消" +#. Default: "Cancel uploads" +#: components/manage/Contents/ContentsUploadPage +msgid "Cancel uploads" +msgstr "" + #. Default: "Cell" #: config/Blocks msgid "Cell" @@ -696,6 +709,11 @@ msgstr "评论" msgid "Compare" msgstr "比较" +#. Default: "Complete" +#: components/manage/Contents/ContentsUploadPage +msgid "Complete" +msgstr "" + #. Default: "Condition changed" #: components/manage/Controlpanels/Rules/ConfigureRule msgid "Condition changed" @@ -963,6 +981,7 @@ msgstr "默认视图" #. Default: "Delete" #: components/manage/Contents/Contents #: components/manage/Contents/ContentsItem +#: components/manage/Contents/ContentsUploadPage #: components/manage/Controlpanels/ContentTypesActions #: components/manage/Controlpanels/Groups/RenderGroups #: components/manage/Controlpanels/ModerateComments @@ -1131,6 +1150,11 @@ msgstr "文档视图" msgid "Download Event" msgstr "下载事件" +#. Default: "Drag and Drop or" +#: components/manage/Contents/ContentsUploadPage +msgid "Drag and Drop or" +msgstr "" + #. Default: "Drag and drop files from your computer onto this area or click the “Browse” button." #: components/manage/Contents/ContentsUploadModal msgid "Drag and drop files from your computer onto this area or click the “Browse” button." @@ -1883,8 +1907,8 @@ msgstr "条目批量大小" #. Default: "Item successfully moved." #: components/manage/Contents/Contents -msgid "Item successfully moved." -msgstr "成功移除条目。" +msgid "Item succesfully moved." +msgstr "" #. Default: "Item(s) copied." #: components/manage/Contents/Contents @@ -1958,6 +1982,11 @@ msgstr "最后备注日期" msgid "Last modified" msgstr "最后修改日期" +#. Default: "Last modified:" +#: components/manage/Contents/ContentsUploadPage +msgid "Last modified:" +msgstr "" + #. Default: "Latest available configuration" #: components/manage/Controlpanels/UpgradeControlPanel msgid "Latest available configuration" @@ -2357,6 +2386,11 @@ msgstr "" msgid "No connection to the server" msgstr "与服务器无连接" +#. Default: "No files uploaded yet!" +#: components/manage/Contents/ContentsUploadPage +msgid "No files uploaded yet!" +msgstr "" + #. Default: "No image selected" #: components/manage/Blocks/Image/ImageSidebar msgid "No image selected" @@ -3453,6 +3487,11 @@ msgstr "" msgid "Start Date" msgstr "开始日期" +#. Default: "Start Upload" +#: components/manage/Contents/ContentsUploadPage +msgid "Start Upload" +msgstr "" + #. Default: "Start of the recurrence" #: components/manage/Widgets/RecurrenceWidget/Occurences msgid "Start of the recurrence" @@ -3733,6 +3772,11 @@ msgstr "" msgid "There is a configuration problem on the backend" msgstr "后端出现了一个配置问题" +#. Default: "There was an error" +#: components/manage/Contents/ContentsUploadPage +msgid "There was an error" +msgstr "" + #. Default: "There was an error with the upgrade." #: components/manage/Controlpanels/UpgradeControlPanel msgid "There was an error with the upgrade." @@ -4061,11 +4105,26 @@ msgstr "" msgid "Upload files" msgstr "上传文件" +#. Default: "Upload more files" +#: components/manage/Contents/ContentsUploadPage +msgid "Upload more files" +msgstr "" + +#. Default: "Uploaded" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploaded" +msgstr "" + #. Default: "Uploading image" #: components/manage/Widgets/ImageWidget msgid "Uploading image" msgstr "上传图像中" +#. Default: "Uploading to {uploadFolder}" +#: components/manage/Contents/ContentsUploadPage +msgid "Uploading to {uploadFolder}" +msgstr "" + #. Default: "Use the form below to define the new content rule" #: components/manage/Controlpanels/Rules/AddRule #: components/manage/Controlpanels/Rules/EditRule diff --git a/packages/volto/package.json b/packages/volto/package.json index 9b31c08fde..592cd29d01 100644 --- a/packages/volto/package.json +++ b/packages/volto/package.json @@ -182,6 +182,10 @@ "@plone/scripts": "workspace:*", "@plone/volto-slate": "workspace:*", "@redux-devtools/extension": "^3.3.0", + "@rpldy/tus-uploady": "^1.8.3", + "@rpldy/upload-drop-zone": "^1.8.3", + "@rpldy/uploady": "^1.8.3", + "body-parser": "^1.20.2", "classnames": "2.2.6", "connected-react-router": "6.8.0", "debug": "4.3.2", @@ -280,11 +284,11 @@ "@babel/plugin-syntax-export-namespace-from": "7.8.3", "@babel/runtime": "7.20.6", "@babel/types": "7.20.5", - "@fiverr/afterbuild-webpack-plugin": "^1.0.0", - "@jest/globals": "^29.7.0", "@dnd-kit/core": "6.0.8", "@dnd-kit/sortable": "7.0.2", "@dnd-kit/utilities": "3.2.2", + "@fiverr/afterbuild-webpack-plugin": "^1.0.0", + "@jest/globals": "^29.7.0", "@loadable/babel-plugin": "5.13.2", "@loadable/webpack-plugin": "5.15.2", "@plone/types": "workspace:*", diff --git a/packages/volto/patches/5423.feature b/packages/volto/patches/5423.feature new file mode 100644 index 0000000000..af244387fc --- /dev/null +++ b/packages/volto/patches/5423.feature @@ -0,0 +1 @@ +Add the tus upload feature with a new ui for uploading files using the tus-uploady react library. @victorchrollo14 diff --git a/packages/volto/src/components/manage/Contents/Contents.jsx b/packages/volto/src/components/manage/Contents/Contents.jsx index 58431e2dce..820ee2711d 100644 --- a/packages/volto/src/components/manage/Contents/Contents.jsx +++ b/packages/volto/src/components/manage/Contents/Contents.jsx @@ -64,7 +64,6 @@ import ContentsBreadcrumbs from '@plone/volto/components/manage/Contents/Content import ContentsIndexHeader from '@plone/volto/components/manage/Contents/ContentsIndexHeader'; import ContentsItem from '@plone/volto/components/manage/Contents/ContentsItem'; import { ContentsRenameModal } from '@plone/volto/components/manage/Contents'; -import ContentsUploadModal from '@plone/volto/components/manage/Contents/ContentsUploadModal'; import ContentsWorkflowModal from '@plone/volto/components/manage/Contents/ContentsWorkflowModal'; import ContentsTagsModal from '@plone/volto/components/manage/Contents/ContentsTagsModal'; import ContentsPropertiesModal from '@plone/volto/components/manage/Contents/ContentsPropertiesModal'; @@ -156,7 +155,7 @@ const messages = defineMessages({ defaultMessage: 'Item(s) has been updated.', }, messageReorder: { - id: 'Item successfully moved.', + id: 'Item succesfully moved.', defaultMessage: 'Item successfully moved.', }, messagePasted: { @@ -369,8 +368,6 @@ class Contents extends Component { this.onSelectNone = this.onSelectNone.bind(this); this.onDeleteOk = this.onDeleteOk.bind(this); this.onDeleteCancel = this.onDeleteCancel.bind(this); - this.onUploadOk = this.onUploadOk.bind(this); - this.onUploadCancel = this.onUploadCancel.bind(this); this.onRenameOk = this.onRenameOk.bind(this); this.onRenameCancel = this.onRenameCancel.bind(this); this.onTagsOk = this.onTagsOk.bind(this); @@ -391,7 +388,6 @@ class Contents extends Component { this.cut = this.cut.bind(this); this.copy = this.copy.bind(this); this.delete = this.delete.bind(this); - this.upload = this.upload.bind(this); this.rename = this.rename.bind(this); this.tags = this.tags.bind(this); this.properties = this.properties.bind(this); @@ -404,7 +400,6 @@ class Contents extends Component { this.state = { selected: [], showDelete: false, - showUpload: false, showRename: false, showTags: false, showProperties: false, @@ -874,29 +869,6 @@ class Contents extends Component { }); } - /** - * On upload ok - * @method onUploadOk - * @returns {undefined} - */ - onUploadOk() { - this.fetchContents(); - this.setState({ - showUpload: false, - }); - } - - /** - * On upload cancel - * @method onUploadCancel - * @returns {undefined} - */ - onUploadCancel() { - this.setState({ - showUpload: false, - }); - } - /** * On rename ok * @method onRenameOk @@ -1093,17 +1065,6 @@ class Contents extends Component { }); } - /** - * Upload handler - * @method upload - * @returns {undefined} - */ - upload() { - this.setState({ - showUpload: true, - }); - } - /** * Rename handler * @method rename @@ -1502,12 +1463,6 @@ class Contents extends Component { onConfirm={this.onDeleteOk} size="medium" /> - - find(this.state.items, { '@id': id }), - ).filter((item) => item)} /> {this.state.showWorkflow && ( - - + aria-label={this.props.intl.formatMessage( + messages.upload, + )} + > + + + } position="top center" content={this.props.intl.formatMessage( diff --git a/packages/volto/src/components/manage/Contents/ContentsUploadPage.jsx b/packages/volto/src/components/manage/Contents/ContentsUploadPage.jsx new file mode 100644 index 0000000000..6e842ac570 --- /dev/null +++ b/packages/volto/src/components/manage/Contents/ContentsUploadPage.jsx @@ -0,0 +1,664 @@ +import { + Button, + Container, + Header, + Item, + ItemContent, + ItemExtra, + ItemHeader, + ItemImage, + ItemMeta, + Modal, + Progress, +} from 'semantic-ui-react'; +import { Toolbar, Icon } from '@plone/volto/components'; + +import { useLocation, useHistory } from 'react-router-dom'; +import { useEffect, useRef, useState } from 'react'; +import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; +import { createPortal } from 'react-dom'; +import { deleteContent } from '@plone/volto/actions'; +import { useDispatch } from 'react-redux'; + +import TusUploady from '@rpldy/tus-uploady'; +import { + useRequestPreSend, + useBatchAddListener, + useUploady, + useItemAbortListener, + useItemProgressListener, + useItemStartListener, + useItemFinishListener, + useItemErrorListener, + useAbortAll, +} from '@rpldy/uploady'; + +import UploadDropZone from '@rpldy/upload-drop-zone'; + +import exclamationSVG from '@plone/volto/icons/exclamation.svg'; +import readySVG from '@plone/volto/icons/ready.svg'; +import uploadSVG from '@plone/volto/icons/upload.svg'; +import backSVG from '@plone/volto/icons/back.svg'; +import clearSVG from '@plone/volto/icons/clear.svg'; +import deleteSVG from '@plone/volto/icons/delete.svg'; +import fileSVG from '@plone/volto/icons/file.svg'; +import { map, isEmpty } from 'lodash'; + +const messages = defineMessages({ + back: { + id: 'Back', + defaultMessage: 'Back', + }, + cancel: { + id: 'Cancel', + defaultMessage: 'Cancel', + }, + delete: { + id: 'Delete', + defaultMessage: 'Delete', + }, + browse: { + id: 'Browse', + defaultMessage: 'Browse', + }, + uploaded: { + id: 'Uploaded', + defaultMessage: 'Uploaded', + }, + lastModified: { + id: 'Last modified:', + defaultMessage: 'Last modified:', + }, + complete: { + id: 'Complete', + defaultMessage: 'Complete', + }, + errorMessage: { + id: 'There was an error', + defaultMessage: 'There was an error', + }, + dragAndDrop: { + id: 'Drag and Drop or', + defaultMessage: 'Drag and Drop or', + }, + noUploads: { + id: 'No files uploaded yet!', + defaultMessage: 'No files uploaded yet!', + }, + uploadContext: { + id: 'Uploading to {uploadFolder}', + defaultMessage: 'Uploading to {uploadFolder}', + }, + uploadMore: { + id: 'Upload more files', + defaultMessage: 'Upload more files', + }, + startUpload: { + id: 'Start Upload', + defaultMessage: 'Start Upload', + }, + abortMessage: { + id: 'Are you sure you want to abort the remaining file uploads?', + defaultMessage: + 'Are you sure you want to abort the remaining file uploads?', + }, +}); + +function ContentsUploadPage() { + const intl = useIntl(); + const location = useLocation(); + const history = useHistory(); + const dispatch = useDispatch(); + + const pathname = location.pathname; + const uploadFolder = + pathname === '/uploads' ? 'Home' : pathname.split('/').reverse()[1]; + + const pendingUploads = useRef(0); + const uploadPropsRef = useRef(); + + const [open, setOpen] = useState(false); + const [isClient, setIsClient] = useState(false); + const [uploadItems, setUploadItems] = useState({}); + + const Uploader = TusUploady; + + /** + * A friendly format to view data size + * @method friendlyFormat + * @param {number} bytes - the nummber of bytes + * @returns {string} + */ + const friendlyFormat = (bytes) => { + if (bytes < 1024) return `${bytes} B`; + const kiloBytes = bytes / 1024; + if (kiloBytes < 1024) return `${kiloBytes.toFixed(2)} KB`; + const megaBytes = kiloBytes / 1024; + if (megaBytes < 1024) return `${megaBytes.toFixed(2)} MB`; + const gigaBytes = megaBytes / 1024; + if (gigaBytes < 1024) return `${gigaBytes.toFixed(2)}GB`; + }; + + /** + * Format data to a readable manner + * @method formatDate + * @param {string} dateValue - the value of date + * @returns {string} + */ + const formatDate = (dateValue) => { + const date = new Date(dateValue); + + const day = date.getDate(); + const month = date.toLocaleDateString('default', { month: 'short' }); + const year = date.getFullYear(); + + return `${day} ${month}, ${year}`; + }; + + /** + * calculate upload speed and time left + * @method getSpeednTime + * @param {string} startTime - start time of the upload of a file (milliseconds) + * @param {number} loaded - the number of bytes loaded in a file + * @param {number} total - the total nunber of bytes in a file + * @returns {{uploadSpeed: number, timeLeft: number}} + */ + const getSpeednTime = (startTime, loaded, total) => { + const currentTime = Date.now(); + const elapsedTime = (currentTime - startTime) / 1000; // convert ms to seconds + const uploadSpeed = loaded / elapsedTime; // bytes per second + + if (uploadSpeed === 0) { + return { uploadSpeed, timeLeft: 0 }; + } + + const remainingBytes = total - loaded; + const timeLeft = Math.round(remainingBytes / uploadSpeed); // seconds + return { uploadSpeed, timeLeft }; + }; + + /** + * Truncate file name handler + * @method truncateFile + * @param {string} + * @returns {string} + */ + const truncateFile = (filename) => { + const file = filename.split('.'); + return file[0].slice(0, 20) + '.' + file[file.length - 1]; + }; + + /** + * formatting timeleft to seconds, minutes and hours. + * @method formatTimeLeft + * @param {number} timeLeft - time left before upload is complete (in seconds) + * @returns {string} + */ + const formatTimeLeft = (timeLeft) => { + if (timeLeft < 60) return `${Math.round(timeLeft)}s`; + + const timeInMins = Math.round(timeLeft / 60); + const secondsLeft = Math.floor(timeLeft % 60); + + if (Number(timeInMins) < 60) return `${timeInMins}min ${secondsLeft}s`; + + const timeInhour = Math.round(timeLeft / 3600); + const minLeft = Math.floor((timeLeft % 3600) / 60); + return `${timeInhour}hr ${minLeft}min`; + }; + + const handleCancel = () => { + if (pendingUploads.current === 0) { + history.push(pathname.replace('uploads', 'contents')); + return; + } + setOpen(true); + }; + + const addItems = (batch) => { + const UploadData = batch.items.reduce((acc, item) => { + const previewUrl = URL.createObjectURL(item.file); + acc[item.id] = { + ...item, + preview: previewUrl, + uploadSpeed: 0, + timeLeft: 0, + startTime: null, + }; + return acc; + }, {}); + + pendingUploads.current = pendingUploads.current + batch.items.length; + setUploadItems((prevState) => { + return { ...prevState, ...UploadData }; + }); + }; + + const updateItems = (item, action) => { + switch (action) { + case 'start': + setUploadItems((prevState) => { + return { + ...prevState, + [item.id]: { ...prevState[item.id], startTime: Date.now() }, + }; + }); + break; + + case 'progress': + setUploadItems((prevState) => { + const progItem = prevState[item.id]; + + const { uploadSpeed, timeLeft } = getSpeednTime( + progItem.startTime, + progItem.loaded, + progItem.file.size, + ); + + return { + ...prevState, + [item.id]: { + ...prevState[item.id], + loaded: item.loaded, + state: item.state, + completed: item.completed, + uploadSpeed: uploadSpeed, + timeLeft: timeLeft, + }, + }; + }); + break; + + case 'finish': + pendingUploads.current = pendingUploads.current - 1; + setUploadItems((prevState) => { + return { + ...prevState, + [item.id]: { + ...prevState[item.id], + state: item.state, + uploadResponse: item.uploadResponse, + }, + }; + }); + break; + + case 'error': + setUploadItems((prevState) => { + return { + ...prevState, + [item.id]: { ...prevState[item.id], state: item.state }, + }; + }); + break; + + case 'abort': + pendingUploads.current = pendingUploads.current - 1; + setUploadItems((prevState) => { + const newData = { ...prevState }; + delete newData[item.id]; + return newData; + }); + break; + + default: + break; + } + }; + + const StartUploadButton = () => { + const { processPending } = useUploady(); + + return ( + + ); + }; + + const DropZoneArea = () => { + const uploady = useUploady(); + + useRequestPreSend(({ items, options }) => { + let ctype = 'File'; + if (items[0]['file']['type'].startsWith('image')) { + ctype = 'Image'; + } + if (items[0]['file']['type'].startsWith('video')) { + ctype = 'Video'; + } + + return { + options: { + params: { + filename: items[0]['file']['name'], + 'Content-type': items[0]['file']['type'], + '@type': ctype, + }, + }, + }; + }); + + useBatchAddListener((batch) => { + addItems(batch); + }); + + useItemStartListener((item) => { + updateItems(item, 'start'); + }); + + useItemProgressListener((item) => { + updateItems(item, 'progress'); + }); + + useItemErrorListener((item) => { + updateItems(item, 'error'); + }); + + useItemFinishListener((item) => { + updateItems(item, 'finish'); + }); + + useItemAbortListener((item) => { + updateItems(item, 'abort'); + }); + + const onUpload = () => { + uploady.showFileUpload({ autoUpload: false }); + }; + + return ( + +
+

{intl.formatMessage(messages.uploadMore)}

+

+ {intl.formatMessage(messages.dragAndDrop)} + {' '} + {' '} +

+
+
+ ); + }; + + const DeleteButton = ({ item }) => { + const handleDelete = () => { + const results = item.uploadResponse['results']; + const url = results[results.length - 1].headers.location; + + dispatch(deleteContent(url)); + setUploadItems((prevState) => { + const newData = { ...prevState }; + delete newData[item.id]; + return newData; + }); + }; + + return ( + + ); + }; + + const RemoveButton = ({ id }) => { + const { abort } = useUploady(); + + const removeFile = () => { + abort(id); + }; + + return ( + + ); + }; + + const ItemProgress = ({ item }) => { + const { state, uploadSpeed, loaded, file, timeLeft, completed } = item; + + return ( +
+ {state === 'pending' && ( + <> + + {friendlyFormat(uploadSpeed)}/s - {friendlyFormat(loaded)} of{' '} + {friendlyFormat(file.size)} , waiting... + + + + )} + {state === 'uploading' && ( + <> + + {friendlyFormat(uploadSpeed)}/s - {friendlyFormat(loaded)} of{' '} + {friendlyFormat(file.size)}, {formatTimeLeft(timeLeft)} left + + + + )} + {state === 'finished' && ( + <> + + + + {intl.formatMessage(messages.uploaded)} + {' '} + + {friendlyFormat(file.size)} + + + {/* */} + + )} + {state === 'error' && ( + <> + + +
{intl.formatMessage(messages.errorMessage)}
+
+ + + )} +
+ ); + }; + + const AbortButton = () => { + const abortAll = useAbortAll(); + + const onAbort = () => { + abortAll(); + history.push(pathname.replace('uploads', 'contents')); + }; + + return ( + + ); + }; + + useEffect(() => { + const token = document.cookie.replace( + /(?:(?:^|.*;\s*)auth_token\s*=\s*([^;]*).*$)|^.*$/, + '$1', + ); + + let uploadURL = `/++api++/${uploadFolder}/@tus-upload`; + if (uploadFolder === 'Home') { + uploadURL = '/++api++/@tus-upload'; + } + + const uploadProps = { + destination: { + url: uploadURL, + headers: { + Authorization: `Bearer ${token}`, + accept: 'application/json', + }, + }, + chunkSize: 52428800, // 50MB + sendDataOnCreate: true, + sendWithFormData: true, + withCredentials: true, + }; + + uploadPropsRef.current = uploadProps; + setIsClient(true); + }, [uploadFolder]); + + return ( + + <> + {isClient && ( + +
+
+

+ {intl.formatMessage(messages.uploadContext, { uploadFolder })} +

+
+ {isEmpty(uploadItems) && ( +
+

+ {intl.formatMessage(messages.noUploads)} +

+
+ )} +
+ {map(uploadItems, (item, index) => ( + + {item.file.type.split('/')[0] === 'image' ? ( + + ) : ( +
+ +
+ )} + + +
+ {truncateFile(item.file.name)} + + + {intl.formatMessage(messages.lastModified)}{' '} + {formatDate(item.file.lastModified)} + + +
+ +
+ + {item.state === 'finished' ? ( + + ) : ( + + )}{' '} + +
+ ))} +
+ + +
+ +
+ +

{intl.formatMessage(messages.abortMessage)}

+
+ + + + +
+
+ {createPortal( + + + + + } + />, + document.getElementById('toolbar'), + )} +
+ )} + +
+ ); +} + +export default ContentsUploadPage; diff --git a/packages/volto/src/components/manage/Contents/__snapshots__/Contents.test.jsx.snap b/packages/volto/src/components/manage/Contents/__snapshots__/Contents.test.jsx.snap index 2c6dd5c65f..43fd36d417 100644 --- a/packages/volto/src/components/manage/Contents/__snapshots__/Contents.test.jsx.snap +++ b/packages/volto/src/components/manage/Contents/__snapshots__/Contents.test.jsx.snap @@ -29,9 +29,6 @@ exports[`Contents renders a folder contents view component 1`] = `
-
@@ -44,17 +41,21 @@ exports[`Contents renders a folder contents view component 1`] = `