summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-08-07 23:04:18 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-08-07 23:04:18 +0000
commit89b2df9b0f7268e4641b05f40b467038c4403b51 (patch)
treee6a91fc8bb00282b1ffe8ece19cf0f1035a2f868
parent861b16b5fb8e35f74d3605093ebd8e8cedec71fa (diff)
parent50908fbed8571042099ab731e8a0bae2c86d151b (diff)
downloadgitlab-ce-89b2df9b0f7268e4641b05f40b467038c4403b51.tar.gz
Merge branch '35952-keep-project-cicd-settings-open-after-submit' into 'master'
Keep project CI/CD settings sections expanded after submitting form See merge request gitlab-org/gitlab-ce!21077
-rw-r--r--app/controllers/projects/runners_controller.rb6
-rw-r--r--app/controllers/projects/triggers_controller.rb10
-rw-r--r--app/views/projects/settings/ci_cd/_autodevops_form.html.haml2
-rw-r--r--app/views/projects/settings/ci_cd/_form.html.haml2
4 files changed, 10 insertions, 10 deletions
diff --git a/app/controllers/projects/runners_controller.rb b/app/controllers/projects/runners_controller.rb
index cc7cce887bf..d118cec977c 100644
--- a/app/controllers/projects/runners_controller.rb
+++ b/app/controllers/projects/runners_controller.rb
@@ -5,7 +5,7 @@ class Projects::RunnersController < Projects::ApplicationController
layout 'project_settings'
def index
- redirect_to project_settings_ci_cd_path(@project)
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-runners-settings')
end
def edit
@@ -50,13 +50,13 @@ class Projects::RunnersController < Projects::ApplicationController
def toggle_shared_runners
project.toggle!(:shared_runners_enabled)
- redirect_to project_settings_ci_cd_path(@project)
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-runners-settings')
end
def toggle_group_runners
project.toggle_ci_cd_settings!(:group_runners_enabled)
- redirect_to project_settings_ci_cd_path(@project)
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-runners-settings')
end
protected
diff --git a/app/controllers/projects/triggers_controller.rb b/app/controllers/projects/triggers_controller.rb
index 6f3de43f85a..cb12b707087 100644
--- a/app/controllers/projects/triggers_controller.rb
+++ b/app/controllers/projects/triggers_controller.rb
@@ -7,7 +7,7 @@ class Projects::TriggersController < Projects::ApplicationController
layout 'project_settings'
def index
- redirect_to project_settings_ci_cd_path(@project)
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-pipeline-triggers')
end
def create
@@ -19,7 +19,7 @@ class Projects::TriggersController < Projects::ApplicationController
flash[:alert] = 'You could not create a new trigger.'
end
- redirect_to project_settings_ci_cd_path(@project)
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-pipeline-triggers')
end
def take_ownership
@@ -29,7 +29,7 @@ class Projects::TriggersController < Projects::ApplicationController
flash[:alert] = 'You could not take ownership of trigger.'
end
- redirect_to project_settings_ci_cd_path(@project)
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-pipeline-triggers')
end
def edit
@@ -37,7 +37,7 @@ class Projects::TriggersController < Projects::ApplicationController
def update
if trigger.update(trigger_params)
- redirect_to project_settings_ci_cd_path(@project), notice: 'Trigger was successfully updated.'
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-pipeline-triggers'), notice: 'Trigger was successfully updated.'
else
render action: "edit"
end
@@ -50,7 +50,7 @@ class Projects::TriggersController < Projects::ApplicationController
flash[:alert] = "Could not remove the trigger."
end
- redirect_to project_settings_ci_cd_path(@project), status: :found
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-pipeline-triggers'), status: :found
end
private
diff --git a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml
index 7d878b38e85..ab9ba5c7569 100644
--- a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml
+++ b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml
@@ -1,6 +1,6 @@
.row
.col-lg-12
- = form_for @project, url: project_settings_ci_cd_path(@project) do |f|
+ = form_for @project, url: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings') do |f|
= form_errors(@project)
%fieldset.builds-feature.js-auto-devops-settings
.form-group
diff --git a/app/views/projects/settings/ci_cd/_form.html.haml b/app/views/projects/settings/ci_cd/_form.html.haml
index 64751e5616a..434aed2f603 100644
--- a/app/views/projects/settings/ci_cd/_form.html.haml
+++ b/app/views/projects/settings/ci_cd/_form.html.haml
@@ -1,6 +1,6 @@
.row.prepend-top-default
.col-lg-12
- = form_for @project, url: project_settings_ci_cd_path(@project) do |f|
+ = form_for @project, url: project_settings_ci_cd_path(@project, anchor: 'js-general-pipeline-settings') do |f|
= form_errors(@project)
%fieldset.builds-feature
.form-group.append-bottom-default.js-secret-runner-token