mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Remove updated on and updated by from default filters [SCI-10751]
This commit is contained in:
parent
6c47e6058f
commit
96dc475f0f
2 changed files with 11 additions and 22 deletions
|
@ -29,6 +29,11 @@ class RepositoryColumnsController < ApplicationController
|
|||
end
|
||||
|
||||
def describe_all
|
||||
additional_columns = [
|
||||
%w(updated_on RepositoryDateTimeValue),
|
||||
%w(updated_by RepositoryUserValue)
|
||||
]
|
||||
|
||||
response_json = @repository.repository_columns
|
||||
.where(data_type: Extends::REPOSITORY_ADVANCED_SEARCHABLE_COLUMNS)
|
||||
.map do |column|
|
||||
|
@ -39,6 +44,12 @@ class RepositoryColumnsController < ApplicationController
|
|||
items: column.items&.map { |item| { value: item.id, label: escape_input(item.data) } }
|
||||
}
|
||||
end
|
||||
|
||||
additional_columns.each do |column, column_type|
|
||||
response_json << { id: column,
|
||||
name: I18n.t("repositories.table.#{column}"),
|
||||
data_type: column_type }
|
||||
end
|
||||
render json: { response: response_json }
|
||||
end
|
||||
|
||||
|
|
|
@ -64,26 +64,6 @@ const DEFAULT_FILTERS = [
|
|||
},
|
||||
data: { operator: 'any_of' },
|
||||
isBlank: true
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
column: {
|
||||
data_type: 'RepositoryDateTimeValue',
|
||||
id: 'updated_on',
|
||||
name: I18n.t('repositories.table.updated_on')
|
||||
},
|
||||
data: { operator: 'equal_to' },
|
||||
isBlank: true
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
column: {
|
||||
data_type: 'RepositoryUserValue',
|
||||
id: 'updated_by',
|
||||
name: I18n.t('repositories.table.updated_by')
|
||||
},
|
||||
data: { operator: 'any_of' },
|
||||
isBlank: true
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -96,8 +76,6 @@ window.initRepositoryFilter = () => {
|
|||
{ id: 'relationships', name: I18n.t('repositories.table.relationships'), data_type: 'RepositoryRelationshipValue' },
|
||||
{ id: 'added_on', name: I18n.t('repositories.table.added_on'), data_type: 'RepositoryDateTimeValue' },
|
||||
{ id: 'added_by', name: I18n.t('repositories.table.added_by'), data_type: 'RepositoryUserValue' },
|
||||
{ id: 'updated_on', name: I18n.t('repositories.table.updated_on'), data_type: 'RepositoryDateTimeValue' },
|
||||
{ id: 'updated_by', name: I18n.t('repositories.table.updated_by'), data_type: 'RepositoryUserValue' },
|
||||
{ id: 'archived_by', name: I18n.t('repositories.table.archived_by'), data_type: 'RepositoryUserValue' },
|
||||
{ id: 'archived_on', name: I18n.t('repositories.table.archived_on'), data_type: 'RepositoryDateTimeValue' }
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue