[WEB-4246] Analytics minor improvements (#7194)
* chore: updated label for epics
* chore: improved export logic
* refactor: move csvConfig to export.ts and clean up export logic
* refactor: remove unused CSV export logic from WorkItemsInsightTable component
* refactor: streamline data handling in InsightTable component for improved rendering
* feat: add translation for "No. of {entity}" and update priority chart y-axis label to use new translation
* refactor: cleaned up some component and added utilitites
* feat: add "at_risk" translation to multiple languages in translations.json files
* refactor: update TrendPiece component to use new status variants for analytics
* fix: adjust TrendPiece component logic for on-track and off-track status
* refactor: use nullish coalescing operator for yAxis.dx in line and scatter charts
* feat: add "at_risk" translation to various languages in translations.json files
* feat: add "no_of" translation to various languages in translations.json files
* feat: update "at_risk" translation in Ukrainian, Vietnamese, and Chinese locales in translations.json files
This commit is contained in:
parent
ad11a34efc
commit
c1a078ef3f
37 changed files with 383 additions and 252 deletions
15
packages/types/src/analytics.d.ts
vendored
15
packages/types/src/analytics.d.ts
vendored
|
|
@ -1,5 +1,6 @@
|
|||
import { ChartXAxisProperty, ChartYAxisMetric } from "@plane/constants";
|
||||
import { TChartData } from "./charts";
|
||||
import { Row } from "@tanstack/react-table";
|
||||
|
||||
export type TAnalyticsTabsBase = "overview" | "work-items";
|
||||
export type TAnalyticsGraphsBase = "projects" | "work-items" | "custom-work-items";
|
||||
|
|
@ -20,12 +21,6 @@ export interface IAnalyticsResponseFields {
|
|||
filter_count: number;
|
||||
}
|
||||
|
||||
export interface IAnalyticsRadarEntity {
|
||||
key: string;
|
||||
name: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
// chart types
|
||||
|
||||
export interface IChartResponse {
|
||||
|
|
@ -43,7 +38,7 @@ export interface WorkItemInsightColumns {
|
|||
backlog_work_items: number;
|
||||
un_started_work_items: number;
|
||||
started_work_items: number;
|
||||
// because of the peek view, we will display the name of the project instead of project__name
|
||||
// incase of peek view, we will display the display_name instead of project__name
|
||||
display_name?: string;
|
||||
avatar_url?: string;
|
||||
assignee_id?: string;
|
||||
|
|
@ -58,3 +53,9 @@ export interface IAnalyticsParams {
|
|||
y_axis: ChartYAxisMetric;
|
||||
group_by?: ChartXAxisProperty;
|
||||
}
|
||||
|
||||
export type ExportConfig<T> = {
|
||||
key: string;
|
||||
value: (row: Row<T>) => string | number;
|
||||
label?: string;
|
||||
};
|
||||
|
|
|
|||
29
packages/types/src/charts/index.d.ts
vendored
29
packages/types/src/charts/index.d.ts
vendored
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
|
||||
// ============================================================
|
||||
// Chart Base
|
||||
// Chart Base
|
||||
// ============================================================
|
||||
export * from "./common";
|
||||
export type TChartLegend = {
|
||||
|
|
@ -48,10 +46,11 @@ type TChartProps<K extends string, T extends string> = {
|
|||
y?: number;
|
||||
};
|
||||
showTooltip?: boolean;
|
||||
customTooltipContent?: (props: { active?: boolean; label: string; payload: any }) => React.ReactNode;
|
||||
};
|
||||
|
||||
// ============================================================
|
||||
// Bar Chart
|
||||
// Bar Chart
|
||||
// ============================================================
|
||||
|
||||
export type TBarItem<T extends string> = {
|
||||
|
|
@ -71,7 +70,7 @@ export type TBarChartProps<K extends string, T extends string> = TChartProps<K,
|
|||
};
|
||||
|
||||
// ============================================================
|
||||
// Line Chart
|
||||
// Line Chart
|
||||
// ============================================================
|
||||
|
||||
export type TLineItem<T extends string> = {
|
||||
|
|
@ -90,7 +89,7 @@ export type TLineChartProps<K extends string, T extends string> = TChartProps<K,
|
|||
};
|
||||
|
||||
// ============================================================
|
||||
// Scatter Chart
|
||||
// Scatter Chart
|
||||
// ============================================================
|
||||
|
||||
export type TScatterPointItem<T extends string> = {
|
||||
|
|
@ -105,7 +104,7 @@ export type TScatterChartProps<K extends string, T extends string> = TChartProps
|
|||
};
|
||||
|
||||
// ============================================================
|
||||
// Area Chart
|
||||
// Area Chart
|
||||
// ============================================================
|
||||
|
||||
export type TAreaItem<T extends string> = {
|
||||
|
|
@ -130,7 +129,7 @@ export type TAreaChartProps<K extends string, T extends string> = TChartProps<K,
|
|||
};
|
||||
|
||||
// ============================================================
|
||||
// Pie Chart
|
||||
// Pie Chart
|
||||
// ============================================================
|
||||
|
||||
export type TCellItem<T extends string> = {
|
||||
|
|
@ -161,7 +160,7 @@ export type TPieChartProps<K extends string, T extends string> = Pick<
|
|||
};
|
||||
|
||||
// ============================================================
|
||||
// Tree Map
|
||||
// Tree Map
|
||||
// ============================================================
|
||||
|
||||
export type TreeMapItem = {
|
||||
|
|
@ -171,13 +170,13 @@ export type TreeMapItem = {
|
|||
textClassName?: string;
|
||||
icon?: React.ReactElement;
|
||||
} & (
|
||||
| {
|
||||
| {
|
||||
fillColor: string;
|
||||
}
|
||||
| {
|
||||
| {
|
||||
fillClassName: string;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
export type TreeMapChartProps = {
|
||||
data: TreeMapItem[];
|
||||
|
|
@ -217,8 +216,8 @@ export type TRadarItem<T extends string> = {
|
|||
dot?: {
|
||||
r: number;
|
||||
fillOpacity: number;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export type TRadarChartProps<K extends string, T extends string> = Pick<
|
||||
TChartProps<K, T>,
|
||||
|
|
@ -231,4 +230,4 @@ export type TRadarChartProps<K extends string, T extends string> = Pick<
|
|||
label?: string;
|
||||
strokeColor?: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue