Commit ddd704ae authored by Jarka Košanová's avatar Jarka Košanová

Enable Epic relationships

- remove epic_links feature flag
- add documentation & changelog
parent 33501c1f
...@@ -23,6 +23,10 @@ you can change its title, description, start date, and due date. ...@@ -23,6 +23,10 @@ you can change its title, description, start date, and due date.
![epic view](img/epic_view.png) ![epic view](img/epic_view.png)
## Relationship in Epics
### With Issues
An epic contains a list of issues, and an issue can be associated with at most An epic contains a list of issues, and an issue can be associated with at most
one epic. You can add issues associated with the epic by clicking the one epic. You can add issues associated with the epic by clicking the
plus icon (<kbd>+</kbd>) under the epic description, pasting the link of the plus icon (<kbd>+</kbd>) under the epic description, pasting the link of the
...@@ -31,9 +35,19 @@ group or any of the epic's subgroups are eligible to be added. To remove an ...@@ -31,9 +35,19 @@ group or any of the epic's subgroups are eligible to be added. To remove an
issue from an epic, simply click on the <kbd>x</kbd> button in the epic's issue from an epic, simply click on the <kbd>x</kbd> button in the epic's
issue list. issue list.
When you add an issue to an epic that's already associated with another epic, ### With Epics
the issue is automatically removed from the previous epic. In other words, an
issue can be associated with at most one epic. An epic can have multiple child epics while the maximum depth is 5. You can add epics associated with the epic by clicking the
plus icon (<kbd>+</kbd>) under the epic description, pasting the link of the
issue, and clicking **Add**. Any epic belonging to a group or subgroup of the epic's
group are eligible to be added. To remove a child epic from a parent epic,
simply click on the <kbd>x</kbd> button in the epic's epic list.
### Conflicts
When you add an issue or an epic to an epic that's already associated with another epic,
the issue or the epic is automatically removed from the previous epic. In other words, an
issue or epic can be associated with at most one epic.
## Start date and due date ## Start date and due date
......
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,7 @@ export default {
return { return {
// Epics specific configuration // Epics specific configuration
issuableRef: '', issuableRef: '',
hasRelatedEpicsFeature: this.subepicsSupported && gon.features && gon.features.epicLinks, hasRelatedEpicsFeature: this.subepicsSupported,
projectPath: this.groupPath, projectPath: this.groupPath,
parentEpic: this.parent ? this.parent : {}, parentEpic: this.parent ? this.parent : {},
projectNamespace: '', projectNamespace: '',
......
...@@ -3,13 +3,8 @@ ...@@ -3,13 +3,8 @@
class Groups::EpicLinksController < Groups::EpicsController class Groups::EpicLinksController < Groups::EpicsController
include EpicRelations include EpicRelations
before_action :check_feature_flag!
before_action :check_nested_support! before_action :check_nested_support!
before_action do
push_frontend_feature_flag(:epic_links)
end
def destroy def destroy
result = ::Epics::UpdateService.new(group, current_user, { parent: nil }).execute(child_epic) result = ::Epics::UpdateService.new(group, current_user, { parent: nil }).execute(child_epic)
...@@ -30,10 +25,6 @@ class Groups::EpicLinksController < Groups::EpicsController ...@@ -30,10 +25,6 @@ class Groups::EpicLinksController < Groups::EpicsController
@child_epic ||= Epic.find(params[:id]) @child_epic ||= Epic.find(params[:id])
end end
def check_feature_flag!
render_404 unless Feature.enabled?(:epic_links, group)
end
def check_nested_support! def check_nested_support!
render_404 unless Epic.supports_nested_objects? render_404 unless Epic.supports_nested_objects?
end end
......
...@@ -8,10 +8,6 @@ class Groups::EpicsController < Groups::ApplicationController ...@@ -8,10 +8,6 @@ class Groups::EpicsController < Groups::ApplicationController
include RendersNotes include RendersNotes
include EpicsActions include EpicsActions
before_action do
push_frontend_feature_flag(:epic_links)
end
before_action :check_epics_available! before_action :check_epics_available!
before_action :epic, except: [:index, :create] before_action :epic, except: [:index, :create]
before_action :set_issuables_index, only: :index before_action :set_issuables_index, only: :index
......
---
title: Add support for relationship between epics
merge_request: 9051
author:
type: added
...@@ -26,20 +26,6 @@ describe Groups::EpicLinksController, :postgresql do ...@@ -26,20 +26,6 @@ describe Groups::EpicLinksController, :postgresql do
end end
end end
shared_examples 'feature flag disabled' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_links: false)
group.add_developer(user)
subject
end
it 'returns 400 status' do
expect(response).to have_gitlab_http_status(404)
end
end
describe 'GET #index' do describe 'GET #index' do
before do before do
epic1.update(parent: parent_epic) epic1.update(parent: parent_epic)
...@@ -48,12 +34,10 @@ describe Groups::EpicLinksController, :postgresql do ...@@ -48,12 +34,10 @@ describe Groups::EpicLinksController, :postgresql do
subject { get :index, group_id: group, epic_id: parent_epic.to_param } subject { get :index, group_id: group, epic_id: parent_epic.to_param }
it_behaves_like 'unlicensed epics action' it_behaves_like 'unlicensed epics action'
it_behaves_like 'feature flag disabled'
context 'when epic_links feature is enabled' do context 'when epics are enabled' do
before do before do
stub_licensed_features(epics: true) stub_licensed_features(epics: true)
stub_feature_flags(epic_linkcs: true)
group.add_developer(user) group.add_developer(user)
subject subject
...@@ -76,12 +60,10 @@ describe Groups::EpicLinksController, :postgresql do ...@@ -76,12 +60,10 @@ describe Groups::EpicLinksController, :postgresql do
end end
it_behaves_like 'unlicensed epics action' it_behaves_like 'unlicensed epics action'
it_behaves_like 'feature flag disabled'
context 'when epic_links feature is enabled' do context 'when epics are enabled' do
before do before do
stub_licensed_features(epics: true) stub_licensed_features(epics: true)
stub_feature_flags(epic_linkcs: true)
end end
context 'when user has permissions to create requested association' do context 'when user has permissions to create requested association' do
...@@ -124,12 +106,10 @@ describe Groups::EpicLinksController, :postgresql do ...@@ -124,12 +106,10 @@ describe Groups::EpicLinksController, :postgresql do
subject { delete :destroy, group_id: group, epic_id: parent_epic.to_param, id: epic1.id } subject { delete :destroy, group_id: group, epic_id: parent_epic.to_param, id: epic1.id }
it_behaves_like 'unlicensed epics action' it_behaves_like 'unlicensed epics action'
it_behaves_like 'feature flag disabled'
context 'when epic_links feature is enabled' do context 'when epics are enabled' do
before do before do
stub_licensed_features(epics: true) stub_licensed_features(epics: true)
stub_feature_flags(epic_linkcs: true)
end end
context 'when user has permissions to update the parent epic' do context 'when user has permissions to update the parent epic' 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