fix: statistics fix
This commit is contained in:
@@ -8,11 +8,9 @@ export type GetProfitChartDataRequest = {
|
|||||||
baseMarketplaceKey: string;
|
baseMarketplaceKey: string;
|
||||||
projectId: number;
|
projectId: number;
|
||||||
boardId: number;
|
boardId: number;
|
||||||
cardStatusId: number;
|
|
||||||
cardTagId: number;
|
cardTagId: number;
|
||||||
managerId: number;
|
managerId: number;
|
||||||
expenseTagId: number;
|
expenseTagId: number;
|
||||||
incomeTagId: number;
|
incomeTagId: number;
|
||||||
isCompletedOnly: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,10 @@ export type GetProfitTableDataRequest = {
|
|||||||
baseMarketplaceKey: string;
|
baseMarketplaceKey: string;
|
||||||
projectId: number;
|
projectId: number;
|
||||||
boardId: number;
|
boardId: number;
|
||||||
cardStatusId: number;
|
|
||||||
cardTagId: number;
|
cardTagId: number;
|
||||||
managerId: number;
|
managerId: number;
|
||||||
expenseTagId: number;
|
expenseTagId: number;
|
||||||
incomeTagId: number;
|
incomeTagId: number;
|
||||||
isCompletedOnly: boolean;
|
|
||||||
groupTableBy: ProfitTableGroupBy;
|
groupTableBy: ProfitTableGroupBy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
import { DatePickerInput, DatePickerInputProps } from "@mantine/dates";
|
import { DatePickerInput, DatePickerInputProps } from "@mantine/dates";
|
||||||
import { Checkbox, CheckboxProps, Divider, Stack, Text } from "@mantine/core";
|
import { Divider, Stack, Text } from "@mantine/core";
|
||||||
import ClientSelectNew from "../../../../../../components/Selects/ClientSelectNew/ClientSelectNew.tsx";
|
import ClientSelectNew from "../../../../../../components/Selects/ClientSelectNew/ClientSelectNew.tsx";
|
||||||
import {
|
import {
|
||||||
BaseMarketplaceSchema,
|
BaseMarketplaceSchema,
|
||||||
BoardSchema, CardTagSchema,
|
BoardSchema,
|
||||||
|
CardTagSchema,
|
||||||
ClientSchema,
|
ClientSchema,
|
||||||
ProjectSchema,
|
ProjectSchema,
|
||||||
StatusSchema,
|
|
||||||
TransactionTagSchema,
|
TransactionTagSchema,
|
||||||
UserSchema,
|
UserSchema,
|
||||||
} from "../../../../../../client";
|
} from "../../../../../../client";
|
||||||
import { ObjectSelectProps } from "../../../../../../components/ObjectSelect/ObjectSelect.tsx";
|
import { ObjectSelectProps } from "../../../../../../components/ObjectSelect/ObjectSelect.tsx";
|
||||||
import BaseMarketplaceSelect
|
import BaseMarketplaceSelect
|
||||||
from "../../../../../../components/Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx";
|
from "../../../../../../components/Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx";
|
||||||
import CardStatusSelect from "../../../../../../components/CardStatusSelect/CardStatusSelect.tsx";
|
|
||||||
import { ProfitTableSegmentedControl } from "../ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
import { ProfitTableSegmentedControl } from "../ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
||||||
import ManagerSelect from "../../../../../../components/ManagerSelect/ManagerSelect.tsx";
|
import ManagerSelect from "../../../../../../components/ManagerSelect/ManagerSelect.tsx";
|
||||||
import TransactionTagSelect from "../../../../components/ExpenseTagSelect/TransactionTagSelect.tsx";
|
import TransactionTagSelect from "../../../../components/ExpenseTagSelect/TransactionTagSelect.tsx";
|
||||||
@@ -41,15 +40,11 @@ type FiltersProps = {
|
|||||||
|
|
||||||
boardSelectProps?: Omit<ObjectSelectProps<BoardSchema | null>, "data">;
|
boardSelectProps?: Omit<ObjectSelectProps<BoardSchema | null>, "data">;
|
||||||
|
|
||||||
statusSelectProps?: Omit<ObjectSelectProps<StatusSchema | null>, "data">;
|
|
||||||
|
|
||||||
cardTagSelectProps?: Omit<ObjectSelectProps<CardTagSchema | null>, "data">;
|
cardTagSelectProps?: Omit<ObjectSelectProps<CardTagSchema | null>, "data">;
|
||||||
|
|
||||||
managerSelectProps?: SelectProps<UserSchema | null | undefined>;
|
managerSelectProps?: SelectProps<UserSchema | null | undefined>;
|
||||||
onManagerClear?: () => void;
|
onManagerClear?: () => void;
|
||||||
|
|
||||||
isCompletedOnlyCheckboxProps?: CheckboxProps;
|
|
||||||
|
|
||||||
expenseTagSelectProps?: SelectProps<TransactionTagSchema | null>;
|
expenseTagSelectProps?: SelectProps<TransactionTagSchema | null>;
|
||||||
onExpenseTagClear?: () => void;
|
onExpenseTagClear?: () => void;
|
||||||
|
|
||||||
@@ -91,12 +86,6 @@ export const Filters = (props: FiltersProps) => {
|
|||||||
}
|
}
|
||||||
}, [props.projectSelectProps?.value]);
|
}, [props.projectSelectProps?.value]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (props.statusSelectProps?.onClear) {
|
|
||||||
props.statusSelectProps.onClear();
|
|
||||||
}
|
|
||||||
}, [props.boardSelectProps?.value]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack mb={"lg"}>
|
<Stack mb={"lg"}>
|
||||||
<Divider />
|
<Divider />
|
||||||
@@ -126,14 +115,6 @@ export const Filters = (props: FiltersProps) => {
|
|||||||
disabled={!props.projectSelectProps?.value}
|
disabled={!props.projectSelectProps?.value}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{props.statusSelectProps &&
|
|
||||||
<CardStatusSelect
|
|
||||||
board={props.boardSelectProps?.value ?? null}
|
|
||||||
{...props.statusSelectProps}
|
|
||||||
clearable
|
|
||||||
disabled={!props.boardSelectProps?.value}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
{props.cardTagSelectProps &&
|
{props.cardTagSelectProps &&
|
||||||
<CardTagSelect
|
<CardTagSelect
|
||||||
project={props.projectSelectProps?.value ?? null}
|
project={props.projectSelectProps?.value ?? null}
|
||||||
@@ -167,10 +148,6 @@ export const Filters = (props: FiltersProps) => {
|
|||||||
placeholder={"Выберите менеджера"}
|
placeholder={"Выберите менеджера"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
<Checkbox
|
|
||||||
{...props.isCompletedOnlyCheckboxProps}
|
|
||||||
label={"Только завершенные сделки"}
|
|
||||||
/>
|
|
||||||
{getTransactionTagsSelect(false)}
|
{getTransactionTagsSelect(false)}
|
||||||
{getTransactionTagsSelect(true)}
|
{getTransactionTagsSelect(true)}
|
||||||
{props.groupTableByProps &&
|
{props.groupTableByProps &&
|
||||||
|
|||||||
@@ -28,12 +28,10 @@ const useProfitTabContextState = () => {
|
|||||||
marketplace: null,
|
marketplace: null,
|
||||||
project: null,
|
project: null,
|
||||||
board: null,
|
board: null,
|
||||||
status: null,
|
|
||||||
cardTag: null,
|
cardTag: null,
|
||||||
manager: null,
|
manager: null,
|
||||||
expenseTag: null,
|
expenseTag: null,
|
||||||
incomeTag: null,
|
incomeTag: null,
|
||||||
isCompletedOnly: false,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const [isChartLoading, setIsChartLoading] = useState(false);
|
const [isChartLoading, setIsChartLoading] = useState(false);
|
||||||
@@ -53,12 +51,10 @@ const useProfitTabContextState = () => {
|
|||||||
baseMarketplaceKey: form.values.marketplace?.key ?? "all",
|
baseMarketplaceKey: form.values.marketplace?.key ?? "all",
|
||||||
projectId: form.values.project?.id ?? -1,
|
projectId: form.values.project?.id ?? -1,
|
||||||
boardId: form.values.board?.id ?? -1,
|
boardId: form.values.board?.id ?? -1,
|
||||||
cardStatusId: form.values.status?.id ?? -1,
|
|
||||||
cardTagId: form.values.cardTag?.id ?? -1,
|
cardTagId: form.values.cardTag?.id ?? -1,
|
||||||
managerId: form.values.manager?.id ?? -1,
|
managerId: form.values.manager?.id ?? -1,
|
||||||
expenseTagId: form.values.expenseTag?.id ?? -1,
|
expenseTagId: form.values.expenseTag?.id ?? -1,
|
||||||
incomeTagId: form.values.incomeTag?.id ?? -1,
|
incomeTagId: form.values.incomeTag?.id ?? -1,
|
||||||
isCompletedOnly: form.values.isCompletedOnly,
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,11 +42,9 @@ export const ProfitFiltersModal = ({ form }: Props) => {
|
|||||||
onBaseMarketplaceClear={() => form.setFieldValue("marketplace", null)}
|
onBaseMarketplaceClear={() => form.setFieldValue("marketplace", null)}
|
||||||
projectSelectProps={form.getInputProps("project")}
|
projectSelectProps={form.getInputProps("project")}
|
||||||
boardSelectProps={form.getInputProps("board")}
|
boardSelectProps={form.getInputProps("board")}
|
||||||
statusSelectProps={form.getInputProps("status")}
|
|
||||||
cardTagSelectProps={form.getInputProps("cardTag")}
|
cardTagSelectProps={form.getInputProps("cardTag")}
|
||||||
managerSelectProps={form.getInputProps("manager")}
|
managerSelectProps={form.getInputProps("manager")}
|
||||||
onManagerClear={() => form.setFieldValue("manager", null)}
|
onManagerClear={() => form.setFieldValue("manager", null)}
|
||||||
isCompletedOnlyCheckboxProps={form.getInputProps("isCompletedOnly", { type: "checkbox" })}
|
|
||||||
expenseTagSelectProps={form.getInputProps("expenseTag")}
|
expenseTagSelectProps={form.getInputProps("expenseTag")}
|
||||||
onExpenseTagClear={() => form.setFieldValue("expenseTag", null)}
|
onExpenseTagClear={() => form.setFieldValue("expenseTag", null)}
|
||||||
incomeTagSelectProps={form.getInputProps("incomeTag")}
|
incomeTagSelectProps={form.getInputProps("incomeTag")}
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ import {
|
|||||||
GroupStatisticsTable,
|
GroupStatisticsTable,
|
||||||
} from "../tabs/ProfitTab/components/ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
} from "../tabs/ProfitTab/components/ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
||||||
import {
|
import {
|
||||||
BaseMarketplaceSchema, BoardSchema, CardTagSchema,
|
BaseMarketplaceSchema,
|
||||||
|
BoardSchema,
|
||||||
|
CardTagSchema,
|
||||||
ClientSchema,
|
ClientSchema,
|
||||||
ProjectSchema,
|
ProjectSchema,
|
||||||
StatusSchema,
|
|
||||||
TransactionTagSchema,
|
TransactionTagSchema,
|
||||||
UserSchema,
|
UserSchema,
|
||||||
} from "../../../client";
|
} from "../../../client";
|
||||||
@@ -17,10 +18,8 @@ export interface FormFilters {
|
|||||||
marketplace: BaseMarketplaceSchema | null;
|
marketplace: BaseMarketplaceSchema | null;
|
||||||
project: ProjectSchema | null;
|
project: ProjectSchema | null;
|
||||||
board: BoardSchema | null;
|
board: BoardSchema | null;
|
||||||
status: StatusSchema | null;
|
|
||||||
cardTag: CardTagSchema | null;
|
cardTag: CardTagSchema | null;
|
||||||
manager: UserSchema | null;
|
manager: UserSchema | null;
|
||||||
isCompletedOnly: boolean;
|
|
||||||
expenseTag: TransactionTagSchema | null;
|
expenseTag: TransactionTagSchema | null;
|
||||||
incomeTag: TransactionTagSchema | null;
|
incomeTag: TransactionTagSchema | null;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user