diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 15:10:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 15:10:12 +0300 |
commit | 419966e5d34a98d89354ed658c33478ce02d8017 (patch) | |
tree | 6a83543e53f483b59953febc8d61a23b19dd5ccb /app/assets/javascripts/pipeline_editor | |
parent | bfbd788e0910597b93b31020300b15952828c386 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_editor')
-rw-r--r-- | app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue | 31 | ||||
-rw-r--r-- | app/assets/javascripts/pipeline_editor/graphql/queries/client/pipeline.graphql | 5 |
2 files changed, 26 insertions, 10 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue b/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue index 0163b8c572b..6fe1459c80c 100644 --- a/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue +++ b/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlIcon, GlLink, GlLoadingIcon, GlSprintf } from '@gitlab/ui'; +import { GlButton, GlIcon, GlLink, GlLoadingIcon, GlSprintf, GlTooltipDirective } from '@gitlab/ui'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { truncateSha } from '~/lib/utils/text_utility'; import { s__ } from '~/locale'; @@ -20,6 +20,7 @@ export const i18n = { `Pipeline|Pipeline %{idStart}#%{idEnd} %{statusStart}%{statusEnd} for %{commitStart}%{commitEnd}`, ), viewBtn: s__('Pipeline|View pipeline'), + viewCommit: s__('Pipeline|View commit'), pipelineNotTriggeredMsg: s__( 'Pipeline|No pipeline was triggered for the latest changes due to the current CI/CD configuration.', ), @@ -36,6 +37,9 @@ export default { GlSprintf, PipelineEditorMiniGraph, }, + directives: { + GlTooltip: GlTooltipDirective, + }, inject: ['projectFullPath'], props: { commitSha: { @@ -60,13 +64,13 @@ export default { }; }, update(data) { - const { id, iid, commitPath = '', detailedStatus = {}, stages, status } = + const { id, iid, commit = {}, detailedStatus = {}, stages, status } = data.project?.pipeline || {}; return { id, iid, - commitPath, + commit, detailedStatus, stages, status, @@ -95,6 +99,16 @@ export default { }; }, computed: { + commitText() { + const shortSha = truncateSha(this.commitSha); + const commitTitle = this.pipeline.commit.title || ''; + + if (commitTitle.length > 0) { + return `${shortSha}: ${commitTitle}`; + } + + return shortSha; + }, hasPipelineData() { return Boolean(this.pipeline?.id); }, @@ -146,7 +160,7 @@ export default { </div> </template> <template v-else> - <div> + <div class="gl-text-truncate gl-md-max-w-50p gl-mr-1"> <a :href="status.detailsPath" class="gl-mr-auto"> <ci-icon :status="status" :size="16" data-testid="pipeline-status-icon" /> </a> @@ -158,12 +172,12 @@ export default { <template #status>{{ status.text }}</template> <template #commit> <gl-link - :href="pipeline.commitPath" - class="commit-sha gl-font-weight-normal" - target="_blank" + v-gl-tooltip.hover + :href="pipeline.commit.webPath" + :title="$options.i18n.viewCommit" data-testid="pipeline-commit" > - {{ shortSha }} + {{ commitText }} </gl-link> </template> </gl-sprintf> @@ -173,7 +187,6 @@ export default { <pipeline-editor-mini-graph :pipeline="pipeline" v-on="$listeners" /> <gl-button class="gl-mt-2 gl-md-mt-0" - target="_blank" category="secondary" variant="confirm" :href="status.detailsPath" diff --git a/app/assets/javascripts/pipeline_editor/graphql/queries/client/pipeline.graphql b/app/assets/javascripts/pipeline_editor/graphql/queries/client/pipeline.graphql index 0c3653a2880..34e98ae3eb3 100644 --- a/app/assets/javascripts/pipeline_editor/graphql/queries/client/pipeline.graphql +++ b/app/assets/javascripts/pipeline_editor/graphql/queries/client/pipeline.graphql @@ -1,10 +1,13 @@ query getPipeline($fullPath: ID!, $sha: String!) { project(fullPath: $fullPath) { pipeline(sha: $sha) { - commitPath id iid status + commit { + title + webPath + } detailedStatus { detailsPath icon |