[WEB-4323] refactor: Analytics refactor (#7213)

* 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

* refactor: rename insightsFields to ANALYTICS_INSIGHTS_FIELDS and update analytics tab import to use getAnalyticsTabs function

* feat: update AnalyticsWrapper to use i18n for titles and add new translation for "no_of" in Russian

* fix: update yAxis labels and offsets in various charts to use new translation key and improve layout

* feat: define AnalyticsTab interface and refactor getAnalyticsTabs function for improved type safety

* fix: update AnalyticsTab interface to use TAnalyticsTabsBase for improved type safety

* fix: add whitespace-nowrap class to TableHead for improved header layout in DataTable component
This commit is contained in:
JayashTripathy 2025-06-16 14:01:49 +05:30 committed by GitHub
parent 6fe0415d66
commit 0fa9c8b015
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 41 additions and 34 deletions

View file

@ -11,7 +11,7 @@ export interface IInsightField {
};
}
export const insightsFields: Record<TAnalyticsTabsBase, IInsightField[]> = {
export const ANALYTICS_INSIGHTS_FIELDS: Record<TAnalyticsTabsBase, IInsightField[]> = {
overview: [
{
key: "total_users",

View file

@ -881,7 +881,8 @@
"completed": "Завершено",
"in_progress": "В процессе",
"planned": "Запланировано",
"paused": "На паузе"
"paused": "На паузе",
"no_of": "Количество {entity}"
},
"chart": {
"x_axis": "Ось X",

View file

@ -124,8 +124,8 @@ export const BarChart = React.memo(<K extends string, T extends string>(props: T
value: yAxis.label,
angle: -90,
position: "bottom",
offset: -24,
dx: -16,
offset: yAxis.offset ?? -24,
dx: yAxis.dx ?? -16,
className: AXIS_LABEL_CLASSNAME,
}}
tick={(props) => <CustomYAxisTick {...props} />}

View file

@ -4,6 +4,12 @@ import { Row } from "@tanstack/react-table";
export type TAnalyticsTabsBase = "overview" | "work-items";
export type TAnalyticsGraphsBase = "projects" | "work-items" | "custom-work-items";
export interface AnalyticsTab {
key: TAnalyticsTabsBase;
label: string;
content: React.FC;
isDisabled: boolean;
}
export type TAnalyticsFilterParams = {
project_ids?: string;
cycle_id?: string;