ticket type rework
This commit is contained in:
@@ -26,6 +26,7 @@ import type {
|
||||
BreadcrumbItem,
|
||||
ProjectTicketMetadataSettingsPageProps,
|
||||
} from '@/types';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
|
||||
const props = defineProps<ProjectTicketMetadataSettingsPageProps>();
|
||||
|
||||
@@ -94,7 +95,12 @@ const breadcrumbs: BreadcrumbItem[] = [
|
||||
|
||||
<div
|
||||
v-if="status"
|
||||
class="rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-900 dark:border-emerald-900/70 dark:bg-emerald-950/40 dark:text-emerald-100"
|
||||
:class="[
|
||||
'rounded-xl border px-4 py-3 text-sm',
|
||||
error
|
||||
? 'border-red-200/80 bg-red-50/60 text-red-800/80 dark:border-red-900/60 dark:bg-red-950/20 dark:text-red-200/80'
|
||||
: 'border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-900/70 dark:bg-emerald-950/40 dark:text-emerald-100',
|
||||
]"
|
||||
>
|
||||
{{ status }}
|
||||
</div>
|
||||
@@ -128,6 +134,16 @@ const breadcrumbs: BreadcrumbItem[] = [
|
||||
placeholder="Bug"
|
||||
/>
|
||||
<InputError :message="errors.name" />
|
||||
|
||||
<Label for="type-is-parent">
|
||||
<Checkbox
|
||||
id="type-is-parent"
|
||||
name="is_parent"
|
||||
required
|
||||
/>
|
||||
Ticket type is can be a parent
|
||||
</Label>
|
||||
<InputError :message="errors.is_parent" />
|
||||
</div>
|
||||
|
||||
<Button type="submit" :disabled="processing">
|
||||
@@ -149,29 +165,6 @@ const breadcrumbs: BreadcrumbItem[] = [
|
||||
class="grid gap-4"
|
||||
v-slot="{ errors, processing }"
|
||||
>
|
||||
<div
|
||||
class="flex items-center justify-between gap-3"
|
||||
>
|
||||
<Badge
|
||||
:variant="
|
||||
ticketType.is_builtin
|
||||
? 'default'
|
||||
: 'secondary'
|
||||
"
|
||||
>
|
||||
{{
|
||||
ticketType.is_builtin
|
||||
? 'Built-in'
|
||||
: 'Custom'
|
||||
}}
|
||||
</Badge>
|
||||
<p
|
||||
class="text-muted-foreground text-xs uppercase tracking-wide"
|
||||
>
|
||||
Position {{ ticketType.position }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label :for="`type-name-${ticketType.id}`">
|
||||
Name
|
||||
@@ -183,6 +176,21 @@ const breadcrumbs: BreadcrumbItem[] = [
|
||||
required
|
||||
/>
|
||||
<InputError :message="errors.name" />
|
||||
|
||||
<Label
|
||||
:for="`type-is-parent-${ticketType.id}}`"
|
||||
>
|
||||
<Checkbox
|
||||
:id="`type-is-parent-${ticketType.id}}`"
|
||||
name="is_parent"
|
||||
required
|
||||
:default-value="
|
||||
ticketType.is_parent
|
||||
"
|
||||
/>
|
||||
Ticket type is can be a parent
|
||||
</Label>
|
||||
<InputError :message="errors.is_parent" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
@@ -217,7 +225,6 @@ const breadcrumbs: BreadcrumbItem[] = [
|
||||
</Form>
|
||||
|
||||
<Form
|
||||
v-if="!ticketType.is_builtin"
|
||||
v-bind="
|
||||
ProjectTicketMetadataSettingsController.destroyType.form(
|
||||
[project.id, ticketType.id],
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
export type TicketTypeModel = {
|
||||
id: number;
|
||||
is_builtin: boolean;
|
||||
is_parent: boolean;
|
||||
name: string;
|
||||
position: number;
|
||||
project_id: number;
|
||||
system_key: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
@@ -83,6 +83,7 @@ export type TicketFieldTypeOption = {
|
||||
export type ProjectTicketMetadataSettingsPageProps = {
|
||||
fieldTypeOptions: TicketFieldTypeOption[];
|
||||
project: ProjectModel;
|
||||
error?: string | null;
|
||||
status?: string | null;
|
||||
ticketFieldDefinitions: TicketFieldDefinitionModel[];
|
||||
ticketLinkTypes: TicketLinkTypeModel[];
|
||||
|
||||
Reference in New Issue
Block a user