Commit 4e7a2a78 authored by Stan Hu's avatar Stan Hu

Merge branch '250837-check-usage-of-app-views-projects-update-js-haml' into 'master'

Resolve "Check usage of /app/views/projects/update.js.haml"

See merge request gitlab-org/gitlab!53065
parents b1eb33ee 3d38d604
...@@ -90,21 +90,13 @@ class ProjectsController < Projects::ApplicationController ...@@ -90,21 +90,13 @@ class ProjectsController < Projects::ApplicationController
# Refresh the repo in case anything changed # Refresh the repo in case anything changed
@repository = @project.repository @repository = @project.repository
respond_to do |format| if result[:status] == :success
if result[:status] == :success flash[:notice] = _("Project '%{project_name}' was successfully updated.") % { project_name: @project.name }
flash[:notice] = _("Project '%{project_name}' was successfully updated.") % { project_name: @project.name } redirect_to(edit_project_path(@project, anchor: 'js-general-project-settings'))
else
format.html do flash[:alert] = result[:message]
redirect_to(edit_project_path(@project, anchor: 'js-general-project-settings')) @project.reset
end render 'edit'
else
flash[:alert] = result[:message]
@project.reset
format.html { render_edit }
end
format.js
end end
end end
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
%p= _('Choose visibility level, enable/disable project features and their permissions, disable email notifications, and show default award emoji.') %p= _('Choose visibility level, enable/disable project features and their permissions, disable email notifications, and show default award emoji.')
.settings-content .settings-content
= form_for @project, remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f| = form_for @project, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' } %input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' }
%template.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data_json(@project) %template.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data_json(@project)
.js-project-permissions-form .js-project-permissions-form
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
.settings-content .settings-content
= render_if_exists 'shared/promotions/promote_mr_features' = render_if_exists 'shared/promotions/promote_mr_features'
= form_for @project, remote: true, html: { multipart: true, class: "merge-request-settings-form js-mr-settings-form" }, authenticity_token: true do |f| = form_for @project, html: { multipart: true, class: "merge-request-settings-form js-mr-settings-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' } %input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' }
= render 'projects/merge_request_settings', form: f = render 'projects/merge_request_settings', form: f
= f.submit _('Save changes'), class: "btn gl-button btn-success rspec-save-merge-request-changes", data: { qa_selector: 'save_merge_request_changes_button' } = f.submit _('Save changes'), class: "btn gl-button btn-success rspec-save-merge-request-changes", data: { qa_selector: 'save_merge_request_changes_button' }
......
= form_for [@project], remote: true, html: { multipart: true, class: "edit-project js-general-settings-form" }, authenticity_token: true do |f| = form_for [@project], html: { multipart: true, class: "edit-project js-general-settings-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-general-settings' } %input{ name: 'update_section', type: 'hidden', value: 'js-general-settings' }
= form_errors(@project)
%fieldset %fieldset
.row .row
......
- if @project.valid?
:plain
location.href = "#{edit_project_path(@project, anchor: params[:update_section])}";
location.reload();
- else
:plain
$(".flash-container").html("#{escape_javascript(render('errors'))}");
$('.save-project-loader').hide();
$('.project-edit-container').show();
$('.edit-project .js-btn-success-general-project-settings').enable();
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
= link_to _("Learn more."), help_page_path("user/project/merge_requests/merge_request_approvals"), target: '_blank' = link_to _("Learn more."), help_page_path("user/project/merge_requests/merge_request_approvals"), target: '_blank'
.settings-content .settings-content
= form_for @project, remote: true, html: { class: "merge-request-approval-settings-form js-mr-approvals-form" }, authenticity_token: true do |f| = form_for @project, html: { class: "merge-request-approval-settings-form js-mr-approvals-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-approval-settings' } %input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-approval-settings' }
= render 'projects/merge_request_approvals_settings_form', form: f, project: @project = render 'projects/merge_request_approvals_settings_form', form: f, project: @project
= f.submit _("Save changes"), class: "btn gl-button btn-success gl-mt-4", data: { qa_selector: 'save_merge_request_approval_settings_button' } = f.submit _("Save changes"), class: "btn gl-button btn-success gl-mt-4", data: { qa_selector: 'save_merge_request_approval_settings_button' }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
%p#issue-settings-default-template-label= _('Set a default description template to be used for new issues. %{link_start}What are description templates?%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } %p#issue-settings-default-template-label= _('Set a default description template to be used for new issues. %{link_start}What are description templates?%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
.settings-content .settings-content
= form_for @project, remote: true, html: { multipart: true, class: "issue-settings-form" }, authenticity_token: true do |f| = form_for @project, html: { multipart: true, class: "issue-settings-form" }, authenticity_token: true do |f|
%input{ type: 'hidden', name: 'update_section', value: 'js-issue-settings' } %input{ type: 'hidden', name: 'update_section', value: 'js-issue-settings' }
.row .row
.form-group.col-md-9 .form-group.col-md-9
......
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