diff --git a/packages/client/public/locales/en/FilesSettings.json b/packages/client/public/locales/en/FilesSettings.json index e63ca41be1..40bdd64c81 100644 --- a/packages/client/public/locales/en/FilesSettings.json +++ b/packages/client/public/locales/en/FilesSettings.json @@ -10,7 +10,7 @@ "OriginalCopy": "Save the file copy in the original format as well", "StoringFileVersion": "Storing file versions", "ThirdPartyAccounts": "Third-party accounts", - "ThirdPartyBtn": "Allow Room admins to connect third-party storages", + "ThirdPartyBtn": "Allow connection of third-party storages", "UpdateOrCreate": "Update the file version for the existing file with the same name. Otherwise, a copy of the file will be created.", "UploadPluginsHere": "Upload plugins here" } diff --git a/packages/client/public/locales/ru/FilesSettings.json b/packages/client/public/locales/ru/FilesSettings.json index 8bf7fcf25f..f60c60c3d4 100644 --- a/packages/client/public/locales/ru/FilesSettings.json +++ b/packages/client/public/locales/ru/FilesSettings.json @@ -10,7 +10,7 @@ "OriginalCopy": "Сохранять также копию файла в исходном формате", "StoringFileVersion": "Хранение версий файлов", "ThirdPartyAccounts": "Сторонние аккаунты", - "ThirdPartyBtn": "Разрешить администраторам комнаты подключать сторонние хранилища", + "ThirdPartyBtn": "Разрешить подключение сторонних хранилищ", "UpdateOrCreate": "Обновлять версию файла для существующего файла с таким же именем. В противном случае будет создаваться копия файла.", "UploadPluginsHere": "Загрузите плагины сюда" } diff --git a/packages/client/src/components/GlobalEvents/CreateRoomEvent.js b/packages/client/src/components/GlobalEvents/CreateRoomEvent.js index 3d7f895ba0..db67b2017d 100644 --- a/packages/client/src/components/GlobalEvents/CreateRoomEvent.js +++ b/packages/client/src/components/GlobalEvents/CreateRoomEvent.js @@ -30,7 +30,6 @@ const CreateRoomEvent = ({ fetchFiles, setInfoPanelIsVisible, setView, - isAdmin, enableThirdParty, }) => { const { t } = useTranslation(["CreateEditRoomDialog", "Common", "Files"]); @@ -144,7 +143,6 @@ const CreateRoomEvent = ({ setIsLoading={setIsLoading} deleteThirdParty={deleteThirdParty} fetchThirdPartyProviders={fetchThirdPartyProviders} - isAdmin={isAdmin} enableThirdParty={enableThirdParty} /> ); @@ -188,8 +186,6 @@ export default inject( setView, } = auth.infoPanelStore; - const { isAdmin } = auth; - const { enableThirdParty } = settingsStore; return { @@ -213,7 +209,6 @@ export default inject( fetchFiles, setInfoPanelIsVisible, setView, - isAdmin, enableThirdParty, }; } diff --git a/packages/client/src/components/dialogs/ConflictResolveDialog/index.js b/packages/client/src/components/dialogs/ConflictResolveDialog/index.js index bc5dc0ad60..4eb0f01f76 100644 --- a/packages/client/src/components/dialogs/ConflictResolveDialog/index.js +++ b/packages/client/src/components/dialogs/ConflictResolveDialog/index.js @@ -66,6 +66,7 @@ const ConflictResolveDialog = (props) => { setActiveFiles, setMoveToPanelVisible, setCopyPanelVisible, + setRestoreAllPanelVisible, } = props; const { @@ -86,6 +87,7 @@ const ConflictResolveDialog = (props) => { setConflictResolveDialogVisible(false); setMoveToPanelVisible(false); setCopyPanelVisible(false); + setRestoreAllPanelVisible(false); }; const onCloseDialog = () => { let newActiveFiles = activeFiles; @@ -258,6 +260,7 @@ export default inject(({ auth, dialogsStore, uploadDataStore, filesStore }) => { conflictResolveDialogData, conflictResolveDialogItems: items, setMoveToPanelVisible, + setRestoreAllPanelVisible, setCopyPanelVisible, } = dialogsStore; @@ -275,6 +278,7 @@ export default inject(({ auth, dialogsStore, uploadDataStore, filesStore }) => { activeFiles, setActiveFiles, setMoveToPanelVisible, + setRestoreAllPanelVisible, setCopyPanelVisible, }; })( diff --git a/packages/client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js b/packages/client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js index 8d8340597e..3059756dd3 100644 --- a/packages/client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js +++ b/packages/client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js @@ -39,7 +39,6 @@ const CreateRoomDialog = ({ deleteThirdParty, fetchThirdPartyProviders, - isAdmin, enableThirdParty, }) => { const [isScrollLocked, setIsScrollLocked] = useState(false); @@ -152,7 +151,6 @@ const CreateRoomDialog = ({ isDisabled={isLoading} isValidTitle={isValidTitle} setIsValidTitle={setIsValidTitle} - isAdmin={isAdmin} enableThirdParty={enableThirdParty} /> )} diff --git a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js index be79c0efcf..2666bf4c7f 100644 --- a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js +++ b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js @@ -45,7 +45,6 @@ const SetRoomParams = ({ isDisabled, isValidTitle, setIsValidTitle, - isAdmin, enableThirdParty, }) => { const [previewIcon, setPreviewIcon] = React.useState(null); @@ -114,7 +113,7 @@ const SetRoomParams = ({ /> )} */} - {!isEdit && (enableThirdParty || isAdmin) && ( + {!isEdit && enableThirdParty && ( { const { hasNew, refreshFiles } = this.props; - return hasNew ? refreshFiles() : Promise.resolve(); + return Promise.resolve(); //hasNew ? refreshFiles() : }) .catch((err) => toastr.error(err)) .finally(() => { @@ -121,7 +121,7 @@ class NewFilesPanel extends React.Component { this.onFileClick(item); }) .then(() => { - refreshFiles(); + // refreshFiles(); }) .catch((err) => toastr.error(err)); }; @@ -130,9 +130,13 @@ class NewFilesPanel extends React.Component { const { id, fileExst, webUrl, fileType, providerKey } = item; const { filter, - //setMediaViewerData, + setMediaViewerData, fetchFiles, addFileToRecentlyViewed, + playlist, + setCurrentItem, + isMediaOrImage, + currentFolderId, } = this.props; if (!fileExst) { @@ -141,7 +145,10 @@ class NewFilesPanel extends React.Component { .finally(() => this.onClose()); } else { const canEdit = [5, 6, 7].includes(fileType); //TODO: maybe dirty - const isMedia = [2, 3, 4].includes(fileType); + // const isMedia = [2, 3, 4].includes(fileType); + + const isMedia = isMediaOrImage(fileExst); + const isMediaActive = playlist.findIndex((el) => el.fileId === id) !== -1; if (canEdit && providerKey) { return addFileToRecentlyViewed(id) @@ -160,8 +167,21 @@ class NewFilesPanel extends React.Component { } if (isMedia) { - //const mediaItem = { visible: true, id }; - //setMediaViewerData(mediaItem); + if (currentFolderId !== item.folderId) { + fetchFiles(item.folderId, null) + .then(() => { + const mediaItem = { visible: true, id }; + setMediaViewerData(mediaItem); + }) + .catch((err) => toastr.error(err)) + .finally(() => this.onClose()); + } else { + const mediaItem = { visible: true, id }; + setMediaViewerData(mediaItem); + + return this.onClose(); + } + return; } @@ -311,10 +331,14 @@ export default inject( refreshFiles, } = filesStore; //const { updateRootBadge } = treeFoldersStore; - const { setMediaViewerData } = mediaViewerDataStore; - const { getIcon, getFolderIcon } = settingsStore; + const { + playlist, + setMediaViewerData, + setCurrentItem, + } = mediaViewerDataStore; + const { getIcon, getFolderIcon, isMediaOrImage } = settingsStore; const { markAsRead } = filesActionsStore; - const { pathParts } = selectedFolderStore; + const { pathParts, id: currentFolderId } = selectedFolderStore; const { setNewFilesPanelVisible, @@ -331,6 +355,11 @@ export default inject( newFilesIds, isLoading, + playlist, + setCurrentItem, + isMediaOrImage, + currentFolderId, + //setIsLoading, fetchFiles, setMediaViewerData, diff --git a/packages/client/src/pages/Home/InfoPanel/Body/styles/common.js b/packages/client/src/pages/Home/InfoPanel/Body/styles/common.js index 90a4e79e63..a3e111b105 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/styles/common.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/styles/common.js @@ -37,21 +37,16 @@ const StyledInfoPanelBody = styled.div` `; const StyledTitle = styled.div` - position: fixed; + //position: fixed; margin-top: -80px; margin-left: -20px; - width: calc(100% - 40px); + width: 100%; padding: 24px 0 24px 20px; background: ${(props) => props.theme.infoPanel.backgroundColor}; z-index: 100; - @media ${tablet} { - padding: 24px 20px 24px 20px; - } - @media ${mobile} { - width: calc(100% - 32px); - padding: 24px 0 24px 16px; + padding: 24px -16px 24px 16px; } display: flex; diff --git a/packages/client/src/pages/Settings/Section/Body/index.js b/packages/client/src/pages/Settings/Section/Body/index.js index fb6c45ed32..8605094b2a 100644 --- a/packages/client/src/pages/Settings/Section/Body/index.js +++ b/packages/client/src/pages/Settings/Section/Body/index.js @@ -40,7 +40,7 @@ const SectionBodyContent = ({ isErrorSettings, history, user }) => { const adminSettings = { id: "admin", - name: t("Common:SettingsGenaral"), + name: t("Common:SettingsGeneral"), content: , }; diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js index 6bf5c6043a..b91b152060 100644 --- a/packages/client/src/store/FilesStore.js +++ b/packages/client/src/store/FilesStore.js @@ -287,6 +287,8 @@ class FilesStore { console.log(`[WS] markasnew-file ${fileId}:${count}`); const foundIndex = fileId && this.files.findIndex((x) => x.id === fileId); + + this.treeFoldersStore.fetchTreeFolders(); if (foundIndex == -1) return; this.updateFileStatus( @@ -295,7 +297,6 @@ class FilesStore { ? this.files[foundIndex].fileStatus | FileStatus.IsNew : this.files[foundIndex].fileStatus & ~FileStatus.IsNew ); - this.treeFoldersStore.fetchTreeFolders(); }); //WAIT FOR RESPONSES OF EDITING FILE diff --git a/public/locales/en/Common.json b/public/locales/en/Common.json index 707b3f056e..2f2efadebc 100644 --- a/public/locales/en/Common.json +++ b/public/locales/en/Common.json @@ -194,7 +194,7 @@ "Sessions": "Sessions", "Settings": "Settings", "SettingsDocSpace": "DocSpace Settings", - "SettingsGenaral": "Genaral", + "SettingsGeneral": "General", "SettingsPersonal": "Personal", "ShowMore": "Show more", "SignInWithFacebook": "Sign in with Facebook", diff --git a/public/locales/ru/Common.json b/public/locales/ru/Common.json index cf2ccbfe9a..b7bef05fe6 100644 --- a/public/locales/ru/Common.json +++ b/public/locales/ru/Common.json @@ -194,7 +194,7 @@ "Sessions": "Сессии", "Settings": "Настройки", "SettingsDocSpace": "Настройки DocSpace", - "SettingsGenaral": "Общие", + "SettingsGeneral": "Общие", "SettingsPersonal": "Персональные", "ShowMore": "Показать еще", "SignInWithFacebook": "Вход через Facebook",