mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Handle column mappings in task repository [SCI-1381]
This commit is contained in:
parent
9a9f8b9c41
commit
115ce91d8d
1 changed files with 8 additions and 8 deletions
|
@ -149,6 +149,14 @@ class RepositoryDatatable < AjaxDatatablesRails::Base
|
|||
.joins(:created_by)
|
||||
.where(repository: @repository)
|
||||
|
||||
# Make mappings of custom columns, so we have same id for every column
|
||||
i = 5
|
||||
@columns_mappings = {}
|
||||
@repository.repository_columns.each do |column|
|
||||
@columns_mappings[column.id] = i.to_s
|
||||
i += 1
|
||||
end
|
||||
|
||||
if @my_module
|
||||
@assigned_rows = @my_module.repository_rows
|
||||
.preload(
|
||||
|
@ -166,13 +174,6 @@ class RepositoryDatatable < AjaxDatatablesRails::Base
|
|||
)
|
||||
end
|
||||
|
||||
# Make mappings of custom columns, so we have same id for every column
|
||||
i = 5
|
||||
@columns_mappings = {}
|
||||
@repository.repository_columns.each do |column|
|
||||
@columns_mappings[column.id] = i.to_s
|
||||
i += 1
|
||||
end
|
||||
repository_rows
|
||||
end
|
||||
|
||||
|
@ -182,7 +183,6 @@ class RepositoryDatatable < AjaxDatatablesRails::Base
|
|||
# number of samples/all samples it's dependant upon sort_record query
|
||||
def fetch_records
|
||||
records = get_raw_records
|
||||
records = @assigned_rows if @my_module && params[:assigned] == 'assigned'
|
||||
records = filter_records(records) if params[:search].present?
|
||||
records = sort_records(records) if params[:order].present?
|
||||
records = paginate_records(records) unless params[:length].present? &&
|
||||
|
|
Loading…
Reference in a new issue