2017-03-31 11:51:49 -04:00
|
|
|
module SystemNoteHelper
|
2017-04-06 16:59:47 -04:00
|
|
|
ICON_NAMES_BY_ACTION = {
|
|
|
|
'commit' => 'icon_commit',
|
2017-04-28 19:54:37 -04:00
|
|
|
'description' => 'icon_edit',
|
2017-04-06 16:59:47 -04:00
|
|
|
'merge' => 'icon_merge',
|
|
|
|
'merged' => 'icon_merged',
|
|
|
|
'opened' => 'icon_status_open',
|
|
|
|
'closed' => 'icon_status_closed',
|
|
|
|
'time_tracking' => 'icon_stopwatch',
|
|
|
|
'assignee' => 'icon_user',
|
2017-04-07 11:01:23 -04:00
|
|
|
'title' => 'icon_edit',
|
2017-04-06 16:59:47 -04:00
|
|
|
'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',
|
2017-05-21 16:38:33 -04:00
|
|
|
'moved' => 'icon_arrow_circle_o_right',
|
|
|
|
'outdated' => 'icon_edit'
|
2017-04-06 16:59:47 -04:00
|
|
|
}.freeze
|
2017-03-31 11:51:49 -04:00
|
|
|
|
2017-04-06 16:59:47 -04:00
|
|
|
def icon_for_system_note(note)
|
|
|
|
icon_name = ICON_NAMES_BY_ACTION[note.system_note_metadata&.action]
|
2017-04-06 14:47:46 -04:00
|
|
|
custom_icon(icon_name) if icon_name
|
2017-03-31 11:51:49 -04:00
|
|
|
end
|
|
|
|
end
|