refactor: move web utils to packages (#7145)

* refactor: move web utils to packages

* fix: build and lint errors

* chore: update drag handle plugin

* chore: update table cell type to fix build errors

* fix: build errors

* chore: sync few changes

* fix: build errors

* chore: minor fixes related to duplicate assets imports

* fix: build errors

* chore: minor changes
This commit is contained in:
Prateek Shourya 2025-06-16 17:18:41 +05:30 committed by GitHub
parent dffcc6dc10
commit 2014400bed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
614 changed files with 1999 additions and 3030 deletions

View file

@ -2,3 +2,28 @@ export interface ICalendarRange {
startDate: Date;
endDate: Date;
}
export interface ICalendarDate {
date: Date;
year: number;
month: number;
day: number;
week: number; // week number wrt year, eg- 51, 52
is_current_month: boolean;
is_current_week: boolean;
is_today: boolean;
}
export interface ICalendarWeek {
[date: string]: ICalendarDate;
}
export interface ICalendarMonth {
[monthIndex: string]: {
[weekNumber: string]: ICalendarWeek;
};
}
export interface ICalendarPayload {
[year: string]: ICalendarMonth;
}

View file

@ -136,3 +136,16 @@ export type TPublicCycle = {
name: string;
status: string;
};
export type TProgressChartData = {
date: string;
scope: number;
completed: number;
backlog: number;
started: number;
unstarted: number;
cancelled: number;
pending: number;
ideal: number;
actual: number;
}[];

View file

@ -68,8 +68,18 @@ export enum EFileAssetType {
TEAM_SPACE_COMMENT_DESCRIPTION = "TEAM_SPACE_COMMENT_DESCRIPTION",
}
export type TEditorAssetType =
| EFileAssetType.COMMENT_DESCRIPTION
| EFileAssetType.ISSUE_DESCRIPTION
| EFileAssetType.DRAFT_ISSUE_DESCRIPTION
| EFileAssetType.PAGE_DESCRIPTION
| EFileAssetType.TEAM_SPACE_DESCRIPTION
| EFileAssetType.INITIATIVE_DESCRIPTION
| EFileAssetType.PROJECT_DESCRIPTION
| EFileAssetType.TEAM_SPACE_COMMENT_DESCRIPTION;
export enum EUpdateStatus {
OFF_TRACK = "OFF-TRACK",
ON_TRACK = "ON-TRACK",
AT_RISK = "AT-RISK",
}
}

View file

@ -1,16 +1,16 @@
import { EFileAssetType } from "./enums"
import { EFileAssetType } from "./enums";
export type TFileMetaDataLite = {
name: string;
// file size in bytes
size: number;
type: string;
}
};
export type TFileEntityInfo = {
entity_identifier: string;
entity_type: EFileAssetType;
}
};
export type TFileMetaData = TFileMetaDataLite & TFileEntityInfo;
@ -29,4 +29,13 @@ export type TFileSignedURLResponse = {
"x-amz-signature": string;
};
};
};
};
export type TDuplicateAssetData = {
entity_id: string;
entity_type: EFileAssetType;
project_id?: string;
asset_ids: string[];
};
export type TDuplicateAssetResponse = Record<string, string>; // asset_id -> new_asset_id

View file

@ -43,4 +43,5 @@ export * from "./home";
export * from "./stickies";
export * from "./utils";
export * from "./payment";
export * from "./layout";
export * from "./analytics";

52
packages/types/src/layout/gantt.d.ts vendored Normal file
View file

@ -0,0 +1,52 @@
export interface IGanttBlock {
data: any;
id: string;
name: string;
position?: {
marginLeft: number;
width: number;
};
sort_order: number | undefined;
start_date: string | undefined;
target_date: string | undefined;
}
export interface IBlockUpdateData {
sort_order?: {
destinationIndex: number;
newSortOrder: number;
sourceIndex: number;
};
start_date?: string;
target_date?: string;
}
export interface IBlockUpdateDependencyData {
id: string;
start_date?: string;
target_date?: string;
}
export type TGanttViews = "week" | "month" | "quarter";
// chart render types
export interface WeekMonthDataType {
key: number;
shortTitle: string;
title: string;
abbreviation: string;
}
export interface ChartDataType {
key: string;
i18n_title: string;
data: ChartDataTypeData;
}
export interface ChartDataTypeData {
startDate: Date;
currentDate: Date;
endDate: Date;
approxFilterRange: number;
dayWidth: number;
}

View file

@ -0,0 +1 @@
export * from "./gantt";

View file

@ -141,3 +141,7 @@ export interface ISearchIssueResponse {
workspace__slug: string;
type_id: string;
}
export type TPartialProject = IPartialProject;
export type TProject = TPartialProject & IProject;