forked from github/plane
[WEB-373] chore: new dashboard updates (#3849)
* chore: replaced marimekko graph with a bar graph * chore: add bar onClick handler * chore: custom date filter for widgets * style: priority graph * chore: workspace profile activity pagination * chore: profile activity pagination * chore: user profile activity pagination * chore: workspace user activity csv download * chore: download activity button added * chore: workspace user pagination * chore: collabrator pagination * chore: field change * chore: recent collaborators pagination * chore: changed the collabrators * chore: collabrators list changed * fix: distinct users * chore: search filter in collaborators * fix: import error * chore: update priority graph x-axis values * chore: admin and member request validation * chore: update csv download request method * chore: search implementation for the collaborators widget * refactor: priority distribution card * chore: add enum for duration filters * chore: update inbox types * chore: add todos for refactoring --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
committed by
GitHub
parent
126d01bdc5
commit
5a32d10f96
9
packages/types/src/cycles.d.ts
vendored
9
packages/types/src/cycles.d.ts
vendored
@@ -1,11 +1,4 @@
|
||||
import type {
|
||||
IUser,
|
||||
TIssue,
|
||||
IProjectLite,
|
||||
IWorkspaceLite,
|
||||
IIssueFilterOptions,
|
||||
IUserLite,
|
||||
} from "@plane/types";
|
||||
import type { TIssue, IIssueFilterOptions } from "@plane/types";
|
||||
|
||||
export type TCycleView = "all" | "active" | "upcoming" | "completed" | "draft";
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { IIssueActivity, TIssuePriorities } from "./issues";
|
||||
import { TIssue } from "./issues/issue";
|
||||
import { TIssueRelationTypes } from "./issues/issue_relation";
|
||||
import { TStateGroups } from "./state";
|
||||
import { IIssueActivity, TIssuePriorities } from "../issues";
|
||||
import { TIssue } from "../issues/issue";
|
||||
import { TIssueRelationTypes } from "../issues/issue_relation";
|
||||
import { TStateGroups } from "../state";
|
||||
import { EDurationFilters } from "./enums";
|
||||
|
||||
export type TWidgetKeys =
|
||||
| "overview_stats"
|
||||
@@ -15,30 +16,27 @@ export type TWidgetKeys =
|
||||
|
||||
export type TIssuesListTypes = "pending" | "upcoming" | "overdue" | "completed";
|
||||
|
||||
export type TDurationFilterOptions =
|
||||
| "none"
|
||||
| "today"
|
||||
| "this_week"
|
||||
| "this_month"
|
||||
| "this_year";
|
||||
|
||||
// widget filters
|
||||
export type TAssignedIssuesWidgetFilters = {
|
||||
duration?: TDurationFilterOptions;
|
||||
custom_dates?: string[];
|
||||
duration?: EDurationFilters;
|
||||
tab?: TIssuesListTypes;
|
||||
};
|
||||
|
||||
export type TCreatedIssuesWidgetFilters = {
|
||||
duration?: TDurationFilterOptions;
|
||||
custom_dates?: string[];
|
||||
duration?: EDurationFilters;
|
||||
tab?: TIssuesListTypes;
|
||||
};
|
||||
|
||||
export type TIssuesByStateGroupsWidgetFilters = {
|
||||
duration?: TDurationFilterOptions;
|
||||
duration?: EDurationFilters;
|
||||
custom_dates?: string[];
|
||||
};
|
||||
|
||||
export type TIssuesByPriorityWidgetFilters = {
|
||||
duration?: TDurationFilterOptions;
|
||||
custom_dates?: string[];
|
||||
duration?: EDurationFilters;
|
||||
};
|
||||
|
||||
export type TWidgetFiltersFormData =
|
||||
@@ -97,6 +95,12 @@ export type TWidgetStatsRequestParams =
|
||||
| {
|
||||
target_date: string;
|
||||
widget_key: "issues_by_priority";
|
||||
}
|
||||
| {
|
||||
cursor: string;
|
||||
per_page: number;
|
||||
search?: string;
|
||||
widget_key: "recent_collaborators";
|
||||
};
|
||||
|
||||
export type TWidgetIssue = TIssue & {
|
||||
@@ -141,8 +145,17 @@ export type TRecentActivityWidgetResponse = IIssueActivity;
|
||||
export type TRecentProjectsWidgetResponse = string[];
|
||||
|
||||
export type TRecentCollaboratorsWidgetResponse = {
|
||||
active_issue_count: number;
|
||||
user_id: string;
|
||||
count: number;
|
||||
extra_stats: Object | null;
|
||||
next_cursor: string;
|
||||
next_page_results: boolean;
|
||||
prev_cursor: string;
|
||||
prev_page_results: boolean;
|
||||
results: {
|
||||
active_issue_count: number;
|
||||
user_id: string;
|
||||
}[];
|
||||
total_pages: number;
|
||||
};
|
||||
|
||||
export type TWidgetStatsResponse =
|
||||
@@ -153,7 +166,7 @@ export type TWidgetStatsResponse =
|
||||
| TCreatedIssuesWidgetResponse
|
||||
| TRecentActivityWidgetResponse[]
|
||||
| TRecentProjectsWidgetResponse
|
||||
| TRecentCollaboratorsWidgetResponse[];
|
||||
| TRecentCollaboratorsWidgetResponse;
|
||||
|
||||
// dashboard
|
||||
export type TDashboard = {
|
||||
8
packages/types/src/dashboard/enums.ts
Normal file
8
packages/types/src/dashboard/enums.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export enum EDurationFilters {
|
||||
NONE = "none",
|
||||
TODAY = "today",
|
||||
THIS_WEEK = "this_week",
|
||||
THIS_MONTH = "this_month",
|
||||
THIS_YEAR = "this_year",
|
||||
CUSTOM = "custom",
|
||||
}
|
||||
2
packages/types/src/dashboard/index.ts
Normal file
2
packages/types/src/dashboard/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./dashboard";
|
||||
export * from "./enums";
|
||||
6
packages/types/src/enums.ts
Normal file
6
packages/types/src/enums.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export enum EUserProjectRoles {
|
||||
GUEST = 5,
|
||||
VIEWER = 10,
|
||||
MEMBER = 15,
|
||||
ADMIN = 20,
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TIssue } from "./issues/base";
|
||||
import type { IProjectLite } from "./projects";
|
||||
import { TIssue } from "../issues/base";
|
||||
import type { IProjectLite } from "../projects";
|
||||
|
||||
export type TInboxIssueExtended = {
|
||||
completed_at: string | null;
|
||||
@@ -33,34 +33,6 @@ export interface IInbox {
|
||||
workspace: string;
|
||||
}
|
||||
|
||||
interface StatePending {
|
||||
readonly status: -2;
|
||||
}
|
||||
interface StatusReject {
|
||||
status: -1;
|
||||
}
|
||||
|
||||
interface StatusSnoozed {
|
||||
status: 0;
|
||||
snoozed_till: Date;
|
||||
}
|
||||
|
||||
interface StatusAccepted {
|
||||
status: 1;
|
||||
}
|
||||
|
||||
interface StatusDuplicate {
|
||||
status: 2;
|
||||
duplicate_to: string;
|
||||
}
|
||||
|
||||
export type TInboxStatus =
|
||||
| StatusReject
|
||||
| StatusSnoozed
|
||||
| StatusAccepted
|
||||
| StatusDuplicate
|
||||
| StatePending;
|
||||
|
||||
export interface IInboxFilterOptions {
|
||||
priority?: string[] | null;
|
||||
inbox_status?: number[] | null;
|
||||
3
packages/types/src/inbox/root.d.ts
vendored
3
packages/types/src/inbox/root.d.ts
vendored
@@ -1,2 +1,3 @@
|
||||
export * from "./inbox";
|
||||
export * from "./inbox-issue";
|
||||
export * from "./inbox-types";
|
||||
export * from "./inbox";
|
||||
|
||||
4
packages/types/src/index.d.ts
vendored
4
packages/types/src/index.d.ts
vendored
@@ -4,7 +4,6 @@ export * from "./cycles";
|
||||
export * from "./dashboard";
|
||||
export * from "./projects";
|
||||
export * from "./state";
|
||||
export * from "./invitation";
|
||||
export * from "./issues";
|
||||
export * from "./modules";
|
||||
export * from "./views";
|
||||
@@ -15,7 +14,6 @@ export * from "./estimate";
|
||||
export * from "./importer";
|
||||
|
||||
// FIXME: Remove this after development and the refactor/mobx-store-issue branch is stable
|
||||
export * from "./inbox";
|
||||
export * from "./inbox/root";
|
||||
|
||||
export * from "./analytics";
|
||||
@@ -32,6 +30,8 @@ export * from "./api_token";
|
||||
export * from "./instance";
|
||||
export * from "./app";
|
||||
|
||||
export * from "./enums";
|
||||
|
||||
export type NestedKeyOf<ObjectType extends object> = {
|
||||
[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object
|
||||
? ObjectType[Key] extends { pop: any; push: any }
|
||||
|
||||
28
packages/types/src/modules.d.ts
vendored
28
packages/types/src/modules.d.ts
vendored
@@ -1,16 +1,12 @@
|
||||
import type {
|
||||
IUser,
|
||||
IUserLite,
|
||||
TIssue,
|
||||
IProject,
|
||||
IWorkspace,
|
||||
IWorkspaceLite,
|
||||
IProjectLite,
|
||||
IIssueFilterOptions,
|
||||
ILinkDetails,
|
||||
} from "@plane/types";
|
||||
import type { TIssue, IIssueFilterOptions, ILinkDetails } from "@plane/types";
|
||||
|
||||
export type TModuleStatus = "backlog" | "planned" | "in-progress" | "paused" | "completed" | "cancelled";
|
||||
export type TModuleStatus =
|
||||
| "backlog"
|
||||
| "planned"
|
||||
| "in-progress"
|
||||
| "paused"
|
||||
| "completed"
|
||||
| "cancelled";
|
||||
|
||||
export interface IModule {
|
||||
backlog_issues: number;
|
||||
@@ -68,6 +64,10 @@ export type ModuleLink = {
|
||||
url: string;
|
||||
};
|
||||
|
||||
export type SelectModuleType = (IModule & { actionType: "edit" | "delete" | "create-issue" }) | undefined;
|
||||
export type SelectModuleType =
|
||||
| (IModule & { actionType: "edit" | "delete" | "create-issue" })
|
||||
| undefined;
|
||||
|
||||
export type SelectIssue = (TIssue & { actionType: "edit" | "delete" | "create" }) | undefined;
|
||||
export type SelectIssue =
|
||||
| (TIssue & { actionType: "edit" | "delete" | "create" })
|
||||
| undefined;
|
||||
|
||||
26
packages/types/src/users.d.ts
vendored
26
packages/types/src/users.d.ts
vendored
@@ -1,5 +1,9 @@
|
||||
import { EUserProjectRoles } from "constants/project";
|
||||
import { IIssueActivity, IIssueLite, TStateGroups } from ".";
|
||||
import {
|
||||
IIssueActivity,
|
||||
TIssuePriorities,
|
||||
TStateGroups,
|
||||
EUserProjectRoles,
|
||||
} from ".";
|
||||
|
||||
export interface IUser {
|
||||
id: string;
|
||||
@@ -17,7 +21,6 @@ export interface IUser {
|
||||
is_onboarded: boolean;
|
||||
is_password_autoset: boolean;
|
||||
is_tour_completed: boolean;
|
||||
is_password_autoset: boolean;
|
||||
mobile_number: string | null;
|
||||
role: string | null;
|
||||
onboarding_step: {
|
||||
@@ -80,7 +83,7 @@ export interface IUserActivity {
|
||||
}
|
||||
|
||||
export interface IUserPriorityDistribution {
|
||||
priority: string;
|
||||
priority: TIssuePriorities;
|
||||
priority_count: number;
|
||||
}
|
||||
|
||||
@@ -89,21 +92,6 @@ export interface IUserStateDistribution {
|
||||
state_count: number;
|
||||
}
|
||||
|
||||
export interface IUserWorkspaceDashboard {
|
||||
assigned_issues_count: number;
|
||||
completed_issues_count: number;
|
||||
issue_activities: IUserActivity[];
|
||||
issues_due_week_count: number;
|
||||
overdue_issues: IIssueLite[];
|
||||
completed_issues: {
|
||||
week_in_month: number;
|
||||
completed_count: number;
|
||||
}[];
|
||||
pending_issues_count: number;
|
||||
state_distribution: IUserStateDistribution[];
|
||||
upcoming_issues: IIssueLite[];
|
||||
}
|
||||
|
||||
export interface IUserActivityResponse {
|
||||
count: number;
|
||||
extra_stats: null;
|
||||
|
||||
Reference in New Issue
Block a user