From 971534929c3c65a541921a9846fd1262ea3215e9 Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:08:56 +0200 Subject: [PATCH] Only show commit title (#2361) https://github.com/woodpecker-ci/woodpecker/issues/2359 --- web/src/components/pipeline-feed/PipelineFeedItem.vue | 4 ++-- web/src/components/repo/pipeline/PipelineItem.vue | 10 ++++++---- web/src/compositions/usePipeline.ts | 4 +++- web/src/views/repo/pipeline/PipelineWrapper.vue | 8 ++++---- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/web/src/components/pipeline-feed/PipelineFeedItem.vue b/web/src/components/pipeline-feed/PipelineFeedItem.vue index 8bd2c6f74..3e6b91f22 100644 --- a/web/src/components/pipeline-feed/PipelineFeedItem.vue +++ b/web/src/components/pipeline-feed/PipelineFeedItem.vue @@ -3,7 +3,7 @@
{{ repo?.owner }} / {{ repo?.name }} - {{ message }} + {{ title }}
@@ -36,5 +36,5 @@ const repoStore = useRepoStore(); const pipeline = toRef(props, 'pipeline'); const repo = repoStore.getRepo(computed(() => pipeline.value.repo_id)); -const { since, duration, message, created } = usePipeline(pipeline); +const { since, duration, message, title, created } = usePipeline(pipeline); diff --git a/web/src/components/repo/pipeline/PipelineItem.vue b/web/src/components/repo/pipeline/PipelineItem.vue index f20d06c13..81dfde87d 100644 --- a/web/src/components/repo/pipeline/PipelineItem.vue +++ b/web/src/components/repo/pipeline/PipelineItem.vue @@ -26,9 +26,11 @@
#{{ pipeline.number }} - - {{ - message - }} + {{ title }}
(); const pipeline = toRef(props, 'pipeline'); -const { since, duration, message, prettyRef, created } = usePipeline(pipeline); +const { since, duration, message, title, prettyRef, created } = usePipeline(pipeline); diff --git a/web/src/compositions/usePipeline.ts b/web/src/compositions/usePipeline.ts index 1f44bc9a7..e10a7c9f8 100644 --- a/web/src/compositions/usePipeline.ts +++ b/web/src/compositions/usePipeline.ts @@ -84,6 +84,8 @@ export default (pipeline: Ref) => { return convertEmojis(pipeline.value.message); }); + const title = computed(() => message.value.split('\n')[0]); + const prettyRef = computed(() => { if (pipeline.value?.event === 'push') { return pipeline.value.branch; @@ -118,5 +120,5 @@ export default (pipeline: Ref) => { return toLocaleString(new Date(start * 1000)); }); - return { since, duration, message, prettyRef, created }; + return { since, duration, message, title, prettyRef, created }; }; diff --git a/web/src/views/repo/pipeline/PipelineWrapper.vue b/web/src/views/repo/pipeline/PipelineWrapper.vue index cce95488e..c71629552 100644 --- a/web/src/views/repo/pipeline/PipelineWrapper.vue +++ b/web/src/views/repo/pipeline/PipelineWrapper.vue @@ -16,7 +16,9 @@ {{ $t('repo.pipeline.pipeline', { pipelineId }) }} - {{ message }} + {{ + title + }}