-
-
-
-
-
-
-
-
- {{ prettyRef }}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- {{ pipeline.commit.slice(0, 10) }}
+ {{ $t('pushed_to') }}
+ {{ $t('closed') }}
+ {{ $t('deployed_to') }}
+ {{ $t('created') }}
+ {{ $t('triggered') }}
+ {{ $t('triggered') }}
+
+ {{ $t('by_user', { user: pipeline.author }) }}
+
+
+
+
+
+
+ {{ duration }}
+
-
-
-
{{ duration }}
+
+
+ {{ since }}
+
-
-
-
{{ since }}
+
+
+
+
+
+
@@ -70,8 +79,10 @@
diff --git a/web/src/compositions/usePipeline.ts b/web/src/compositions/usePipeline.ts
index cd249d2571..d02409fdbb 100644
--- a/web/src/compositions/usePipeline.ts
+++ b/web/src/compositions/usePipeline.ts
@@ -27,7 +27,8 @@ export default (pipeline: Ref
) => {
const i18n = useI18n();
const since = computed(() => {
if (sinceRaw.value === 0) {
- return i18n.t('time.not_started');
+ // return i18n.t('time.not_started');
+ return '-';
}
if (sinceElapsed.value === undefined) {
@@ -73,15 +74,11 @@ export default (pipeline: Ref) => {
return prettyDuration(durationElapsed.value);
});
- const message = computed(() => {
- if (!pipeline.value) {
- return '';
- }
-
- return convertEmojis(pipeline.value.message);
- });
+ const message = computed(() => convertEmojis(pipeline.value?.message ?? ''));
+ const shortMessage = computed(() => message.value.split('\n')[0]);
- const title = computed(() => message.value.split('\n')[0]);
+ const prTitleWithDescription = computed(() => convertEmojis(pipeline.value?.title ?? ''));
+ const prTitle = computed(() => prTitleWithDescription.value.split('\n')[0]);
const prettyRef = computed(() => {
if (pipeline.value?.event === 'push' || pipeline.value?.event === 'deployment') {
@@ -117,5 +114,5 @@ export default (pipeline: Ref) => {
return toLocaleString(new Date(start * 1000));
});
- return { since, duration, message, title, prettyRef, created };
+ return { since, duration, message, shortMessage, prTitle, prTitleWithDescription, prettyRef, created };
};
diff --git a/web/src/utils/locale.ts b/web/src/utils/locale.ts
index 319ec8701f..091a85bde0 100644
--- a/web/src/utils/locale.ts
+++ b/web/src/utils/locale.ts
@@ -6,3 +6,11 @@ export function getUserLanguage(): string {
return selectedLocale;
}
+
+export function truncate(text: string, length: number): string {
+ if (text.length <= length) {
+ return text;
+ }
+
+ return `${text.slice(0, length)}...`;
+}
diff --git a/web/src/views/repo/pipeline/PipelineWrapper.vue b/web/src/views/repo/pipeline/PipelineWrapper.vue
index f147031644..a204bf4828 100644
--- a/web/src/views/repo/pipeline/PipelineWrapper.vue
+++ b/web/src/views/repo/pipeline/PipelineWrapper.vue
@@ -26,7 +26,9 @@
{{ $t('repo.pipeline.pipeline', { pipelineId }) }}
-
- {{ title }}
+ {{
+ shortMessage
+ }}
@@ -138,7 +140,7 @@ if (!repo || !repoPermissions) {
}
const pipeline = pipelineStore.getPipeline(repositoryId, pipelineId);
-const { since, duration, created, message, title } = usePipeline(pipeline);
+const { since, duration, created, message, shortMessage } = usePipeline(pipeline);
provide('pipeline', pipeline);
const pipelineConfigs = ref();