mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-07 13:44:23 +08:00
Fix display of a creator in the reports table [SCI-7297]
This commit is contained in:
parent
58acb94977
commit
68fab55328
2 changed files with 7 additions and 7 deletions
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue