From ce448f9ddac9583c3b123f9524a6af9e909dfb7e Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 13 Aug 2024 12:09:40 +0300 Subject: [PATCH] Client: Renaming. --- packages/client/src/components/MainBar/Bar.js | 23 +++++++++++++------ .../src/components/MainBar/QuotasBar.js | 2 +- packages/client/src/helpers/constants.js | 2 +- packages/shared/store/CurrentQuotaStore.ts | 4 ++++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 954a1149c9..2cc0eae20a 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -86,7 +86,7 @@ const Bar = (props) => { roomQuota: false, storageQuota: false, tenantCustomQuota: false, - userQuota: false, + almostTariffLimitPerUser: false, storageAndUserQuota: false, storageAndRoomQuota: false, confirmEmail: false, @@ -132,7 +132,10 @@ const Bar = (props) => { if (isAdmin || isRoomAdmin) { setBarVisible((value) => ({ ...value, - userQuota: !closed.includes(QuotaBarTypes.UserQuota), + + almostTariffLimitPerUser: !closed.includes( + QuotaBarTypes.AlmostTariffLimitPerUser, + ), })); } if (isAdmin || isPowerUser || isRoomAdmin) { @@ -154,7 +157,7 @@ const Bar = (props) => { roomQuota: isAdmin, storageQuota: isAdmin || isPowerUser || isRoomAdmin, tenantCustomQuota: isAdmin || isPowerUser || isRoomAdmin, - userQuota: isAdmin | isRoomAdmin, + almostTariffLimitPerUser: isAdmin | isRoomAdmin, storageAndUserQuota: isAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, @@ -240,8 +243,11 @@ const Bar = (props) => { case QuotaBarTypes.TenantCustomQuota: setBarVisible((value) => ({ ...value, tenantCustomQuota: false })); break; - case QuotaBarTypes.UserQuota: - setBarVisible((value) => ({ ...value, userQuota: false })); + case QuotaBarTypes.AlmostTariffLimitPerUser: + setBarVisible((value) => ({ + ...value, + almostTariffLimitPerUser: false, + })); break; case QuotaBarTypes.UserAndStorageQuota: setBarVisible((value) => ({ ...value, storageAndUserQuota: false })); @@ -316,9 +322,12 @@ const Bar = (props) => { }; } - if (showAlmostReachedUserTariffLimit && barVisible.userQuota) { + if ( + showAlmostReachedUserTariffLimit && + barVisible.almostTariffLimitPerUser + ) { return { - type: QuotaBarTypes.UserQuota, + type: QuotaBarTypes.AlmostTariffLimitPerUser, maxValue: maxCountManagersByQuota, currentValue: addedManagersCount, }; diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index a8dd2c5f7a..c327b9127c 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -151,7 +151,7 @@ const QuotasBar = ({ header: t("StorageQuotaHeader", { currentValue, maxValue }), description: getTenantCustomQuota(), }; - case QuotaBarTypes.UserQuota: + case QuotaBarTypes.AlmostTariffLimitPerUser: return { header: t("UserQuotaHeader", { currentValue, maxValue }), description: getUserQuotaDescription(), diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index c40d85552f..690e518378 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -98,7 +98,7 @@ export const QuotaBarTypes = Object.freeze({ ConfirmEmail: "confirm-email", RoomQuota: "room-quota", StorageQuota: "storage-quota", - UserQuota: "user-quota", + AlmostTariffLimitPerUser: "user-quota", UserAndStorageQuota: "user-storage-quota", RoomAndStorageQuota: "room-storage-quota", PersonalUserQuota: "personal-user-quota", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 735c003cdc..94488251c9 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -280,6 +280,10 @@ class CurrentQuotasStore { ); } + get showReachedUserTariffLimit() { + return null; + } + get isPaidUserLimit() { return this.addedManagersCount >= this.maxCountManagersByQuota; }