Commit 160ffb68 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix empty state for build that doesn ot have a trace

It also adds a fallback that covers other edge cases that might surface
later.
parent 7e3bb679
...@@ -3,6 +3,13 @@ module Gitlab ...@@ -3,6 +3,13 @@ module Gitlab
module Status module Status
module Build module Build
module Common module Common
def illustration
{
image: 'illustrations/skipped-job_empty.svg',
size: 'svg-430'
}
end
def has_details? def has_details?
can?(user, :read_build, subject) can?(user, :read_build, subject)
end end
......
module Gitlab
module Ci
module Status
module Build
class Empty < Status::Extended
def illustration
{
image: 'illustrations/skipped-job_empty.svg',
size: 'svg-430',
title: _('This job does not have a trace.')
}
end
def self.matches?(build, user)
!build.has_trace?
end
end
end
end
end
end
...@@ -17,7 +17,8 @@ module Gitlab ...@@ -17,7 +17,8 @@ module Gitlab
Status::Build::Play, Status::Build::Play,
Status::Build::Stop], Status::Build::Stop],
[Status::Build::Action], [Status::Build::Action],
[Status::Build::Retried]] [Status::Build::Retried],
[Status::Build::Empty]]
end end
def self.common_helpers def self.common_helpers
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment