Class: NotePresenter
- Inherits:
-
Gitlab::View::Presenter::Delegated
- Object
- SimpleDelegator
- Gitlab::View::Presenter::Delegated
- NotePresenter
- Includes:
- ActionView::Helpers::SanitizeHelper, MarkupHelper
- Defined in:
- app/presenters/note_presenter.rb
Overview
rubocop:disable Gitlab/NamespacedClass – Note is not namespaced
Instance Method Summary collapse
Methods included from MarkupHelper
#cross_project_reference, #first_line_in_markdown, #link_to_html, #link_to_markdown, #link_to_markdown_field, #markdown, #markdown_field, #markup, #render_wiki_content
Methods inherited from Gitlab::View::Presenter::Delegated
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
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
#external_author ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'app/presenters/note_presenter.rb', line 26 def return unless object.&. if can?(current_user, :read_external_emails, object) object.. else Gitlab::Utils::Email.(object.., deform: true) end end |
#note ⇒ Object
10 11 12 |
# File 'app/presenters/note_presenter.rb', line 10 def note obfuscate_participants_emails_in_system_note(object.note) end |
#note_first_line_html ⇒ Object
21 22 23 24 |
# File 'app/presenters/note_presenter.rb', line 21 def note_first_line_html text = first_line_in_markdown(object, :note, 125) obfuscate_participants_emails_in_system_note(text) end |
#note_html ⇒ Object
15 16 17 18 19 |
# File 'app/presenters/note_presenter.rb', line 15 def note_html # Always use `markdown_field` because it removes references based on the current user context. text = markdown_field(object, :note) obfuscate_participants_emails_in_system_note(text) end |