diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index dc9d27b0db..88f4aa111a 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -14,9 +14,10 @@ "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.", "RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.", - "StorageAndRoomHeader": "The limit for storage space and the number of rooms is about to be exceeded.", + "StorageAndRoomHeader": "The limit for storage space and the number of rooms is about to be exceeded", + "StorageAndRoomLimitHeader": "The limit is reached for storage space and the number of rooms", "StorageAndUserHeader": "The limit for storage space and the number of admins/power users is about to be exceeded.", - "StorageAndUserTariffLimitHeader": "The limit is reached for storage space and the number of admins/power users ", + "StorageAndUserTariffLimitHeader": "The limit is reached for storage space and the number of admins/power users", "StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}", "StorageLimitHeader": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "You can remove the unnecessary files or change quota in the <1>Storage management settings.", diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index a73be566b9..e4c17afcb1 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -82,6 +82,7 @@ const Bar = (props) => { isStorageQuotaAlmostLimit, isStorageQuotaLimit, isRoomTariffAlmostLimit, + isRoomsTariffLimit, } = props; const navigate = useNavigate(); @@ -97,6 +98,7 @@ const Bar = (props) => { storageAndUserTariff: false, storageAndUserTariffLimit: false, roomsAndStorageTariff: false, + roomsAndStorageTariffLimit: false, storageAndRoomQuota: false, confirmEmail: false, personalUserQuota: false, @@ -147,6 +149,9 @@ const Bar = (props) => { roomsAndStorageTariff: closed.includes( QuotaBarTypes.RoomsAndStorageTariff, ), + roomsAndStorageTariffLimit: closed.includes( + QuotaBarTypes.RoomsAndStorageTariffLimit, + ), storageAndUserTariffLimit: !closed.includes( QuotaBarTypes.UserAndStorageTariffLimit, ), @@ -183,6 +188,7 @@ const Bar = (props) => { usersTariffLimit: isAdmin | isRoomAdmin, storageAndUserTariff: isAdmin | isRoomAdmin, roomsAndStorageTariff: isAdmin | isRoomAdmin, + roomsAndStorageTariffLimit: isAdmin | isRoomAdmin, storageAndUserTariffLimit: isAdmin | isRoomAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, @@ -298,6 +304,12 @@ const Bar = (props) => { case QuotaBarTypes.RoomsAndStorageTariff: setBarVisible((value) => ({ ...value, roomsAndStorageTariff: false })); break; + case QuotaBarTypes.RoomsAndStorageTariffLimit: + setBarVisible((value) => ({ + ...value, + roomsAndStorageTariffLimit: false, + })); + break; case QuotaBarTypes.PersonalUserQuota: setBarVisible((value) => ({ ...value, personalUserQuota: false })); break; @@ -344,6 +356,18 @@ const Bar = (props) => { }; } + if ( + isRoomsTariffLimit && + isStorageTariffLimit && + barVisible.roomsAndStorageTariffLimit + ) { + return { + type: QuotaBarTypes.RoomsAndStorageTariffLimit, + maxValue: null, + currentValue: null, + }; + } + if ( isUserTariffAlmostLimit && isStorageTariffAlmostLimit && @@ -510,6 +534,7 @@ export default inject( isStorageQuotaAlmostLimit, isStorageQuotaLimit, isRoomTariffAlmostLimit, + isRoomsTariffLimit, } = currentQuotaStore; const { currentColorScheme, setMainBarVisible } = settingsStore; @@ -547,6 +572,7 @@ export default inject( isStorageQuotaAlmostLimit, isStorageQuotaLimit, isRoomTariffAlmostLimit, + isRoomsTariffLimit, }; }, )(withTranslation(["Profile", "Common"])(observer(Bar))); diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index 8becf76fde..37c7b7920b 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -269,6 +269,11 @@ const QuotasBar = ({ header: t("StorageAndRoomHeader"), description: getUpgradeTariffDescription(), }; + case QuotaBarTypes.RoomsAndStorageTariffLimit: + return { + header: t("StorageAndRoomLimitHeader"), + description: getUpgradeTariffDescription(), + }; case QuotaBarTypes.PersonalUserQuota: return { header: getPersonalQuotaHeader(), diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index d10d88214b..7d5b7f8248 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -104,6 +104,7 @@ export const QuotaBarTypes = Object.freeze({ UserAndStorageTariff: "user-storage-quota", UserAndStorageTariffLimit: "user-storage-quota-limit", RoomsAndStorageTariff: "room-storage-quota", + RoomsAndStorageTariffLimit: "room-storage-quota-limit", PersonalUserQuota: "personal-user-quota", StorageQuota: "tenant-custom-quota", StorageQuotaLimit: "tenant-custom-quota-limit", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 02d84608d8..4fe4b72895 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -335,11 +335,6 @@ class CurrentQuotasStore { }; get isWarningRoomsDialog() { - console.log( - "isRoomsTariffLimit", - this.currentTariffStatusStore?.isGracePeriod, - this.isRoomsTariffLimit, - ); return ( this.currentTariffStatusStore?.isGracePeriod || this.isRoomsTariffLimit );