From 9d8ab491c111042b04b31a73af308233372f6e1f Mon Sep 17 00:00:00 2001 From: Payton Burdette Date: Mon, 8 May 2023 11:13:53 -0400 Subject: [PATCH 1/2] Change cancel running button Change cancel running pipeline button text and add tooltip. Changelog: changed --- .../pipelines/components/header_component.vue | 7 ++++++- app/assets/javascripts/pipelines/constants.js | 2 +- locale/gitlab.pot | 5 ++++- spec/features/commits_spec.rb | 6 +++--- .../projects/pipelines/pipeline_spec.rb | 18 +++++++++--------- .../pipelines/header_component_spec.js | 6 +++++- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/pipelines/components/header_component.vue b/app/assets/javascripts/pipelines/components/header_component.vue index a36d5d9b58f483..065e40bd3ea897 100644 --- a/app/assets/javascripts/pipelines/components/header_component.vue +++ b/app/assets/javascripts/pipelines/components/header_component.vue @@ -16,6 +16,7 @@ import { DELETE_FAILURE, DEFAULT, BUTTON_TOOLTIP_RETRY, + BUTTON_TOOLTIP_CANCEL, } from '../constants'; import cancelPipelineMutation from '../graphql/mutations/cancel_pipeline.mutation.graphql'; import deletePipelineMutation from '../graphql/mutations/delete_pipeline.mutation.graphql'; @@ -29,6 +30,7 @@ const POLL_INTERVAL = 10000; export default { name: 'PipelineHeaderSection', BUTTON_TOOLTIP_RETRY, + BUTTON_TOOLTIP_CANCEL, pipelineCancel: 'pipelineCancel', pipelineRetry: 'pipelineRetry', finishedStatuses: ['FAILED', 'SUCCESS', 'CANCELED'], @@ -275,6 +277,9 @@ export default { - {{ __('Cancel running') }} + {{ __('Cancel pipeline') }} { }); }); + it('should render cancel action tooltip', () => { + expect(findCancelButton().attributes('title')).toBe(BUTTON_TOOLTIP_CANCEL); + }); + it('should display error message on failure', async () => { const failureMessage = 'failure message'; jest.spyOn(wrapper.vm.$apollo, 'mutate').mockResolvedValue({ -- GitLab From 10d2562da177025eb1945d83dc5bb761ed6a71d3 Mon Sep 17 00:00:00 2001 From: Payton Burdette Date: Mon, 8 May 2023 11:45:11 -0400 Subject: [PATCH 2/2] Fix spec typo --- spec/features/projects/pipelines/pipeline_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 9e547c27086d14..7167581eedfea1 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -625,7 +625,7 @@ context 'when canceling' do before do - click_on 'Cancel pipepline' + click_on 'Cancel pipeline' end it 'does not show a "Cancel pipeline" button', :sidekiq_might_not_need_inline do -- GitLab