Module: NotifyHelper

Defined in:
app/helpers/notify_helper.rb

Instance Method Summary collapse

Instance Method Details



8
9
10
# File 'app/helpers/notify_helper.rb', line 8

def issue_reference_link(entity, *args, full: false)
  link_to(entity.to_reference(full: full), issue_url(entity, *args))
end

#merge_request_hash_param(merge_request, reviewer) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/helpers/notify_helper.rb', line 20

def merge_request_hash_param(merge_request, reviewer)
  {
    mr_highlight: '<span style="font-weight: 600;color:#333333;">'.html_safe,
    highlight_end: '</span>'.html_safe,
    mr_link: link_to(
      merge_request.to_reference, merge_request_url(merge_request),
      style: "font-weight: 600;color:#3777b0;text-decoration:none"
    ).html_safe,
    reviewer_highlight: '<span>'.html_safe,
    reviewer_avatar: (
      :img,
      nil,
      height: "24",
      src: avatar_icon_for_user(reviewer, 24, only_path: false),
      style: "border-radius:12px;margin-left:3px;vertical-align:bottom;",
      width: "24",
      alt: "Avatar",
      class: "avatar"
    ).html_safe,
    reviewer_link: link_to(
      reviewer.name,
      user_url(reviewer),
      style: "color:#333333;text-decoration:none;",
      class: "muted"
    ).html_safe
  }
end


4
5
6
# File 'app/helpers/notify_helper.rb', line 4

def merge_request_reference_link(entity, *args)
  link_to(entity.to_reference, merge_request_url(entity, *args))
end

#work_item_type_for(work_item) ⇒ Object



12
13
14
15
16
17
18
# File 'app/helpers/notify_helper.rb', line 12

def work_item_type_for(work_item)
  type = work_item.work_item_type

  # For now we are limiting the scope of the change only for epic work items,
  # we can remove this check to support all work item types.
  type.epic? ? type.base_type : 'issue'
end