improvement: enhance activity components and types modularity (#6262)
This commit is contained in:
parent
ac47cc62ee
commit
6070ed4d36
8 changed files with 77 additions and 47 deletions
36
packages/types/src/activity.d.ts
vendored
Normal file
36
packages/types/src/activity.d.ts
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
export type TBaseActivity<
|
||||
TFieldKey extends string = string,
|
||||
TVerbKey extends string = string,
|
||||
> = {
|
||||
id: string;
|
||||
field: TFieldKey | undefined;
|
||||
epoch: number;
|
||||
verb: TVerbKey;
|
||||
comment: string | undefined;
|
||||
// updates
|
||||
old_value: string | undefined;
|
||||
new_value: string | undefined;
|
||||
old_identifier: string | undefined;
|
||||
new_identifier: string | undefined;
|
||||
// actor detail
|
||||
actor: string;
|
||||
// timestamp
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
export type TWorkspaceBaseActivity<
|
||||
K extends string = string,
|
||||
V extends string = string,
|
||||
> = TBaseActivity<K, V> & {
|
||||
workspace: string;
|
||||
};
|
||||
|
||||
export type TProjectBaseActivity<
|
||||
K extends string = string,
|
||||
V extends string = string,
|
||||
> = TWorkspaceBaseActivity<K, V> & {
|
||||
project: string;
|
||||
};
|
||||
|
||||
export type TBaseActivityVerbs = "created" | "updated" | "deleted";
|
||||
|
|
@ -4,10 +4,7 @@ export enum EUserPermissions {
|
|||
GUEST = 5,
|
||||
}
|
||||
|
||||
export type TUserPermissions =
|
||||
| EUserPermissions.ADMIN
|
||||
| EUserPermissions.MEMBER
|
||||
| EUserPermissions.GUEST;
|
||||
export type TUserPermissions = EUserPermissions.ADMIN | EUserPermissions.MEMBER | EUserPermissions.GUEST;
|
||||
|
||||
// project pages
|
||||
export enum EPageAccess {
|
||||
|
|
@ -62,4 +59,5 @@ export enum EFileAssetType {
|
|||
TEAM_SPACE_DESCRIPTION = "TEAM_SPACE_DESCRIPTION",
|
||||
INITIATIVE_DESCRIPTION = "INITIATIVE_DESCRIPTION",
|
||||
PROJECT_DESCRIPTION = "PROJECT_DESCRIPTION",
|
||||
TEAM_SPACE_COMMENT_DESCRIPTION = "TEAM_SPACE_COMMENT_DESCRIPTION",
|
||||
}
|
||||
|
|
|
|||
1
packages/types/src/index.d.ts
vendored
1
packages/types/src/index.d.ts
vendored
|
|
@ -35,3 +35,4 @@ export * from "./file";
|
|||
export * from "./workspace-draft-issues/base";
|
||||
export * from "./command-palette";
|
||||
export * from "./timezone";
|
||||
export * from "./activity";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue