Skip to content

Commit 78ebd55

Browse files
authored
Some UI enhancement (#2468)
- Closes #2001 - #2162 (comment) - shows prettyRef for deployments
1 parent 7e8cd1c commit 78ebd55

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

web/.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ coverage/
44
LICENSE
55
components.d.ts
66
src/assets/locales/*.json
7-
src/assets/timeAgoLocales/*.json
7+
src/assets/timeAgoLocales/
88
!src/assets/locales/en.json

web/src/components/pipeline-feed/PipelineFeedItem.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
<div v-if="pipeline" class="flex text-wp-text-100 w-full">
33
<PipelineStatusIcon :status="pipeline.status" class="flex items-center" />
44
<div class="flex flex-col ml-4 min-w-0">
5-
<span class="underline">{{ repo?.owner }} / {{ repo?.name }}</span>
5+
<router-link
6+
:to="{
7+
name: 'repo',
8+
params: { repoId: pipeline.repo_id },
9+
}"
10+
class="underline"
11+
>{{ repo?.owner }} / {{ repo?.name }}</router-link
12+
>
613
<span class="whitespace-nowrap overflow-hidden overflow-ellipsis" :title="message">{{ title }}</span>
714
<div class="flex flex-col mt-2">
815
<div class="flex space-x-2 items-center" :title="created">

web/src/components/repo/pipeline/PipelineStepList.vue

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,28 @@
1010
</div>
1111
<span>{{ pipeline.author }}</span>
1212
</div>
13-
<div class="flex space-x-1 items-center min-w-0">
13+
<a
14+
v-if="pipeline.event === 'pull_request'"
15+
class="flex items-center space-x-1 text-wp-link-100 hover:text-wp-link-200 min-w-0"
16+
:href="pipeline.link_url"
17+
>
18+
<Icon name="pull_request" />
19+
<span class="truncate">{{ prettyRef }}</span>
20+
</a>
21+
<router-link
22+
v-else-if="pipeline.event === 'push' || pipeline.event === 'manual' || pipeline.event === 'deployment'"
23+
class="flex items-center space-x-1 text-wp-link-100 hover:text-wp-link-200 min-w-0"
24+
:to="{ name: 'repo-branch', params: { branch: prettyRef } }"
25+
>
1426
<Icon v-if="pipeline.event === 'manual'" name="manual-pipeline" />
15-
<Icon v-if="pipeline.event === 'push'" name="push" />
16-
<Icon v-if="pipeline.event === 'deployment'" name="deployment" />
17-
<Icon v-else-if="pipeline.event === 'tag'" name="tag" />
18-
<a
19-
v-else-if="pipeline.event === 'pull_request'"
20-
class="flex items-center space-x-1 text-wp-link-100 hover:text-wp-link-200 min-w-0"
21-
:href="pipeline.link_url"
22-
target="_blank"
23-
>
24-
<Icon name="pull_request" />
25-
<span class="truncate">{{ prettyRef }}</span>
26-
</a>
27-
<span v-if="pipeline.event !== 'pull_request'" class="truncate">{{ prettyRef }}</span>
27+
<Icon v-else-if="pipeline.event === 'push'" name="push" />
28+
<Icon v-else-if="pipeline.event === 'deployment'" name="deployment" />
29+
<span class="truncate">{{ prettyRef }}</span>
30+
</router-link>
31+
<div v-else class="flex space-x-1 items-center min-w-0">
32+
<Icon v-if="pipeline.event === 'tag'" name="tag" />
33+
34+
<span class="truncate">{{ prettyRef }}</span>
2835
</div>
2936
<div class="flex items-center flex-shrink-0">
3037
<template v-if="pipeline.event === 'pull_request'">

web/src/compositions/usePipeline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default (pipeline: Ref<Pipeline | undefined>) => {
8787
const title = computed(() => message.value.split('\n')[0]);
8888

8989
const prettyRef = computed(() => {
90-
if (pipeline.value?.event === 'push') {
90+
if (pipeline.value?.event === 'push' || pipeline.value?.event === 'deployment') {
9191
return pipeline.value.branch;
9292
}
9393

0 commit comments

Comments
 (0)