Web: Client: Data Import: fix parseQuota util

This commit is contained in:
Vladimir Khvan 2024-06-10 14:36:36 +05:00
parent 0e92195133
commit e574eee425
7 changed files with 14 additions and 5 deletions

View File

@ -55,7 +55,7 @@ const SelectUsersStep = ({
useEffect(() => {
setSearchValue("");
setQuota(parseQuota(quotaCharacteristics[1]));
setQuota(parseQuota(t, quotaCharacteristics[1]));
}, []);
const handleDataChange = (leftBoundary, rightBoundary) => {

View File

@ -88,7 +88,7 @@ const AddEmailsStep = (props) => {
checkedUsers.withEmail.length + checkedUsers.withoutEmail.length;
useEffect(() => {
setQuota(parseQuota(quotaCharacteristics[1]));
setQuota(parseQuota(t, quotaCharacteristics[1]));
}, []);
const totalUsedUsers =

View File

@ -59,7 +59,7 @@ const SelectUsersStep = (props) => {
useEffect(() => {
setSearchValue("");
setQuota(parseQuota(quotaCharacteristics[1]));
setQuota(parseQuota(t, quotaCharacteristics[1]));
}, []);
const handleDataChange = (leftBoundary, rightBoundary) => {

View File

@ -55,7 +55,7 @@ const SelectUsersStep = ({
useEffect(() => {
setSearchValue("");
setQuota(parseQuota(quotaCharacteristics[1]));
setQuota(parseQuota(t, quotaCharacteristics[1]));
}, []);
const handleDataChange = (leftBoundary, rightBoundary) => {

View File

@ -104,3 +104,11 @@ export interface LayoutProps {
description: string;
component: JSX.Element;
}
export type TQuota = {
id: string;
priceTitle: string;
type: string;
used: { title: string; value: number };
value: number;
};

View File

@ -25,8 +25,9 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import { PortalFeaturesLimitations } from "@docspace/shared/enums";
import { getConvertedSize } from "@docspace/shared/utils/common";
import { TFunciton, TQuota } from "../types";
export const parseQuota = (quotaCharacteristics) => {
export const parseQuota = (t: TFunciton, quotaCharacteristics: TQuota) => {
const maxValue = quotaCharacteristics.value;
const usedValue = quotaCharacteristics.used.value;