Commit c93d8a11 authored by David O'Regan's avatar David O'Regan Committed by Heinrich Lee Yu

Remove milestone from Incidents

We remove the milestone and nested
iteration feature from Incidents.
parent bddd3da1
...@@ -51,7 +51,7 @@ module Milestoneable ...@@ -51,7 +51,7 @@ module Milestoneable
# Overridden on EE module # Overridden on EE module
# #
def supports_milestone? def supports_milestone?
respond_to?(:milestone_id) respond_to?(:milestone_id) && !incident?
end end
end end
......
...@@ -104,6 +104,7 @@ class IssuableSidebarBasicEntity < Grape::Entity ...@@ -104,6 +104,7 @@ class IssuableSidebarBasicEntity < Grape::Entity
end end
expose :supports_time_tracking?, as: :supports_time_tracking expose :supports_time_tracking?, as: :supports_time_tracking
expose :supports_milestone?, as: :supports_milestone
private private
......
...@@ -29,33 +29,34 @@ ...@@ -29,33 +29,34 @@
= render_if_exists 'shared/issuable/sidebar_item_epic', issuable_sidebar: issuable_sidebar = render_if_exists 'shared/issuable/sidebar_item_epic', issuable_sidebar: issuable_sidebar
- milestone = issuable_sidebar[:milestone] || {} - if issuable_sidebar[:supports_milestone]
.block.milestone{ data: { qa_selector: 'milestone_block' } } - milestone = issuable_sidebar[:milestone] || {}
.sidebar-collapsed-icon.has-tooltip{ title: sidebar_milestone_tooltip_label(milestone), data: { container: 'body', html: 'true', placement: 'left', boundary: 'viewport' } } .block.milestone{ data: { qa_selector: 'milestone_block' } }
= sprite_icon('clock') .sidebar-collapsed-icon.has-tooltip{ title: sidebar_milestone_tooltip_label(milestone), data: { container: 'body', html: 'true', placement: 'left', boundary: 'viewport' } }
%span.milestone-title.collapse-truncated-title = sprite_icon('clock')
%span.milestone-title.collapse-truncated-title
- if milestone.present?
= milestone[:title]
- else
= _('None')
.title.hide-collapsed
= _('Milestone')
= loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading')
- if can_edit_issuable
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { qa_selector: "edit_milestone_link", track_label: "right_sidebar", track_property: "milestone", track_event: "click_edit_button", track_value: "" }
.value.hide-collapsed
- if milestone.present? - if milestone.present?
= milestone[:title] - milestone_title = milestone[:expired] ? _("%{milestone_name} (Past due)").html_safe % { milestone_name: milestone[:title] } : milestone[:title]
= link_to milestone_title, milestone[:web_url], class: "bold has-tooltip", title: sidebar_milestone_remaining_days(milestone), data: { container: "body", html: 'true', boundary: 'viewport', qa_selector: 'milestone_link', qa_title: milestone[:title] }
- else - else
= _('None') %span.no-value
.title.hide-collapsed = _('None')
= _('Milestone')
= loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading') .selectbox.hide-collapsed
- if can_edit_issuable = f.hidden_field 'milestone_id', value: milestone[:id], id: nil
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { qa_selector: "edit_milestone_link", track_label: "right_sidebar", track_property: "milestone", track_event: "click_edit_button", track_value: "" } = dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable_type}[milestone_id]", project_id: issuable_sidebar[:project_id], issuable_id: issuable_sidebar[:id], ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], use_id: true, default_no: true, selected: milestone[:title], null_default: true, display: 'static' }})
.value.hide-collapsed - if @project.group.present?
- if milestone.present? = render_if_exists 'shared/issuable/iteration_select', { can_edit: can_edit_issuable, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type }
- milestone_title = milestone[:expired] ? _("%{milestone_name} (Past due)").html_safe % { milestone_name: milestone[:title] } : milestone[:title]
= link_to milestone_title, milestone[:web_url], class: "bold has-tooltip", title: sidebar_milestone_remaining_days(milestone), data: { container: "body", html: 'true', boundary: 'viewport', qa_selector: 'milestone_link', qa_title: milestone[:title] }
- else
%span.no-value
= _('None')
.selectbox.hide-collapsed
= f.hidden_field 'milestone_id', value: milestone[:id], id: nil
= dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable_type}[milestone_id]", project_id: issuable_sidebar[:project_id], issuable_id: issuable_sidebar[:id], ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], use_id: true, default_no: true, selected: milestone[:title], null_default: true, display: 'static' }})
- if @project.group.present?
= render_if_exists 'shared/issuable/iteration_select', { can_edit: can_edit_issuable, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type }
- if issuable_sidebar[:supports_time_tracking] - if issuable_sidebar[:supports_time_tracking]
#issuable-time-tracker.block #issuable-time-tracker.block
......
---
title: "Remove milestone and iteration feature from Incidents sidebar"
merge_request: 40283
author:
type: other
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"toggle_subscription_path": { "type": "string" }, "toggle_subscription_path": { "type": "string" },
"move_issue_path": { "type": "string" }, "move_issue_path": { "type": "string" },
"projects_autocomplete_path": { "type": "string" }, "projects_autocomplete_path": { "type": "string" },
"supports_time_tracking": { "type": "boolean" } "supports_time_tracking": { "type": "boolean" },
"supports_milestone": { "type": "boolean" }
} }
} }
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
"toggle_subscription_path": { "type": "string" }, "toggle_subscription_path": { "type": "string" },
"move_issue_path": { "type": "string" }, "move_issue_path": { "type": "string" },
"projects_autocomplete_path": { "type": "string" }, "projects_autocomplete_path": { "type": "string" },
"supports_time_tracking": { "type": "boolean" } "supports_time_tracking": { "type": "boolean" },
"supports_milestone": { "type": "boolean" }
} }
} }
...@@ -100,6 +100,14 @@ RSpec.describe Milestoneable do ...@@ -100,6 +100,14 @@ RSpec.describe Milestoneable do
expect(merge_request.supports_milestone?).to be_truthy expect(merge_request.supports_milestone?).to be_truthy
end end
end end
context "for incidents" do
let(:incident) { build(:incident) }
it 'returns false' do
expect(incident.supports_milestone?).to be_falsy
end
end
end end
describe 'release scopes' do describe 'release scopes' do
......
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