[WEB-4230] refactor: Analytics code refacor, Removal of nivo charts dependencies and translations (#7131)
* chore: added code split for the analytics store * chore: done some refactor * refactor: update entity keys in analytics and translations * chore: updated the translations * refactor: simplify AnalyticsStoreV2 class by removing unnecessary constructor * feat: add AnalyticsStoreV2 class and interface for enhanced analytics functionality * feat: enhance WorkItemsModal and analytics store with isEpic functionality * feat: integrate isEpic state into TotalInsights and WorkItemsModal components * refactor: remove isEpic state from WorkItemsModalMainContent component * refactor: removed old analytics components and related services * refactor: new analytics * refactor: removed all nivo chart dependencies * chore: resolved coderabbit comments * fix: update processUrl to handle custom-work-items in peek view * feat: implement CSV export functionality in InsightTable component * feat: enhance analytics service with filter parameters and improve data handling in InsightTable * feat: add new translation keys for various statuses across multiple languages * [WEB-4246] fix: enhance analytics components to include 'isEpic' parameter for improved data fetching * chore: update yarn.lock to remove deprecated @nivo packages and clean up unused dependencies
This commit is contained in:
parent
570a9e319e
commit
14d2d69120
151 changed files with 1144 additions and 4800 deletions
55
packages/types/src/analytics-v2.d.ts
vendored
55
packages/types/src/analytics-v2.d.ts
vendored
|
|
@ -1,55 +0,0 @@
|
|||
import { ChartXAxisProperty, ChartYAxisMetric } from "@plane/constants";
|
||||
import { TChartData } from "./charts";
|
||||
|
||||
export type TAnalyticsTabsV2Base = "overview" | "work-items";
|
||||
export type TAnalyticsGraphsV2Base = "projects" | "work-items" | "custom-work-items";
|
||||
|
||||
// service types
|
||||
|
||||
export interface IAnalyticsResponseV2 {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface IAnalyticsResponseFieldsV2 {
|
||||
count: number;
|
||||
filter_count: number;
|
||||
}
|
||||
|
||||
export interface IAnalyticsRadarEntityV2 {
|
||||
key: string;
|
||||
name: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
// chart types
|
||||
|
||||
export interface IChartResponseV2 {
|
||||
schema: Record<string, string>;
|
||||
data: TChartData<string, string>[];
|
||||
}
|
||||
|
||||
// table types
|
||||
|
||||
export interface WorkItemInsightColumns {
|
||||
project_id?: string;
|
||||
project__name?: string;
|
||||
cancelled_work_items: number;
|
||||
completed_work_items: number;
|
||||
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
|
||||
display_name?: string;
|
||||
avatar_url?: string;
|
||||
assignee_id?: string;
|
||||
}
|
||||
|
||||
export type AnalyticsTableDataMap = {
|
||||
"work-items": WorkItemInsightColumns;
|
||||
};
|
||||
|
||||
export interface IAnalyticsV2Params {
|
||||
x_axis: ChartXAxisProperty;
|
||||
y_axis: ChartYAxisMetric;
|
||||
group_by?: ChartXAxisProperty;
|
||||
}
|
||||
156
packages/types/src/analytics.d.ts
vendored
156
packages/types/src/analytics.d.ts
vendored
|
|
@ -1,116 +1,60 @@
|
|||
import { ChartXAxisProperty, ChartYAxisMetric } from "@plane/constants";
|
||||
import { TChartData } from "./charts";
|
||||
|
||||
export type TAnalyticsTabsBase = "overview" | "work-items";
|
||||
export type TAnalyticsGraphsBase = "projects" | "work-items" | "custom-work-items";
|
||||
export type TAnalyticsFilterParams = {
|
||||
project_ids?: string;
|
||||
cycle_id?: string;
|
||||
module_id?: string;
|
||||
};
|
||||
|
||||
// service types
|
||||
|
||||
export interface IAnalyticsResponse {
|
||||
total: number;
|
||||
distribution: IAnalyticsData;
|
||||
extras: {
|
||||
assignee_details: IAnalyticsAssigneeDetails[];
|
||||
cycle_details: IAnalyticsCycleDetails[];
|
||||
label_details: IAnalyticsLabelDetails[];
|
||||
module_details: IAnalyticsModuleDetails[];
|
||||
state_details: IAnalyticsStateDetails[];
|
||||
};
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface IAnalyticsData {
|
||||
[key: string]: {
|
||||
dimension: string | null;
|
||||
segment?: string;
|
||||
count?: number;
|
||||
estimate?: number | null;
|
||||
}[];
|
||||
export interface IAnalyticsResponseFields {
|
||||
count: number;
|
||||
filter_count: number;
|
||||
}
|
||||
|
||||
export interface IAnalyticsAssigneeDetails {
|
||||
assignees__avatar_url: string | null;
|
||||
assignees__display_name: string | null;
|
||||
assignees__first_name: string;
|
||||
assignees__id: string | null;
|
||||
assignees__last_name: string;
|
||||
}
|
||||
|
||||
export interface IAnalyticsCycleDetails {
|
||||
issue_cycle__cycle__name: string | null;
|
||||
issue_cycle__cycle_id: string | null;
|
||||
}
|
||||
|
||||
export interface IAnalyticsLabelDetails {
|
||||
labels__color: string | null;
|
||||
labels__id: string | null;
|
||||
labels__name: string | null;
|
||||
}
|
||||
|
||||
export interface IAnalyticsModuleDetails {
|
||||
issue_module__module__name: string | null;
|
||||
issue_module__module_id: string | null;
|
||||
}
|
||||
|
||||
export interface IAnalyticsStateDetails {
|
||||
state__color: string;
|
||||
state__name: string;
|
||||
state_id: string;
|
||||
}
|
||||
|
||||
export type TXAxisValues =
|
||||
| "state_id"
|
||||
| "state__group"
|
||||
| "labels__id"
|
||||
| "assignees__id"
|
||||
| "estimate_point__value"
|
||||
| "issue_cycle__cycle_id"
|
||||
| "issue_module__module_id"
|
||||
| "priority"
|
||||
| "start_date"
|
||||
| "target_date"
|
||||
| "created_at"
|
||||
| "completed_at";
|
||||
|
||||
export type TYAxisValues = "issue_count" | "estimate";
|
||||
|
||||
export interface IAnalyticsParams {
|
||||
x_axis: TXAxisValues;
|
||||
y_axis: TYAxisValues;
|
||||
segment?: TXAxisValues | null;
|
||||
project?: string[] | null;
|
||||
cycle?: string | null;
|
||||
module?: string | null;
|
||||
}
|
||||
|
||||
export interface ISaveAnalyticsFormData {
|
||||
export interface IAnalyticsRadarEntity {
|
||||
key: string;
|
||||
name: string;
|
||||
description: string;
|
||||
query_dict: IExportAnalyticsFormData;
|
||||
}
|
||||
export interface IExportAnalyticsFormData {
|
||||
x_axis: TXAxisValues;
|
||||
y_axis: TYAxisValues;
|
||||
segment?: TXAxisValues | null;
|
||||
project?: string[];
|
||||
}
|
||||
|
||||
export interface IDefaultAnalyticsUser {
|
||||
assignees__avatar_url: string | null;
|
||||
assignees__first_name: string;
|
||||
assignees__last_name: string;
|
||||
assignees__display_name: string;
|
||||
assignees__id: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface IDefaultAnalyticsResponse {
|
||||
issue_completed_month_wise: { month: number; count: number }[];
|
||||
most_issue_closed_user: IDefaultAnalyticsUser[];
|
||||
most_issue_created_user: {
|
||||
created_by__avatar_url: string | null;
|
||||
created_by__first_name: string;
|
||||
created_by__last_name: string;
|
||||
created_by__display_name: string;
|
||||
created_by__id: string;
|
||||
count: number;
|
||||
}[];
|
||||
open_estimate_sum: number;
|
||||
open_issues: number;
|
||||
open_issues_classified: { state_group: string; state_count: number }[];
|
||||
pending_issue_user: IDefaultAnalyticsUser[];
|
||||
total_estimate_sum: number;
|
||||
total_issues: number;
|
||||
total_issues_classified: { state_group: string; state_count: number }[];
|
||||
// chart types
|
||||
|
||||
export interface IChartResponse {
|
||||
schema: Record<string, string>;
|
||||
data: TChartData<string, string>[];
|
||||
}
|
||||
|
||||
// table types
|
||||
|
||||
export interface WorkItemInsightColumns {
|
||||
project_id?: string;
|
||||
project__name?: string;
|
||||
cancelled_work_items: number;
|
||||
completed_work_items: number;
|
||||
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
|
||||
display_name?: string;
|
||||
avatar_url?: string;
|
||||
assignee_id?: string;
|
||||
}
|
||||
|
||||
export type AnalyticsTableDataMap = {
|
||||
"work-items": WorkItemInsightColumns;
|
||||
};
|
||||
|
||||
export interface IAnalyticsParams {
|
||||
x_axis: ChartXAxisProperty;
|
||||
y_axis: ChartYAxisMetric;
|
||||
group_by?: ChartXAxisProperty;
|
||||
}
|
||||
|
|
|
|||
2
packages/types/src/index.d.ts
vendored
2
packages/types/src/index.d.ts
vendored
|
|
@ -43,4 +43,4 @@ export * from "./home";
|
|||
export * from "./stickies";
|
||||
export * from "./utils";
|
||||
export * from "./payment";
|
||||
export * from "./analytics-v2";
|
||||
export * from "./analytics";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue