diff options
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/filters/change-managements-by-statuses.filter.js')
-rw-r--r-- | vid-app-common/src/main/webapp/app/vid/scripts/filters/change-managements-by-statuses.filter.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/filters/change-managements-by-statuses.filter.js b/vid-app-common/src/main/webapp/app/vid/scripts/filters/change-managements-by-statuses.filter.js new file mode 100644 index 000000000..6f0ae2c69 --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/filters/change-managements-by-statuses.filter.js @@ -0,0 +1,22 @@ +(function () { + 'use strict'; + appDS2.filter('changeManagementsByStatuses', [changeManagementsByStatuses]); + + function changeManagementsByStatuses () { + return function(changeManagements, metadata) { + var result = []; + if(changeManagements && metadata && metadata.statuses) { + angular.forEach(changeManagements, function(changeManagement) { + angular.forEach(metadata.statuses, function(status) { + if(changeManagement.requestStatus.requestState === status) { + result.push(changeManagement); + return; + } + }); + }); + } + + return result; + } + } +})(); |