Client: Updated room and storage bar when almost reaching the tariff limit.
This commit is contained in:
parent
5ab2fbeb15
commit
266fdabc75
@ -14,7 +14,7 @@
|
|||||||
"RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here</1> to upgrade your tariff plan.",
|
"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.",
|
||||||
"RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.",
|
"RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.",
|
||||||
"StorageAndRoomHeader": "Storage and rooms limits are about to be exceeded.",
|
"StorageAndRoomHeader": "The limit for storage space and the number of rooms is about to be exceeded.",
|
||||||
"StorageAndUserHeader": "The limit for storage space and the number of admins/power users is about to be exceeded.",
|
"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}}",
|
"StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}",
|
||||||
|
@ -81,6 +81,7 @@ const Bar = (props) => {
|
|||||||
isUserTariffLimit,
|
isUserTariffLimit,
|
||||||
isStorageQuotaAlmostLimit,
|
isStorageQuotaAlmostLimit,
|
||||||
isStorageQuotaLimit,
|
isStorageQuotaLimit,
|
||||||
|
isRoomTariffAlmostLimit,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -95,6 +96,7 @@ const Bar = (props) => {
|
|||||||
usersTariffLimit: false,
|
usersTariffLimit: false,
|
||||||
storageAndUserTariff: false,
|
storageAndUserTariff: false,
|
||||||
storageAndUserTariffLimit: false,
|
storageAndUserTariffLimit: false,
|
||||||
|
roomsAndStorageTariff: false,
|
||||||
storageAndRoomQuota: false,
|
storageAndRoomQuota: false,
|
||||||
confirmEmail: false,
|
confirmEmail: false,
|
||||||
personalUserQuota: false,
|
personalUserQuota: false,
|
||||||
@ -142,6 +144,9 @@ const Bar = (props) => {
|
|||||||
storageAndUserTariff: !closed.includes(
|
storageAndUserTariff: !closed.includes(
|
||||||
QuotaBarTypes.UserAndStorageTariff,
|
QuotaBarTypes.UserAndStorageTariff,
|
||||||
),
|
),
|
||||||
|
roomsAndStorageTariff: closed.includes(
|
||||||
|
QuotaBarTypes.RoomsAndStorageTariff,
|
||||||
|
),
|
||||||
storageAndUserTariffLimit: !closed.includes(
|
storageAndUserTariffLimit: !closed.includes(
|
||||||
QuotaBarTypes.UserAndStorageTariffLimit,
|
QuotaBarTypes.UserAndStorageTariffLimit,
|
||||||
),
|
),
|
||||||
@ -177,6 +182,7 @@ const Bar = (props) => {
|
|||||||
usersTariff: isAdmin | isRoomAdmin,
|
usersTariff: isAdmin | isRoomAdmin,
|
||||||
usersTariffLimit: isAdmin | isRoomAdmin,
|
usersTariffLimit: isAdmin | isRoomAdmin,
|
||||||
storageAndUserTariff: isAdmin | isRoomAdmin,
|
storageAndUserTariff: isAdmin | isRoomAdmin,
|
||||||
|
roomsAndStorageTariff: isAdmin | isRoomAdmin,
|
||||||
storageAndUserTariffLimit: isAdmin | isRoomAdmin,
|
storageAndUserTariffLimit: isAdmin | isRoomAdmin,
|
||||||
storageAndRoomQuota: isAdmin,
|
storageAndRoomQuota: isAdmin,
|
||||||
confirmEmail: true,
|
confirmEmail: true,
|
||||||
@ -289,9 +295,9 @@ const Bar = (props) => {
|
|||||||
storageAndUserTariffLimit: false,
|
storageAndUserTariffLimit: false,
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
// case QuotaBarTypes.RoomAndStorageQuota:
|
case QuotaBarTypes.RoomsAndStorageTariff:
|
||||||
// setBarVisible((value) => ({ ...value, storageAndRoomQuota: false }));
|
setBarVisible((value) => ({ ...value, roomsAndStorageTariff: false }));
|
||||||
// break;
|
break;
|
||||||
case QuotaBarTypes.PersonalUserQuota:
|
case QuotaBarTypes.PersonalUserQuota:
|
||||||
setBarVisible((value) => ({ ...value, personalUserQuota: false }));
|
setBarVisible((value) => ({ ...value, personalUserQuota: false }));
|
||||||
break;
|
break;
|
||||||
@ -331,6 +337,19 @@ const Bar = (props) => {
|
|||||||
isStorageTariffAlmostLimit,
|
isStorageTariffAlmostLimit,
|
||||||
barVisible.storageAndUserTariff,
|
barVisible.storageAndUserTariff,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
isRoomTariffAlmostLimit &&
|
||||||
|
isStorageTariffAlmostLimit &&
|
||||||
|
barVisible.roomsAndStorageTariff
|
||||||
|
) {
|
||||||
|
return {
|
||||||
|
type: QuotaBarTypes.RoomsAndStorageTariff,
|
||||||
|
maxValue: null,
|
||||||
|
currentValue: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isUserTariffAlmostLimit &&
|
isUserTariffAlmostLimit &&
|
||||||
isStorageTariffAlmostLimit &&
|
isStorageTariffAlmostLimit &&
|
||||||
@ -342,6 +361,7 @@ const Bar = (props) => {
|
|||||||
currentValue: null,
|
currentValue: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isUserTariffLimit &&
|
isUserTariffLimit &&
|
||||||
isStorageTariffLimit &&
|
isStorageTariffLimit &&
|
||||||
@ -495,6 +515,7 @@ export default inject(
|
|||||||
isUserTariffLimit,
|
isUserTariffLimit,
|
||||||
isStorageQuotaAlmostLimit,
|
isStorageQuotaAlmostLimit,
|
||||||
isStorageQuotaLimit,
|
isStorageQuotaLimit,
|
||||||
|
isRoomTariffAlmostLimit,
|
||||||
} = currentQuotaStore;
|
} = currentQuotaStore;
|
||||||
|
|
||||||
const { currentColorScheme, setMainBarVisible } = settingsStore;
|
const { currentColorScheme, setMainBarVisible } = settingsStore;
|
||||||
@ -531,6 +552,7 @@ export default inject(
|
|||||||
isUserTariffLimit,
|
isUserTariffLimit,
|
||||||
isStorageQuotaAlmostLimit,
|
isStorageQuotaAlmostLimit,
|
||||||
isStorageQuotaLimit,
|
isStorageQuotaLimit,
|
||||||
|
isRoomTariffAlmostLimit,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
)(withTranslation(["Profile", "Common"])(observer(Bar)));
|
)(withTranslation(["Profile", "Common"])(observer(Bar)));
|
||||||
|
@ -287,10 +287,10 @@ const QuotasBar = ({
|
|||||||
header: t("StorageAndUserTariffLimitHeader"),
|
header: t("StorageAndUserTariffLimitHeader"),
|
||||||
description: getUpgradeTariffDescription(),
|
description: getUpgradeTariffDescription(),
|
||||||
};
|
};
|
||||||
case QuotaBarTypes.RoomAndStorageQuota:
|
case QuotaBarTypes.RoomsAndStorageTariff:
|
||||||
return {
|
return {
|
||||||
header: t("StorageAndRoomHeader", { currentValue, maxValue }),
|
header: t("StorageAndRoomHeader"),
|
||||||
description: getUserQuotaDescription(),
|
description: getUpgradeTariffDescription(),
|
||||||
};
|
};
|
||||||
case QuotaBarTypes.PersonalUserQuota:
|
case QuotaBarTypes.PersonalUserQuota:
|
||||||
return {
|
return {
|
||||||
|
@ -103,7 +103,7 @@ export const QuotaBarTypes = Object.freeze({
|
|||||||
UsersTariffLimit: "user-quota-limit",
|
UsersTariffLimit: "user-quota-limit",
|
||||||
UserAndStorageTariff: "user-storage-quota",
|
UserAndStorageTariff: "user-storage-quota",
|
||||||
UserAndStorageTariffLimit: "user-storage-quota-limit",
|
UserAndStorageTariffLimit: "user-storage-quota-limit",
|
||||||
RoomAndStorageQuota: "room-storage-quota",
|
RoomsAndStorageTariff: "room-storage-quota",
|
||||||
PersonalUserQuota: "personal-user-quota",
|
PersonalUserQuota: "personal-user-quota",
|
||||||
StorageQuota: "tenant-custom-quota",
|
StorageQuota: "tenant-custom-quota",
|
||||||
StorageQuotaLimit: "tenant-custom-quota-limit",
|
StorageQuotaLimit: "tenant-custom-quota-limit",
|
||||||
|
@ -252,6 +252,13 @@ class CurrentQuotasStore {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isRoomTariffAlmostLimit() {
|
||||||
|
return (
|
||||||
|
this.maxCountRoomsByQuota - this.usedRoomsCount <=
|
||||||
|
COUNT_FOR_SHOWING_BAR && this.usedRoomsCount < this.maxCountRoomsByQuota
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
get isStorageTariffAlmostLimit() {
|
get isStorageTariffAlmostLimit() {
|
||||||
return (
|
return (
|
||||||
(this.usedTotalStorageSizeCount / this.maxTotalSizeByQuota) * 100 >=
|
(this.usedTotalStorageSizeCount / this.maxTotalSizeByQuota) * 100 >=
|
||||||
@ -296,11 +303,6 @@ class CurrentQuotasStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get isUserTariffAlmostLimit() {
|
get isUserTariffAlmostLimit() {
|
||||||
console.log(
|
|
||||||
"isUserTariffAlmostLimit",
|
|
||||||
this.addedManagersCount,
|
|
||||||
this.maxCountManagersByQuota,
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
this.addedManagersCount > 1 &&
|
this.addedManagersCount > 1 &&
|
||||||
this.maxCountManagersByQuota - this.addedManagersCount <=
|
this.maxCountManagersByQuota - this.addedManagersCount <=
|
||||||
|
Loading…
Reference in New Issue
Block a user