From c0e9a46dd590084e42dd43754e9b2ef93d31d6a6 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 16 Jan 2018 12:22:09 +0100 Subject: Fix running manual action tooltip --- lib/gitlab/ci/status/build/action.rb | 5 ++++- spec/lib/gitlab/ci/status/build/action_spec.rb | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/gitlab/ci/status/build/action.rb b/lib/gitlab/ci/status/build/action.rb index 45fd0d4aa07..6c9125647ad 100644 --- a/lib/gitlab/ci/status/build/action.rb +++ b/lib/gitlab/ci/status/build/action.rb @@ -2,6 +2,9 @@ module Gitlab module Ci module Status module Build + ## + # Extended status for playable manual actions. + # class Action < Status::Extended def label if has_action? @@ -12,7 +15,7 @@ module Gitlab end def self.matches?(build, user) - build.action? + build.playable? end end end diff --git a/spec/lib/gitlab/ci/status/build/action_spec.rb b/spec/lib/gitlab/ci/status/build/action_spec.rb index 8c25f72804b..d612d29e3e0 100644 --- a/spec/lib/gitlab/ci/status/build/action_spec.rb +++ b/spec/lib/gitlab/ci/status/build/action_spec.rb @@ -37,16 +37,16 @@ describe Gitlab::Ci::Status::Build::Action do describe '.matches?' do subject { described_class.matches?(build, user) } - context 'when build is an action' do - let(:build) { create(:ci_build, :manual) } + context 'when build is playable action' do + let(:build) { create(:ci_build, :playable) } it 'is a correct match' do expect(subject).to be true end end - context 'when build is not manual' do - let(:build) { create(:ci_build) } + context 'when build is not playable action' do + let(:build) { create(:ci_build, :non_playable) } it 'does not match' do expect(subject).to be false -- cgit v1.2.1 From 6cdc711b6cb1a4a947496506e4b81208d3a61f82 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 16 Jan 2018 12:26:02 +0100 Subject: Add changelog entry for manual actions tooltip fix --- changelogs/unreleased/fix-gb-improve-manual-action-tooltips.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/fix-gb-improve-manual-action-tooltips.yml diff --git a/changelogs/unreleased/fix-gb-improve-manual-action-tooltips.yml b/changelogs/unreleased/fix-gb-improve-manual-action-tooltips.yml new file mode 100644 index 00000000000..31b4734bc79 --- /dev/null +++ b/changelogs/unreleased/fix-gb-improve-manual-action-tooltips.yml @@ -0,0 +1,5 @@ +--- +title: Fix tooltip displayed for running manual actions +merge_request: 16489 +author: +type: fixed -- cgit v1.2.1