Add ticket pull request visibility

This commit is contained in:
2026-03-26 09:19:56 +01:00
parent 0b95477f4e
commit 789675f83f
11 changed files with 495 additions and 3 deletions
+138
View File
@@ -36,6 +36,15 @@ const visibleRepositoryBranches = computed(() =>
),
);
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',
@@ -687,6 +696,135 @@ const formatDateTime = (value: string): string => {
</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>