Commit 480f3abe authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'ee-jprovazn-epic-icon' into 'master'

Add system_note_icon mapping for epic actions

Closes #4262

See merge request gitlab-org/gitlab-ee!5229
parents 02a15197 49894743
module SystemNoteHelper
prepend EE::SystemNoteHelper
ICON_NAMES_BY_ACTION = {
'commit' => 'commit',
'description' => 'pencil',
......
module EE
module SystemNoteHelper
extend ::Gitlab::Utils::Override
EE_ICON_NAMES_BY_ACTION = {
'epic_issue_added' => 'issues',
'epic_issue_removed' => 'issues',
'epic_issue_moved' => 'issues',
'issue_added_to_epic' => 'epic',
'issue_removed_from_epic' => 'epic',
'issue_changed_epic' => 'epic'
}.freeze
override :system_note_icon_name
def system_note_icon_name(note)
EE_ICON_NAMES_BY_ACTION[note.system_note_metadata&.action] || super
end
end
end
---
title: Add icons to epic system notes issue actions
merge_request:
author:
type: fixed
......@@ -16,4 +16,13 @@ describe EpicNoteEntity do
it 'exposes epic-specific elements' do
expect(subject).to include(:toggle_award_path, :path)
end
context 'on a system note' do
let(:note) { create(:system_note, noteable: epic, author: user) }
let!(:note_metadata) { create(:system_note_metadata, note: note, action: 'epic_issue_added') }
it 'sets system_note_icon_name for epic system notes' do
expect(subject[:system_note_icon_name]).to eq('issues')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment