YangUI - API - Fixed list filtering 86/39386/1
authorĽubomír Balogh <lubomir.balogh@pantheon.sk>
Wed, 25 May 2016 06:24:26 +0000 (08:24 +0200)
committerĽubomír Balogh <lubomir.balogh@pantheon.sk>
Wed, 25 May 2016 06:30:52 +0000 (08:30 +0200)
- Bug 5774 - fixed topology list filtering in YangUI

Change-Id: I705491e82ffe262c420afe81ad7618a9842fa528
Signed-off-by: Ľubomír Balogh <lubomir.balogh@pantheon.sk>
modules/common-yangutils-resources/src/main/resources/yangutils/services/list-filtering.services.js
modules/yangui-resources/src/main/resources/yangui/assets/data/locale-en_US.json
modules/yangui-resources/src/main/resources/yangui/controllers/api/list.controller.js

index 89b79c10bae24c9c3588fc20c7853c38048ae669..7ff0f39d06fe21920ec044dc6aaef71bc856a107 100644 (file)
@@ -80,8 +80,12 @@ define([], function () {
 
             getFilterResult = function(element, filterValue, node){
                 for (var i in filterValue){
+                    if(!filterValue[i].filterType) {
+                        continue;
+                    }
+
                     if(!filterValue[i].hasOwnProperty('value') && !filterValue[i].hasOwnProperty('selectboxBitsValue') && !filterValue[i].hasOwnProperty('bitsValue') &&
-                        !filterValue[i].hasOwnProperty('filterRangeFrom') && !filterValue[i].hasOwnProperty('filterRangeTo')){
+                        !filterValue[i].hasOwnProperty('filterRangeFrom') && !filterValue[i].hasOwnProperty('filterRangeTo') && element[i]){
                         getFilterResult(element[i],filterValue[i]);
                     }else{
                         if(filterValue[i].selectboxBitsValue && filterValue[i].selectboxBitsValue.length){
index adab4b5a60891974e6cb2c1583159dcd15bf6df2..279c5bd6953e152dfa6a22a914c267a08398421f 100644 (file)
   "YANGUI_CREATE_NEW_FILTER" : "Create new filter",
   "YANGUI_ACTIVATE_DEACTIVATE_FILTER" : "Activate/Deactivate filter",
   "YANGUI_SWITCH_FILTER" : "Switch filter",
+  "YANGUI_FILTER_MATCH_SUCCESS" : "Filter successfully activated",
+  "YANGUI_FILTER_MATCH_ERROR" : "Filter does NOT match any nodes",
   "YANGUI_OK" : "Ok",
   "YANGUI_REMOVE_ALL" : "Remove all",
   "YANGUI_DEACTIVATE_ALL" : "Deactivate all",
index 666138ef5c2cb3280c5793b1818ee9ea047d065c..00ca1e7373783a20127330798f6321093354ce1d 100644 (file)
@@ -82,8 +82,10 @@ define([], function() {
             $scope.currentDisplayIndex = 1;
             if($scope.node.filteredListData.length){
                 $scope.node.doubleKeyIndexes = NodeWrapperService.checkKeyDuplicity($scope.node.filteredListData,$scope.node.refKey);
+                $scope.setStatusMessage('success', 'YANGUI_FILTER_MATCH_SUCCESS', e.message);
             }else{
                 $scope.node.doubleKeyIndexes = NodeWrapperService.checkKeyDuplicity($scope.node.listData,$scope.node.refKey);
+                $scope.setStatusMessage('danger', 'YANGUI_FILTER_MATCH_ERROR', e.message);
             }
         };