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' },
  failed_outdated_deployment_job: { path: 'ci/environments/deployment_safety', anchor: 'prevent-outdated-deployment-jobs' }
}.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?, #path_with_line_numbers, #present, #url_builder, #web_path, #web_url

Methods included from Gitlab::Allowable

#can?

Methods included from Gitlab::Routing

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



51
52
53
# File 'app/presenters/commit_status_presenter.rb', line 51

def self.callout_failure_messages
  CALLOUT_FAILURE_MESSAGES
end

Instance Method Details

#callout_failure_messageObject



55
56
57
58
59
60
61
62
63
# File 'app/presenters/commit_status_presenter.rb', line 55

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