diff --git a/app/controllers/repository_columns_controller.rb b/app/controllers/repository_columns_controller.rb index 057ff09b6..7b6e640dc 100644 --- a/app/controllers/repository_columns_controller.rb +++ b/app/controllers/repository_columns_controller.rb @@ -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 diff --git a/app/javascript/packs/vue/repository_filter.js b/app/javascript/packs/vue/repository_filter.js index 5cd5ad142..f130d82fd 100644 --- a/app/javascript/packs/vue/repository_filter.js +++ b/app/javascript/packs/vue/repository_filter.js @@ -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' } ];