Class: WorkItemPresenter

Inherits:
IssuePresenter show all
Extended by:
Gitlab::Utils::Override
Defined in:
app/presenters/work_item_presenter.rb

Overview

rubocop:todo Gitlab/NamespacedClass -- WorkItem is not namespaced

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods inherited from IssuePresenter

#issue_email_participants, #issue_path, #parent_emails_disabled?, #parent_emails_enabled?, #service_desk_reply_to, #subscribed?

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

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Methods included from Gitlab::Routing

includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

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

Instance Method Details

#duplicated_to_work_item_urlObject



22
23
24
25
26
27
# File 'app/presenters/work_item_presenter.rb', line 22

def duplicated_to_work_item_url
  return unless work_item.duplicated?
  return unless allowed_to_read_work_item?(work_item.duplicated_to)

  Gitlab::UrlBuilder.build(work_item.duplicated_to)
end

#moved_to_work_item_urlObject



29
30
31
32
33
34
# File 'app/presenters/work_item_presenter.rb', line 29

def moved_to_work_item_url
  return unless work_item.moved?
  return unless allowed_to_read_work_item?(work_item.moved_to)

  Gitlab::UrlBuilder.build(work_item.moved_to)
end

#web_pathObject



16
17
18
19
20
# File 'app/presenters/work_item_presenter.rb', line 16

def web_path
  return super unless should_use_work_item_path?

  work_item_url_helper(only_path: true)
end

#web_urlObject



9
10
11
12
13
# File 'app/presenters/work_item_presenter.rb', line 9

def web_url
  return super unless should_use_work_item_path?

  work_item_url_helper(only_path: false)
end