-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add task category field validation and bind package & category …
…api (#5096) * feat(ops-flow): add task field metadata and enhance task fields UI Signed-off-by: Wanjin Noh <[email protected]> * feat(task-fields-configuration): refactor task field management and add new components Signed-off-by: Wanjin Noh <[email protected]> * feat(task-fields-configuration): enhance task field generator with foldable options and new layout Signed-off-by: Wanjin Noh <[email protected]> * feat(task-fields): add functionality to dynamically add custom fields Signed-off-by: Wanjin Noh <[email protected]> * feat(task-fields-configuration): implement task fields management component Signed-off-by: Wanjin Noh <[email protected]> * feat(task-field): add dropdown task field options and validation logic Signed-off-by: Wanjin Noh <[email protected]> * feat(editor): add placeholder extension to text editor component Signed-off-by: Wanjin Noh <[email protected]> * feat: add validation event emission for task field options generator Signed-off-by: Wanjin Noh <[email protected]> * feat(task-management): add task management template functionality and translations Signed-off-by: Wanjin Noh <[email protected]> * feat(landing-panel): implement initial data loading and update functionality Signed-off-by: Wanjin Noh <[email protected]> * feat: enhance action menu button and add package management APIs Signed-off-by: Wanjin Noh <[email protected]> * feat(task-category): enhance task status options and add color constants Signed-off-by: Wanjin Noh <[email protected]> * fix: update import path for useDomainConfigStore in components and store Signed-off-by: Wanjin Noh <[email protected]> * feat(task-status): add default status menu and isDefault prop handling Signed-off-by: Wanjin Noh <[email protected]> * feat(ops-flow): conditionally render status type field in TaskStatusForm Signed-off-by: Wanjin Noh <[email protected]> --------- Signed-off-by: Wanjin Noh <[email protected]>
- Loading branch information
Showing
58 changed files
with
2,052 additions
and
1,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,52 @@ | ||
export type TaskFieldType = |'GLOBAL' | ||
|'TEXT'|'PARAGRAPH'|'LABELS'|'DROPDOWN'|'DATE' | ||
|'USER'|'ASSET'|'PROJECT'|'PROVIDER'|'SERVICE_ACCOUNT'; | ||
|
||
export type TaskFieldSelectionType = 'SINGLE'|'MULTI'; | ||
export interface TaskField { | ||
|
||
/* options */ | ||
export type TaskFieldEnum = { | ||
key: string; | ||
name: string; | ||
}; | ||
interface TextTaskFieldOptions { | ||
example: string; | ||
} | ||
export interface ParagraphTaskFieldOptions { | ||
example: string; | ||
} | ||
export interface DropdownTaskFieldOptions { | ||
enums: TaskFieldEnum[]; | ||
} | ||
interface OtherTaskFieldOptions { | ||
[key: string]: never; | ||
} | ||
export type TaskFieldOptions = TextTaskFieldOptions | ParagraphTaskFieldOptions | DropdownTaskFieldOptions | OtherTaskFieldOptions; | ||
|
||
/* task field */ | ||
interface BaseTaskField { | ||
field_id: string; | ||
name: string; | ||
description?: string; | ||
field_type: TaskFieldType; | ||
selection_type?: TaskFieldSelectionType; | ||
is_required?: boolean; | ||
is_primary?: boolean; // whether to display field during task creation | ||
options?: string[]; // for dropdown field type | ||
} | ||
interface TextTaskField extends BaseTaskField { | ||
field_type: 'TEXT'; | ||
options: TextTaskFieldOptions; | ||
} | ||
interface ParagraphTaskField extends BaseTaskField { | ||
field_type: 'PARAGRAPH'; | ||
options: ParagraphTaskFieldOptions; | ||
} | ||
interface DropdownTaskField extends BaseTaskField { | ||
field_type: 'DROPDOWN'; | ||
options: DropdownTaskFieldOptions; | ||
} | ||
interface OtherTaskField extends BaseTaskField { | ||
field_type: Exclude<TaskFieldType, 'TEXT'|'PARAGRAPH'|'DROPDOWN'>; | ||
options: object; | ||
} | ||
export type TaskField = TextTaskField | ParagraphTaskField | DropdownTaskField | OtherTaskField; |
8 changes: 6 additions & 2 deletions
8
apps/web/src/schema/opsflow/task-category/api-verbs/create.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const TASK_STATUS_COLOR_NAMES = ['gray200', 'violet200', 'blue200', 'peacock200', 'green200', 'yellow200', 'coral200', 'red200'] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import type { TASK_STATUS_COLOR_NAMES } from '@/schema/opsflow/task/constant'; | ||
|
||
export type TaskStatusType = 'TODO'|'IN_PROGRESS'|'COMPLETED'; | ||
type TaskStatusColorName = typeof TASK_STATUS_COLOR_NAMES[number]; | ||
export interface TaskStatusOption { | ||
status_id: string; | ||
name: string; | ||
color: string; | ||
is_default: boolean; | ||
color: TaskStatusColorName; | ||
is_default?: boolean; | ||
} | ||
export type TaskStatusOptions = Record<TaskStatusType, TaskStatusOption[]>; | ||
export type TaskPriority = 'LOW'|'MEDIUM'|'HIGH'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.