fix(KAN-14): preserve template inheritance and project data
This commit is contained in:
@@ -67,7 +67,8 @@ export type ProjectTemplatesIndexPageProps = {
|
||||
|
||||
export type ProjectTemplatesCreatePageProps = {
|
||||
copyAreaOptions: ProjectDuplicateCopyAreaOption[];
|
||||
project: ProjectModel;
|
||||
project: ProjectModel | null;
|
||||
initialConfiguration?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type ProjectTemplatesEditPageProps = {
|
||||
@@ -82,6 +83,8 @@ export type ProjectTemplateStateArea = {
|
||||
|
||||
export type ProjectTemplateState = {
|
||||
effectiveConfiguration: Record<string, unknown>;
|
||||
localConfiguration?: Record<string, unknown>;
|
||||
localAreas?: ProjectTemplateStateArea[];
|
||||
inheritedAreas: ProjectTemplateStateArea[];
|
||||
inheritedConfiguration?: Record<string, unknown>;
|
||||
inheritsFromTemplate: boolean;
|
||||
@@ -95,7 +98,7 @@ export type ProjectTemplateState = {
|
||||
name: string;
|
||||
ticketCount: number;
|
||||
}>;
|
||||
replacementOptions: Array<{ id: number; name: string }>;
|
||||
replacementOptions: Array<{ id: number | string; name: string }>;
|
||||
}
|
||||
>;
|
||||
templateConfiguration?: Record<string, unknown>;
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import type { ProjectDuplicateCopyAreaOption } from '@/types/page-props';
|
||||
|
||||
export type TemplateNotificationFilter = {
|
||||
attribute: string;
|
||||
operator: string;
|
||||
value: string | string[] | null;
|
||||
};
|
||||
|
||||
export type TemplateConfigurationItem = {
|
||||
configuration_key: string;
|
||||
name?: string;
|
||||
label?: string;
|
||||
counterpart_label?: string;
|
||||
position?: number;
|
||||
is_parent?: boolean;
|
||||
field_type?: string;
|
||||
board_column_key?: string | null;
|
||||
provider?: string;
|
||||
base_url?: string;
|
||||
provider_repository_id?: string;
|
||||
owner_name?: string;
|
||||
repository_name?: string;
|
||||
repository_full_name?: string;
|
||||
repository_url?: string;
|
||||
enabled?: boolean;
|
||||
event_type?: string;
|
||||
channel?: string;
|
||||
channel_configuration?: { allowed_mentions?: string[] };
|
||||
message_template?: string | null;
|
||||
delivery_url?: string;
|
||||
filters?: TemplateNotificationFilter[];
|
||||
};
|
||||
|
||||
export type TemplateStatusTransition = {
|
||||
status_key: string;
|
||||
target_keys: string[];
|
||||
};
|
||||
export type TemplateConfiguration = {
|
||||
project_settings: { show_author: boolean; show_story_points: boolean };
|
||||
board_columns: TemplateConfigurationItem[];
|
||||
ticket_statuses: TemplateConfigurationItem[];
|
||||
status_transitions: TemplateStatusTransition[];
|
||||
ticket_types: TemplateConfigurationItem[];
|
||||
ticket_priorities: TemplateConfigurationItem[];
|
||||
ticket_fields: TemplateConfigurationItem[];
|
||||
ticket_link_types: TemplateConfigurationItem[];
|
||||
repository_connections: TemplateConfigurationItem[];
|
||||
notification_actions: TemplateConfigurationItem[];
|
||||
};
|
||||
export type TemplateListArea = Exclude<
|
||||
keyof TemplateConfiguration,
|
||||
'project_settings' | 'status_transitions'
|
||||
>;
|
||||
export type TemplateTextField = {
|
||||
key:
|
||||
| 'name'
|
||||
| 'label'
|
||||
| 'counterpart_label'
|
||||
| 'base_url'
|
||||
| 'provider_repository_id'
|
||||
| 'owner_name'
|
||||
| 'repository_name'
|
||||
| 'repository_full_name'
|
||||
| 'repository_url'
|
||||
| 'delivery_url';
|
||||
label: string;
|
||||
};
|
||||
export type TemplateConfigurationEditorProps = {
|
||||
areas: string[];
|
||||
options: ProjectDuplicateCopyAreaOption[];
|
||||
errors: Record<string, string | undefined>;
|
||||
disabled?: boolean;
|
||||
};
|
||||
export type TemplateResetForm = {
|
||||
areas: string[];
|
||||
status_replacements: Record<string, number | string | undefined>;
|
||||
};
|
||||
Reference in New Issue
Block a user