summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-08-08 10:40:21 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-08-08 10:40:21 +0000
commit6aa56a70270001323f85791aec205cce5558501f (patch)
tree9ef72066479747e70bd367ec235efcd7d9bf34ee
parent81b1fd6f7a92744b67570706203cd0d2cd9ee923 (diff)
parent308a07f365d0ea0828f404d596492ca7318c3674 (diff)
downloadgitlab-ce-6aa56a70270001323f85791aec205cce5558501f.tar.gz
Merge branch '35952-keep-group-settings-open-after-submit' into 'master'
Keep group settings sections expanded after submitting form See merge request gitlab-org/gitlab-ce!21083
-rw-r--r--app/controllers/groups_controller.rb2
-rw-r--r--app/views/groups/settings/_general.html.haml1
-rw-r--r--app/views/groups/settings/_permissions.html.haml1
3 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 79fa5818359..83169636ccf 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -85,7 +85,7 @@ class GroupsController < Groups::ApplicationController
def update
if Groups::UpdateService.new(@group, current_user, group_params).execute
- redirect_to edit_group_path(@group), notice: "Group '#{@group.name}' was successfully updated."
+ redirect_to edit_group_path(@group, anchor: params[:update_section]), notice: "Group '#{@group.name}' was successfully updated."
else
@group.restore_path!
diff --git a/app/views/groups/settings/_general.html.haml b/app/views/groups/settings/_general.html.haml
index ab8263533be..0e225fe33a5 100644
--- a/app/views/groups/settings/_general.html.haml
+++ b/app/views/groups/settings/_general.html.haml
@@ -1,4 +1,5 @@
= form_for @group, html: { multipart: true, class: 'gl-show-field-errors' }, authenticity_token: true do |f|
+ %input{ type: 'hidden', name: 'update_section', value: 'js-general-settings' }
= form_errors(@group)
%fieldset
diff --git a/app/views/groups/settings/_permissions.html.haml b/app/views/groups/settings/_permissions.html.haml
index f1f67af1d1e..ffce2d4b14f 100644
--- a/app/views/groups/settings/_permissions.html.haml
+++ b/app/views/groups/settings/_permissions.html.haml
@@ -1,4 +1,5 @@
= form_for @group, html: { multipart: true, class: 'gl-show-field-errors' }, authenticity_token: true do |f|
+ %input{ type: 'hidden', name: 'update_section', value: 'js-permissions-settings' }
= form_errors(@group)
%fieldset