From 332fc5866ab0470122299cd3a4c4e9eb06cbaf0f Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 12 Jan 2022 17:09:21 +0300 Subject: [PATCH] Web: Files: Hide the file destination when checkbox is not set. --- .../components/dialogs/ConvertDialog/index.js | 19 ++++++++++++------- .../dialogs/ModalDialogContainer.js | 6 ++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/products/ASC.Files/Client/src/components/dialogs/ConvertDialog/index.js b/products/ASC.Files/Client/src/components/dialogs/ConvertDialog/index.js index 2c60609f20..966575451c 100644 --- a/products/ASC.Files/Client/src/components/dialogs/ConvertDialog/index.js +++ b/products/ASC.Files/Client/src/components/dialogs/ConvertDialog/index.js @@ -8,6 +8,7 @@ import Checkbox from "@appserver/components/checkbox"; import { withTranslation, Trans } from "react-i18next"; import { inject, observer } from "mobx-react"; import Loaders from "@appserver/common/components/Loaders"; +import { FolderType } from "@appserver/common/constants"; const ConvertDialogComponent = (props) => { const { @@ -30,12 +31,12 @@ const ConvertDialogComponent = (props) => { let rootFolderTitle = ""; const convertSingleFile = !!convertItem; + const sortedFolder = isRecentFolder || isFavoritesFolder || isShareFolder; - if ( - convertSingleFile && - (isRecentFolder || isFavoritesFolder || isShareFolder) - ) { - rootFolderTitle = rootFoldersTitles[convertItem.rootFolderType]; + if (convertSingleFile && sortedFolder) { + rootFolderTitle = isShareFolder + ? rootFoldersTitles[FolderType.USER] + : rootFoldersTitles[convertItem.rootFolderType]; } const [hideMessage, setHideMessage] = useState(false); @@ -90,8 +91,12 @@ const ConvertDialogComponent = (props) => { isChecked={storeOriginalFiles} onChange={onChangeFormat} /> - {convertSingleFile && rootFolderTitle && ( -
+ {convertSingleFile && sortedFolder && ( +