Fix parent ticket assignment and display
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user