diff --git a/packages/asc-web-common/api/files/index.js b/packages/asc-web-common/api/files/index.js index 8c151ce09a9..14ac5b471ca 100644 --- a/packages/asc-web-common/api/files/index.js +++ b/packages/asc-web-common/api/files/index.js @@ -550,8 +550,8 @@ export function getNewFiles(folderId) { }); } -export function convertFile(fileId, sync = false) { - const data = { sync }; +export function convertFile(fileId, password = null, sync = false) { + const data = { password, sync }; return request({ method: "put", @@ -800,7 +800,13 @@ export function checkFillFormDraft(fileId) { }); } -export function fileCopyAs(fileId, destTitle, destFolderId, enableExternalExt) { +export function fileCopyAs( + fileId, + destTitle, + destFolderId, + enableExternalExt, + password +) { return request({ method: "post", url: `files/file/${fileId}/copyas`, @@ -808,6 +814,7 @@ export function fileCopyAs(fileId, destTitle, destFolderId, enableExternalExt) { destTitle, destFolderId, enableExternalExt, + password, }, }); } diff --git a/packages/asc-web-components/input-block/index.js b/packages/asc-web-components/input-block/index.js index c80561eabb2..ccb701767d1 100644 --- a/packages/asc-web-components/input-block/index.js +++ b/packages/asc-web-components/input-block/index.js @@ -57,6 +57,7 @@ class InputBlock extends React.Component { onIconClick, iconSize, theme, + forwardedRef, } = this.props; if (typeof iconSize == "number" && iconSize > 0) { @@ -118,6 +119,7 @@ class InputBlock extends React.Component { withBorder={false} mask={mask} keepCharPositions={keepCharPositions} + forwardedRef={forwardedRef} /> { //iconNames.includes(iconName) && ( diff --git a/packages/asc-web-components/input-block/styled-input-block.js b/packages/asc-web-components/input-block/styled-input-block.js index f22bb9629d6..a7a2974b9cb 100644 --- a/packages/asc-web-components/input-block/styled-input-block.js +++ b/packages/asc-web-components/input-block/styled-input-block.js @@ -47,8 +47,12 @@ const StyledInputGroup = styled(CustomInputGroup)` margin: ${(props) => props.theme.inputBlock.margin}; } - ${commonInputStyle} :focus-within { - border-color: ${(props) => props.theme.inputBlock.borderColor}; + ${commonInputStyle} + + :focus-within { + border-color: ${(props) => + (props.hasError && props.theme.input.focusErrorBorderColor) || + props.theme.inputBlock.borderColor}; } `; StyledInputGroup.defaultProps = { theme: Base }; diff --git a/products/ASC.Files/Client/public/locales/bg/Translations.json b/products/ASC.Files/Client/public/locales/bg/Translations.json index f54b70266c8..80e884a482f 100644 --- a/products/ASC.Files/Client/public/locales/bg/Translations.json +++ b/products/ASC.Files/Client/public/locales/bg/Translations.json @@ -1,49 +1,50 @@ { - "AddAccount": "Добави профил", - "ArchivingData": "Архивиране на данни", - "ConnectingAccount": "Свързване на профил", - "Copy": "Копирай", - "CopyOperation": "Копиране", - "DeleteFromTrash": "Избраните елементи бяха успешно изтрити от Кошчето", - "DeleteOperation": "Изтриване", - "DeleteSelectedElem": "Избраните елементи бяха успешно изтрити", - "DeleteThirdParty": "Изтрий трето лице", - "DownloadApps": "Изтегли приложенията", - "DownloadAs": "Изтегли като", - "EncryptedFileSaving": "Запазване на криптиран файл", - "Files": "Файлове", - "Folders": "Папки", - "FolderSelection": "Избор на папка", - "FolderTitleBoxNet": "Box директория", - "FolderTitleDocuSign": "DocuSign профил", - "FolderTitleDropBox": "Dropbox директория", - "FolderTitleGoogle": "Google директория", - "FolderTitlekDrive": "kDrive директория", - "FolderTitleSharePoint": "SharePoint директория", - "FolderTitleSkyDrive": "OneDrive директория", - "FolderTitleWebDav": "WebDAV директория", - "FolderTitleYandex": "Yandex директория", - "LinkCopySuccess": "Връзката беше копирана в клипборда", - "MediaLoadError": "Медийният файл не може да бъде зареден", - "Move": "Премести", - "MoveToOperation": "Преместване", - "OwnerChange": "Смени собственик", - "Presentations": "Презентации", - "Restore": "Възстанови", - "Spreadsheets": "Таблици", - "ThirdPartyInfo": "Смени информацията от трето лице", - "TypeTitleBoxNet": "Box", - "TypeTitleDocuSign": "DocuSign", - "TypeTitleDropBox": "Dropbox", - "TypeTitleGoogle": "Google Drive", - "TypeTitlekDrive": "kDrive", - "TypeTitleSharePoint": "SharePoint", - "TypeTitleSkyDrive": "OneDrive", - "TypeTitleWebDav": "WebDAV", - "TypeTitleYandex": "Yandex.Disk", - "NewForm": "Шаблон на формуляр", - "NewFormFile": "Шаблон от файл", - "CreateMasterFormFromFile": "Създай шаблон на формуляр от файл", - "SubNewForm": "Празен", - "SubNewFormFile": "От текстов файл" -} \ No newline at end of file + "AddAccount": "Добави профил", + "ArchivingData": "Архивиране на данни", + "ConnectingAccount": "Свързване на профил", + "Copy": "Копирай", + "CopyOperation": "Копиране", + "DeleteFromTrash": "Избраните елементи бяха успешно изтрити от Кошчето", + "DeleteOperation": "Изтриване", + "DeleteSelectedElem": "Избраните елементи бяха успешно изтрити", + "DeleteThirdParty": "Изтрий трето лице", + "DownloadApps": "Изтегли приложенията", + "DownloadAs": "Изтегли като", + "EncryptedFileSaving": "Запазване на криптиран файл", + "Files": "Файлове", + "FileProtected": "Файлът е защитен с парола", + "Folders": "Папки", + "FolderSelection": "Избор на папка", + "FolderTitleBoxNet": "Box директория", + "FolderTitleDocuSign": "DocuSign профил", + "FolderTitleDropBox": "Dropbox директория", + "FolderTitleGoogle": "Google директория", + "FolderTitlekDrive": "kDrive директория", + "FolderTitleSharePoint": "SharePoint директория", + "FolderTitleSkyDrive": "OneDrive директория", + "FolderTitleWebDav": "WebDAV директория", + "FolderTitleYandex": "Yandex директория", + "LinkCopySuccess": "Връзката беше копирана в клипборда", + "MediaLoadError": "Медийният файл не може да бъде зареден", + "Move": "Премести", + "MoveToOperation": "Преместване", + "OwnerChange": "Смени собственик", + "Presentations": "Презентации", + "Restore": "Възстанови", + "Spreadsheets": "Таблици", + "ThirdPartyInfo": "Смени информацията от трето лице", + "TypeTitleBoxNet": "Box", + "TypeTitleDocuSign": "DocuSign", + "TypeTitleDropBox": "Dropbox", + "TypeTitleGoogle": "Google Drive", + "TypeTitlekDrive": "kDrive", + "TypeTitleSharePoint": "SharePoint", + "TypeTitleSkyDrive": "OneDrive", + "TypeTitleWebDav": "WebDAV", + "TypeTitleYandex": "Yandex.Disk", + "NewForm": "Шаблон на формуляр", + "NewFormFile": "Шаблон от файл", + "CreateMasterFormFromFile": "Създай шаблон на формуляр от файл", + "SubNewForm": "Празен", + "SubNewFormFile": "От текстов файл" +} diff --git a/products/ASC.Files/Client/public/locales/de/Translations.json b/products/ASC.Files/Client/public/locales/de/Translations.json index c5544d38101..58d6dddaa20 100644 --- a/products/ASC.Files/Client/public/locales/de/Translations.json +++ b/products/ASC.Files/Client/public/locales/de/Translations.json @@ -1,49 +1,50 @@ { - "AddAccount": "Konto hinzufügen", - "ArchivingData": "Archivieren der Daten", - "ConnectingAccount": "Konto wird verbunden", - "Copy": "Kopieren", - "CopyOperation": "Kopieren", - "DeleteFromTrash": "Die ausgewählten Elemente wurden aus dem Papierkorb gelöscht", - "DeleteOperation": "Löschen", - "DeleteSelectedElem": "Die ausgewählten Elemente wurden gelöscht", - "DeleteThirdParty": "Drittanbieterdienst deaktivieren", - "DownloadApps": "Apps herunterladen", - "DownloadAs": "Herunterladen als", - "EncryptedFileSaving": "Die verschlüsselte Datei wird gespeichert", - "Files": "Dateien", - "Folders": "Ordner", - "FolderSelection": "Ordnerauswahl", - "FolderTitleBoxNet": "Box-Verzeichnis", - "FolderTitleDocuSign": "DocuSign Konto", - "FolderTitleDropBox": "Dropbox-Verzeichnis", - "FolderTitleGoogle": "Google-Verzeichnis", - "FolderTitlekDrive": "kDrive Verzeichnis", - "FolderTitleSharePoint": "SharePoint-Verzeichnis", - "FolderTitleSkyDrive": "OneDrive-Verzeichnis", - "FolderTitleWebDav": "WebDAV Verzeichnis", - "FolderTitleYandex": "Yandex Verzeichnis", - "LinkCopySuccess": "Der Link wurde in die Zwischenablage kopiert", - "MediaLoadError": "Die Mediendatei konnte nicht geladen werden", - "Move": "Verschieben", - "MoveToOperation": "Wird verschoben", - "OwnerChange": "Besitzer ändern", - "Presentations": "Präsentationen", - "Restore": "Wiederherstellen", - "Spreadsheets": "Tabellenkalkulationen", - "ThirdPartyInfo": "Ändern Sie die Drittanbieterinformationen", - "TypeTitleBoxNet": "Box", - "TypeTitleDocuSign": "DocuSign", - "TypeTitleDropBox": "Dropbox", - "TypeTitleGoogle": "Google Drive", - "TypeTitlekDrive": "kDrive", - "TypeTitleSharePoint": "SharePoint", - "TypeTitleSkyDrive": "OneDrive", - "TypeTitleWebDav": "WebDAV", - "TypeTitleYandex": "Yandex.Disk", - "NewForm": "Formularvorlage", - "NewFormFile": "Formular aus Textdatei", - "CreateMasterFormFromFile": "Formularvorlage aus Datei erstellen", - "SubNewForm": "Leer", - "SubNewFormFile": "Aus Textdatei" + "AddAccount": "Konto hinzufügen", + "ArchivingData": "Archivieren der Daten", + "ConnectingAccount": "Konto wird verbunden", + "Copy": "Kopieren", + "CopyOperation": "Kopieren", + "DeleteFromTrash": "Die ausgewählten Elemente wurden aus dem Papierkorb gelöscht", + "DeleteOperation": "Löschen", + "DeleteSelectedElem": "Die ausgewählten Elemente wurden gelöscht", + "DeleteThirdParty": "Drittanbieterdienst deaktivieren", + "DownloadApps": "Apps herunterladen", + "DownloadAs": "Herunterladen als", + "EncryptedFileSaving": "Die verschlüsselte Datei wird gespeichert", + "Files": "Dateien", + "FileProtected": "Diese Datei ist kennwortgeschützt", + "Folders": "Ordner", + "FolderSelection": "Ordnerauswahl", + "FolderTitleBoxNet": "Box-Verzeichnis", + "FolderTitleDocuSign": "DocuSign Konto", + "FolderTitleDropBox": "Dropbox-Verzeichnis", + "FolderTitleGoogle": "Google-Verzeichnis", + "FolderTitlekDrive": "kDrive Verzeichnis", + "FolderTitleSharePoint": "SharePoint-Verzeichnis", + "FolderTitleSkyDrive": "OneDrive-Verzeichnis", + "FolderTitleWebDav": "WebDAV Verzeichnis", + "FolderTitleYandex": "Yandex Verzeichnis", + "LinkCopySuccess": "Der Link wurde in die Zwischenablage kopiert", + "MediaLoadError": "Die Mediendatei konnte nicht geladen werden", + "Move": "Verschieben", + "MoveToOperation": "Wird verschoben", + "OwnerChange": "Besitzer ändern", + "Presentations": "Präsentationen", + "Restore": "Wiederherstellen", + "Spreadsheets": "Tabellenkalkulationen", + "ThirdPartyInfo": "Ändern Sie die Drittanbieterinformationen", + "TypeTitleBoxNet": "Box", + "TypeTitleDocuSign": "DocuSign", + "TypeTitleDropBox": "Dropbox", + "TypeTitleGoogle": "Google Drive", + "TypeTitlekDrive": "kDrive", + "TypeTitleSharePoint": "SharePoint", + "TypeTitleSkyDrive": "OneDrive", + "TypeTitleWebDav": "WebDAV", + "TypeTitleYandex": "Yandex.Disk", + "NewForm": "Formularvorlage", + "NewFormFile": "Formular aus Textdatei", + "CreateMasterFormFromFile": "Formularvorlage aus Datei erstellen", + "SubNewForm": "Leer", + "SubNewFormFile": "Aus Textdatei" } diff --git a/products/ASC.Files/Client/public/locales/en/ConvertPasswordDialog.json b/products/ASC.Files/Client/public/locales/en/ConvertPasswordDialog.json new file mode 100644 index 00000000000..a80445329c0 --- /dev/null +++ b/products/ASC.Files/Client/public/locales/en/ConvertPasswordDialog.json @@ -0,0 +1,6 @@ +{ + "SuccessfullyCreated": "File '{{fileTitle}}' created", + "ConversionPasswordFormCaption": "Enter a password to save the template", + "ConversionPasswordMasterFormCaption": "Enter a password to save as oform", + "CreationError": "File creation error. The wrong password was entered" +} diff --git a/products/ASC.Files/Client/public/locales/en/Translations.json b/products/ASC.Files/Client/public/locales/en/Translations.json index bb5c3fc3f08..7295344a3d4 100644 --- a/products/ASC.Files/Client/public/locales/en/Translations.json +++ b/products/ASC.Files/Client/public/locales/en/Translations.json @@ -12,6 +12,7 @@ "DownloadAs": "Download as", "EncryptedFileSaving": "Saving encrypted file", "Files": "Files", + "FileProtected": "The file is password protected", "Folders": "Folders", "FolderSelection": "Folder selection", "FolderTitleBoxNet": "Box directory", diff --git a/products/ASC.Files/Client/public/locales/en/UploadPanel.json b/products/ASC.Files/Client/public/locales/en/UploadPanel.json index 3964cfa04ba..e77de8357da 100644 --- a/products/ASC.Files/Client/public/locales/en/UploadPanel.json +++ b/products/ASC.Files/Client/public/locales/en/UploadPanel.json @@ -1,3 +1,8 @@ { - "Uploads": "Uploads" -} \ No newline at end of file + "Uploads": "Uploads", + "EnterPassword": "Enter password", + "HideInput": "Hide", + "Ready": "Done", + "UploadAndConvert": "Upload and convert files", + "Conversion": "Convert files" +} diff --git a/products/ASC.Files/Client/public/locales/fr/Translations.json b/products/ASC.Files/Client/public/locales/fr/Translations.json index d0b69235499..8f6c732f62f 100644 --- a/products/ASC.Files/Client/public/locales/fr/Translations.json +++ b/products/ASC.Files/Client/public/locales/fr/Translations.json @@ -1,49 +1,50 @@ { - "AddAccount": "Ajouter un compte", - "ArchivingData": "Archivage des données", - "ConnectingAccount": "Connecter un compte", - "Copy": "Copier", - "CopyOperation": "copier", - "DeleteFromTrash": "Les éléments sélectionnés ont été supprimés avec succès de la corbeille", - "DeleteOperation": "Suppression", - "DeleteSelectedElem": "Les éléments sélectionnés ont été supprimés avec succès", - "DeleteThirdParty": "Supprimer un tiers", - "DownloadApps": "Download applications", - "DownloadAs": "Télécharger comme", - "EncryptedFileSaving": "Enregistrement du fichier chiffré", - "Files": "Fichiers", - "Folders": "Dossiers", - "FolderSelection": "Folder selection", - "FolderTitleBoxNet": "Répertoire de Box", - "FolderTitleDocuSign": "Сompte DocuSign", - "FolderTitleDropBox": "Répertoire de Dropbox", - "FolderTitleGoogle": "Répertoire de Google", - "FolderTitlekDrive": "Répertoire kDrive", - "FolderTitleSharePoint": "Répertoire de SharePoint", - "FolderTitleSkyDrive": "Répertoire de OneDrive", - "FolderTitleWebDav": "Répertoire WebDAV", - "FolderTitleYandex": "WebDAV Yandex", - "LinkCopySuccess": "Le lien a été copié dans le Presse-papiers", - "MediaLoadError": "Media file could not be loaded", - "Move": "Déplacer", - "MoveToOperation": "Déplacement", - "OwnerChange": "Changer le propriétaire", - "Presentations": "Présentations", - "Restore": "Restaurer", - "Spreadsheets": "Feuilles de calcul", - "ThirdPartyInfo": "Modifier les informations sur les tiers", - "TypeTitleBoxNet": "Box", - "TypeTitleDocuSign": "DocuSign", - "TypeTitleDropBox": "Dropbox", - "TypeTitleGoogle": "Google Drive", - "TypeTitlekDrive": "kDrive", - "TypeTitleSharePoint": "SharePoint", - "TypeTitleSkyDrive": "OneDrive", - "TypeTitleWebDav": "WebDAV", - "TypeTitleYandex": "Yandex.Disk", - "NewForm": "Modèle de formulaire", - "NewFormFile": "Formulaire à partir d'un fichier texte", - "CreateMasterFormFromFile": "Créer un modèle de formulaire à partir d'un fichier", - "SubNewForm": "Blanc", - "SubNewFormFile": "Depuis un fichier texte" + "AddAccount": "Ajouter un compte", + "ArchivingData": "Archivage des données", + "ConnectingAccount": "Connecter un compte", + "Copy": "Copier", + "CopyOperation": "copier", + "DeleteFromTrash": "Les éléments sélectionnés ont été supprimés avec succès de la corbeille", + "DeleteOperation": "Suppression", + "DeleteSelectedElem": "Les éléments sélectionnés ont été supprimés avec succès", + "DeleteThirdParty": "Supprimer un tiers", + "DownloadApps": "Download applications", + "DownloadAs": "Télécharger comme", + "EncryptedFileSaving": "Enregistrement du fichier chiffré", + "Files": "Fichiers", + "FileProtected": "Le fichier est protégé par un mot de passe", + "Folders": "Dossiers", + "FolderSelection": "Folder selection", + "FolderTitleBoxNet": "Répertoire de Box", + "FolderTitleDocuSign": "Сompte DocuSign", + "FolderTitleDropBox": "Répertoire de Dropbox", + "FolderTitleGoogle": "Répertoire de Google", + "FolderTitlekDrive": "Répertoire kDrive", + "FolderTitleSharePoint": "Répertoire de SharePoint", + "FolderTitleSkyDrive": "Répertoire de OneDrive", + "FolderTitleWebDav": "Répertoire WebDAV", + "FolderTitleYandex": "WebDAV Yandex", + "LinkCopySuccess": "Le lien a été copié dans le Presse-papiers", + "MediaLoadError": "Media file could not be loaded", + "Move": "Déplacer", + "MoveToOperation": "Déplacement", + "OwnerChange": "Changer le propriétaire", + "Presentations": "Présentations", + "Restore": "Restaurer", + "Spreadsheets": "Feuilles de calcul", + "ThirdPartyInfo": "Modifier les informations sur les tiers", + "TypeTitleBoxNet": "Box", + "TypeTitleDocuSign": "DocuSign", + "TypeTitleDropBox": "Dropbox", + "TypeTitleGoogle": "Google Drive", + "TypeTitlekDrive": "kDrive", + "TypeTitleSharePoint": "SharePoint", + "TypeTitleSkyDrive": "OneDrive", + "TypeTitleWebDav": "WebDAV", + "TypeTitleYandex": "Yandex.Disk", + "NewForm": "Modèle de formulaire", + "NewFormFile": "Formulaire à partir d'un fichier texte", + "CreateMasterFormFromFile": "Créer un modèle de formulaire à partir d'un fichier", + "SubNewForm": "Blanc", + "SubNewFormFile": "Depuis un fichier texte" } diff --git a/products/ASC.Files/Client/public/locales/it/Translations.json b/products/ASC.Files/Client/public/locales/it/Translations.json index 188e2ef0183..bf6d20b415c 100644 --- a/products/ASC.Files/Client/public/locales/it/Translations.json +++ b/products/ASC.Files/Client/public/locales/it/Translations.json @@ -1,49 +1,50 @@ { - "AddAccount": "Aggiungere account", - "ArchivingData": "Archiviazione dei dati", - "ConnectingAccount": "Collegamento dell'account", - "Copy": "Copiare", - "CopyOperation": "Sta copiando", - "DeleteFromTrash": "Gli elementi selezionati sono stati eliminati dal Cestino con successo", - "DeleteOperation": "Sta eliminando", - "DeleteSelectedElem": "Gli elementi selezionati sono stati eliminati con successo", - "DeleteThirdParty": "Eliminare terze parti", - "DownloadApps": "Scaricare applicazioni", - "DownloadAs": "Scaricare come", - "EncryptedFileSaving": "Salvataggio di file criptato", - "Files": "File", - "Folders": "Cartelle", - "FolderSelection": "Selezione cartella", - "FolderTitleBoxNet": "Cartella di Box", - "FolderTitleDocuSign": "Account DocuSign", - "FolderTitleDropBox": "Cartella di Dropbox", - "FolderTitleGoogle": "Cartella di Google", - "FolderTitlekDrive": "directory kDrive", - "FolderTitleSharePoint": "Cartella di SharePoint", - "FolderTitleSkyDrive": "Cartella di OneDrive", - "FolderTitleWebDav": "Cartella di WebDAV", - "FolderTitleYandex": "Cartella di Yandex", - "LinkCopySuccess": "Il link è stato copiato negli appunti", - "MediaLoadError": "È impossibile caricare il file multimediale", - "Move": "Spostare", - "MoveToOperation": "Sta spostando", - "OwnerChange": "Cambiare proprietario", - "Presentations": "Presentazioni", - "Restore": "Ripristinare", - "Spreadsheets": "Fogli di calcolo", - "ThirdPartyInfo": "Cambiare le informazioni di terze parti", - "TypeTitleBoxNet": "Box", - "TypeTitleDocuSign": "Docusign", - "TypeTitleDropBox": "Dropbox", - "TypeTitleGoogle": "Google Drive", - "TypeTitlekDrive": "kDrive", - "TypeTitleSharePoint": "SharePoint", - "TypeTitleSkyDrive": "OneDrive", - "TypeTitleWebDav": "WebDAV", - "TypeTitleYandex": "Yandex.Disk", - "NewForm": "Modello di modulo", - "NewFormFile": "Formulario desde archivo de texto", - "CreateMasterFormFromFile": "Crear plantilla de formulario desde archivo", - "SubNewForm": "En blanco", - "SubNewFormFile": "Desde archivo de texto" + "AddAccount": "Aggiungere account", + "ArchivingData": "Archiviazione dei dati", + "ConnectingAccount": "Collegamento dell'account", + "Copy": "Copiare", + "CopyOperation": "Sta copiando", + "DeleteFromTrash": "Gli elementi selezionati sono stati eliminati dal Cestino con successo", + "DeleteOperation": "Sta eliminando", + "DeleteSelectedElem": "Gli elementi selezionati sono stati eliminati con successo", + "DeleteThirdParty": "Eliminare terze parti", + "DownloadApps": "Scaricare applicazioni", + "DownloadAs": "Scaricare come", + "EncryptedFileSaving": "Salvataggio di file criptato", + "Files": "File", + "FileProtected": "Il file è protetto con password", + "Folders": "Cartelle", + "FolderSelection": "Selezione cartella", + "FolderTitleBoxNet": "Cartella di Box", + "FolderTitleDocuSign": "Account DocuSign", + "FolderTitleDropBox": "Cartella di Dropbox", + "FolderTitleGoogle": "Cartella di Google", + "FolderTitlekDrive": "directory kDrive", + "FolderTitleSharePoint": "Cartella di SharePoint", + "FolderTitleSkyDrive": "Cartella di OneDrive", + "FolderTitleWebDav": "Cartella di WebDAV", + "FolderTitleYandex": "Cartella di Yandex", + "LinkCopySuccess": "Il link è stato copiato negli appunti", + "MediaLoadError": "È impossibile caricare il file multimediale", + "Move": "Spostare", + "MoveToOperation": "Sta spostando", + "OwnerChange": "Cambiare proprietario", + "Presentations": "Presentazioni", + "Restore": "Ripristinare", + "Spreadsheets": "Fogli di calcolo", + "ThirdPartyInfo": "Cambiare le informazioni di terze parti", + "TypeTitleBoxNet": "Box", + "TypeTitleDocuSign": "Docusign", + "TypeTitleDropBox": "Dropbox", + "TypeTitleGoogle": "Google Drive", + "TypeTitlekDrive": "kDrive", + "TypeTitleSharePoint": "SharePoint", + "TypeTitleSkyDrive": "OneDrive", + "TypeTitleWebDav": "WebDAV", + "TypeTitleYandex": "Yandex.Disk", + "NewForm": "Modello di modulo", + "NewFormFile": "Formulario desde archivo de texto", + "CreateMasterFormFromFile": "Crear plantilla de formulario desde archivo", + "SubNewForm": "En blanco", + "SubNewFormFile": "Desde archivo de texto" } diff --git a/products/ASC.Files/Client/public/locales/nl/Translations.json b/products/ASC.Files/Client/public/locales/nl/Translations.json index 5ecac0d1e44..0e1ffa37fae 100644 --- a/products/ASC.Files/Client/public/locales/nl/Translations.json +++ b/products/ASC.Files/Client/public/locales/nl/Translations.json @@ -1,49 +1,50 @@ { - "AddAccount": "Account toevoegen", - "ArchivingData": "Gegevens archiveren", - "ConnectingAccount": "Account koppelen", - "Copy": "Kopieer", - "CopyOperation": "Kopiëren", - "DeleteFromTrash": "Geselecteerde elementen werden met succes uit de Prullenmand verwijderd", - "DeleteOperation": "Verwijderen", - "DeleteSelectedElem": "Geselecteerde elementen werden met succes verwijderd", - "DeleteThirdParty": "Verwijder derde partij", - "DownloadApps": "Download toepassingen", - "DownloadAs": "Download als", - "EncryptedFileSaving": "Versleuteld bestand opslaan", - "Files": "Bestanden", - "Folders": "Mappen", - "FolderSelection": "Map selectie", - "FolderTitleBoxNet": "Box directory", - "FolderTitleDocuSign": "DocuSign account", - "FolderTitleDropBox": "Dropbox directory", - "FolderTitleGoogle": "Google directory", - "FolderTitlekDrive": "kDrive directory", - "FolderTitleSharePoint": "SharePoint directory", - "FolderTitleSkyDrive": "OneDrive directory", - "FolderTitleWebDav": "WebDAV Directory", - "FolderTitleYandex": "Yandex Directory", - "LinkCopySuccess": "Link is gekopieerd naar het klembord", - "MediaLoadError": "Mediabestand kon niet worden geladen", - "Move": "Verplaats", - "MoveToOperation": "Verplaatsen", - "OwnerChange": "Wijzig eigenaar", - "Presentations": "Presentaties", - "Restore": "Herstel", - "Spreadsheets": "Spreadsheets", - "ThirdPartyInfo": "Wijzig de info van derden", - "TypeTitleBoxNet": "Box", - "TypeTitleDocuSign": "DocuSign", - "TypeTitleDropBox": "Dropbox", - "TypeTitleGoogle": "Google Drive", - "TypeTitlekDrive": "kDrive", - "TypeTitleSharePoint": "SharePoint", - "TypeTitleSkyDrive": "OneDrive", - "TypeTitleWebDav": "WebDAV", - "TypeTitleYandex": "Yandex.Disk", - "NewForm": "Formulier sjabloon", - "NewFormFile": "Formulier van еekstbestand", - "CreateMasterFormFromFile": "Maak Formulier sjabloon van bestand", - "SubNewForm": "Blanco", - "SubNewFormFile": "Vanuit een tekstbestand" -} \ No newline at end of file + "AddAccount": "Account toevoegen", + "ArchivingData": "Gegevens archiveren", + "ConnectingAccount": "Account koppelen", + "Copy": "Kopieer", + "CopyOperation": "Kopiëren", + "DeleteFromTrash": "Geselecteerde elementen werden met succes uit de Prullenmand verwijderd", + "DeleteOperation": "Verwijderen", + "DeleteSelectedElem": "Geselecteerde elementen werden met succes verwijderd", + "DeleteThirdParty": "Verwijder derde partij", + "DownloadApps": "Download toepassingen", + "DownloadAs": "Download als", + "EncryptedFileSaving": "Versleuteld bestand opslaan", + "Files": "Bestanden", + "FileProtected": "Het bestand is beschermd met een wachtwoord", + "Folders": "Mappen", + "FolderSelection": "Map selectie", + "FolderTitleBoxNet": "Box directory", + "FolderTitleDocuSign": "DocuSign account", + "FolderTitleDropBox": "Dropbox directory", + "FolderTitleGoogle": "Google directory", + "FolderTitlekDrive": "kDrive directory", + "FolderTitleSharePoint": "SharePoint directory", + "FolderTitleSkyDrive": "OneDrive directory", + "FolderTitleWebDav": "WebDAV Directory", + "FolderTitleYandex": "Yandex Directory", + "LinkCopySuccess": "Link is gekopieerd naar het klembord", + "MediaLoadError": "Mediabestand kon niet worden geladen", + "Move": "Verplaats", + "MoveToOperation": "Verplaatsen", + "OwnerChange": "Wijzig eigenaar", + "Presentations": "Presentaties", + "Restore": "Herstel", + "Spreadsheets": "Spreadsheets", + "ThirdPartyInfo": "Wijzig de info van derden", + "TypeTitleBoxNet": "Box", + "TypeTitleDocuSign": "DocuSign", + "TypeTitleDropBox": "Dropbox", + "TypeTitleGoogle": "Google Drive", + "TypeTitlekDrive": "kDrive", + "TypeTitleSharePoint": "SharePoint", + "TypeTitleSkyDrive": "OneDrive", + "TypeTitleWebDav": "WebDAV", + "TypeTitleYandex": "Yandex.Disk", + "NewForm": "Formulier sjabloon", + "NewFormFile": "Formulier van еekstbestand", + "CreateMasterFormFromFile": "Maak Formulier sjabloon van bestand", + "SubNewForm": "Blanco", + "SubNewFormFile": "Vanuit een tekstbestand" +} diff --git a/products/ASC.Files/Client/public/locales/pt-BR/Translations.json b/products/ASC.Files/Client/public/locales/pt-BR/Translations.json index 70882b7355b..9402ffcdf38 100644 --- a/products/ASC.Files/Client/public/locales/pt-BR/Translations.json +++ b/products/ASC.Files/Client/public/locales/pt-BR/Translations.json @@ -1,49 +1,50 @@ { - "AddAccount": "Adicionar conta", - "ArchivingData": "Arquivando dados", - "ConnectingAccount": "Conectando conta", - "Copy": "Copiar", - "CopyOperation": "Copiando", - "DeleteFromTrash": "Os elementos selecionados foram excluídos com sucesso do Lixo", - "DeleteOperation": "Excluindo", - "DeleteSelectedElem": "Os elementos selecionados foram eliminados com sucesso", - "DeleteThirdParty": "Excluir terceiros", - "DownloadApps": "Baixar aplicativos", - "DownloadAs": "Baixar como", - "EncryptedFileSaving": "Salvando arquivo criptografado", - "Files": "Arquivos", - "Folders": "Pastas", - "FolderSelection": "Seleção de pasta", - "FolderTitleBoxNet": "Diretório da box", - "FolderTitleDocuSign": "Conta do DocuSign", - "FolderTitleDropBox": "Diretório da Dropbox", - "FolderTitleGoogle": "Diretório do Google", - "FolderTitlekDrive": "Diretório do kDrive", - "FolderTitleSharePoint": "Diretório do SharePoint", - "FolderTitleSkyDrive": "Diretório OneDrive", - "FolderTitleWebDav": "Diretório WebDAV", - "FolderTitleYandex": "Diretório Yandex", - "LinkCopySuccess": "Link foi copiado para a área de trabalho", - "MediaLoadError": "Não foi possível carregar o arquivo de mídia", - "Move": "Mover", - "MoveToOperation": "Movendo", - "OwnerChange": "Alterar proprietário", - "Presentations": "Apresentações ", - "Restore": "Restaurar", - "Spreadsheets": "Planilhas", - "ThirdPartyInfo": "Alterar as informações de terceiros", - "TypeTitleBoxNet": "Box", - "TypeTitleDocuSign": "DocuSign", - "TypeTitleDropBox": "Dropbox", - "TypeTitleGoogle": "Google Drive", - "TypeTitlekDrive": "kDrive", - "TypeTitleSharePoint": "SharePoint", - "TypeTitleSkyDrive": "OneDrive", - "TypeTitleWebDav": "WebDAV", - "TypeTitleYandex": "Yandex.Disk", - "NewForm": "Modelo de formulário", - "NewFormFile": "Formulário do arquivo", - "CreateMasterFormFromFile": "Criar modelo de formulário do arquivo", - "SubNewForm": "Branco", - "SubNewFormFile": "De um arquivo de texto" + "AddAccount": "Adicionar conta", + "ArchivingData": "Arquivando dados", + "ConnectingAccount": "Conectando conta", + "Copy": "Copiar", + "CopyOperation": "Copiando", + "DeleteFromTrash": "Os elementos selecionados foram excluídos com sucesso do Lixo", + "DeleteOperation": "Excluindo", + "DeleteSelectedElem": "Os elementos selecionados foram eliminados com sucesso", + "DeleteThirdParty": "Excluir terceiros", + "DownloadApps": "Baixar aplicativos", + "DownloadAs": "Baixar como", + "EncryptedFileSaving": "Salvando arquivo criptografado", + "Files": "Arquivos", + "FileProtected": "O arquivo está protegido com senha", + "Folders": "Pastas", + "FolderSelection": "Seleção de pasta", + "FolderTitleBoxNet": "Diretório da box", + "FolderTitleDocuSign": "Conta do DocuSign", + "FolderTitleDropBox": "Diretório da Dropbox", + "FolderTitleGoogle": "Diretório do Google", + "FolderTitlekDrive": "Diretório do kDrive", + "FolderTitleSharePoint": "Diretório do SharePoint", + "FolderTitleSkyDrive": "Diretório OneDrive", + "FolderTitleWebDav": "Diretório WebDAV", + "FolderTitleYandex": "Diretório Yandex", + "LinkCopySuccess": "Link foi copiado para a área de trabalho", + "MediaLoadError": "Não foi possível carregar o arquivo de mídia", + "Move": "Mover", + "MoveToOperation": "Movendo", + "OwnerChange": "Alterar proprietário", + "Presentations": "Apresentações ", + "Restore": "Restaurar", + "Spreadsheets": "Planilhas", + "ThirdPartyInfo": "Alterar as informações de terceiros", + "TypeTitleBoxNet": "Box", + "TypeTitleDocuSign": "DocuSign", + "TypeTitleDropBox": "Dropbox", + "TypeTitleGoogle": "Google Drive", + "TypeTitlekDrive": "kDrive", + "TypeTitleSharePoint": "SharePoint", + "TypeTitleSkyDrive": "OneDrive", + "TypeTitleWebDav": "WebDAV", + "TypeTitleYandex": "Yandex.Disk", + "NewForm": "Modelo de formulário", + "NewFormFile": "Formulário do arquivo", + "CreateMasterFormFromFile": "Criar modelo de formulário do arquivo", + "SubNewForm": "Branco", + "SubNewFormFile": "De um arquivo de texto" } diff --git a/products/ASC.Files/Client/public/locales/ru/ConvertPasswordDialog.json b/products/ASC.Files/Client/public/locales/ru/ConvertPasswordDialog.json new file mode 100644 index 00000000000..4297b53f006 --- /dev/null +++ b/products/ASC.Files/Client/public/locales/ru/ConvertPasswordDialog.json @@ -0,0 +1,6 @@ +{ + "SuccessfullyCreated": "Файл '{{fileTitle}}' создан", + "ConversionPasswordFormCaption": "Введите пароль, чтобы сохранить шаблон формы", + "ConversionPasswordMasterFormCaption": "Введите пароль, чтобы сохранить как oform", + "CreationError": "Ошибка создания. Введен не верный пароль" +} diff --git a/products/ASC.Files/Client/public/locales/ru/Translations.json b/products/ASC.Files/Client/public/locales/ru/Translations.json index e4629b3a3f9..8e363f29810 100644 --- a/products/ASC.Files/Client/public/locales/ru/Translations.json +++ b/products/ASC.Files/Client/public/locales/ru/Translations.json @@ -1,49 +1,50 @@ { - "AddAccount": "Подключить", - "ArchivingData": "Архивирование данных", - "ConnectingAccount": "Подключение аккаунта", - "Copy": "Копировать", - "CopyOperation": "Копирование", - "DeleteFromTrash": "Выбранные элементы успешно удалены из корзины", - "DeleteOperation": "Удаление", - "DeleteSelectedElem": "Выбранные элементы успешно удалены", - "DeleteThirdParty": "Отключить сторонний ресурс", - "DownloadApps": "Скачать приложения", - "DownloadAs": "Скачать как", - "EncryptedFileSaving": "Сохранение зашифрованного файла", - "Files": "Файлы", - "Folders": "Папки", - "FolderSelection": "Выбор папки", - "FolderTitleBoxNet": "Каталог Box", - "FolderTitleDocuSign": "Аккаунт DocuSign", - "FolderTitleDropBox": "Каталог Dropbox", - "FolderTitleGoogle": "Каталог Google", - "FolderTitlekDrive": "Каталог kDrive", - "FolderTitleSharePoint": "Каталог SharePoint", - "FolderTitleSkyDrive": "Каталог OneDrive", - "FolderTitleWebDav": "Каталог WebDAV", - "FolderTitleYandex": "Каталог Яндекса", - "LinkCopySuccess": "Ссылка скопирована в буфер обмена", - "MediaLoadError": "Медиа файл не может быть загружен", - "Move": "Переместить", - "MoveToOperation": "Перемещение", - "OwnerChange": "Сменить владельца", - "Presentations": "Презентации", - "Restore": "Восстановить", - "Spreadsheets": "Таблицы", - "ThirdPartyInfo": "Изменить настройки подключения", - "TypeTitleBoxNet": "Box", - "TypeTitleDocuSign": "DocuSign", - "TypeTitleDropBox": "Dropbox", - "TypeTitleGoogle": "Google Drive", - "TypeTitlekDrive": "kDrive", - "TypeTitleSharePoint": "SharePoint", - "TypeTitleSkyDrive": "OneDrive", - "TypeTitleWebDav": "WebDAV", - "TypeTitleYandex": "Яндекс.Диск", - "NewForm": "Шаблон формы", - "NewFormFile": "Форма из текстового файла", - "CreateMasterFormFromFile": "Создать шаблон формы из файла", - "SubNewForm": "Пустая", - "SubNewFormFile": " Из текстового файла" + "AddAccount": "Подключить", + "ArchivingData": "Архивирование данных", + "ConnectingAccount": "Подключение аккаунта", + "Copy": "Копировать", + "CopyOperation": "Копирование", + "DeleteFromTrash": "Выбранные элементы успешно удалены из корзины", + "DeleteOperation": "Удаление", + "DeleteSelectedElem": "Выбранные элементы успешно удалены", + "DeleteThirdParty": "Отключить сторонний ресурс", + "DownloadApps": "Скачать приложения", + "DownloadAs": "Скачать как", + "EncryptedFileSaving": "Сохранение зашифрованного файла", + "Files": "Файлы", + "FileProtected": "Файл защищен с помощью пароля", + "Folders": "Папки", + "FolderSelection": "Выбор папки", + "FolderTitleBoxNet": "Каталог Box", + "FolderTitleDocuSign": "Аккаунт DocuSign", + "FolderTitleDropBox": "Каталог Dropbox", + "FolderTitleGoogle": "Каталог Google", + "FolderTitlekDrive": "Каталог kDrive", + "FolderTitleSharePoint": "Каталог SharePoint", + "FolderTitleSkyDrive": "Каталог OneDrive", + "FolderTitleWebDav": "Каталог WebDAV", + "FolderTitleYandex": "Каталог Яндекса", + "LinkCopySuccess": "Ссылка скопирована в буфер обмена", + "MediaLoadError": "Медиа файл не может быть загружен", + "Move": "Переместить", + "MoveToOperation": "Перемещение", + "OwnerChange": "Сменить владельца", + "Presentations": "Презентации", + "Restore": "Восстановить", + "Spreadsheets": "Таблицы", + "ThirdPartyInfo": "Изменить настройки подключения", + "TypeTitleBoxNet": "Box", + "TypeTitleDocuSign": "DocuSign", + "TypeTitleDropBox": "Dropbox", + "TypeTitleGoogle": "Google Drive", + "TypeTitlekDrive": "kDrive", + "TypeTitleSharePoint": "SharePoint", + "TypeTitleSkyDrive": "OneDrive", + "TypeTitleWebDav": "WebDAV", + "TypeTitleYandex": "Яндекс.Диск", + "NewForm": "Шаблон формы", + "NewFormFile": "Форма из текстового файла", + "CreateMasterFormFromFile": "Создать шаблон формы из файла", + "SubNewForm": "Пустая", + "SubNewFormFile": " Из текстового файла" } diff --git a/products/ASC.Files/Client/public/locales/ru/UploadPanel.json b/products/ASC.Files/Client/public/locales/ru/UploadPanel.json index dc66ca0ba97..9ec68813244 100644 --- a/products/ASC.Files/Client/public/locales/ru/UploadPanel.json +++ b/products/ASC.Files/Client/public/locales/ru/UploadPanel.json @@ -1,3 +1,8 @@ { - "Uploads": "Загрузки" -} \ No newline at end of file + "Uploads": "Загрузки", + "EnterPassword": "Ввести пароль", + "HideInput": "Скрыть ввод", + "Ready": "Готово", + "UploadAndConvert": "Загрузки и конвертация", + "Conversion": "Конвертация" +} diff --git a/products/ASC.Files/Client/src/HOCs/withContent.js b/products/ASC.Files/Client/src/HOCs/withContent.js index 7d53076504b..0a0ebe96ae4 100644 --- a/products/ASC.Files/Client/src/HOCs/withContent.js +++ b/products/ASC.Files/Client/src/HOCs/withContent.js @@ -16,6 +16,7 @@ import EditingWrapperComponent from "../components/EditingWrapperComponent"; import { getTitleWithoutExst } from "../helpers/files-helpers"; import { getDefaultFileName } from "../helpers/utils"; import ItemIcon from "../components/ItemIcon"; + export default function withContent(WrappedContent) { class WithContent extends React.Component { constructor(props) { @@ -35,11 +36,19 @@ export default function withContent(WrappedContent) { } componentDidUpdate(prevProps) { - const { fileActionId, fileActionExt } = this.props; + const { + fileActionId, + fileActionExt, + setIsUpdatingRowItem, + isUpdatingRowItem, + } = this.props; if (fileActionId === -1 && fileActionExt !== prevProps.fileActionExt) { const itemTitle = getDefaultFileName(fileActionExt); this.setState({ itemTitle }); } + if (fileActionId === null && prevProps.fileActionId !== fileActionId) { + isUpdatingRowItem && setIsUpdatingRowItem(false); + } } completeAction = (id) => { @@ -60,22 +69,33 @@ export default function withContent(WrappedContent) { setIsLoading, fileActionId, editCompleteAction, + addActiveItems, + clearActiveOperations, } = this.props; const { itemTitle } = this.state; const originalTitle = getTitleWithoutExst(item); setIsLoading(true); + let timerId; + const isSameTitle = originalTitle.trim() === itemTitle.trim() || itemTitle.trim() === ""; + + const isFile = item.fileExst || item.contentLength; + if (isSameTitle) { this.setState({ itemTitle: originalTitle, }); return editCompleteAction(fileActionId, item, isSameTitle); + } else { + timerId = setTimeout(() => { + isFile ? addActiveItems([item.id]) : addActiveItems(null, [item.id]); + }, 500); } - item.fileExst || item.contentLength + isFile ? updateFile(fileActionId, itemTitle) .then(() => this.completeAction(fileActionId)) .then(() => @@ -87,7 +107,13 @@ export default function withContent(WrappedContent) { ) ) .catch((err) => toastr.error(err)) - .finally(() => setIsLoading(false)) + .finally(() => { + clearTimeout(timerId); + timerId = null; + clearActiveOperations([item.id]); + + setIsLoading(false); + }) : renameFolder(fileActionId, itemTitle) .then(() => this.completeAction(fileActionId)) .then(() => @@ -99,7 +125,13 @@ export default function withContent(WrappedContent) { ) ) .catch((err) => toastr.error(err)) - .finally(() => setIsLoading(false)); + .finally(() => { + clearTimeout(timerId); + timerId = null; + clearActiveOperations(null, [item.id]); + + setIsLoading(false); + }); }; cancelUpdateItem = (e) => { @@ -114,10 +146,23 @@ export default function withContent(WrappedContent) { }; onClickUpdateItem = (e, open = true) => { - const { fileActionType } = this.props; - fileActionType === FileAction.Create - ? this.createItem(e, open) - : this.updateItem(e); + const { + fileActionType, + setIsUpdatingRowItem, + addActiveItems, + item, + } = this.props; + + setIsUpdatingRowItem(true); + + if (fileActionType === FileAction.Create) { + !item.fileExst && !item.contentLength + ? addActiveItems(null, [item.id]) + : addActiveItems([item.id]); + this.createItem(e, open); + } else { + this.updateItem(e); + } }; createItem = (e, open) => { @@ -134,9 +179,17 @@ export default function withContent(WrappedContent) { setEncryptionAccess, setIsLoading, t, + setConvertPasswordDialogVisible, + setFormCreationInfo, + setIsUpdatingRowItem, + clearActiveOperations, + addActiveItems, + fileCopyAs, } = this.props; const { itemTitle } = this.state; + const isMakeFormFromFile = fileActionTemplateId ? true : false; + let title = itemTitle; if (isLoading) return; @@ -145,6 +198,8 @@ export default function withContent(WrappedContent) { const itemId = e.currentTarget.dataset.itemid; + let createdFileId, createdFolderId; + if (itemTitle.trim() === "") { title = fileActionTemplateId === null @@ -168,19 +223,78 @@ export default function withContent(WrappedContent) { ) : null; - !item.fileExst && !item.contentLength - ? createFolder(item.parentId, title) + if (!item.fileExst && !item.contentLength) { + createFolder(item.parentId, title) + .then((folder) => { + createdFolderId = folder.id; + addActiveItems(null, [folder.id]); + }) + .then(() => this.completeAction(itemId)) + .catch((e) => toastr.error(e)) + .finally(() => { + const folderIds = [+itemId]; + createdFolderId && folderIds.push(createdFolderId); + + clearActiveOperations(null, folderIds); + + return setIsLoading(false); + }); + } else { + if (isMakeFormFromFile) { + fileCopyAs( + fileActionTemplateId, + `${title}.${item.fileExst}`, + item.parentId + ) + .then((file) => { + createdFileId = file.id; + addActiveItems([file.id]); + + open && openDocEditor(file.id, file.providerKey, tab); + }) .then(() => this.completeAction(itemId)) - .catch((e) => toastr.error(e)) + .catch((err) => { + console.log("err", err); + const isPasswordError = new RegExp(/\(password\)*$/); + + if (isPasswordError.test(err)) { + toastr.error( + t("Translations:FileProtected"), + t("Common:Warning") + ); + setIsUpdatingRowItem(false); + + setFormCreationInfo({ + newTitle: `${title}.${item.fileExst}`, + fromExst: ".docx", + toExst: item.fileExst, + open, + actionId: itemId, + fileInfo: { + id: fileActionTemplateId, + folderId: item.parentId, + fileExst: item.fileExst, + }, + }); + setConvertPasswordDialogVisible(true); + + open && openDocEditor(null, null, tab); + } + }) .finally(() => { + const fileIds = [+itemId]; + createdFileId && fileIds.push(createdFileId); + + clearActiveOperations(fileIds); + return setIsLoading(false); - }) - : createFile( - item.parentId, - `${title}.${item.fileExst}`, - fileActionTemplateId - ) + }); + } else { + createFile(item.parentId, `${title}.${item.fileExst}`) .then((file) => { + createdFileId = file.id; + addActiveItems([file.id]); + if (isPrivacy) { return setEncryptionAccess(file).then((encryptedFile) => { if (!encryptedFile) return Promise.resolve(); @@ -200,8 +314,15 @@ export default function withContent(WrappedContent) { .then(() => this.completeAction(itemId)) .catch((e) => toastr.error(e)) .finally(() => { + const fileIds = [+itemId]; + createdFileId && fileIds.push(createdFileId); + + clearActiveOperations(fileIds); + return setIsLoading(false); }); + } + } }; renameTitle = (e) => { @@ -259,6 +380,8 @@ export default function withContent(WrappedContent) { t, viewAs, viewer, + isUpdatingRowItem, + passwordEntryProcess, } = this.props; const { access, @@ -316,6 +439,8 @@ export default function withContent(WrappedContent) { renameTitle={this.renameTitle} onClickUpdateItem={this.onClickUpdateItem} cancelUpdateItem={this.cancelUpdateItem} + isUpdatingRowItem={isUpdatingRowItem} + passwordEntryProcess={passwordEntryProcess} /> ) : ( { + ( + { + filesActionsStore, + filesStore, + treeFoldersStore, + auth, + dialogsStore, + uploadDataStore, + }, + {} + ) => { const { editCompleteAction } = filesActionsStore; const { createFile, @@ -347,7 +482,12 @@ export default function withContent(WrappedContent) { setIsLoading, updateFile, viewAs, + setIsUpdatingRowItem, + isUpdatingRowItem, + passwordEntryProcess, + addActiveItems, } = filesStore; + const { clearActiveOperations, fileCopyAs } = uploadDataStore; const { isRecycleBinFolder, isPrivacyFolder } = treeFoldersStore; const { @@ -363,6 +503,12 @@ export default function withContent(WrappedContent) { isDesktopClient, } = auth.settingsStore; + const { + setConvertPasswordDialogVisible, + setConvertItem, + setFormCreationInfo, + } = dialogsStore; + return { createFile, createFolder, @@ -386,6 +532,15 @@ export default function withContent(WrappedContent) { updateFile, viewAs, viewer: auth.userStore.user, + setConvertPasswordDialogVisible, + setConvertItem, + setFormCreationInfo, + setIsUpdatingRowItem, + isUpdatingRowItem, + passwordEntryProcess, + addActiveItems, + clearActiveOperations, + fileCopyAs, }; } )(observer(WithContent)); diff --git a/products/ASC.Files/Client/src/HOCs/withContextOptions.js b/products/ASC.Files/Client/src/HOCs/withContextOptions.js index 77c6aac94f9..cee2b551f03 100644 --- a/products/ASC.Files/Client/src/HOCs/withContextOptions.js +++ b/products/ASC.Files/Client/src/HOCs/withContextOptions.js @@ -21,13 +21,34 @@ export default function withContextOptions(WrappedComponent) { }; onClickMakeForm = () => { - const { copyAsAction, item, formfillingDocs } = this.props; + const { + copyAsAction, + item, + formfillingDocs, + setConvertPasswordDialogVisible, + setFormCreationInfo, + t, + } = this.props; const { title, id, folderId, fileExst } = item; const newTitle = title.substring(0, title.length - fileExst.length) + formfillingDocs[0]; - copyAsAction(id, newTitle, folderId).catch((err) => toastr.error(err)); + copyAsAction(id, newTitle, folderId).catch((err) => { + console.log("err", err); + const isPasswordError = new RegExp(/\(password\)*$/); + + if (isPasswordError.test(err)) { + toastr.error(t("Translations:FileProtected"), t("Common:Warning")); + setFormCreationInfo({ + newTitle, + fromExst: fileExst, + toExst: formfillingDocs[0], + fileInfo: item, + }); + setConvertPasswordDialogVisible(true); + } + }); }; onOpenLocation = () => { @@ -586,6 +607,8 @@ export default function withContextOptions(WrappedComponent) { setRemoveItem, setSharingPanelVisible, setUnsubscribe, + setConvertPasswordDialogVisible, + setFormCreationInfo, } = dialogsStore; const { isTabletView, isDesktopClient } = auth.settingsStore; const { setIsVerHistoryPanel, fetchFileVersions } = versionHistoryStore; @@ -618,6 +641,7 @@ export default function withContextOptions(WrappedComponent) { setMediaViewerData, setRemoveItem, setDeleteThirdPartyDialogVisible, + setConvertPasswordDialogVisible, deleteItemAction, onSelectItem, setSharingPanelVisible, @@ -633,6 +657,7 @@ export default function withContextOptions(WrappedComponent) { isDesktop: isDesktopClient, copyAsAction, formfillingDocs, + setFormCreationInfo, }; } )(observer(WithContextOptions)); diff --git a/products/ASC.Files/Client/src/HOCs/withFileActions.js b/products/ASC.Files/Client/src/HOCs/withFileActions.js index 9e4b4fd4f3f..c9f92838a03 100644 --- a/products/ASC.Files/Client/src/HOCs/withFileActions.js +++ b/products/ASC.Files/Client/src/HOCs/withFileActions.js @@ -363,7 +363,11 @@ export default function withFileActions(WrappedFileItem) { const inProgress = activeFiles.findIndex((x) => x === item.id) !== -1 || - activeFolders.findIndex((x) => x === item.id && item.isFolder) !== -1; + activeFolders.findIndex( + (x) => + x === item.id && + (item.isFolder || (!item.fileExst && item.id === -1)) + ) !== -1; const isActive = bufferSelection && diff --git a/products/ASC.Files/Client/src/components/EditingWrapperComponent.js b/products/ASC.Files/Client/src/components/EditingWrapperComponent.js index e2dd5f537fc..ad3a35b5414 100644 --- a/products/ASC.Files/Client/src/components/EditingWrapperComponent.js +++ b/products/ASC.Files/Client/src/components/EditingWrapperComponent.js @@ -2,6 +2,7 @@ import React, { useState } from "react"; import styled, { css } from "styled-components"; import Button from "@appserver/components/button"; import TextInput from "@appserver/components/text-input"; +import Text from "@appserver/components/text"; import commonIconsStyles from "@appserver/components/utils/common-icons-style"; import CheckIcon from "../../public/images/check.react.svg"; @@ -72,6 +73,13 @@ const EditingWrapper = styled.div` text-align: left; color: #333333; margin-left: 6px; + ${(props) => + props.isUpdatingRowItem && + css` + margin-left: 0; + display: flex; + align-items: center; + `} } .edit-button { margin-left: 8px; @@ -123,6 +131,8 @@ const EditingWrapperComponent = (props) => { //isLoading, viewAs, elementIcon, + isUpdatingRowItem, + passwordEntryProcess, } = props; const isTable = viewAs === "table"; @@ -158,51 +168,63 @@ const EditingWrapperComponent = (props) => { const onBlur = (e) => { if (e.relatedTarget && e.relatedTarget.classList.contains("edit-button")) return false; - onClickUpdateItem(e, false); + + !passwordEntryProcess && onClickUpdateItem(e, false); }; return ( - + {isTable && elementIcon} - -