Fix column selection on filtering

pull/1065/head
Till Breuer 11 years ago
parent a22b03fd1d
commit b3ae494169
  1. 5
      app/assets/javascripts/angular/models/query.js
  2. 2
      app/controllers/api/v3/work_packages_controller.rb

@ -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()

@ -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,

Loading…
Cancel
Save