From 397cee3f8d0a46613da21536a89ca01b72dc3c92 Mon Sep 17 00:00:00 2001 From: Mihail Maxacov <0xf013@gmail.com> Date: Wed, 24 Sep 2014 17:29:19 +0300 Subject: [PATCH] fix sorting by wp id not displayed in modal --- .../javascripts/angular/controllers/dialogs/columns.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/angular/controllers/dialogs/columns.js b/app/assets/javascripts/angular/controllers/dialogs/columns.js index bf7b3e71d8..af0b8c636c 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/columns.js +++ b/app/assets/javascripts/angular/controllers/dialogs/columns.js @@ -50,10 +50,12 @@ angular.module('openproject.workPackages.controllers') this.closeMe = columnsModal.deactivate; $scope.getObjectsData = function(term, result) { - // Note: This relies on the columns having been cached in the service so they can be instantly available. - var filtered = $filter('filter')($scope.availableColumnsData, {label: term}); - sorted = $filter('orderBy')(filtered, 'label'); - + var filtered = $filter('filter')($scope.availableColumnsData.filter(function(column) { + //Note: very special case; if such columns shall multiple, we better add a field + // to the query model hash of available columns + return column.id != "id"; + }), {label: term}); + var sorted = $filter('orderBy')(filtered, 'label'); return result(sorted); };