915 lines
46 KiB
Vue
915 lines
46 KiB
Vue
<script setup lang="ts">
|
|
import { Form, useForm, Head, Link } from '@inertiajs/vue3';
|
|
import { computed } from 'vue';
|
|
import ProjectTicketLinkController from '@/actions/App/Http/Controllers/ProjectTicketLinkController';
|
|
import ProjectTicketController from '@/actions/App/Http/Controllers/ProjectTicketController';
|
|
import Heading from '@/components/Heading.vue';
|
|
import InputError from '@/components/InputError.vue';
|
|
import TicketTreeList from '@/components/TicketTreeList.vue';
|
|
import { Badge } from '@/components/ui/badge';
|
|
import { Button } from '@/components/ui/button';
|
|
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from '@/components/ui/card';
|
|
import { Input } from '@/components/ui/input';
|
|
import { Label } from '@/components/ui/label';
|
|
import AppLayout from '@/layouts/AppLayout.vue';
|
|
import { edit as editGitConnections } from '@/routes/git-connections';
|
|
import { index as backlogIndex } from '@/routes/projects/backlog';
|
|
import { index as boardIndex } from '@/routes/projects/board';
|
|
import { index as projectIndex, show } from '@/routes/projects';
|
|
import { show as showTicket } from '@/routes/projects/tickets';
|
|
import type { BreadcrumbItem, ProjectTicketPageProps } from '@/types';
|
|
|
|
const props = defineProps<ProjectTicketPageProps>();
|
|
|
|
const visibleRepositoryBranches = computed(() =>
|
|
props.repositoryBranches.filter(
|
|
(repositoryBranch) =>
|
|
repositoryBranch.branches.length > 0 ||
|
|
repositoryBranch.error !== null ||
|
|
!repositoryBranch.repository_connection.has_personal_access,
|
|
),
|
|
);
|
|
|
|
const visibleRepositoryPullRequests = computed(() =>
|
|
props.repositoryPullRequests.filter(
|
|
(repositoryPullRequest) =>
|
|
repositoryPullRequest.pull_requests.length > 0 ||
|
|
repositoryPullRequest.error !== null ||
|
|
!repositoryPullRequest.repository_connection.has_personal_access,
|
|
),
|
|
);
|
|
|
|
const breadcrumbs: BreadcrumbItem[] = [
|
|
{
|
|
title: 'Projects',
|
|
href: projectIndex(),
|
|
},
|
|
{
|
|
title: props.project.name,
|
|
href: show(props.project.id),
|
|
},
|
|
{
|
|
title: props.ticket.ticket_key,
|
|
href: showTicket({
|
|
project: props.project.id,
|
|
ticket: props.ticket.id,
|
|
}),
|
|
},
|
|
];
|
|
|
|
const form = useForm({
|
|
acceptance_criteria: props.ticket.acceptance_criteria ?? '',
|
|
blocked_comment: props.ticket.blocked_comment ?? '',
|
|
description: props.ticket.description ?? '',
|
|
field_values: props.ticketFieldDefinitions.map((ticketFieldDefinition) => {
|
|
const currentFieldValue = props.ticket.field_values?.find(
|
|
(fieldValue) =>
|
|
fieldValue.ticket_field_definition_id ===
|
|
ticketFieldDefinition.id,
|
|
);
|
|
|
|
return {
|
|
ticket_field_definition_id: ticketFieldDefinition.id,
|
|
value_number: currentFieldValue?.value_number ?? '',
|
|
value_user_id: currentFieldValue?.value_user_id ?? '',
|
|
};
|
|
}),
|
|
is_blocked: props.ticket.is_blocked,
|
|
parent_ticket_id: props.ticket.parent_ticket_id ?? '',
|
|
ticket_priority_id: props.ticket.ticket_priority_id,
|
|
ticket_type_id: props.ticket.ticket_type_id,
|
|
title: props.ticket.title,
|
|
});
|
|
|
|
const submit = (): void => {
|
|
if (!props.canEditTicket) {
|
|
return;
|
|
}
|
|
|
|
form.submit(
|
|
ProjectTicketController.update({
|
|
project: props.project.id,
|
|
ticket: props.ticket.id,
|
|
}),
|
|
{
|
|
preserveScroll: true,
|
|
},
|
|
);
|
|
};
|
|
|
|
const formatDateTime = (value: string): string => {
|
|
return new Intl.DateTimeFormat(undefined, {
|
|
dateStyle: 'medium',
|
|
timeStyle: 'short',
|
|
}).format(new Date(value));
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<AppLayout :breadcrumbs="breadcrumbs">
|
|
<Head :title="ticket.ticket_key" />
|
|
|
|
<div class="flex flex-1 flex-col gap-6 p-4">
|
|
<div
|
|
class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"
|
|
>
|
|
<div class="space-y-3">
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
<Badge variant="outline" class="px-3 py-1">
|
|
{{ ticket.ticket_key }}
|
|
</Badge>
|
|
<Badge variant="secondary">
|
|
{{ ticket.ticket_type.name }}
|
|
</Badge>
|
|
<Badge variant="secondary">
|
|
{{ ticket.ticket_priority.name }}
|
|
</Badge>
|
|
<Badge v-if="!canEditTicket" variant="outline">
|
|
Read only
|
|
</Badge>
|
|
</div>
|
|
<Heading
|
|
:title="ticket.title"
|
|
description="Review ticket details, update tracked fields, and inspect the change timeline."
|
|
/>
|
|
</div>
|
|
|
|
<div class="flex flex-wrap gap-3">
|
|
<Button as-child variant="outline">
|
|
<Link :href="backlogIndex(project.id)"
|
|
>Open backlog</Link
|
|
>
|
|
</Button>
|
|
|
|
<Button as-child variant="outline">
|
|
<Link :href="boardIndex(project.id)">Open board</Link>
|
|
</Button>
|
|
|
|
<Button as-child variant="outline">
|
|
<Link :href="show(project.id)">Back to project</Link>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
|
|
<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"
|
|
>
|
|
{{ status }}
|
|
</div>
|
|
|
|
<div
|
|
class="grid gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(320px,1fr)]"
|
|
>
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Ticket details</CardTitle>
|
|
<CardDescription>
|
|
{{
|
|
canEditTicket
|
|
? 'Tracked ticket changes create worklog entries automatically.'
|
|
: 'You can review the tracked fields, but editing requires project edit permission.'
|
|
}}
|
|
</CardDescription>
|
|
</CardHeader>
|
|
|
|
<CardContent>
|
|
<form class="grid gap-6" @submit.prevent="submit">
|
|
<div class="grid gap-2">
|
|
<Label for="title">Title</Label>
|
|
<Input
|
|
id="title"
|
|
v-model="form.title"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
/>
|
|
<InputError :message="form.errors.title" />
|
|
</div>
|
|
|
|
<div class="grid gap-2 md:grid-cols-2 md:gap-6">
|
|
<div class="grid gap-2">
|
|
<Label for="ticket_type_id">Type</Label>
|
|
<select
|
|
id="ticket_type_id"
|
|
v-model="form.ticket_type_id"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60"
|
|
>
|
|
<option
|
|
v-for="ticketType in ticketTypes"
|
|
:key="ticketType.id"
|
|
:value="ticketType.id"
|
|
>
|
|
{{ ticketType.name }}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="form.errors.ticket_type_id"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="ticket_priority_id">
|
|
Priority
|
|
</Label>
|
|
<select
|
|
id="ticket_priority_id"
|
|
v-model="form.ticket_priority_id"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60"
|
|
>
|
|
<option
|
|
v-for="ticketPriority in ticketPriorities"
|
|
:key="ticketPriority.id"
|
|
:value="ticketPriority.id"
|
|
>
|
|
{{ ticketPriority.name }}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="
|
|
form.errors.ticket_priority_id
|
|
"
|
|
/>
|
|
</div>
|
|
</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="
|
|
!canEditTicket || form.processing
|
|
"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60"
|
|
>
|
|
<option value="">No parent ticket</option>
|
|
<option
|
|
v-for="parentTicketOption in parentTicketOptions"
|
|
:key="parentTicketOption.id"
|
|
:value="parentTicketOption.id"
|
|
>
|
|
{{
|
|
`${parentTicketOption.ticket_key} - ${parentTicketOption.title}`
|
|
}}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="form.errors.parent_ticket_id"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="description">Description</Label>
|
|
<textarea
|
|
id="description"
|
|
v-model="form.description"
|
|
rows="5"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60"
|
|
/>
|
|
<InputError
|
|
:message="form.errors.description"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="acceptance_criteria">
|
|
Acceptance criteria
|
|
</Label>
|
|
<textarea
|
|
id="acceptance_criteria"
|
|
v-model="form.acceptance_criteria"
|
|
rows="5"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60"
|
|
/>
|
|
<InputError
|
|
:message="form.errors.acceptance_criteria"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-3 rounded-xl border border-border p-4">
|
|
<div class="flex items-center gap-3">
|
|
<input
|
|
id="is_blocked"
|
|
v-model="form.is_blocked"
|
|
type="checkbox"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
class="size-4 rounded border-input text-primary focus:ring-ring"
|
|
/>
|
|
<Label for="is_blocked">
|
|
Mark ticket as blocked
|
|
</Label>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="blocked_comment">
|
|
Blocker comment
|
|
</Label>
|
|
<textarea
|
|
id="blocked_comment"
|
|
v-model="form.blocked_comment"
|
|
rows="3"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60"
|
|
placeholder="Describe what currently blocks progress on this ticket."
|
|
/>
|
|
<InputError
|
|
:message="form.errors.blocked_comment"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid gap-4">
|
|
<div class="space-y-1">
|
|
<h3 class="text-sm font-semibold">
|
|
Custom fields
|
|
</h3>
|
|
<p class="text-sm text-muted-foreground">
|
|
Project-configured fields can be tracked
|
|
directly on the ticket.
|
|
</p>
|
|
</div>
|
|
|
|
<div
|
|
v-if="ticketFieldDefinitions.length === 0"
|
|
class="rounded-xl border border-dashed border-border px-4 py-6 text-sm text-muted-foreground"
|
|
>
|
|
No custom fields are configured for this
|
|
project yet.
|
|
</div>
|
|
|
|
<div v-else class="grid gap-4 md:grid-cols-2">
|
|
<div
|
|
v-for="(
|
|
ticketFieldDefinition, index
|
|
) in ticketFieldDefinitions"
|
|
:key="ticketFieldDefinition.id"
|
|
class="grid gap-2"
|
|
>
|
|
<Label
|
|
:for="`field-${ticketFieldDefinition.id}`"
|
|
>
|
|
{{ ticketFieldDefinition.label }}
|
|
</Label>
|
|
|
|
<select
|
|
v-if="
|
|
ticketFieldDefinition.field_type ===
|
|
'user'
|
|
"
|
|
:id="`field-${ticketFieldDefinition.id}`"
|
|
v-model="
|
|
form.field_values[index]
|
|
.value_user_id
|
|
"
|
|
:disabled="
|
|
!canEditTicket ||
|
|
form.processing
|
|
"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-60"
|
|
>
|
|
<option value="">Unassigned</option>
|
|
<option
|
|
v-for="user in users"
|
|
:key="user.id"
|
|
:value="user.id"
|
|
>
|
|
{{ user.name }}
|
|
</option>
|
|
</select>
|
|
|
|
<Input
|
|
v-else
|
|
:id="`field-${ticketFieldDefinition.id}`"
|
|
v-model="
|
|
form.field_values[index]
|
|
.value_number
|
|
"
|
|
type="number"
|
|
step="0.1"
|
|
:disabled="
|
|
!canEditTicket ||
|
|
form.processing
|
|
"
|
|
/>
|
|
|
|
<InputError
|
|
:message="
|
|
form.errors[
|
|
`field_values.${index}.value_user_id`
|
|
] ??
|
|
form.errors[
|
|
`field_values.${index}.value_number`
|
|
]
|
|
"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
v-if="canEditTicket"
|
|
class="flex items-center gap-3"
|
|
>
|
|
<Button
|
|
type="submit"
|
|
:disabled="form.processing"
|
|
>
|
|
Save changes
|
|
</Button>
|
|
</div>
|
|
</form>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<div class="space-y-6">
|
|
<Card class="h-fit">
|
|
<CardHeader>
|
|
<CardTitle>Branches</CardTitle>
|
|
<CardDescription>
|
|
Matching branches are discovered from linked
|
|
repositories when the branch name starts with
|
|
this ticket key.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
|
|
<CardContent class="space-y-4">
|
|
<div
|
|
v-if="visibleRepositoryBranches.length === 0"
|
|
class="rounded-xl border border-dashed border-border px-4 py-6 text-sm text-muted-foreground"
|
|
>
|
|
No matching branches were found across the
|
|
linked repositories you can access.
|
|
</div>
|
|
|
|
<div v-else class="space-y-3">
|
|
<div
|
|
v-for="repositoryBranch in visibleRepositoryBranches"
|
|
:key="
|
|
repositoryBranch.repository_connection.id
|
|
"
|
|
class="rounded-xl border border-border px-4 py-4"
|
|
>
|
|
<div
|
|
class="flex flex-wrap items-center gap-2"
|
|
>
|
|
<Badge variant="secondary">
|
|
{{
|
|
repositoryBranch
|
|
.repository_connection
|
|
.provider_label
|
|
}}
|
|
</Badge>
|
|
<span class="font-medium">
|
|
{{
|
|
repositoryBranch
|
|
.repository_connection
|
|
.repository_full_name
|
|
}}
|
|
</span>
|
|
</div>
|
|
|
|
<p
|
|
class="mt-2 text-sm text-muted-foreground"
|
|
>
|
|
{{
|
|
repositoryBranch
|
|
.repository_connection.base_url
|
|
}}
|
|
</p>
|
|
|
|
<div
|
|
v-if="
|
|
!repositoryBranch
|
|
.repository_connection
|
|
.has_personal_access
|
|
"
|
|
class="mt-3 space-y-3"
|
|
>
|
|
<p
|
|
class="text-sm text-muted-foreground"
|
|
>
|
|
Connect a matching Git account in
|
|
your user settings to inspect
|
|
branches for this repository.
|
|
</p>
|
|
|
|
<Button as-child variant="outline" size="sm">
|
|
<Link :href="editGitConnections()">
|
|
Open Git connections
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
|
|
<div
|
|
v-else-if="repositoryBranch.error"
|
|
class="mt-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 dark:border-amber-900/70 dark:bg-amber-950/40 dark:text-amber-100"
|
|
>
|
|
{{ repositoryBranch.error }}
|
|
</div>
|
|
|
|
<div v-else class="mt-3 flex flex-wrap gap-2">
|
|
<Badge
|
|
v-for="branch in repositoryBranch.branches"
|
|
:key="branch.name"
|
|
variant="outline"
|
|
class="px-3 py-1"
|
|
>
|
|
{{ branch.name }}
|
|
</Badge>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card class="h-fit">
|
|
<CardHeader>
|
|
<CardTitle>Linked tickets</CardTitle>
|
|
<CardDescription>
|
|
Track cross-ticket relationships with
|
|
project-defined link labels.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
|
|
<CardContent class="space-y-4">
|
|
<Form
|
|
v-if="
|
|
canEditTicket &&
|
|
ticketLinkTypes.length > 0 &&
|
|
ticketLinkOptions.length > 0
|
|
"
|
|
v-bind="
|
|
ProjectTicketLinkController.store.form({
|
|
project: project.id,
|
|
ticket: ticket.id,
|
|
})
|
|
"
|
|
class="grid gap-4 rounded-xl border border-dashed border-border p-4"
|
|
v-slot="{ errors, processing }"
|
|
>
|
|
<div class="grid gap-2">
|
|
<Label for="ticket_link_type_id">
|
|
Link type
|
|
</Label>
|
|
<select
|
|
id="ticket_link_type_id"
|
|
name="ticket_link_type_id"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
>
|
|
<option
|
|
v-for="ticketLinkType in ticketLinkTypes"
|
|
:key="ticketLinkType.id"
|
|
:value="ticketLinkType.id"
|
|
>
|
|
{{ ticketLinkType.label }}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="errors.ticket_link_type_id"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="linked_ticket_id">
|
|
Linked ticket
|
|
</Label>
|
|
<select
|
|
id="linked_ticket_id"
|
|
name="linked_ticket_id"
|
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
>
|
|
<option
|
|
v-for="ticketLinkOption in ticketLinkOptions"
|
|
:key="ticketLinkOption.id"
|
|
:value="ticketLinkOption.id"
|
|
>
|
|
{{
|
|
`${ticketLinkOption.ticket_key} - ${ticketLinkOption.title}`
|
|
}}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="errors.linked_ticket_id"
|
|
/>
|
|
</div>
|
|
|
|
<Button
|
|
type="submit"
|
|
:disabled="processing"
|
|
>
|
|
Save link
|
|
</Button>
|
|
</Form>
|
|
|
|
<div
|
|
v-if="linkedTickets.length === 0"
|
|
class="rounded-xl border border-dashed border-border px-4 py-6 text-sm text-muted-foreground"
|
|
>
|
|
No ticket links are configured for this ticket
|
|
yet.
|
|
</div>
|
|
|
|
<div v-else class="space-y-3">
|
|
<div
|
|
v-for="linkedTicket in linkedTickets"
|
|
:key="linkedTicket.id"
|
|
class="rounded-xl border border-border px-4 py-4"
|
|
>
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
<Badge variant="secondary">
|
|
{{
|
|
linkedTicket.ticket_link_type
|
|
.label
|
|
}}
|
|
</Badge>
|
|
<Link
|
|
:href="
|
|
showTicket({
|
|
project: project.id,
|
|
ticket: linkedTicket
|
|
.linked_ticket.id,
|
|
})
|
|
"
|
|
class="font-medium text-foreground transition hover:text-primary"
|
|
>
|
|
{{
|
|
linkedTicket.linked_ticket
|
|
.ticket_key
|
|
}}
|
|
</Link>
|
|
</div>
|
|
<p class="mt-2 text-sm text-muted-foreground">
|
|
{{ linkedTicket.linked_ticket.title }}
|
|
</p>
|
|
|
|
<Form
|
|
v-if="canEditTicket"
|
|
v-bind="
|
|
ProjectTicketLinkController.destroy.form(
|
|
{
|
|
project: project.id,
|
|
ticket: ticket.id,
|
|
ticketLink:
|
|
linkedTicket.id,
|
|
},
|
|
)
|
|
"
|
|
class="mt-3 flex justify-end"
|
|
v-slot="{ processing: deleting }"
|
|
>
|
|
<Button
|
|
type="submit"
|
|
variant="destructive"
|
|
size="sm"
|
|
:disabled="deleting"
|
|
>
|
|
Remove
|
|
</Button>
|
|
</Form>
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card class="h-fit">
|
|
<CardHeader>
|
|
<CardTitle>Pull requests</CardTitle>
|
|
<CardDescription>
|
|
Matching pull requests are detected from linked
|
|
repositories by checking whether the source
|
|
branch starts with this ticket key.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
|
|
<CardContent class="space-y-4">
|
|
<div
|
|
v-if="
|
|
visibleRepositoryPullRequests.length === 0
|
|
"
|
|
class="rounded-xl border border-dashed border-border px-4 py-6 text-sm text-muted-foreground"
|
|
>
|
|
No matching pull requests were found across the
|
|
linked repositories you can access.
|
|
</div>
|
|
|
|
<div v-else class="space-y-3">
|
|
<div
|
|
v-for="repositoryPullRequest in visibleRepositoryPullRequests"
|
|
:key="
|
|
repositoryPullRequest
|
|
.repository_connection.id
|
|
"
|
|
class="rounded-xl border border-border px-4 py-4"
|
|
>
|
|
<div
|
|
class="flex flex-wrap items-center gap-2"
|
|
>
|
|
<Badge variant="secondary">
|
|
{{
|
|
repositoryPullRequest
|
|
.repository_connection
|
|
.provider_label
|
|
}}
|
|
</Badge>
|
|
<span class="font-medium">
|
|
{{
|
|
repositoryPullRequest
|
|
.repository_connection
|
|
.repository_full_name
|
|
}}
|
|
</span>
|
|
</div>
|
|
|
|
<p
|
|
class="mt-2 text-sm text-muted-foreground"
|
|
>
|
|
{{
|
|
repositoryPullRequest
|
|
.repository_connection.base_url
|
|
}}
|
|
</p>
|
|
|
|
<div
|
|
v-if="
|
|
!repositoryPullRequest
|
|
.repository_connection
|
|
.has_personal_access
|
|
"
|
|
class="mt-3 space-y-3"
|
|
>
|
|
<p
|
|
class="text-sm text-muted-foreground"
|
|
>
|
|
Connect a matching Git account in
|
|
your user settings to inspect pull
|
|
requests for this repository.
|
|
</p>
|
|
|
|
<Button as-child variant="outline" size="sm">
|
|
<Link :href="editGitConnections()">
|
|
Open Git connections
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
|
|
<div
|
|
v-else-if="repositoryPullRequest.error"
|
|
class="mt-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 dark:border-amber-900/70 dark:bg-amber-950/40 dark:text-amber-100"
|
|
>
|
|
{{ repositoryPullRequest.error }}
|
|
</div>
|
|
|
|
<div v-else class="mt-3 space-y-3">
|
|
<div
|
|
v-for="pullRequest in repositoryPullRequest.pull_requests"
|
|
:key="pullRequest.html_url"
|
|
class="rounded-xl border border-border/70 px-4 py-3"
|
|
>
|
|
<div
|
|
class="flex flex-wrap items-center gap-2"
|
|
>
|
|
<Badge variant="outline">
|
|
#{{ pullRequest.number }}
|
|
</Badge>
|
|
<Badge variant="secondary">
|
|
{{
|
|
pullRequest.status
|
|
}}
|
|
</Badge>
|
|
<a
|
|
:href="pullRequest.html_url"
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
class="font-medium text-foreground transition hover:text-primary"
|
|
>
|
|
{{ pullRequest.title }}
|
|
</a>
|
|
</div>
|
|
<p
|
|
class="mt-2 text-sm text-muted-foreground"
|
|
>
|
|
Source branch:
|
|
{{
|
|
pullRequest.source_branch
|
|
}}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card class="h-fit">
|
|
<CardHeader>
|
|
<CardTitle>Child tickets</CardTitle>
|
|
<CardDescription>
|
|
Parent tickets expose their full child tree
|
|
here, including nested parent chains.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
|
|
<CardContent>
|
|
<div
|
|
v-if="childTicketTree.length === 0"
|
|
class="rounded-xl border border-dashed border-border px-4 py-6 text-sm text-muted-foreground"
|
|
>
|
|
No child tickets are assigned to this ticket
|
|
yet.
|
|
</div>
|
|
|
|
<TicketTreeList
|
|
v-else
|
|
:nodes="childTicketTree"
|
|
:project-id="project.id"
|
|
/>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card class="h-fit">
|
|
<CardHeader>
|
|
<CardTitle>Worklog</CardTitle>
|
|
<CardDescription>
|
|
Every tracked ticket change is recorded with
|
|
actor and timestamp.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
|
|
<CardContent class="space-y-4">
|
|
<div
|
|
v-if="
|
|
(ticket.worklog_entries?.length ?? 0) === 0
|
|
"
|
|
class="rounded-xl border border-dashed border-border px-4 py-6 text-sm text-muted-foreground"
|
|
>
|
|
No worklog entries exist for this ticket yet.
|
|
</div>
|
|
|
|
<div v-else class="flex flex-col gap-4">
|
|
<div
|
|
v-for="worklogEntry in ticket.worklog_entries"
|
|
:key="worklogEntry.id"
|
|
class="rounded-xl border border-border px-4 py-4"
|
|
>
|
|
<div
|
|
class="flex flex-wrap items-center gap-2"
|
|
>
|
|
<Badge variant="outline">
|
|
{{ worklogEntry.entry_type }}
|
|
</Badge>
|
|
<span
|
|
class="text-sm font-medium text-foreground"
|
|
>
|
|
{{
|
|
worklogEntry.actor?.name ??
|
|
'System'
|
|
}}
|
|
</span>
|
|
</div>
|
|
<p class="mt-3 text-sm text-foreground">
|
|
{{ worklogEntry.summary }}
|
|
</p>
|
|
<p
|
|
class="mt-2 text-xs text-muted-foreground"
|
|
>
|
|
{{
|
|
formatDateTime(
|
|
worklogEntry.created_at,
|
|
)
|
|
}}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</AppLayout>
|
|
</template>
|