summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js
diff options
context:
space:
mode:
authorrb7147 <rb7147@att.com>2018-02-01 12:07:13 -0500
committerrb7147 <rb7147@att.com>2018-02-01 13:50:11 -0500
commit1148834bc4b10d00c1b1830b087357e63af8293f (patch)
treef3a6d166f8a86c8b2b0a9bc1b062f9fc87cd3d58 /POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js
parent066fc4529f36d210a4a4700e8dbfd2cb42f4dc66 (diff)
Included Policy GUI Enhancements and validations
Added hover messages for all policy templates. Resolved few sonar issues. Added fixes for Policy GUI Validations. Issue-ID: POLICY-597 Change-Id: I74abb92dd6ac8722d7869b6a316fad1d8db11d9c Signed-off-by: rb7147 <rb7147@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js')
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js61
1 files changed, 32 insertions, 29 deletions
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js
index f973a236a..42e6796cd 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/controllers/policySearchManager.js
@@ -157,35 +157,38 @@ app.controller('PolicySearchController', [
return currentPath.indexOf(path) !== -1;
};
- $scope.searchPolicy = function(searchContent){
- var deferred = $q.defer();
- var uuu = "searchPolicy";
- var postData = {searchdata : searchContent};
- $.ajax({
- type : 'POST',
- url : uuu,
- dataType: 'json',
- contentType: 'application/json',
- data: JSON.stringify(postData),
- success : function(data){
- $scope.$apply(function(){
- var searchdata = data.result;
- if(searchdata.length > 0){
- if(searchdata[0] == "Elastic Search Server is down"){
- alert("Elastic Search Server is down.");
- }else{
- $scope.policyNavigator.searchrefresh(searchdata);
- }
- }else{
- Notification.info("No Matches Found with your Search");
- }
- });
- },
- error : function(data){
- alert("Error while Searching.");
- }
- });
- };
+ $scope.searchPolicy = function(searchContent){
+ if(searchContent != undefined){
+ var uuu = "searchPolicy";
+ var postData = {searchdata : searchContent};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ var searchdata = data.result;
+ if(searchdata.length > 0){
+ if(searchdata[0] == "Exception"){
+ Notification.error(searchdata[1]);
+ }else{
+ $scope.policyNavigator.searchrefresh(searchdata);
+ }
+ }else{
+ Notification.info("No Matches Found with your Search");
+ }
+ });
+ },
+ error : function(data){
+ Notification.error("Error while Searching.");
+ }
+ });
+ }else{
+ Notification.error("No data has been entered or selected to search");
+ }
+ };
$scope.refresh = function(searchData){
$scope.policyNavigator.searchrefresh(null);