diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-01-17 08:03:09 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-01-17 08:03:09 +0000 |
commit | ceb2a76876de68d705ab6d9ae677fb90fc8bab3e (patch) | |
tree | deb8d2e6bccdc899e37e9bfa69f4635db8d9653c | |
parent | 73cb6c3e717f3aa4979003552e00c715c052241a (diff) | |
parent | 6cdc711b6cb1a4a947496506e4b81208d3a61f82 (diff) | |
download | gitlab-ce-ceb2a76876de68d705ab6d9ae677fb90fc8bab3e.tar.gz |
Merge branch 'fix/gb/improve-manual-action-tooltips' into 'master'
Fix running manual action tooltip
Closes #41418
See merge request gitlab-org/gitlab-ce!16489
-rw-r--r-- | changelogs/unreleased/fix-gb-improve-manual-action-tooltips.yml | 5 | ||||
-rw-r--r-- | lib/gitlab/ci/status/build/action.rb | 5 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/status/build/action_spec.rb | 8 |
3 files changed, 13 insertions, 5 deletions
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 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 |