Commit 8a4710f6 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'issue_10439' into 'master'

Resolve: Epic labels in system notes point to the epic itself

Closes #10439

See merge request gitlab-org/gitlab-ee!11234
parents 4b55148b b1552831
......@@ -15,7 +15,7 @@ module CacheMarkdownField
# Increment this number every time the renderer changes its output
CACHE_COMMONMARK_VERSION_START = 10
CACHE_COMMONMARK_VERSION = 15
CACHE_COMMONMARK_VERSION = 16
# changes to these attributes cause the cache to be invalidates
INVALIDATED_BY = %w[author project].freeze
......
......@@ -19,5 +19,10 @@ module EE
def issuable
epic || super
end
override :banzai_render_context
def banzai_render_context(field)
epic ? super.merge(label_url_method: :group_epics_url) : super
end
end
end
---
title: 'Resolve: Epic labels in system notes point to the epic itself'
merge_request: 11234
author:
type: fixed
......@@ -3,6 +3,8 @@
require 'spec_helper'
describe LabelNote do
include Gitlab::Routing.url_helpers
set(:group) { create(:group) }
set(:user) { create(:user) }
set(:label) { create(:group_label, group: group) }
......@@ -14,5 +16,14 @@ describe LabelNote do
let(:project) { nil }
it_behaves_like 'label note created from events'
it 'includes a link to the list of epics filtered by the label' do
resource_key = resource.class.name.underscore.to_s
events = [build(:resource_label_event, label: label, resource_key => resource)]
note = described_class.from_events(events)
expect(note.note_html).to include(group_epics_path(group, label_name: label.title))
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