Fix display of a creator in the reports table [SCI-7297]

This commit is contained in:
Oleksii Kriuchykhin 2022-10-13 14:55:24 +02:00
parent 58acb94977
commit 68fab55328
2 changed files with 7 additions and 7 deletions

View file

@ -18,7 +18,7 @@ class CustomDatatable < AjaxDatatablesRails::Base
def fetch_records
records = get_raw_records
records = filter_records(records) if dt_params[:search].present?
records = filter_records(records) if dt_params.dig(:search, :value).present?
records = sort_records(records) if order_params.present?
records = paginate_records(records) unless dt_params[:length].present? &&
dt_params[:length] == '-1'

View file

@ -9,8 +9,8 @@ class ReportDatatable < CustomDatatable
Report.name
Report.pdf_file
Report.docx_file
Report.created_by
Report.modified_by
Report.created_by_name
Report.modified_by_name
Report.created_at
Report.updated_at
).freeze
@ -56,8 +56,8 @@ class ReportDatatable < CustomDatatable
'2' => sanitize_input(record.name),
'3' => pdf_file(record),
'4' => docx_file(record),
'5' => sanitize_input(record.created_by),
'6' => sanitize_input(record.modified_by),
'5' => sanitize_input(record.created_by_name),
'6' => sanitize_input(record.modified_by_name),
'7' => I18n.l(record.created_at, format: :full),
'8' => I18n.l(record.updated_at, format: :full),
'archived' => record.project.archived?,
@ -99,8 +99,8 @@ class ReportDatatable < CustomDatatable
)
.select('reports.* AS reports')
.select('projects.name AS project_name')
.select('creators.full_name AS created_by')
.select('modifiers.full_name AS modified_by')
.select('creators.full_name AS created_by_name')
.select('modifiers.full_name AS modified_by_name')
Report.from(res, :reports)
end