Commit 0f77d24b authored by Mike Greiling's avatar Mike Greiling 🏄 Committed by Tim Zallmann

Keep project settings sections expanded after submitting form

parent 6aa56a70
......@@ -21,6 +21,6 @@ class Projects::AvatarsController < Projects::ApplicationController
@project.save
redirect_to edit_project_path(@project), status: :found
redirect_to edit_project_path(@project, anchor: 'js-general-project-settings'), status: :found
end
end
......@@ -61,7 +61,7 @@ class ProjectsController < Projects::ApplicationController
flash[:notice] = _("Project '%{project_name}' was successfully updated.") % { project_name: @project.name }
format.html do
redirect_to(edit_project_path(@project))
redirect_to(edit_project_path(@project, anchor: 'js-general-project-settings'))
end
else
flash.now[:alert] = result[:message]
......@@ -174,7 +174,7 @@ class ProjectsController < Projects::ApplicationController
)
rescue ::Projects::HousekeepingService::LeaseTaken => ex
redirect_to(
edit_project_path(@project),
edit_project_path(@project, anchor: 'js-project-advanced-settings'),
alert: ex.to_s
)
end
......@@ -183,7 +183,7 @@ class ProjectsController < Projects::ApplicationController
@project.add_export_job(current_user: current_user)
redirect_to(
edit_project_path(@project),
edit_project_path(@project, anchor: 'js-export-project'),
notice: _("Project export started. A download link will be sent by email.")
)
end
......@@ -195,7 +195,7 @@ class ProjectsController < Projects::ApplicationController
send_file export_project_path, disposition: 'attachment'
else
redirect_to(
edit_project_path(@project),
edit_project_path(@project, anchor: 'js-export-project'),
alert: _("Project export link has expired. Please generate a new export from your project settings.")
)
end
......@@ -208,7 +208,7 @@ class ProjectsController < Projects::ApplicationController
flash[:alert] = _("Project export could not be deleted.")
end
redirect_to(edit_project_path(@project))
redirect_to(edit_project_path(@project, anchor: 'js-export-project'))
end
def generate_new_export
......@@ -216,7 +216,7 @@ class ProjectsController < Projects::ApplicationController
export
else
redirect_to(
edit_project_path(@project),
edit_project_path(@project, anchor: 'js-export-project'),
alert: _("Project export could not be deleted.")
)
end
......
......@@ -15,6 +15,7 @@
.settings-content
.project-edit-errors
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-general-project-settings' }
%fieldset
.row
.form-group.col-md-9
......@@ -75,6 +76,7 @@
Enable or disable certain project features and choose access levels.
.settings-content
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' }
-# haml-lint:disable InlineJavaScript
%script.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data(@project)
.js-project-permissions-form
......@@ -94,6 +96,7 @@
= render_if_exists 'shared/promotions/promote_mr_features'
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' }
= render 'projects/merge_request_settings', form: f
= f.submit 'Save changes', class: "btn btn-save qa-save-merge-request-changes"
......
- if @project.valid?
:plain
location.href = "#{edit_project_path(@project)}";
location.href = "#{edit_project_path(@project, anchor: params[:update_section])}";
location.reload();
- else
:plain
$(".project-edit-errors").html("#{escape_javascript(render('errors'))}");
......
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