2016-12-05 10:35:27 +00:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Status
|
2016-12-02 11:38:07 +00:00
|
|
|
# Base abstract class fore core status
|
|
|
|
#
|
2016-12-05 10:35:27 +00:00
|
|
|
class Core
|
2016-12-13 13:51:23 +00:00
|
|
|
include Gitlab::Routing
|
2016-12-13 13:44:43 +00:00
|
|
|
include Gitlab::Allowable
|
2016-12-02 13:21:04 +00:00
|
|
|
|
2016-12-08 13:28:49 +00:00
|
|
|
attr_reader :subject, :user
|
|
|
|
|
|
|
|
def initialize(subject, user)
|
2016-12-02 11:38:07 +00:00
|
|
|
@subject = subject
|
2016-12-08 13:28:49 +00:00
|
|
|
@user = user
|
2016-12-02 11:38:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def icon
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def label
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2016-12-06 10:22:31 +00:00
|
|
|
# Deprecation warning: this method is here because we need to maintain
|
|
|
|
# backwards compatibility with legacy statuses. We often do something
|
|
|
|
# like "ci-status ci-status-#{status}" to set CSS class.
|
|
|
|
#
|
|
|
|
# `to_s` method should be renamed to `group` at some point, after
|
|
|
|
# phasing legacy satuses out.
|
|
|
|
#
|
|
|
|
def to_s
|
2016-12-06 11:16:52 +00:00
|
|
|
self.class.name.demodulize.downcase.underscore
|
2016-12-06 10:22:31 +00:00
|
|
|
end
|
|
|
|
|
2016-12-08 13:28:49 +00:00
|
|
|
def has_details?
|
2016-12-08 08:51:36 +00:00
|
|
|
false
|
2016-12-02 11:38:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def details_path
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2016-12-08 13:28:49 +00:00
|
|
|
def has_action?
|
2016-12-08 08:51:36 +00:00
|
|
|
false
|
2016-12-02 11:38:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def action_icon
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2016-12-08 17:18:30 +00:00
|
|
|
def action_class
|
|
|
|
end
|
|
|
|
|
2016-12-02 11:38:07 +00:00
|
|
|
def action_path
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2016-12-08 08:51:36 +00:00
|
|
|
|
|
|
|
def action_method
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2016-12-08 17:18:30 +00:00
|
|
|
|
|
|
|
def action_title
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2016-12-02 11:38:07 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|