Commit 8442f452 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'epic-inicent-filter' into 'master'

Remove epic widget by incident

Closes #229973

See merge request gitlab-org/gitlab!39547
parents eedcd048 1f500faa
......@@ -6,7 +6,7 @@ module EE
extend ::Gitlab::Utils::Override
def supports_epic?
is_a?(Issue) && project.group
is_a?(Issue) && !incident? && project.group.present?
end
def supports_health_status?
......
- if issuable_sidebar[:supports_epic]
- if issuable_sidebar[:features_available][:epics]
- unless @issuable.labels.map(&:title).include?('incident')
#js-vue-sidebar-item-epics-select{ data: { can_edit: can_admin_issue?.to_s, group_id: @project.group.id, issue_id: @issuable.id, epic_issue_id: @issuable.epic_issue&.id } }
#js-vue-sidebar-item-epics-select{ data: { can_edit: can_admin_issue?.to_s, group_id: @project.group.id, issue_id: @issuable.id, epic_issue_id: @issuable.epic_issue&.id } }
- else
- unless @issuable.labels.map(&:title).include?('incident')
= render 'shared/promotions/promote_epics'
= render 'shared/promotions/promote_epics'
......@@ -29,4 +29,29 @@ RSpec.describe EE::Issuable do
it_behaves_like 'matches_cross_reference_regex? fails fast'
end
end
describe '#supports_epic?' do
let(:group) { build_stubbed(:group) }
let(:project_with_group) { build_stubbed(:project, group: group) }
let(:project_without_group) { build_stubbed(:project) }
where(:issuable_type, :project, :supports_epic) do
[
[:issue, :project_with_group, true],
[:issue, :project_without_group, false],
[:incident, :project_with_group, false],
[:incident, :project_without_group, false],
[:merge_request, :project_with_group, false],
[:merge_request, :project_without_group, false]
]
end
with_them do
let(:issuable) { build_stubbed(issuable_type, project: send(project)) }
subject { issuable.supports_epic? }
it { is_expected.to eq(supports_epic) }
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