1739 lines
84 KiB
Vue
1739 lines
84 KiB
Vue
<script setup lang="ts">
|
|
import { Form, useForm, Head, Link, usePage } from '@inertiajs/vue3';
|
|
import { CheckCircle2, GitBranchPlus, XCircle } from 'lucide-vue-next';
|
|
import { computed, ref, watch } from 'vue';
|
|
import ProjectTicketBranchController from '@/actions/App/Http/Controllers/ProjectTicketBranchController';
|
|
import ProjectTicketLinkController from '@/actions/App/Http/Controllers/ProjectTicketLinkController';
|
|
import ProjectTicketController from '@/actions/App/Http/Controllers/ProjectTicketController';
|
|
import FeatureComingSoonPanel from '@/components/FeatureComingSoonPanel.vue';
|
|
import InputError from '@/components/InputError.vue';
|
|
import TicketPriorityIcon from '@/components/TicketPriorityIcon.vue';
|
|
import TicketTreeList from '@/components/TicketTreeList.vue';
|
|
import TicketTypeIcon from '@/components/TicketTypeIcon.vue';
|
|
import { Badge } from '@/components/ui/badge';
|
|
import { Button } from '@/components/ui/button';
|
|
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from '@/components/ui/card';
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from '@/components/ui/dialog';
|
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
import { Input } from '@/components/ui/input';
|
|
import { Label } from '@/components/ui/label';
|
|
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
SelectValue,
|
|
} from '@/components/ui/select';
|
|
import { Textarea } from '@/components/ui/textarea';
|
|
import AppLayout from '@/layouts/AppLayout.vue';
|
|
import { edit as editGitConnections } from '@/routes/git-connections/index';
|
|
import { index as backlogIndex } from '@/routes/projects/backlog';
|
|
import { index as boardIndex } from '@/routes/projects/board';
|
|
import { index as projectIndex, show } from '@/routes/projects/index';
|
|
import { show as showTicket } from '@/routes/projects/tickets';
|
|
import type { BranchNameValidationModel } from '@/types/models/branch-name-validation-model';
|
|
import type { RepositoryConnectionModel } from '@/types/models/repository-connection-model';
|
|
import type { BreadcrumbItem, ProjectTicketPageProps } from '@/types';
|
|
|
|
const props = defineProps<ProjectTicketPageProps>();
|
|
const page = usePage();
|
|
const appName = String(page.props.name);
|
|
|
|
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 linkedRepositoryConnections = computed<RepositoryConnectionModel[]>(() =>
|
|
props.repositoryBranches.map(
|
|
(repositoryBranch) => repositoryBranch.repository_connection,
|
|
),
|
|
);
|
|
|
|
const canCreateBranches = computed(
|
|
() => props.canEditTicket && linkedRepositoryConnections.value.length > 0,
|
|
);
|
|
const canEditAuthor = computed(
|
|
() => props.canEditTicket && props.canManageProject,
|
|
);
|
|
const canViewAuthor = computed(
|
|
() => props.project.show_author || props.canManageProject,
|
|
);
|
|
|
|
const defaultBranchRepositoryConnectionId = computed(() =>
|
|
String(
|
|
linkedRepositoryConnections.value.find(
|
|
(repositoryConnection) => repositoryConnection.has_personal_access,
|
|
)?.id ??
|
|
linkedRepositoryConnections.value[0]?.id ??
|
|
'',
|
|
),
|
|
);
|
|
|
|
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 frostedCardClass =
|
|
'rounded-[1.75rem] border-white/70 bg-white/85 shadow-[0_22px_65px_-40px_rgba(45,51,53,0.38)] backdrop-blur-sm dark:border-white/10 dark:bg-card/90 dark:shadow-black/25';
|
|
const frostedAsideCardClass =
|
|
'h-fit rounded-[1.75rem] border-white/70 bg-white/85 shadow-[0_22px_65px_-40px_rgba(45,51,53,0.38)] backdrop-blur-sm dark:border-white/10 dark:bg-card/90 dark:shadow-black/25';
|
|
const airyOutlineButtonClass =
|
|
'rounded-full border-white/70 bg-white/80 text-[#2d3335] shadow-[0_18px_45px_-34px_rgba(45,51,53,0.34)] hover:bg-white dark:border-white/10 dark:bg-card/85 dark:text-foreground dark:hover:bg-card';
|
|
const inputClass =
|
|
'h-12 rounded-xl border-white/70 bg-white/80 text-[#2d3335] shadow-[0_18px_45px_-34px_rgba(45,51,53,0.22)] focus-visible:border-[#9de77c] focus-visible:ring-[#abf688]/35 dark:border-white/10 dark:bg-card/90 dark:text-foreground dark:focus-visible:border-primary';
|
|
const textareaClass =
|
|
'min-h-32 rounded-[1.25rem] border-white/70 bg-white/80 text-[#2d3335] shadow-[0_18px_45px_-34px_rgba(45,51,53,0.22)] focus-visible:border-[#9de77c] focus-visible:ring-[#abf688]/35 dark:border-white/10 dark:bg-card/90 dark:text-foreground dark:focus-visible:border-primary';
|
|
const nativeSelectClass =
|
|
'h-12 w-full rounded-xl border border-white/70 bg-white/80 px-3 py-2 text-sm text-[#2d3335] shadow-[0_18px_45px_-34px_rgba(45,51,53,0.22)] outline-none transition-[color,box-shadow] focus:border-[#9de77c] focus:ring-4 focus:ring-[#abf688]/35 disabled:cursor-not-allowed disabled:opacity-60 dark:border-white/10 dark:bg-card/90 dark:text-foreground dark:focus:border-primary dark:focus:ring-primary/20';
|
|
const selectTriggerClass =
|
|
'h-12 w-full rounded-xl border-white/70 bg-white/80 text-left text-[#2d3335] shadow-[0_18px_45px_-34px_rgba(45,51,53,0.22)] focus:border-[#9de77c] focus:ring-[#abf688]/35 dark:border-white/10 dark:bg-card/90 dark:text-foreground dark:focus:border-primary';
|
|
const selectContentClass =
|
|
'rounded-[1.25rem] border-white/80 bg-white/95 shadow-[0_24px_60px_-40px_rgba(45,51,53,0.34)] backdrop-blur-sm dark:border-white/10 dark:bg-card/95';
|
|
const fieldLabelClass =
|
|
'text-[0.72rem] font-semibold uppercase tracking-[0.18em] text-[#5a6062]';
|
|
|
|
const form = useForm({
|
|
acceptance_criteria: props.ticket.acceptance_criteria ?? '',
|
|
assignee_user_id: props.ticket.assignee_user_id ?? '',
|
|
author_user_id: props.ticket.author_user_id ?? '',
|
|
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: String(props.ticket.ticket_priority_id),
|
|
ticket_type_id: String(props.ticket.ticket_type_id),
|
|
title: props.ticket.title,
|
|
story_points: props.ticket.story_points,
|
|
});
|
|
|
|
const selectedTicketType = computed(
|
|
() =>
|
|
props.ticketTypes.find(
|
|
(ticketType) => String(ticketType.id) === form.ticket_type_id,
|
|
) ?? props.ticket.ticket_type,
|
|
);
|
|
|
|
const selectedTicketPriority = computed(
|
|
() =>
|
|
props.ticketPriorities.find(
|
|
(ticketPriority) =>
|
|
String(ticketPriority.id) === form.ticket_priority_id,
|
|
) ?? props.ticket.ticket_priority,
|
|
);
|
|
|
|
const selectedAssignee = computed(
|
|
() =>
|
|
props.users.find(
|
|
(user) => String(user.id) === String(form.assignee_user_id),
|
|
) ?? null,
|
|
);
|
|
|
|
const selectedAuthor = computed(
|
|
() =>
|
|
props.users.find(
|
|
(user) => String(user.id) === String(form.author_user_id),
|
|
) ?? null,
|
|
);
|
|
|
|
const repositoryBranchCount = computed(() =>
|
|
visibleRepositoryBranches.value.reduce(
|
|
(count, repositoryBranch) => count + repositoryBranch.branches.length,
|
|
0,
|
|
),
|
|
);
|
|
|
|
const pullRequestCount = computed(() =>
|
|
visibleRepositoryPullRequests.value.reduce(
|
|
(count, repositoryPullRequest) =>
|
|
count + repositoryPullRequest.pull_requests.length,
|
|
0,
|
|
),
|
|
);
|
|
|
|
const isCreateBranchDialogOpen = ref(false);
|
|
const isCheckingBranchName = ref(false);
|
|
const branchNameValidation = ref<BranchNameValidationModel | null>(null);
|
|
|
|
const branchCreationForm = useForm<{
|
|
branch_name: string;
|
|
repository_connection_id: string;
|
|
}>({
|
|
branch_name: props.suggestedBranchName,
|
|
repository_connection_id: defaultBranchRepositoryConnectionId.value,
|
|
});
|
|
|
|
const selectedBranchRepositoryConnection = computed(
|
|
(): RepositoryConnectionModel | null =>
|
|
linkedRepositoryConnections.value.find(
|
|
(repositoryConnection) =>
|
|
String(repositoryConnection.id) ===
|
|
branchCreationForm.repository_connection_id,
|
|
) ?? null,
|
|
);
|
|
|
|
const selectedBranchRepositoryHasPersonalAccess = computed(
|
|
() =>
|
|
selectedBranchRepositoryConnection.value?.has_personal_access ?? false,
|
|
);
|
|
|
|
const initializeBranchCreationForm = (): void => {
|
|
branchCreationForm.clearErrors();
|
|
branchCreationForm.branch_name = props.suggestedBranchName;
|
|
branchCreationForm.repository_connection_id =
|
|
defaultBranchRepositoryConnectionId.value;
|
|
branchNameValidation.value = null;
|
|
isCheckingBranchName.value = false;
|
|
};
|
|
|
|
watch(
|
|
() => isCreateBranchDialogOpen.value,
|
|
(isOpen) => {
|
|
if (!isOpen) {
|
|
branchCreationForm.clearErrors();
|
|
branchNameValidation.value = null;
|
|
isCheckingBranchName.value = false;
|
|
|
|
return;
|
|
}
|
|
|
|
initializeBranchCreationForm();
|
|
},
|
|
);
|
|
|
|
watch(
|
|
[
|
|
() => isCreateBranchDialogOpen.value,
|
|
() => branchCreationForm.repository_connection_id,
|
|
() => branchCreationForm.branch_name,
|
|
],
|
|
(
|
|
[isOpen, repositoryConnectionId, branchName],
|
|
_previousValues,
|
|
onCleanup,
|
|
) => {
|
|
if (!isOpen) {
|
|
return;
|
|
}
|
|
|
|
const repositoryConnection = selectedBranchRepositoryConnection.value;
|
|
|
|
if (repositoryConnection === null || repositoryConnectionId === '') {
|
|
branchNameValidation.value = null;
|
|
isCheckingBranchName.value = false;
|
|
|
|
return;
|
|
}
|
|
|
|
if (!repositoryConnection.has_personal_access) {
|
|
branchNameValidation.value = {
|
|
is_valid: false,
|
|
message:
|
|
'Connect a matching Git connection in your user settings first.',
|
|
};
|
|
isCheckingBranchName.value = false;
|
|
|
|
return;
|
|
}
|
|
|
|
if (branchName.trim() === '') {
|
|
branchNameValidation.value = {
|
|
is_valid: false,
|
|
message: 'Branch name is required.',
|
|
};
|
|
isCheckingBranchName.value = false;
|
|
|
|
return;
|
|
}
|
|
|
|
const abortController = new AbortController();
|
|
const timeoutId = window.setTimeout(async () => {
|
|
isCheckingBranchName.value = true;
|
|
|
|
try {
|
|
const response = await fetch(
|
|
ProjectTicketBranchController.validate.url(
|
|
{
|
|
project: props.project.id,
|
|
ticket: props.ticket.id,
|
|
},
|
|
{
|
|
query: {
|
|
branch_name: branchName,
|
|
repository_connection_id:
|
|
repositoryConnectionId,
|
|
},
|
|
},
|
|
),
|
|
{
|
|
credentials: 'same-origin',
|
|
headers: {
|
|
Accept: 'application/json',
|
|
'X-Requested-With': 'XMLHttpRequest',
|
|
},
|
|
method: 'GET',
|
|
signal: abortController.signal,
|
|
},
|
|
);
|
|
|
|
if (!response.ok) {
|
|
throw new Error('Branch validation failed.');
|
|
}
|
|
|
|
branchNameValidation.value =
|
|
(await response.json()) as BranchNameValidationModel;
|
|
} catch (error) {
|
|
if (
|
|
error instanceof DOMException &&
|
|
error.name === 'AbortError'
|
|
) {
|
|
return;
|
|
}
|
|
|
|
branchNameValidation.value = {
|
|
is_valid: false,
|
|
message: `${appName} could not validate this branch name right now.`,
|
|
};
|
|
} finally {
|
|
if (!abortController.signal.aborted) {
|
|
isCheckingBranchName.value = false;
|
|
}
|
|
}
|
|
}, 300);
|
|
|
|
onCleanup(() => {
|
|
abortController.abort();
|
|
window.clearTimeout(timeoutId);
|
|
isCheckingBranchName.value = false;
|
|
});
|
|
},
|
|
{ immediate: true },
|
|
);
|
|
|
|
const submitBranchCreation = (): void => {
|
|
if (
|
|
!canCreateBranches.value ||
|
|
!selectedBranchRepositoryHasPersonalAccess.value ||
|
|
branchNameValidation.value?.is_valid !== true
|
|
) {
|
|
return;
|
|
}
|
|
|
|
branchCreationForm.submit(
|
|
ProjectTicketBranchController.store({
|
|
project: props.project.id,
|
|
ticket: props.ticket.id,
|
|
}),
|
|
{
|
|
onSuccess: () => {
|
|
isCreateBranchDialogOpen.value = false;
|
|
},
|
|
preserveScroll: true,
|
|
},
|
|
);
|
|
};
|
|
|
|
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="relative isolate flex flex-1 flex-col gap-8 px-4 py-6">
|
|
<div
|
|
class="pointer-events-none absolute inset-x-0 top-0 -z-10 h-72 bg-[radial-gradient(circle_at_top_left,rgba(171,246,136,0.34),transparent_42%),radial-gradient(circle_at_top_right,rgba(216,231,203,0.7),transparent_34%)]"
|
|
/>
|
|
|
|
<section
|
|
class="rounded-[2rem] border border-white/70 bg-[linear-gradient(135deg,rgba(255,255,255,0.94)_0%,rgba(241,244,245,0.9)_100%)] p-6 shadow-[0_28px_80px_-48px_rgba(45,51,53,0.4)] backdrop-blur-sm dark:border-white/10 dark:bg-[linear-gradient(135deg,rgba(17,20,20,0.92)_0%,rgba(24,28,28,0.88)_100%)] dark:shadow-black/30"
|
|
>
|
|
<div
|
|
class="flex flex-col gap-6 xl:flex-row xl:items-start xl:justify-between"
|
|
>
|
|
<div class="max-w-3xl space-y-4">
|
|
<div class="flex flex-wrap items-center gap-2.5">
|
|
<Badge
|
|
variant="outline"
|
|
class="dark:bg-card/85 dark:text-muted-foreground rounded-full border-white/70 bg-white/80 px-3 py-1 text-[0.68rem] font-semibold uppercase tracking-[0.2em] text-[#5a6062] shadow-[0_16px_40px_-34px_rgba(45,51,53,0.3)] dark:border-white/10"
|
|
>
|
|
{{ ticket.ticket_key }}
|
|
</Badge>
|
|
|
|
<Badge
|
|
variant="outline"
|
|
class="dark:bg-card/80 dark:text-foreground gap-2 rounded-full border-white/70 bg-white/70 px-3 py-1.5 text-[#2d3335] shadow-[0_16px_40px_-34px_rgba(45,51,53,0.3)] dark:border-white/10"
|
|
>
|
|
<TicketTypeIcon class="size-5" />
|
|
{{ selectedTicketType.name }}
|
|
</Badge>
|
|
|
|
<Badge
|
|
variant="outline"
|
|
class="dark:bg-card/80 dark:text-foreground gap-2 rounded-full border-white/70 bg-white/70 px-3 py-1.5 text-[#2d3335] shadow-[0_16px_40px_-34px_rgba(45,51,53,0.3)] dark:border-white/10"
|
|
>
|
|
<TicketPriorityIcon class="size-5" />
|
|
{{ selectedTicketPriority.name }}
|
|
</Badge>
|
|
|
|
<Badge
|
|
v-if="ticket.ticket_status"
|
|
variant="outline"
|
|
class="dark:bg-card/80 dark:text-foreground rounded-full border-white/70 bg-white/70 px-3 py-1.5 text-[#2d3335] shadow-[0_16px_40px_-34px_rgba(45,51,53,0.3)] dark:border-white/10"
|
|
>
|
|
{{ ticket.ticket_status.name }}
|
|
</Badge>
|
|
|
|
<Badge
|
|
v-if="ticket.is_blocked"
|
|
class="rounded-full border-transparent bg-[#fdf6b0] px-3 py-1.5 text-[#615d27] dark:bg-[#65612a]/35 dark:text-[#fdf6b0]"
|
|
>
|
|
Blocked
|
|
</Badge>
|
|
|
|
<Badge
|
|
v-if="!canEditTicket"
|
|
variant="outline"
|
|
class="dark:bg-card/80 dark:text-muted-foreground rounded-full border-white/70 bg-white/70 px-3 py-1.5 text-[#5a6062] shadow-[0_16px_40px_-34px_rgba(45,51,53,0.3)] dark:border-white/10"
|
|
>
|
|
Read only
|
|
</Badge>
|
|
</div>
|
|
|
|
<div class="space-y-3">
|
|
<p
|
|
class="dark:text-muted-foreground text-[0.72rem] font-semibold uppercase tracking-[0.22em] text-[#5a6062]"
|
|
>
|
|
Ticket detail
|
|
</p>
|
|
<h1
|
|
class="font-display dark:text-foreground text-3xl font-semibold tracking-tight text-[#2d3335] md:text-4xl"
|
|
>
|
|
{{ ticket.title }}
|
|
</h1>
|
|
<p
|
|
class="dark:text-muted-foreground max-w-2xl text-sm leading-7 text-[#5a6062]"
|
|
>
|
|
Review ticket details, update tracked fields,
|
|
and inspect the change timeline in the new
|
|
Stitch-inspired workspace.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex flex-wrap gap-3">
|
|
<Button
|
|
as-child
|
|
variant="outline"
|
|
:class="airyOutlineButtonClass"
|
|
>
|
|
<Link :href="backlogIndex(project.id)">
|
|
Open backlog
|
|
</Link>
|
|
</Button>
|
|
|
|
<Button
|
|
as-child
|
|
variant="outline"
|
|
:class="airyOutlineButtonClass"
|
|
>
|
|
<Link :href="boardIndex(project.id)"
|
|
>Open board</Link
|
|
>
|
|
</Button>
|
|
|
|
<Button
|
|
as-child
|
|
variant="outline"
|
|
:class="airyOutlineButtonClass"
|
|
>
|
|
<Link :href="show(project.id)"
|
|
>Back to project</Link
|
|
>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<div
|
|
v-if="status"
|
|
class="rounded-[1.5rem] border border-emerald-200/80 bg-emerald-50/80 px-5 py-4 text-sm text-emerald-900 shadow-[0_20px_45px_-38px_rgba(16,185,129,0.45)] dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-100"
|
|
>
|
|
{{ status }}
|
|
</div>
|
|
|
|
<div
|
|
class="grid gap-6 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,0.95fr)] 2xl:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.95fr)_minmax(280px,0.85fr)]"
|
|
>
|
|
<Card :class="frostedCardClass">
|
|
<CardHeader>
|
|
<CardTitle
|
|
class="font-display dark:text-foreground text-2xl text-[#2d3335]"
|
|
>
|
|
Ticket details
|
|
</CardTitle>
|
|
<CardDescription class="max-w-2xl leading-6">
|
|
{{
|
|
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" :class="fieldLabelClass">
|
|
Title
|
|
</Label>
|
|
<Input
|
|
id="title"
|
|
v-model="form.title"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
:class="inputClass"
|
|
/>
|
|
<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"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Type
|
|
</Label>
|
|
<Select
|
|
v-model="form.ticket_type_id"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
>
|
|
<SelectTrigger
|
|
id="ticket_type_id"
|
|
:class="selectTriggerClass"
|
|
>
|
|
<SelectValue
|
|
placeholder="Choose a type"
|
|
/>
|
|
</SelectTrigger>
|
|
<SelectContent
|
|
:class="selectContentClass"
|
|
>
|
|
<SelectItem
|
|
v-for="ticketType in ticketTypes"
|
|
:key="ticketType.id"
|
|
:value="String(ticketType.id)"
|
|
>
|
|
<TicketTypeIcon
|
|
class="size-5"
|
|
/>
|
|
<span>
|
|
{{ ticketType.name }}
|
|
</span>
|
|
</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
<InputError
|
|
:message="form.errors.ticket_type_id"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label
|
|
for="ticket_priority_id"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Priority
|
|
</Label>
|
|
<Select
|
|
v-model="form.ticket_priority_id"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
>
|
|
<SelectTrigger
|
|
id="ticket_priority_id"
|
|
:class="selectTriggerClass"
|
|
>
|
|
<SelectValue
|
|
placeholder="Choose a priority"
|
|
/>
|
|
</SelectTrigger>
|
|
<SelectContent
|
|
:class="selectContentClass"
|
|
>
|
|
<SelectItem
|
|
v-for="ticketPriority in ticketPriorities"
|
|
:key="ticketPriority.id"
|
|
:value="
|
|
String(ticketPriority.id)
|
|
"
|
|
>
|
|
<TicketPriorityIcon
|
|
class="size-5"
|
|
/>
|
|
<span>
|
|
{{ ticketPriority.name }}
|
|
</span>
|
|
</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
<InputError
|
|
:message="
|
|
form.errors.ticket_priority_id
|
|
"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid gap-2 md:grid-cols-2 md:gap-6">
|
|
<div class="grid gap-2">
|
|
<Label
|
|
for="assignee_user_id"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Assignee
|
|
</Label>
|
|
<select
|
|
id="assignee_user_id"
|
|
v-model="form.assignee_user_id"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
:class="nativeSelectClass"
|
|
>
|
|
<option value="">Unassigned</option>
|
|
<option
|
|
v-for="user in users"
|
|
:key="user.id"
|
|
:value="user.id"
|
|
>
|
|
{{ user.name }}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="form.errors.assignee_user_id"
|
|
/>
|
|
</div>
|
|
|
|
<div v-if="canViewAuthor" class="grid gap-2">
|
|
<Label
|
|
for="author_user_id"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Author
|
|
</Label>
|
|
<select
|
|
id="author_user_id"
|
|
v-model="form.author_user_id"
|
|
:disabled="
|
|
!canEditAuthor || form.processing
|
|
"
|
|
:class="nativeSelectClass"
|
|
>
|
|
<option value="">No author</option>
|
|
<option
|
|
v-for="user in users"
|
|
:key="user.id"
|
|
:value="user.id"
|
|
>
|
|
{{ user.name }}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="form.errors.author_user_id"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
class="grid gap-2"
|
|
v-if="project.show_story_points"
|
|
>
|
|
<Label
|
|
for="story_points"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Estimated story points
|
|
</Label>
|
|
<Input
|
|
id="story_points"
|
|
name="story_points"
|
|
v-model="form.story_points"
|
|
type="number"
|
|
step="1"
|
|
:class="inputClass"
|
|
/>
|
|
<InputError
|
|
:message="form.errors.story_points"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label
|
|
for="parent_ticket_id"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Parent ticket
|
|
</Label>
|
|
<select
|
|
id="parent_ticket_id"
|
|
v-model="form.parent_ticket_id"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
:class="nativeSelectClass"
|
|
>
|
|
<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"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Description
|
|
</Label>
|
|
<Textarea
|
|
id="description"
|
|
v-model="form.description"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
:class="textareaClass"
|
|
/>
|
|
<InputError
|
|
:message="form.errors.description"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label
|
|
for="acceptance_criteria"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Acceptance criteria
|
|
</Label>
|
|
<Textarea
|
|
id="acceptance_criteria"
|
|
v-model="form.acceptance_criteria"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
:class="textareaClass"
|
|
/>
|
|
<InputError
|
|
:message="form.errors.acceptance_criteria"
|
|
/>
|
|
</div>
|
|
|
|
<div
|
|
class="dark:bg-muted/25 grid gap-4 rounded-[1.5rem] border border-dashed border-[#adb3b5]/35 bg-[#f8f9fa]/80 p-5 dark:border-white/10"
|
|
>
|
|
<div class="flex items-center gap-3">
|
|
<Checkbox
|
|
id="is_blocked"
|
|
:checked="form.is_blocked"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
@update:checked="
|
|
(
|
|
value:
|
|
| boolean
|
|
| 'indeterminate',
|
|
) =>
|
|
(form.is_blocked =
|
|
value === true)
|
|
"
|
|
/>
|
|
<Label
|
|
for="is_blocked"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Mark ticket as blocked
|
|
</Label>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label
|
|
for="blocked_comment"
|
|
:class="fieldLabelClass"
|
|
>
|
|
Blocker comment
|
|
</Label>
|
|
<Textarea
|
|
id="blocked_comment"
|
|
v-model="form.blocked_comment"
|
|
:disabled="
|
|
!canEditTicket || form.processing
|
|
"
|
|
placeholder="Describe what currently blocks progress on this ticket."
|
|
:class="textareaClass"
|
|
/>
|
|
<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-muted-foreground text-sm">
|
|
Project-configured fields can be tracked
|
|
directly on the ticket.
|
|
</p>
|
|
</div>
|
|
|
|
<div
|
|
v-if="ticketFieldDefinitions.length === 0"
|
|
class="border-border text-muted-foreground rounded-xl border border-dashed px-4 py-6 text-sm"
|
|
>
|
|
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}`"
|
|
:class="fieldLabelClass"
|
|
>
|
|
{{ 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="nativeSelectClass"
|
|
>
|
|
<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
|
|
"
|
|
:class="inputClass"
|
|
/>
|
|
|
|
<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="frostedAsideCardClass">
|
|
<CardHeader
|
|
class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"
|
|
>
|
|
<div class="space-y-1.5">
|
|
<CardTitle>Branches</CardTitle>
|
|
<CardDescription>
|
|
Matching branches are discovered from linked
|
|
repositories when the branch name starts
|
|
with this ticket key.
|
|
</CardDescription>
|
|
</div>
|
|
|
|
<Dialog v-model:open="isCreateBranchDialogOpen">
|
|
<Button
|
|
v-if="canCreateBranches"
|
|
type="button"
|
|
variant="outline"
|
|
class="gap-2"
|
|
@click="isCreateBranchDialogOpen = true"
|
|
>
|
|
<GitBranchPlus class="size-4" />
|
|
Create branch
|
|
</Button>
|
|
|
|
<DialogContent class="sm:max-w-lg">
|
|
<DialogHeader class="space-y-3">
|
|
<DialogTitle>
|
|
Create branch from ticket
|
|
</DialogTitle>
|
|
<DialogDescription>
|
|
Pick a linked repository, confirm
|
|
the suggested branch name, and
|
|
create it directly in Gitea.
|
|
</DialogDescription>
|
|
</DialogHeader>
|
|
|
|
<form
|
|
class="grid gap-4"
|
|
@submit.prevent="submitBranchCreation"
|
|
>
|
|
<div class="grid gap-2">
|
|
<Label
|
|
for="repository_connection_id"
|
|
>
|
|
Repository
|
|
</Label>
|
|
<select
|
|
id="repository_connection_id"
|
|
v-model="
|
|
branchCreationForm.repository_connection_id
|
|
"
|
|
:disabled="
|
|
branchCreationForm.processing
|
|
"
|
|
:class="nativeSelectClass"
|
|
>
|
|
<option
|
|
v-for="repositoryConnection in linkedRepositoryConnections"
|
|
:key="
|
|
repositoryConnection.id
|
|
"
|
|
:value="
|
|
String(
|
|
repositoryConnection.id,
|
|
)
|
|
"
|
|
>
|
|
{{
|
|
`${repositoryConnection.repository_full_name}${repositoryConnection.has_personal_access ? '' : ' (connect personal Git access)'}`
|
|
}}
|
|
</option>
|
|
</select>
|
|
<InputError
|
|
:message="
|
|
branchCreationForm.errors
|
|
.repository_connection_id
|
|
"
|
|
/>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="branch_name">
|
|
Branch name
|
|
</Label>
|
|
<Input
|
|
id="branch_name"
|
|
v-model="
|
|
branchCreationForm.branch_name
|
|
"
|
|
:disabled="
|
|
branchCreationForm.processing ||
|
|
!selectedBranchRepositoryHasPersonalAccess
|
|
"
|
|
:class="inputClass"
|
|
/>
|
|
<InputError
|
|
:message="
|
|
branchCreationForm.errors
|
|
.branch_name
|
|
"
|
|
/>
|
|
</div>
|
|
|
|
<div
|
|
class="rounded-xl border px-4 py-3"
|
|
:class="
|
|
branchNameValidation?.is_valid
|
|
? 'border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-900/70 dark:bg-emerald-950/40 dark:text-emerald-100'
|
|
: 'border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900/70 dark:bg-amber-950/40 dark:text-amber-100'
|
|
"
|
|
>
|
|
<div class="flex items-start gap-3">
|
|
<CheckCircle2
|
|
v-if="
|
|
branchNameValidation?.is_valid
|
|
"
|
|
class="mt-0.5 size-4 shrink-0"
|
|
/>
|
|
<XCircle
|
|
v-else-if="
|
|
branchNameValidation !==
|
|
null
|
|
"
|
|
class="mt-0.5 size-4 shrink-0"
|
|
/>
|
|
<p class="text-sm">
|
|
{{
|
|
isCheckingBranchName
|
|
? 'Checking whether this branch name is valid and still available...'
|
|
: (branchNameValidation?.message ??
|
|
'Select a linked repository to validate the branch name.')
|
|
}}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
v-if="
|
|
!selectedBranchRepositoryHasPersonalAccess &&
|
|
selectedBranchRepositoryConnection !==
|
|
null
|
|
"
|
|
class="border-border rounded-xl border border-dashed px-4 py-4"
|
|
>
|
|
<p
|
|
class="text-muted-foreground text-sm"
|
|
>
|
|
You can only create branches in
|
|
repositories that match one of
|
|
your personal Git connections.
|
|
</p>
|
|
|
|
<Button
|
|
as-child
|
|
variant="outline"
|
|
size="sm"
|
|
class="mt-3"
|
|
>
|
|
<Link
|
|
:href="editGitConnections()"
|
|
>
|
|
Open Git connections
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
|
|
<DialogFooter class="gap-2">
|
|
<Button
|
|
type="button"
|
|
variant="secondary"
|
|
@click="
|
|
isCreateBranchDialogOpen = false
|
|
"
|
|
>
|
|
Cancel
|
|
</Button>
|
|
|
|
<Button
|
|
type="submit"
|
|
:disabled="
|
|
branchCreationForm.processing ||
|
|
isCheckingBranchName ||
|
|
branchNameValidation?.is_valid !==
|
|
true
|
|
"
|
|
>
|
|
Create now
|
|
</Button>
|
|
</DialogFooter>
|
|
</form>
|
|
</DialogContent>
|
|
</Dialog>
|
|
</CardHeader>
|
|
|
|
<CardContent class="space-y-4">
|
|
<div
|
|
v-if="visibleRepositoryBranches.length === 0"
|
|
class="border-border text-muted-foreground rounded-xl border border-dashed px-4 py-6 text-sm"
|
|
>
|
|
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="border-border rounded-xl 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="text-muted-foreground mt-2 text-sm"
|
|
>
|
|
{{
|
|
repositoryBranch
|
|
.repository_connection.base_url
|
|
}}
|
|
</p>
|
|
|
|
<div
|
|
v-if="
|
|
!repositoryBranch
|
|
.repository_connection
|
|
.has_personal_access
|
|
"
|
|
class="mt-3 space-y-3"
|
|
>
|
|
<p
|
|
class="text-muted-foreground text-sm"
|
|
>
|
|
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="frostedAsideCardClass">
|
|
<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
|
|
"
|
|
:action="
|
|
ProjectTicketLinkController.store.url({
|
|
project: project.id,
|
|
ticket: ticket.id,
|
|
})
|
|
"
|
|
class="border-border grid gap-4 rounded-xl border border-dashed p-4"
|
|
method="post"
|
|
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="nativeSelectClass"
|
|
>
|
|
<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="nativeSelectClass"
|
|
>
|
|
<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="border-border text-muted-foreground rounded-xl border border-dashed px-4 py-6 text-sm"
|
|
>
|
|
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="border-border rounded-xl 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="text-foreground hover:text-primary font-medium transition"
|
|
>
|
|
{{
|
|
linkedTicket.linked_ticket
|
|
.ticket_key
|
|
}}
|
|
</Link>
|
|
</div>
|
|
<p
|
|
class="text-muted-foreground mt-2 text-sm"
|
|
>
|
|
{{ linkedTicket.linked_ticket.title }}
|
|
</p>
|
|
|
|
<Form
|
|
v-if="canEditTicket"
|
|
:action="
|
|
ProjectTicketLinkController.destroy.url(
|
|
{
|
|
project: project.id,
|
|
ticket: ticket.id,
|
|
ticketLink: linkedTicket.id,
|
|
},
|
|
)
|
|
"
|
|
class="mt-3 flex justify-end"
|
|
method="delete"
|
|
v-slot="{ processing: deleting }"
|
|
>
|
|
<Button
|
|
type="submit"
|
|
variant="destructive"
|
|
size="sm"
|
|
:disabled="deleting"
|
|
>
|
|
Remove
|
|
</Button>
|
|
</Form>
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card :class="frostedAsideCardClass">
|
|
<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="border-border text-muted-foreground rounded-xl border border-dashed px-4 py-6 text-sm"
|
|
>
|
|
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="border-border rounded-xl 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="text-muted-foreground mt-2 text-sm"
|
|
>
|
|
{{
|
|
repositoryPullRequest
|
|
.repository_connection.base_url
|
|
}}
|
|
</p>
|
|
|
|
<div
|
|
v-if="
|
|
!repositoryPullRequest
|
|
.repository_connection
|
|
.has_personal_access
|
|
"
|
|
class="mt-3 space-y-3"
|
|
>
|
|
<p
|
|
class="text-muted-foreground text-sm"
|
|
>
|
|
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="border-border/70 rounded-xl border 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="text-foreground hover:text-primary font-medium transition"
|
|
>
|
|
{{ pullRequest.title }}
|
|
</a>
|
|
</div>
|
|
<p
|
|
class="text-muted-foreground mt-2 text-sm"
|
|
>
|
|
Source branch:
|
|
{{ pullRequest.source_branch }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card :class="frostedAsideCardClass">
|
|
<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="border-border text-muted-foreground rounded-xl border border-dashed px-4 py-6 text-sm"
|
|
>
|
|
No child tickets are assigned to this ticket
|
|
yet.
|
|
</div>
|
|
|
|
<TicketTreeList
|
|
v-else
|
|
:nodes="childTicketTree"
|
|
:project-id="project.id"
|
|
/>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card :class="frostedAsideCardClass">
|
|
<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="border-border text-muted-foreground rounded-xl border border-dashed px-4 py-6 text-sm"
|
|
>
|
|
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="border-border rounded-xl border px-4 py-4"
|
|
>
|
|
<div
|
|
class="flex flex-wrap items-center gap-2"
|
|
>
|
|
<Badge variant="outline">
|
|
{{ worklogEntry.entry_type }}
|
|
</Badge>
|
|
<span
|
|
class="text-foreground text-sm font-medium"
|
|
>
|
|
{{
|
|
worklogEntry.actor?.name ??
|
|
'System'
|
|
}}
|
|
</span>
|
|
</div>
|
|
<p class="text-foreground mt-3 text-sm">
|
|
{{ worklogEntry.summary }}
|
|
</p>
|
|
<p
|
|
class="text-muted-foreground mt-2 text-xs"
|
|
>
|
|
{{
|
|
formatDateTime(
|
|
worklogEntry.created_at,
|
|
)
|
|
}}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
|
|
<div class="space-y-6 2xl:sticky 2xl:top-24 2xl:self-start">
|
|
<Card :class="frostedAsideCardClass">
|
|
<CardHeader>
|
|
<CardTitle
|
|
class="font-display dark:text-foreground text-xl text-[#2d3335]"
|
|
>
|
|
Snapshot
|
|
</CardTitle>
|
|
<CardDescription>
|
|
Quick context for the ticket without scrolling
|
|
through the full detail form.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
|
|
<CardContent class="space-y-3">
|
|
<div
|
|
class="dark:bg-muted/35 rounded-[1.25rem] bg-[#f1f4f5] px-4 py-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.8)]"
|
|
>
|
|
<p
|
|
class="dark:text-muted-foreground text-[0.68rem] font-semibold uppercase tracking-[0.18em] text-[#5a6062]"
|
|
>
|
|
Assignee
|
|
</p>
|
|
<p
|
|
class="dark:text-foreground mt-1 text-sm font-medium text-[#2d3335]"
|
|
>
|
|
{{ selectedAssignee?.name ?? 'Unassigned' }}
|
|
</p>
|
|
</div>
|
|
|
|
<div
|
|
class="dark:bg-muted/25 rounded-[1.25rem] bg-[#f8f9fa] px-4 py-3"
|
|
>
|
|
<p
|
|
class="dark:text-muted-foreground text-[0.68rem] font-semibold uppercase tracking-[0.18em] text-[#5a6062]"
|
|
>
|
|
Author
|
|
</p>
|
|
<p
|
|
class="dark:text-foreground mt-1 text-sm font-medium text-[#2d3335]"
|
|
>
|
|
{{ selectedAuthor?.name ?? 'No author' }}
|
|
</p>
|
|
</div>
|
|
|
|
<div
|
|
class="grid gap-3 sm:grid-cols-2 2xl:grid-cols-1"
|
|
>
|
|
<div
|
|
class="dark:bg-muted/25 rounded-[1.25rem] bg-[#f8f9fa] px-4 py-3"
|
|
>
|
|
<p
|
|
class="dark:text-muted-foreground text-[0.68rem] font-semibold uppercase tracking-[0.18em] text-[#5a6062]"
|
|
>
|
|
Branches
|
|
</p>
|
|
<p
|
|
class="dark:text-foreground mt-1 text-lg font-semibold text-[#2d3335]"
|
|
>
|
|
{{ repositoryBranchCount }}
|
|
</p>
|
|
</div>
|
|
|
|
<div
|
|
class="dark:bg-muted/25 rounded-[1.25rem] bg-[#f8f9fa] px-4 py-3"
|
|
>
|
|
<p
|
|
class="dark:text-muted-foreground text-[0.68rem] font-semibold uppercase tracking-[0.18em] text-[#5a6062]"
|
|
>
|
|
Pull requests
|
|
</p>
|
|
<p
|
|
class="dark:text-foreground mt-1 text-lg font-semibold text-[#2d3335]"
|
|
>
|
|
{{ pullRequestCount }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
class="dark:bg-muted/25 rounded-[1.25rem] bg-[#f8f9fa] px-4 py-3"
|
|
>
|
|
<p
|
|
class="dark:text-muted-foreground text-[0.68rem] font-semibold uppercase tracking-[0.18em] text-[#5a6062]"
|
|
>
|
|
Last updated
|
|
</p>
|
|
<p
|
|
class="dark:text-foreground mt-1 text-sm font-medium text-[#2d3335]"
|
|
>
|
|
{{ formatDateTime(ticket.updated_at) }}
|
|
</p>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<FeatureComingSoonPanel
|
|
feature="Comments & discussion"
|
|
description="The Stitch design already reserves this full rail for threaded comments, collaboration, and follow-up context. The visual shell is in place here until the feature is wired."
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</AppLayout>
|
|
</template>
|