2018-10-30 15:05:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-12-05 05:35:27 -05:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Status
|
2020-06-16 14:09:01 -04:00
|
|
|
# Base abstract class for core status
|
2016-12-02 06:38:07 -05:00
|
|
|
#
|
2016-12-05 05:35:27 -05:00
|
|
|
class Core
|
2016-12-13 08:51:23 -05:00
|
|
|
include Gitlab::Routing
|
2016-12-13 08:44:43 -05:00
|
|
|
include Gitlab::Allowable
|
2016-12-02 08:21:04 -05:00
|
|
|
|
2016-12-08 08:28:49 -05:00
|
|
|
attr_reader :subject, :user
|
|
|
|
|
2021-05-18 17:10:16 -04:00
|
|
|
delegate :cache_key, to: :subject
|
|
|
|
|
2016-12-08 08:28:49 -05:00
|
|
|
def initialize(subject, user)
|
2016-12-02 06:38:07 -05:00
|
|
|
@subject = subject
|
2016-12-08 08:28:49 -05:00
|
|
|
@user = user
|
2016-12-02 06:38:07 -05:00
|
|
|
end
|
|
|
|
|
2021-07-14 17:09:44 -04:00
|
|
|
def id
|
|
|
|
"#{group}-#{subject.id}"
|
|
|
|
end
|
|
|
|
|
2016-12-02 06:38:07 -05:00
|
|
|
def icon
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2017-03-03 01:59:25 -05:00
|
|
|
def favicon
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2018-03-24 06:46:04 -04:00
|
|
|
def illustration
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2016-12-02 06:38:07 -05:00
|
|
|
def label
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2016-12-15 06:55:20 -05:00
|
|
|
def group
|
2016-12-16 09:32:54 -05:00
|
|
|
self.class.name.demodulize.underscore
|
2016-12-06 05:22:31 -05:00
|
|
|
end
|
|
|
|
|
2016-12-08 08:28:49 -05:00
|
|
|
def has_details?
|
2016-12-08 03:51:36 -05:00
|
|
|
false
|
2016-12-02 06:38:07 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def details_path
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2016-12-08 08:28:49 -05:00
|
|
|
def has_action?
|
2016-12-08 03:51:36 -05:00
|
|
|
false
|
2016-12-02 06:38:07 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def action_icon
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def action_path
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2016-12-08 03:51:36 -05:00
|
|
|
|
|
|
|
def action_method
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2016-12-08 12:18:30 -05:00
|
|
|
|
|
|
|
def action_title
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2018-04-03 10:54:03 -04:00
|
|
|
|
|
|
|
def action_button_title
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2018-04-06 05:16:40 -04:00
|
|
|
|
2018-04-05 17:04:42 -04:00
|
|
|
# Hint that appears on all the pipeline graph tooltips and builds on the right sidebar in Job detail view
|
|
|
|
def status_tooltip
|
|
|
|
label
|
|
|
|
end
|
|
|
|
|
|
|
|
# Hint that appears on the build badges
|
|
|
|
def badge_tooltip
|
|
|
|
subject.status
|
|
|
|
end
|
2016-12-02 06:38:07 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|