Fix parent ticket assignment and display
linter / quality (pull_request) Successful in 1m15s
tests / ci (8.4) (pull_request) Successful in 1m35s

This commit is contained in:
2026-05-24 15:24:29 +00:00
parent ffe5939628
commit ce260bfd46
9 changed files with 227 additions and 1 deletions
+42 -1
View File
@@ -83,6 +83,15 @@ const canViewAuthor = computed(
() => props.project.show_author || props.canManageProject,
);
const currentParentTicket = computed(
() =>
props.ticket.parent_ticket ??
props.parentTicketOptions.find(
(parentTicket) => parentTicket.id === props.ticket.parent_ticket_id,
) ??
null,
);
const defaultBranchRepositoryConnectionId = computed(() =>
String(
linkedRepositoryConnections.value.find(
@@ -1521,7 +1530,10 @@ const formatDateTime = (value: string): string => {
</CardContent>
</Card>
<Card class="h-fit">
<Card
v-if="ticket.ticket_type?.is_parent"
class="h-fit"
>
<CardHeader>
<CardTitle>Child tickets</CardTitle>
<CardDescription>
@@ -1547,6 +1559,35 @@ const formatDateTime = (value: string): string => {
</CardContent>
</Card>
<Card
v-else-if="currentParentTicket !== null"
class="h-fit"
>
<CardHeader>
<CardTitle>Parent ticket</CardTitle>
<CardDescription>
This ticket belongs to the parent shown here.
</CardDescription>
</CardHeader>
<CardContent>
<Link
:href="showTicket({
project: project.id,
ticket: currentParentTicket.id,
})"
class="border-border hover:border-primary/60 block rounded-xl border px-4 py-4 transition"
>
<div class="font-medium">
{{ currentParentTicket.ticket_key }}
</div>
<div class="text-muted-foreground mt-1 text-sm">
{{ currentParentTicket.title }}
</div>
</Link>
</CardContent>
</Card>
<Card class="h-fit">
<CardHeader>
<CardTitle>Worklog</CardTitle>
@@ -67,6 +67,7 @@ const form = useForm({
acceptance_criteria: buildAcceptanceCriteria(acceptanceCriteriaChecklist.value),
assignee_user_id: '',
description: '',
parent_ticket_id: '',
story_points: '',
ticket_priority_id: String(props.ticketPriorities[0]?.id ?? ''),
ticket_status_id: String(
@@ -312,6 +313,28 @@ const ticketStatusLabel = (ticketStatus: TicketStatusModel): string => {
<InputError :message="form.errors.assignee_user_id" />
</div>
<div class="grid gap-2">
<Label for="parent_ticket_id">
Parent ticket
</Label>
<select
id="parent_ticket_id"
v-model="form.parent_ticket_id"
:disabled="form.processing"
class="border-input bg-background shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 rounded-md border px-3 py-2 text-sm outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-60"
>
<option value="">No parent ticket</option>
<option
v-for="parentTicketOption in parentTicketOptions"
:key="parentTicketOption.id"
:value="String(parentTicketOption.id)"
>
{{ `${parentTicketOption.ticket_key} - ${parentTicketOption.title}` }}
</option>
</select>
<InputError :message="form.errors.parent_ticket_id" />
</div>
<div
v-if="project.show_story_points"
class="grid gap-2"