From fa5436037e81e4231cedf8719b6f55b5e3d785a0 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 20 Mar 2024 15:34:23 +0300 Subject: [PATCH] Fix bug 66883 - Accounts:Change quota. When changing the quota, the default limit is always indicated in the modal dialog. --- .../GlobalEvents/ChangeQuotaEvent.js | 20 ++++++++----------- .../dialogs/ChangeQuotaDialog/index.js | 14 ++++++------- .../dialogs/ChangeStorageQuotaDialog/index.js | 13 ++++++------ .../storage-management/StorageSpaceUsed.js | 14 ++++++------- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/packages/client/src/components/GlobalEvents/ChangeQuotaEvent.js b/packages/client/src/components/GlobalEvents/ChangeQuotaEvent.js index b99a7db17c..72c236c3ae 100644 --- a/packages/client/src/components/GlobalEvents/ChangeQuotaEvent.js +++ b/packages/client/src/components/GlobalEvents/ChangeQuotaEvent.js @@ -1,25 +1,25 @@ // (c) Copyright Ascensio System SIA 2010-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 @@ -44,7 +44,7 @@ const ChangeQuotaEvent = (props) => { setCustomRoomQuota, successCallback, abortCallback, - initialSize, + inRoom, setNewInfoPanelSelection, needResetSelection, @@ -55,7 +55,7 @@ const ChangeQuotaEvent = (props) => { const { t } = useTranslation("Common"); const [isLoading, setIsLoading] = useState(false); const [isError, setIsError] = useState(false); - const [size, setSize] = useState(initialSize); + const [size, setSize] = useState(); const onSetQuotaBytesSize = (size) => { setSize(size); @@ -123,7 +123,6 @@ const ChangeQuotaEvent = (props) => { headerTitle={headerTitle} isError={isError} isLoading={isLoading} - initialSize={initialSize} size={size} /> ); @@ -146,14 +145,11 @@ export default inject( setInfoPanelSelection, } = infoPanelStore; - const initialSize = type === "user" ? defaultUsersQuota : defaultRoomsQuota; - const inRoom = infoPanelSelection?.inRoom; const needResetSelection = type === "user" ? needResetUserSelection : needResetFilesSelection; return { - initialSize, setCustomUserQuota, setCustomRoomQuota, inRoom, diff --git a/packages/client/src/components/dialogs/ChangeQuotaDialog/index.js b/packages/client/src/components/dialogs/ChangeQuotaDialog/index.js index 3633c4aea4..c741a804cb 100644 --- a/packages/client/src/components/dialogs/ChangeQuotaDialog/index.js +++ b/packages/client/src/components/dialogs/ChangeQuotaDialog/index.js @@ -1,25 +1,25 @@ // (c) Copyright Ascensio System SIA 2010-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 @@ -66,7 +66,7 @@ const ChangeQuotaDialog = (props) => { primary onClick={onSaveClick} isLoading={isLoading} - isDisabled={initialSize == size} + isDisabled={initialSize == size || size.trim() === ""} scale />