system_note_helper.rb 807 Bytes
Newer Older
1
module SystemNoteHelper
2
3
4
5
6
7
8
9
  ICON_NAMES_BY_ACTION = {
    'commit' => 'icon_commit',
    'merge' => 'icon_merge',
    'merged' => 'icon_merged',
    'opened' => 'icon_status_open',
    'closed' => 'icon_status_closed',
    'time_tracking' => 'icon_stopwatch',
    'assignee' => 'icon_user',
10
    'title' => 'icon_edit',
11
12
13
14
15
16
17
18
    'task' => 'icon_check_square_o',
    'label' => 'icon_tags',
    'cross_reference' => 'icon_random',
    'branch' => 'icon_code_fork',
    'confidential' => 'icon_eye_slash',
    'visible' => 'icon_eye',
    'milestone' => 'icon_clock_o',
    'discussion' => 'icon_comment_o',
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
19
    'moved' => 'icon_arrow_circle_o_right'
20
  }.freeze
21

22
23
  def icon_for_system_note(note)
    icon_name = ICON_NAMES_BY_ACTION[note.system_note_metadata&.action]
24
    custom_icon(icon_name) if icon_name
25
26
  end
end