Class: CommitStatusPresenter

Inherits:
Gitlab::View::Presenter::Delegated show all
Defined in:
app/presenters/commit_status_presenter.rb

Constant Summary collapse

TROUBLESHOOTING_DOC =
{
  environment_creation_failure: { path: 'ci/environments/index', anchor: 'a-deployment-job-failed-with-this-job-could-not-be-executed-because-it-would-create-an-environment-with-an-invalid-parameter-error' }
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gitlab::View::Presenter::Delegated

#initialize

Methods included from Gitlab::Utils::DelegatorOverride

#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!

Methods included from Gitlab::View::Presenter::Base

#__subject__, #can?, #declarative_policy_delegate, #is_a?, #present, #url_builder, #web_path, #web_url

Methods included from Gitlab::Allowable

#can?

Methods included from Gitlab::Routing

add_helpers, includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

This class inherits a constructor from Gitlab::View::Presenter::Delegated

Class Method Details

.callout_failure_messagesObject


44
45
46
# File 'app/presenters/commit_status_presenter.rb', line 44

def self.callout_failure_messages
  CALLOUT_FAILURE_MESSAGES
end

Instance Method Details

#callout_failure_messageObject


48
49
50
51
52
53
54
55
56
# File 'app/presenters/commit_status_presenter.rb', line 48

def callout_failure_message
  message = self.class.callout_failure_messages.fetch(failure_reason.to_sym)

  if doc = TROUBLESHOOTING_DOC[failure_reason.to_sym]
    message += " #{help_page_link(doc[:path], doc[:anchor])}"
  end

  message
end