Merge branch 'milestone-project-require' into 'master'
Require projects before creating milestone Closes #24101 See merge request !7301
This commit is contained in:
commit
a5c3bfc94d
|
@ -58,7 +58,7 @@ class Groups::MilestonesController < Groups::ApplicationController
|
||||||
|
|
||||||
def render_new_with_error(empty_project_ids)
|
def render_new_with_error(empty_project_ids)
|
||||||
@milestone = Milestone.new(milestone_params)
|
@milestone = Milestone.new(milestone_params)
|
||||||
@milestone.errors.add(:project_id, "Please select at least one project.") if empty_project_ids
|
@milestone.errors.add(:base, "Please select at least one project.") if empty_project_ids
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
= f.label :projects, "Projects", class: "control-label"
|
= f.label :projects, "Projects", class: "control-label"
|
||||||
.col-sm-10
|
.col-sm-10
|
||||||
= f.collection_select :project_ids, @group.projects.non_archived, :id, :name,
|
= f.collection_select :project_ids, @group.projects.non_archived, :id, :name,
|
||||||
{ selected: @group.projects.non_archived.pluck(:id) }, multiple: true, class: 'select2'
|
{ selected: @group.projects.non_archived.pluck(:id) }, required: true, multiple: true, class: 'select2'
|
||||||
|
|
||||||
.col-md-6
|
.col-md-6
|
||||||
.form-group
|
.form-group
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Require projects before creating milestone.
|
||||||
|
merge_request: 7301
|
||||||
|
author: gfyoung
|
Loading…
Reference in New Issue