Client: Changed translation for personal quota.

This commit is contained in:
Tatiana Lopaeva 2024-08-14 14:46:06 +03:00
parent 5994561951
commit 93dd41ff7e
4 changed files with 50 additions and 42 deletions

View File

@ -22,5 +22,7 @@
"UserTariffLimit": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}",
"StorageTariffLimit": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}",
"RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here</1> to upgrade your tariff plan.",
"RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan."
"RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.",
"StorageQuotaPerUserExceeded": "Storage quota per user exceeded",
"PersonalStorageQuotaExceed": "Your personal storage quota exceeded"
}

View File

@ -74,7 +74,7 @@ const Bar = (props) => {
currentColorScheme,
setMainBarVisible,
showUserPersonalQuotaBar,
isPersonalQuotaLimit,
tenantCustomQuota,
isStorageTariffLimit,
@ -140,10 +140,7 @@ const Bar = (props) => {
usersTariff: !closed.includes(QuotaBarTypes.UsersTariff),
}));
}
console.log(
"!closed.includes(QuotaBarTypes.StorageTariff)",
!closed.includes(QuotaBarTypes.StorageTariff),
);
if (isAdmin || isPowerUser || isRoomAdmin) {
setBarVisible((value) => ({
...value,
@ -151,7 +148,9 @@ const Bar = (props) => {
storageTariffLimit: !closed.includes(
QuotaBarTypes.StorageTariffLimit,
),
tenantCustomQuota: !closed.includes(QuotaBarTypes.TenantCustomQuota),
personalUserQuota: !closed.includes(QuotaBarTypes.PersonalUserQuota),
}));
}
@ -172,7 +171,7 @@ const Bar = (props) => {
storageAndUserQuota: isAdmin,
storageAndRoomQuota: isAdmin,
confirmEmail: true,
personalUserQuota: true,
personalUserQuota: isAdmin || isPowerUser || isRoomAdmin,
});
}
@ -275,9 +274,9 @@ const Bar = (props) => {
// case QuotaBarTypes.RoomAndStorageQuota:
// setBarVisible((value) => ({ ...value, storageAndRoomQuota: false }));
// break;
// case QuotaBarTypes.PersonalUserQuota:
// setBarVisible((value) => ({ ...value, personalUserQuota: false }));
// break;
case QuotaBarTypes.PersonalUserQuota:
setBarVisible((value) => ({ ...value, personalUserQuota: false }));
break;
}
setMaintenanceExist(false);
@ -336,11 +335,6 @@ const Bar = (props) => {
// };
// }
console.log(
"isStorageTariffAlmostLimit",
isStorageTariffAlmostLimit,
barVisible.storageTariff,
);
if (isStorageTariffAlmostLimit && barVisible.storageTariff) {
return {
type: QuotaBarTypes.StorageTariff,
@ -372,12 +366,13 @@ const Bar = (props) => {
currentValue: addedManagersCount,
};
}
console.log("isPersonalQuotaLimit", isPersonalQuotaLimit);
if (isPersonalQuotaLimit && barVisible.personalUserQuota) {
return {
type: QuotaBarTypes.PersonalUserQuota,
};
}
// if (showUserPersonalQuotaBar && barVisible.personalUserQuota) {
// return {
// type: QuotaBarTypes.PersonalUserQuota,
// };
// }
return null;
};
@ -452,7 +447,7 @@ export default inject(
showRoomQuotaBar,
isStorageTariffAlmostLimit,
isUserTariffAlmostLimit,
showUserPersonalQuotaBar,
isPersonalQuotaLimit,
tenantCustomQuota,
isStorageTariffLimit,
isUserTariffLimit,
@ -486,7 +481,7 @@ export default inject(
currentColorScheme,
setMainBarVisible,
showUserPersonalQuotaBar,
isPersonalQuotaLimit,
tenantCustomQuota,
isStorageTariffLimit,
isUserTariffLimit,

View File

@ -193,6 +193,33 @@ const QuotasBar = ({
/>
);
};
const getPersonalQuotaDescription = () => {
if (!isAdmin) return t("PersonalUserQuotaDescription");
return (
<Trans
t={t}
i18nKey="PersonalUserQuotaAdminsDescription"
components={{
1: (
<Link
fontSize="12px"
fontWeight="400"
color={currentColorScheme?.main?.accent}
className="error_description_link"
onClick={onClickAction}
/>
),
}}
/>
);
};
const getPersonalQuotaHeader = () => {
if (!isAdmin) return t("PersonalStorageQuotaExceed");
return t("StorageQuotaPerUserExceeded");
};
const getQuotaInfo = () => {
switch (type) {
case QuotaBarTypes.RoomQuota:
@ -237,7 +264,7 @@ const QuotasBar = ({
header: t("UserQuotaHeader", { currentValue, maxValue }),
description: getUserTariffAlmostLimit(),
};
case QuotaBarTypes.TariffLimitPerUser:
case QuotaBarTypes.UsersTariffLimit:
return {
header: t("UserTariffLimit", { currentValue, maxValue }),
description: getUserTariffLimit(),
@ -253,25 +280,9 @@ const QuotasBar = ({
description: getUserQuotaDescription(),
};
case QuotaBarTypes.PersonalUserQuota:
const description = !isAdmin ? (
t("PersonalUserQuotaDescription")
) : (
<Trans i18nKey="PersonalUserQuotaAdminsDescription" t={t}>
To upload and create new files and folders, please free up disk
space, or manage quota per user in the
<Link
fontSize="12px"
fontWeight="400"
color={currentColorScheme?.main?.accent}
onClick={onClickAction}
>
Storage management settings.
</Link>
</Trans>
);
return {
header: t("StorageQuotaExceeded"),
description,
header: getPersonalQuotaHeader(),
description: getPersonalQuotaDescription(),
};
default:

View File

@ -304,7 +304,7 @@ class CurrentQuotasStore {
return this.currentTariffStatusStore?.isGracePeriod;
};
get showUserPersonalQuotaBar() {
get isPersonalQuotaLimit() {
const personalQuotaLimitReached = this.userStore?.personalQuotaLimitReached;
if (!this.isDefaultUsersQuotaSet) return false;