diff --git a/packages/asc-web-common/store/SettingsStore.js b/packages/asc-web-common/store/SettingsStore.js index 90025572c4..386487156f 100644 --- a/packages/asc-web-common/store/SettingsStore.js +++ b/packages/asc-web-common/store/SettingsStore.js @@ -18,7 +18,10 @@ class SettingsStore { timezones = []; utcOffset = "00:00:00"; utcHoursOffset = 0; - defaultPage = combineUrl(proxyURL, "/"); + defaultPage = combineUrl( + proxyURL, + window["AscDesktopEditor"] !== undefined ? "/products/files/" : "/" + ); homepage = ""; datePattern = "M/d/yyyy"; datePatternJQ = "00/00/0000"; diff --git a/products/ASC.Files/Client/public/locales/en/Home.json b/products/ASC.Files/Client/public/locales/en/Home.json index 2b9e26ee90..f87d90bfe4 100644 --- a/products/ASC.Files/Client/public/locales/en/Home.json +++ b/products/ASC.Files/Client/public/locales/en/Home.json @@ -81,7 +81,7 @@ "PrivateRoomDescriptionSecure": "Secure sharing with trusted teammates.", "PrivateRoomDescriptionEncrypted": "Encrypted editing and real-time collaboration.", "PrivateRoomDescriptionUnbreakable": "Unbreakable AES-256 algorithm.", - "PrivateRoomSupport": "Work in Private Room is available via {{organizationName}} desktop app. <3>Instructions", + "PrivateRoomSupport": "Work in Private Room is available via {{organizationName}} desktop app. <4>Instructions", "GoToMyButton": "Go to My Documents", "BackToParentFolderButton": "Back to parent folder", "EmptyFolderHeader": "No files in this folder", diff --git a/products/ASC.Files/Client/public/locales/ru/Home.json b/products/ASC.Files/Client/public/locales/ru/Home.json index 4c5e75955e..bd7087b31e 100644 --- a/products/ASC.Files/Client/public/locales/ru/Home.json +++ b/products/ASC.Files/Client/public/locales/ru/Home.json @@ -81,7 +81,7 @@ "PrivateRoomDescriptionSecure": "Безопасное предоставление доступа доверенным участникам команды.", "PrivateRoomDescriptionEncrypted": "Зашифрованное редактирование и совместная работа в режиме реального времени.", "PrivateRoomDescriptionUnbreakable": "Стойкий алгоритм AES-256.", - "PrivateRoomSupport": "Работа в Приватной комнате доступна через десктопное приложение {{organizationName}}. <3>Инструкции", + "PrivateRoomSupport": "Работа в Приватной комнате доступна через десктопное приложение {{organizationName}}. <4>Инструкции", "GoToMyButton": "Перейти к моим документам", "BackToParentFolderButton": "Вернуться в папку на уровень выше", "EmptyFolderHeader": "В этой папке нет файлов", diff --git a/products/ASC.Files/Client/src/Files.jsx b/products/ASC.Files/Client/src/Files.jsx index 3d76f823b8..af01694911 100644 --- a/products/ASC.Files/Client/src/Files.jsx +++ b/products/ASC.Files/Client/src/Files.jsx @@ -21,7 +21,7 @@ import filesActionsStore from "./store/FilesActionsStore"; import "./custom.scss"; import i18n from "./i18n"; import { I18nextProvider } from "react-i18next"; -//import { regDesktop } from "@appserver/common/src/desktop"; +import { regDesktop } from "@appserver/common/desktop"; import Home from "./components/pages/Home"; import Settings from "./components/pages/Settings"; import VersionHistory from "./components/pages/VersionHistory"; @@ -79,33 +79,33 @@ class FilesContent extends React.Component { }); } - // componentDidUpdate(prevProps) { - // const { - // isAuthenticated, - // user, - // isEncryption, - // encryptionKeys, - // setEncryptionKeys, - // isLoaded, - // } = this.props; - // //console.log("componentDidUpdate: ", this.props); - // if (isAuthenticated && !this.isDesktopInit && isEncryption && isLoaded) { - // this.isDesktopInit = true; - // regDesktop( - // user, - // isEncryption, - // encryptionKeys, - // setEncryptionKeys, - // this.isEditor - // ); - // console.log( - // "%c%s", - // "color: green; font: 1.2em bold;", - // "Current keys is: ", - // encryptionKeys - // ); - // } - // } + componentDidUpdate(prevProps) { + const { + isAuthenticated, + user, + isEncryption, + encryptionKeys, + setEncryptionKeys, + isLoaded, + } = this.props; + //console.log("componentDidUpdate: ", this.props); + if (isAuthenticated && !this.isDesktopInit && isEncryption && isLoaded) { + this.isDesktopInit = true; + regDesktop( + user, + isEncryption, + encryptionKeys, + setEncryptionKeys, + this.isEditor + ); + console.log( + "%c%s", + "color: green; font: 1.2em bold;", + "Current keys is: ", + encryptionKeys + ); + } + } render() { //const { /*, isDesktop*/ } = this.props; @@ -127,7 +127,7 @@ class FilesContent extends React.Component { const Files = inject(({ auth, initFilesStore }) => { return { - //isDesktop: auth.settingsStore.isDesktopClient, + isDesktop: auth.settingsStore.isDesktopClient, user: auth.userStore.user, isAuthenticated: auth.isAuthenticated, encryptionKeys: auth.settingsStore.encryptionKeys, diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/RootFolderContainer.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/RootFolderContainer.js index e0ed1fc32f..7a5cbd0686 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/RootFolderContainer.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/RootFolderContainer.js @@ -111,8 +111,8 @@ const RootFolderContainer = (props) => { {!isDesktop && ( - Work in Private Room is available via {{ organizationName }} - desktop app. + Work in Private Room is available via {{ organizationName }} desktop + app.{" "} Instructions diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/index.js index d4960356ec..3fdc0c0bb9 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyContainer/index.js @@ -19,6 +19,7 @@ const EmptyContainer = ({ setAction, isPrivacyFolder, parentId, + isEncryptionSupport, }) => { const onCreate = (e) => { const format = e.currentTarget.dataset.format || null; diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js index d64b3b6963..d19827257d 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js @@ -317,7 +317,7 @@ class SectionHeaderContent extends React.Component { getMenuItems = () => { const { t, - isItemsSelected, + selectionCount, isAccessedSelected, isWebEditSelected, deleteDialogVisible, @@ -383,33 +383,33 @@ class SectionHeaderContent extends React.Component { label: t("Share"), disabled: !isAccessedSelected || - (isPrivacy && (isOnlyFoldersSelected || isItemsSelected)), + (isPrivacy && (isOnlyFoldersSelected || selectionCount > 1)), onClick: this.onOpenSharingPanel, }, { label: t("Download"), - disabled: !isItemsSelected, + disabled: !selectionCount, onClick: this.downloadAction, }, { label: t("DownloadAs"), - disabled: !isItemsSelected || !isWebEditSelected, + disabled: !selectionCount || !isWebEditSelected, onClick: this.downloadAsAction, }, { label: t("MoveTo"), - disabled: !isItemsSelected || isThirdPartySelection, + disabled: !selectionCount || isThirdPartySelection, onClick: this.onMoveAction, }, { label: t("Copy"), - disabled: !isItemsSelected, + disabled: !selectionCount, onClick: this.onCopyAction, }, { label: t("Delete"), disabled: - !isItemsSelected || !deleteDialogVisible || isThirdPartySelection, + !selectionCount || !deleteDialogVisible || isThirdPartySelection, onClick: this.onDeleteAction, }, ]; @@ -605,7 +605,7 @@ export default inject( isPrivacy: isPrivacyFolder, filter, canCreate, - isItemsSelected: !!selection.length, + selectionCount: selection.length, isHeaderVisible, isHeaderIndeterminate, isHeaderChecked, diff --git a/products/ASC.Files/Client/src/store/FilesStore.js b/products/ASC.Files/Client/src/store/FilesStore.js index 8d06c584f8..5df1ac3f22 100644 --- a/products/ASC.Files/Client/src/store/FilesStore.js +++ b/products/ASC.Files/Client/src/store/FilesStore.js @@ -20,7 +20,7 @@ import { combineUrl } from "@appserver/common/utils"; const { FilesFilter } = api; const { settingsStore, userStore, isAdmin } = store.auth; -const { isEncryptionSupport, isDesktopClient } = settingsStore; + const { iconFormatsStore, mediaViewersFormatsStore, @@ -217,7 +217,7 @@ class FilesStore { setSelectedNode([folderId + ""]); if (privacyFolder && privacyFolder.id === +folderId) { - if (!isEncryptionSupport) { + if (!store.auth.settingsStore.isEncryptionSupport) { const newExpandedKeys = createTreeFolders( privacyFolder.pathParts, expandedKeys @@ -251,9 +251,15 @@ class FilesStore { filterData.total = data.total; this.setFilesFilter(filterData); //TODO: FILTER this.setFolders( - isPrivacyFolder && !isEncryptionSupport ? [] : data.folders + isPrivacyFolder && !store.auth.settingsStore.isEncryptionSupport + ? [] + : data.folders + ); + this.setFiles( + isPrivacyFolder && !store.auth.settingsStore.isEncryptionSupport + ? [] + : data.files ); - this.setFiles(isPrivacyFolder && !isEncryptionSupport ? [] : data.files); if (clearFilter) { this.fileActionStore.setAction({ type: null }); this.setSelected("close"); @@ -547,7 +553,10 @@ class FilesStore { const canCreateInSharedFolder = selectedFolderStore.access === 1; return !selectedFolderStore.isRootFolder && canCreateInSharedFolder; case FolderType.Privacy: - return isDesktopClient && isEncryptionSupport; + return ( + store.auth.settingsStore.isDesktopClient && + store.auth.settingsStore.isEncryptionSupport + ); case FolderType.COMMON: return isAdmin; case FolderType.TRASH: @@ -714,14 +723,14 @@ class FilesStore { get isAccessedSelected() { return ( - this.selection.length && - isAdmin && - this.selection.every((x) => x.access === 1 || x.access === 0) + (this.selection.length && + this.selection.every((x) => x.access === 1 || x.access === 0)) || + (isAdmin && this.selection.length) ); } get isOnlyFoldersSelected() { - return this.selection.every((selected) => selected.fileExst !== undefined); + return this.selection.every((selected) => selected.fileExst === undefined); } get isThirdPartySelection() { diff --git a/web/ASC.Web.Client/src/components/NavMenu/index.js b/web/ASC.Web.Client/src/components/NavMenu/index.js index 78870b49a4..d2c7b9013b 100644 --- a/web/ASC.Web.Client/src/components/NavMenu/index.js +++ b/web/ASC.Web.Client/src/components/NavMenu/index.js @@ -54,7 +54,7 @@ const StyledContainer = styled.header` #ipl-progress-indicator { position: fixed; z-index: 190; - top: 56px; + top: ${(props) => (props.isDesktop ? "0" : "56px")}; left: -6px; width: 0%; height: 3px; @@ -159,7 +159,11 @@ class NavMenu extends React.Component { return ( {(value) => ( - +