diff --git a/packages/client/public/locales/en/Confirm.json b/packages/client/public/locales/en/Confirm.json index b91c4a4925..68f06c0ae5 100644 --- a/packages/client/public/locales/en/Confirm.json +++ b/packages/client/public/locales/en/Confirm.json @@ -30,5 +30,6 @@ "SignUp": "Sign up", "SuccessDeactivate": "Your account has been successfully deactivated. In 10 seconds you will be redirected to the <1>site.", "SuccessReactivate": "Your account has been successfully reactivated. In 10 seconds you will be redirected to the <1>portal.", - "SuccessRemoved": "Your account has been successfully removed. In 10 seconds you will be redirected to the <1>site." + "SuccessRemoved": "Your account has been successfully removed. In 10 seconds you will be redirected to the <1>site.", + "TermsAndConditions": "By continuing, you understand and agree to our <1>Terms and conditions and <2>Privacy statement." } diff --git a/packages/client/src/HOCs/withFileActions.js b/packages/client/src/HOCs/withFileActions.js index cc0d12e076..fb99ec2526 100644 --- a/packages/client/src/HOCs/withFileActions.js +++ b/packages/client/src/HOCs/withFileActions.js @@ -29,6 +29,7 @@ import { inject, observer } from "mobx-react"; import { DeviceType, RoomsType } from "@docspace/shared/enums"; import Planet12ReactSvgUrl from "PUBLIC_DIR/images/icons/12/planet.react.svg?url"; +import { toastr } from "@docspace/shared/components/toast"; export default function withFileActions(WrappedFileItem) { class WithFileActions extends React.Component { @@ -67,9 +68,13 @@ export default function withFileActions(WrappedFileItem) { dragging && setDragging(false); - createFoldersTree(files, uploadToFolder).then((f) => { - if (f.length > 0) startUpload(f, null, t); - }); + createFoldersTree(t, files, uploadToFolder) + .then((f) => { + if (f.length > 0) startUpload(f, null, t); + }) + .catch((err) => { + toastr.error(err); + }); }; onDrop = (items) => { diff --git a/packages/client/src/components/Article/Body/AccountsItem.js b/packages/client/src/components/Article/Body/AccountsItem.js index 79f5fe48c3..d34734407e 100644 --- a/packages/client/src/components/Article/Body/AccountsItem.js +++ b/packages/client/src/components/Article/Body/AccountsItem.js @@ -39,6 +39,7 @@ const PureAccountsItem = ({ onClick, t, currentColorScheme, + getLinkData, }) => { const onClickAction = React.useCallback( (e, id) => { @@ -51,10 +52,13 @@ const PureAccountsItem = ({ const title = t("Accounts"); + const linkData = getLinkData("accounts"); + return ( { const [isDragActive, setIsDragActive] = useState(false); @@ -87,9 +89,13 @@ const Item = ({ (files, uploadToFolder) => { dragging && setDragging(false); - createFoldersTree(files, uploadToFolder).then((f) => { - if (f.length > 0) startUpload(f, null, t); - }); + createFoldersTree(t, files, uploadToFolder) + .then((f) => { + if (f.length > 0) startUpload(f, null, t); + }) + .catch((err) => { + toastr.error(err); + }); }, [t, dragging, setDragging, startUpload, createFoldersTree], ); @@ -126,18 +132,24 @@ const Item = ({ (e, folderId) => { setBufferSelection(null); - onClick && - onClick( - e, - folderId, - item.title, - item.rootFolderType, - item.security.Create, - ); + onClick?.( + e, + folderId, + item.title, + item.rootFolderType, + item.security.Create, + ); }, [onClick, item.title, item.rootFolderType], ); + const linkData = getLinkData( + item.id, + item.title, + item.rootFolderType, + item.security.Create, + ); + return ( @@ -215,6 +228,8 @@ const Items = ({ currentDeviceType, folderAccess, currentColorScheme, + + getLinkData, }) => { const getEndOfBlock = React.useCallback((item) => { switch (item.key) { @@ -329,6 +344,7 @@ const Items = ({ getEndOfBlock={getEndOfBlock} showText={showText} onClick={onClick} + getLinkData={getLinkData} onMoveTo={isTrash ? onRemove : onMoveTo} onBadgeClick={isTrash ? onEmptyTrashAction : onBadgeClick} showDragItems={showDragItems} @@ -341,16 +357,6 @@ const Items = ({ ); }); - /*if (!firstLoad && !isVisitor) - items.splice( - 3, - 0, - - );*/ if (!isVisitor && !isCollaborator) items.splice( 3, @@ -358,6 +364,7 @@ const Items = ({ , ); @@ -375,6 +382,7 @@ const Items = ({ dragging, getFolderIcon, onClick, + getLinkData, onMoveTo, getEndOfBlock, onBadgeClick, diff --git a/packages/client/src/components/Article/Body/SettingsItem.js b/packages/client/src/components/Article/Body/SettingsItem.js deleted file mode 100644 index fd551df2c7..0000000000 --- a/packages/client/src/components/Article/Body/SettingsItem.js +++ /dev/null @@ -1,72 +0,0 @@ -// (c) Copyright Ascensio System SIA 2009-2024 -// -// This program is a free software product. -// You can redistribute it and/or modify it under the terms -// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software -// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended -// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of -// any third-party rights. -// -// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty -// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see -// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -// -// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021. -// -// The interactive user interfaces in modified source and object code versions of the Program must -// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3. -// -// Pursuant to Section 7(b) of the License you must retain the original Product logo when -// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under -// trademark law for use of our trademarks. -// -// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing -// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 -// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - -import React from "react"; -import { inject, observer } from "mobx-react"; -import { withTranslation } from "react-i18next"; - -import { ArticleItem } from "@docspace/shared/components/article-item"; - -import CatalogSettingsReactSvgUrl from "PUBLIC_DIR/images/catalog.settings.react.svg?url"; - -const PureSettingsItem = ({ - t, - showText, - isActive, - onClick, - currentColorScheme, -}) => { - const onClickAction = React.useCallback(() => { - onClick && onClick("settings"); - }, [onClick]); - - const title = t("Common:Settings"); - - return ( - - ); -}; - -const SettingsItem = withTranslation(["FilesSettings", "Common"])( - PureSettingsItem, -); - -export default inject(({ settingsStore }) => { - return { - showText: settingsStore.showText, - currentColorScheme: settingsStore.currentColorScheme, - }; -})(observer(SettingsItem)); diff --git a/packages/client/src/components/Article/Body/index.js b/packages/client/src/components/Article/Body/index.js index df5a9c9930..9b68a256bb 100644 --- a/packages/client/src/components/Article/Body/index.js +++ b/packages/client/src/components/Article/Body/index.js @@ -28,7 +28,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { withTranslation } from "react-i18next"; -import { useNavigate, useLocation } from "react-router-dom"; +import { useLocation } from "react-router-dom"; import { DeviceType, RoomSearchArea } from "@docspace/shared/enums"; import Items from "./Items"; @@ -43,9 +43,7 @@ import { getCategoryUrl } from "SRC_DIR/helpers/utils"; import { CategoryType } from "SRC_DIR/helpers/constants"; import { ArticleFolderLoader } from "@docspace/shared/skeletons/article"; import { MEDIA_VIEW_URL } from "@docspace/shared/constants"; -import { combineUrl } from "@docspace/shared/utils/combineUrl"; import { showProgress } from "@docspace/shared/utils/common"; -import { openingNewTab } from "@docspace/shared/utils/openingNewTab"; const ArticleBodyContent = (props) => { const { @@ -77,18 +75,13 @@ const ArticleBodyContent = (props) => { isFrame, } = props; - const navigate = useNavigate(); const location = useLocation(); const [disableBadgeClick, setDisableBadgeClick] = React.useState(false); const [activeItemId, setActiveItemId] = React.useState(null); - const isAccounts = location.pathname.includes("accounts/filter"); - - const onClick = React.useCallback( - (e, folderId, title, rootFolderType, canCreate) => { - const { toggleArticleOpen } = props; - + const getLinkData = React.useCallback( + (folderId, title, rootFolderType, canCreate) => { let params = null; let path = ``; @@ -100,8 +93,6 @@ const ArticleBodyContent = (props) => { canCreate, }; - let withTimer = !!selectedFolderId; - switch (folderId) { case myFolderId: const myFilter = FilesFilter.getDefault(); @@ -155,17 +146,7 @@ const ArticleBodyContent = (props) => { params = accountsFilter.toUrlParams(); path = getCategoryUrl(CategoryType.Accounts); - withTimer = false; - break; - case "settings": - path = getCategoryUrl(CategoryType.Settings); - navigate(path); - - if (currentDeviceType === DeviceType.mobile) { - toggleArticleOpen(); - } - return; case roomsFolderId: default: const roomsFilter = RoomsFilter.getDefault( @@ -181,16 +162,33 @@ const ArticleBodyContent = (props) => { path += `?${params}&date=${new Date().getTime()}`; - if (openingNewTab(path, e)) return; + return { path, state }; + }, + [ + roomsFolderId, + archiveFolderId, + myFolderId, + recycleBinFolderId, + activeItemId, + ], + ); - if (folderId === "accounts" || folderId === "settings") clearFiles(); + const onClick = React.useCallback( + (e, folderId) => { + if (e?.ctrlKey || e?.metaKey || e?.shiftKey || e?.button) return; - setSelection && setSelection([]); + const { toggleArticleOpen } = props; + + const isAccountsClick = folderId === "accounts"; + + let withTimer = isAccountsClick ? false : !!selectedFolderId; + + if (isAccountsClick) clearFiles(); + + setSelection?.([]); setIsLoading(true, withTimer); - navigate(path, { state }); - if (currentDeviceType === DeviceType.mobile) { toggleArticleOpen(); } @@ -202,7 +200,7 @@ const ArticleBodyContent = (props) => { recycleBinFolderId, activeItemId, selectedFolderId, - isAccounts, + setSelection, ], ); @@ -281,6 +279,7 @@ const ArticleBodyContent = (props) => { { async (e) => { const files = await getFilesFromEvent(e); - createFoldersTree(files).then((f) => { - if (f.length > 0) startUpload(f, null, t); - }); + createFoldersTree(t, files) + .then((f) => { + if (f.length > 0) startUpload(f, null, t); + }) + .catch((err) => { + toastr.error(err); + }); }, [startUpload, t], ); diff --git a/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js b/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js index 8cedbcdd0c..9d0ea3e9ca 100644 --- a/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js +++ b/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js @@ -116,6 +116,10 @@ export const RegisterContainer = styled.div` .email-container{ ${(props) => props.registrationForm && "display:none"}; } + + .terms-conditions{ + margin: 20px 0; + } @media ${tablet} { width: 100%; } diff --git a/packages/client/src/pages/Confirm/sub-components/createUser.js b/packages/client/src/pages/Confirm/sub-components/createUser.js index 99eb5e95f6..4c5797b838 100644 --- a/packages/client/src/pages/Confirm/sub-components/createUser.js +++ b/packages/client/src/pages/Confirm/sub-components/createUser.js @@ -74,6 +74,7 @@ import LanguageComboboxWrapper from "./LanguageCombobox"; import withCultureNames from "SRC_DIR/HOCs/withCultureNames"; import { setCookie } from "@docspace/shared/utils/cookie"; +import { ColorTheme, ThemeId } from "@docspace/shared/components/color-theme"; const DEFAULT_ROOM_TEXT = "{{firstName}} {{lastName}} invites you to join the room {{roomName}} for secure document collaboration."; @@ -113,6 +114,9 @@ const CreateUserForm = (props) => { defaultPage, cultures, i18n, + + licenseUrl, + legalTerms, } = props; const currentCultureName = i18n.language; @@ -473,6 +477,37 @@ const CreateUserForm = (props) => { } : {}; + const termsConditionsComponent = ( +
+ + + ), + 2: ( + + ), + }} + /> + +
+ ); return ( { /> + {termsConditionsComponent} +