diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-08-06 19:31:09 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-08-06 19:31:09 +0300 |
commit | 8bed16ee8458e287ccd30b4f9e01cc2b596b5929 (patch) | |
tree | 8ee86bd40fcd97490fec4fbfe8c298aa9ec85a2b | |
parent | 4aa824e7059889c7b8badb4bd43cc44f9a01201f (diff) |
Removes duplicate button
Prevents manual action button from being rendered
twice in the job log empty state
-rw-r--r-- | app/assets/javascripts/jobs/components/empty_state.vue | 2 | ||||
-rw-r--r-- | changelogs/unreleased/65705-two-buttons.yml | 5 | ||||
-rw-r--r-- | spec/javascripts/jobs/components/empty_state_spec.js (renamed from spec/frontend/jobs/components/empty_state_spec.js) | 8 |
3 files changed, 13 insertions, 2 deletions
diff --git a/app/assets/javascripts/jobs/components/empty_state.vue b/app/assets/javascripts/jobs/components/empty_state.vue index 275ed80146e..e2bc413e3ce 100644 --- a/app/assets/javascripts/jobs/components/empty_state.vue +++ b/app/assets/javascripts/jobs/components/empty_state.vue @@ -81,7 +81,7 @@ export default { :variables-settings-url="variablesSettingsUrl" /> <div class="text-content"> - <div v-if="action" class="text-center"> + <div v-if="action && !shouldRenderManualVariables" class="text-center"> <gl-link :href="action.path" :data-method="action.method" diff --git a/changelogs/unreleased/65705-two-buttons.yml b/changelogs/unreleased/65705-two-buttons.yml new file mode 100644 index 00000000000..b92e28f9d68 --- /dev/null +++ b/changelogs/unreleased/65705-two-buttons.yml @@ -0,0 +1,5 @@ +--- +title: Prevent duplicated trigger action button +merge_request: +author: +type: fixed diff --git a/spec/frontend/jobs/components/empty_state_spec.js b/spec/javascripts/jobs/components/empty_state_spec.js index dfba5a936ee..c6eac4e27b3 100644 --- a/spec/frontend/jobs/components/empty_state_spec.js +++ b/spec/javascripts/jobs/components/empty_state_spec.js @@ -105,7 +105,7 @@ describe('Empty State', () => { }); describe('with playbale action and not scheduled job', () => { - it('renders manual variables form', () => { + beforeEach(() => { vm = mountComponent(Component, { ...props, content, @@ -117,9 +117,15 @@ describe('Empty State', () => { method: 'post', }, }); + }); + it('renders manual variables form', () => { expect(vm.$el.querySelector('.js-manual-vars-form')).not.toBeNull(); }); + + it('does not render the empty state action', () => { + expect(vm.$el.querySelector('.js-job-empty-state-action')).toBeNull(); + }); }); describe('with playbale action and scheduled job', () => { |