mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 16:45:18 +08:00
Merge pull request #4530 from okriuchykhin/ok_SCI_7297_v2
Fix display of a creator in the reports table [SCI-7297]
This commit is contained in:
commit
d12cdb8a9a
2 changed files with 7 additions and 7 deletions
|
@ -18,7 +18,7 @@ class CustomDatatable < AjaxDatatablesRails::Base
|
||||||
|
|
||||||
def fetch_records
|
def fetch_records
|
||||||
records = get_raw_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 = sort_records(records) if order_params.present?
|
||||||
records = paginate_records(records) unless dt_params[:length].present? &&
|
records = paginate_records(records) unless dt_params[:length].present? &&
|
||||||
dt_params[:length] == '-1'
|
dt_params[:length] == '-1'
|
||||||
|
|
|
@ -9,8 +9,8 @@ class ReportDatatable < CustomDatatable
|
||||||
Report.name
|
Report.name
|
||||||
Report.pdf_file
|
Report.pdf_file
|
||||||
Report.docx_file
|
Report.docx_file
|
||||||
Report.created_by
|
Report.created_by_name
|
||||||
Report.modified_by
|
Report.modified_by_name
|
||||||
Report.created_at
|
Report.created_at
|
||||||
Report.updated_at
|
Report.updated_at
|
||||||
).freeze
|
).freeze
|
||||||
|
@ -56,8 +56,8 @@ class ReportDatatable < CustomDatatable
|
||||||
'2' => sanitize_input(record.name),
|
'2' => sanitize_input(record.name),
|
||||||
'3' => pdf_file(record),
|
'3' => pdf_file(record),
|
||||||
'4' => docx_file(record),
|
'4' => docx_file(record),
|
||||||
'5' => sanitize_input(record.created_by),
|
'5' => sanitize_input(record.created_by_name),
|
||||||
'6' => sanitize_input(record.modified_by),
|
'6' => sanitize_input(record.modified_by_name),
|
||||||
'7' => I18n.l(record.created_at, format: :full),
|
'7' => I18n.l(record.created_at, format: :full),
|
||||||
'8' => I18n.l(record.updated_at, format: :full),
|
'8' => I18n.l(record.updated_at, format: :full),
|
||||||
'archived' => record.project.archived?,
|
'archived' => record.project.archived?,
|
||||||
|
@ -99,8 +99,8 @@ class ReportDatatable < CustomDatatable
|
||||||
)
|
)
|
||||||
.select('reports.* AS reports')
|
.select('reports.* AS reports')
|
||||||
.select('projects.name AS project_name')
|
.select('projects.name AS project_name')
|
||||||
.select('creators.full_name AS created_by')
|
.select('creators.full_name AS created_by_name')
|
||||||
.select('modifiers.full_name AS modified_by')
|
.select('modifiers.full_name AS modified_by_name')
|
||||||
Report.from(res, :reports)
|
Report.from(res, :reports)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue