Fix task page issues after rails upgrade [SCI-8821] (#5745)

This commit is contained in:
Soufiane 2023-07-11 09:21:22 +02:00 committed by GitHub
parent 6aaa68f320
commit d8658991d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 8 deletions

View file

@ -28,13 +28,13 @@ class MyModuleRepositoriesController < ApplicationController
if params[:simple_view]
repository_rows = datatable_service.repository_rows
rows_view = 'repository_rows/simple_view_index.json'
rows_view = 'repository_rows/simple_view_index'
else
repository_rows = datatable_service.repository_rows
.preload(:repository_columns,
:created_by,
repository_cells: { value: @repository.cell_preload_includes })
rows_view = 'repository_rows/index.json'
rows_view = 'repository_rows/index'
end
@repository_rows = repository_rows.page(page).per(per_page)

View file

@ -13,7 +13,7 @@ class MyModuleTagsController < ApplicationController
render json: {
my_module: @my_module,
html: render_to_string(partial: 'index_edit.html.erb')
html: render_to_string(partial: 'index_edit', formats: :html)
}
end

View file

@ -199,27 +199,33 @@ class MyModulesController < ApplicationController
status: :ok,
start_date_label: render_to_string(
partial: 'my_modules/start_date_label',
formats: :html,
locals: { my_module: @my_module, start_date_editable: true }
),
due_date_label: render_to_string(
partial: 'my_modules/due_date_label',
formats: :html,
locals: { my_module: @my_module, due_date_editable: true }
),
card_due_date_label: render_to_string(
partial: 'my_modules/card_due_date_label',
formats: :html,
locals: { my_module: @my_module }
),
table_due_date_label: {
html: render_to_string(partial: 'experiments/table_due_date_label',
formats: :html,
locals: { my_module: @my_module, user: current_user }),
due_status: my_module_due_status(@my_module)
},
module_header_due_date: render_to_string(
partial: 'my_modules/module_header_due_date',
formats: :html,
locals: { my_module: @my_module }
),
description_label: render_to_string(
partial: 'my_modules/description_label',
formats: :html,
locals: { my_module: @my_module }
),
alerts: alerts

View file

@ -338,6 +338,7 @@ class ProtocolsController < ApplicationController
render json: { message: t('my_modules.protocols.copy_to_repository_modal.success_message') }
end
end
format.html
end
end

View file

@ -45,7 +45,7 @@ module CommentHelper
render json: {
html: render_to_string(
partial: "/shared/comments/#{partial}.html.erb",
partial: "shared/comments/#{partial}",
locals: {
comment: comment,
skip_header: false

View file

@ -36,7 +36,7 @@
<%= f.text_field :name, hide_label: true %>
</div>
<div class="pull-right">
<%= render partial: 'shared/color_picker_select.erb',
<%= render partial: 'shared/color_picker_select',
locals: { name: :color, colors: Constants::TAG_COLORS,
classes: "edit-tag-color", styles: "",
object_name: :tag} %>

View file

@ -1,5 +1,8 @@
<div class="modal" id="newProtocolModal" tabindex="-1" role="dialog">
<%= form_with model: @protocol || Protocol.new, url: type == 'new' ? protocols_path : copy_to_repository_protocol_path(@protocol), method: :post, data: { action: type } do |f| %>
<%= form_with model: @protocol || Protocol.new,
url: type == 'new' ? protocols_path : copy_to_repository_protocol_path(@protocol),
method: :post,
html: { data: { action: type, remote: true } } do |f| %>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">

View file

@ -473,7 +473,7 @@ Rails.application.routes.draw do
resources :repositories, controller: :my_module_repositories, only: %i(update create) do
member do
get :full_view_table
post :index_dt
post :index_dt, defaults: { format: 'json' }
post :export_repository
get :assign_repository_records_modal, as: :assign_modal
get :update_repository_records_modal, as: :update_modal
@ -485,7 +485,7 @@ Rails.application.routes.draw do
resources :repository_snapshots, controller: :my_module_repository_snapshots, only: %i(destroy show) do
member do
get :full_view_table
post :index_dt
post :index_dt, defaults: { format: 'json' }
post :export_repository_snapshot
get :status
end