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