diff --git a/app/models/dmsf_query.rb b/app/models/dmsf_query.rb index 20e8deba..6f58eae3 100644 --- a/app/models/dmsf_query.rb +++ b/app/models/dmsf_query.rb @@ -30,10 +30,10 @@ class DmsfQuery < Query # Standard columns self.available_columns = [ QueryColumn.new(:id, sortable: 'id', caption: +'#'), - DmsfTitleQueryColumn.new(:title, sortable: 'title', frozen: true, caption: :label_column_title), + DmsfQueryTitleColumn.new(:title, sortable: 'title', frozen: true, caption: :label_column_title), QueryColumn.new(:size, sortable: 'size', caption: :label_column_size), - DmsfModifiedQueryColumn.new(:modified, sortable: 'updated', caption: :label_column_modified), - DmsfVersionQueryColumn.new(:version, sortable: %(major_version minor_version patch_version), + DmsfQueryModifiedColumn.new(:modified, sortable: 'updated', caption: :label_column_modified), + DmsfQueryVersionColumn.new(:version, sortable: %(major_version minor_version patch_version), caption: :label_column_version), QueryColumn.new(:workflow, sortable: 'workflow', caption: :label_column_workflow), QueryColumn.new(:author, sortable: %(firstname lastname), caption: :label_column_author), @@ -58,15 +58,17 @@ def available_columns unless @available_columns @available_columns = self.class.available_columns.dup @available_columns += DmsfFileRevisionCustomField.visible.collect do |cf| - c = QueryCustomFieldColumn.new(cf) - # We would like to prevent grouping in the Option form - c.groupable = false - c + QueryCustomFieldColumn.new(cf) end end @available_columns end + def groupable_columns + # TODO: Implement grouping, then remove this method. + [] + end + def default_columns_names unless @default_column_names @default_column_names = [] diff --git a/app/models/dmsf_modified_query_column.rb b/app/models/dmsf_query_modified_column.rb similarity index 95% rename from app/models/dmsf_modified_query_column.rb rename to app/models/dmsf_query_modified_column.rb index 42f3b545..11f59942 100644 --- a/app/models/dmsf_modified_query_column.rb +++ b/app/models/dmsf_query_modified_column.rb @@ -22,7 +22,7 @@ require 'query' -class DmsfModifiedQueryColumn < QueryColumn +class DmsfQueryModifiedColumn < QueryColumn def value_object(object) object.updated diff --git a/app/models/dmsf_title_query_column.rb b/app/models/dmsf_query_title_column.rb similarity index 95% rename from app/models/dmsf_title_query_column.rb rename to app/models/dmsf_query_title_column.rb index 1f125f89..507acde1 100644 --- a/app/models/dmsf_title_query_column.rb +++ b/app/models/dmsf_query_title_column.rb @@ -22,7 +22,7 @@ require 'query' -class DmsfTitleQueryColumn < QueryColumn +class DmsfQueryTitleColumn < QueryColumn def css_classes 'dmsf-title' diff --git a/app/models/dmsf_version_query_column.rb b/app/models/dmsf_query_version_column.rb similarity index 96% rename from app/models/dmsf_version_query_column.rb rename to app/models/dmsf_query_version_column.rb index 3a271895..d21db26a 100644 --- a/app/models/dmsf_version_query_column.rb +++ b/app/models/dmsf_query_version_column.rb @@ -22,7 +22,7 @@ require 'query' -class DmsfVersionQueryColumn < QueryColumn +class DmsfQueryVersionColumn < QueryColumn def value_object(object) DmsfFileRevision.version object.major_version, object.minor_version, object.patch_version diff --git a/test/functional/dmsf_controller_test.rb b/test/functional/dmsf_controller_test.rb index 50d00994..619d3c24 100644 --- a/test/functional/dmsf_controller_test.rb +++ b/test/functional/dmsf_controller_test.rb @@ -200,6 +200,8 @@ def test_show assert_select 'fieldset#filters' # Options assert_select 'fieldset#options' + # Options - no "Group by" + assert_select 'select#group_by', count: 0 # The main table assert_select 'table.dmsf' # CSV export diff --git a/test/unit/dmsf_query_test.rb b/test/unit/dmsf_query_test.rb index 2e014efa..7b5153fc 100644 --- a/test/unit/dmsf_query_test.rb +++ b/test/unit/dmsf_query_test.rb @@ -69,4 +69,8 @@ def test_default end end + def test_groupable_columns + assert_not @query401.groupable_columns.any? + end + end \ No newline at end of file