From b3ae49416975cb2726a8e9a2739f56918aaf2663 Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Tue, 25 Mar 2014 12:25:04 +0100 Subject: [PATCH] Fix column selection on filtering --- app/assets/javascripts/angular/models/query.js | 5 ++--- app/controllers/api/v3/work_packages_controller.rb | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/angular/models/query.js b/app/assets/javascripts/angular/models/query.js index 66cc14e1e8..96984f543b 100644 --- a/app/assets/javascripts/angular/models/query.js +++ b/app/assets/javascripts/angular/models/query.js @@ -8,7 +8,6 @@ angular.module('openproject.models') angular.extend(this, data, options); this.group_by = this.group_by || ''; - this.selectedColumns = this.selectedColumns || []; if (this.filters === undefined){ this.filters = []; @@ -32,9 +31,9 @@ angular.module('openproject.models') return angular.extend.apply(this, [ { 'f[]': this.getFilterNames(this.getActiveConfiguredFilters()), - 'c[]': ['id'].concat(this.selectedColumns.map(function(column) { + 'c[]': this.columns.map(function(column) { return column.name; - })), + }), 'group_by': this.group_by, 'query_id': this.id, 'sort': this.sortation.encode() diff --git a/app/controllers/api/v3/work_packages_controller.rb b/app/controllers/api/v3/work_packages_controller.rb index ff78923614..c5c17ab695 100644 --- a/app/controllers/api/v3/work_packages_controller.rb +++ b/app/controllers/api/v3/work_packages_controller.rb @@ -85,7 +85,7 @@ module Api def set_work_packages_meta_data(query, results, work_packages) @display_meta = true - @columns = query.columns.map &:name + @columns = ['id'] | query.columns.map(&:name) @work_packages_meta_data = { query: query,