diff --git a/packages/client/public/locales/en/Settings.json b/packages/client/public/locales/en/Settings.json index d8a63e8790..fa3e943305 100644 --- a/packages/client/public/locales/en/Settings.json +++ b/packages/client/public/locales/en/Settings.json @@ -258,10 +258,10 @@ "Statistics": "Statistics", "StorageManagement": "Storage management", "StoragePeriod": "Storage period", - "StorageQuotaWarningDescription": "Storage quota is enabled for this {{productName}}: {{roomsQuotaLimit}} for rooms, {{usersQuotaLimit}} for users. Limitations can occur during data import.", - "RoomsQuotaWarningDescription": "Storage quota is enabled for this {{productName}}: {{roomsQuotaLimit}} for rooms. Limitations can occur during data import.", - "UsersQuotaWarningDescription": "Storage quota is enabled for this {{productName}}: {{usersQuotaLimit}} for users. Limitations can occur during data import.", - + "StorageQuotaWarningDescription": "Storage quota is enabled for this {{productName}}: {{quotaLimits}}. Limitations can occur during data import.", + "RoomsQuotaLimit": "{{roomsQuotaLimit}} for rooms", + "UsersQuotaLimit": "{{usersQuotaLimit}} for users", + "TenantQuotaLimit": "{{tenantQuotaLimit}} for {{productName}}", "StudioTimeLanguageSettings": "Language and Time Zone Settings", "Submit": "Submit", "SuccessfullySaveGreetingSettingsMessage": "Welcome Page settings have been successfully saved", diff --git a/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.tsx b/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.tsx index cf53f8b9f3..f5b19b5a24 100644 --- a/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.tsx +++ b/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.tsx @@ -41,30 +41,45 @@ export const WarningQuotaDialog = ({ onCloseDialog, defaultRoomsQuota, defaultUsersQuota, + tenantCustomQuota, isDefaultRoomsQuotaSet, isDefaultUsersQuotaSet, + isTenantCustomQuotaSet, }: WarningQuotaDialogProps) => { const getWarningDescription = () => { - if (isDefaultRoomsQuotaSet && isDefaultUsersQuotaSet) { - return t("Settings:StorageQuotaWarningDescription", { - usersQuotaLimit: getConvertedSize(t, defaultUsersQuota), - roomsQuotaLimit: getConvertedSize(t, defaultRoomsQuota), - productName: t("Common:ProductName"), - }); - } + const quotaLimits = []; + if (isDefaultRoomsQuotaSet) { - return t("Settings:RoomsQuotaWarningDescription", { - roomsQuotaLimit: getConvertedSize(t, defaultRoomsQuota), - productName: t("Common:ProductName"), - }); + quotaLimits.push( + t("Settings:RoomsQuotaLimit", { + roomsQuotaLimit: getConvertedSize(t, defaultRoomsQuota), + }), + ); } if (isDefaultUsersQuotaSet) { - return t("Settings:UsersQuotaWarningDescription", { - usersQuotaLimit: getConvertedSize(t, defaultUsersQuota), - productName: t("Common:ProductName"), - }); + quotaLimits.push( + t("Settings:UsersQuotaLimit", { + usersQuotaLimit: getConvertedSize(t, defaultUsersQuota), + }), + ); } - return ""; + if (isTenantCustomQuotaSet) { + quotaLimits.push( + t("Settings:TenantQuotaLimit", { + tenantQuotaLimit: getConvertedSize(t, tenantCustomQuota), + productName: t("Common:ProductName"), + }), + ); + } + + if (quotaLimits.length === 0) { + return ""; + } + + return t("Settings:StorageQuotaWarningDescription", { + quotaLimits: quotaLimits.join(", "), + productName: t("Common:ProductName"), + }); }; return ( diff --git a/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.types.ts b/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.types.ts index a827e0431c..1f4266a7ad 100644 --- a/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.types.ts +++ b/packages/client/src/components/dialogs/WarningQuotaDialog/WarningQuotaDialog.types.ts @@ -33,6 +33,8 @@ export interface WarningQuotaDialogProps { onClickRedirect: () => void; defaultRoomsQuota: number; defaultUsersQuota: number; + tenantCustomQuota: number; isDefaultRoomsQuotaSet?: boolean; isDefaultUsersQuotaSet?: boolean; + isTenantCustomQuotaSet?: boolean; } diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/components/SelectFileStep.tsx b/packages/client/src/pages/PortalSettings/categories/data-import/components/SelectFileStep.tsx index 5cbde38822..75b2ee79ba 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/components/SelectFileStep.tsx +++ b/packages/client/src/pages/PortalSettings/categories/data-import/components/SelectFileStep.tsx @@ -158,8 +158,10 @@ const SelectFileStep = (props: SelectFileStepProps) => { uploadFiles, defaultUsersQuota = 0, defaultRoomsQuota = 0, + tenantCustomQuota = 0, isDefaultUsersQuotaSet, isDefaultRoomsQuotaSet, + isTenantCustomQuotaSet, warningQuotaDialogVisible, setWarningQuotaDialogVisible, } = props as InjectedSelectFileStepProps; @@ -184,10 +186,12 @@ const SelectFileStep = (props: SelectFileStepProps) => { useEffect(() => { const isQuotaWarningVisible = - isDefaultUsersQuotaSet || isDefaultRoomsQuotaSet; + isDefaultUsersQuotaSet || + isDefaultRoomsQuotaSet || + isTenantCustomQuotaSet; setWarningQuotaDialogVisible(isQuotaWarningVisible); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [isDefaultUsersQuotaSet, isDefaultRoomsQuotaSet]); + }, [isDefaultUsersQuotaSet, isDefaultRoomsQuotaSet, isTenantCustomQuotaSet]); const onClickRedirect = () => { navigate("/portal-settings/management/disk-space"); @@ -505,8 +509,10 @@ const SelectFileStep = (props: SelectFileStepProps) => { onClickRedirect={onClickRedirect} defaultRoomsQuota={defaultRoomsQuota} defaultUsersQuota={defaultUsersQuota} + tenantCustomQuota={tenantCustomQuota} isDefaultRoomsQuotaSet={isDefaultRoomsQuotaSet} isDefaultUsersQuotaSet={isDefaultUsersQuotaSet} + isTenantCustomQuotaSet={isTenantCustomQuotaSet} /> )} @@ -540,8 +546,10 @@ export default inject( const { isDefaultRoomsQuotaSet, isDefaultUsersQuotaSet, + isTenantCustomQuotaSet, defaultUsersQuota, defaultRoomsQuota, + tenantCustomQuota, } = currentQuotaStore; return { @@ -562,8 +570,10 @@ export default inject( uploadFiles, defaultUsersQuota, defaultRoomsQuota, + tenantCustomQuota, isDefaultRoomsQuotaSet, isDefaultUsersQuotaSet, + isTenantCustomQuotaSet, warningQuotaDialogVisible, setWarningQuotaDialogVisible, }; diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/types/index.ts b/packages/client/src/pages/PortalSettings/categories/data-import/types/index.ts index 0065378aea..419a1ad7da 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/types/index.ts +++ b/packages/client/src/pages/PortalSettings/categories/data-import/types/index.ts @@ -72,8 +72,10 @@ export interface InjectedSelectFileStepProps extends SelectFileStepProps { uploadFiles: TStore["importAccountsStore"]["uploadFiles"]; defaultUsersQuota: TStore["currentQuotaStore"]["defaultUsersQuota"]; defaultRoomsQuota: TStore["currentQuotaStore"]["defaultRoomsQuota"]; + tenantCustomQuota: TStore["currentQuotaStore"]["tenantCustomQuota"]; isDefaultUsersQuotaSet: TStore["currentQuotaStore"]["isDefaultUsersQuotaSet"]; isDefaultRoomsQuotaSet: TStore["currentQuotaStore"]["isDefaultRoomsQuotaSet"]; + isTenantCustomQuotaSet: TStore["currentQuotaStore"]["isTenantCustomQuotaSet"]; warningQuotaDialogVisible: TStore["dialogsStore"]["warningQuotaDialogVisible"]; setWarningQuotaDialogVisible: TStore["dialogsStore"]["setWarningQuotaDialogVisible"]; }