summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services
diff options
context:
space:
mode:
authorITSERVICES\rb7147 <rb7147@att.com>2017-05-08 22:20:44 -0400
committerITSERVICES\rb7147 <rb7147@att.com>2017-05-09 13:58:03 -0400
commitdda032f8bb161d54eb1f59de2b4a3efb774fc4d1 (patch)
tree9a11825d59434d97bb0c7dcbf00a0b84e7e5f526 /POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services
parenta330af579866dacbe595e2e4ad1dd29cd3c96945 (diff)
Policy 1707 Second commit
Change-Id: I18f5b142238733d17280cf17c3d1dd28204d34e9 Signed-off-by: ITSERVICES\rb7147 <rb7147@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services')
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services/policynavigator.js72
1 files changed, 48 insertions, 24 deletions
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services/policynavigator.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services/policynavigator.js
index bb76dd9d5..1435afe8a 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services/policynavigator.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/services/policynavigator.js
@@ -30,8 +30,13 @@
this.currentPath = [];
this.history = [];
this.error = '';
+ this.searchModalActive = false;
};
+ PolicyNavigator.prototype.setSearchModalActiveStatus = function(){
+ this.searchModalActive = true;
+ };
+
PolicyNavigator.prototype.deferredHandler = function(data, deferred, defaultMsg) {
if (!data || typeof data !== 'object') {
this.error = 'Bridge response error, please check the docs';
@@ -99,29 +104,49 @@
PolicyNavigator.prototype.refresh = function() {
var self = this;
var path = self.currentPath.join('/');
- return self.list().then(function(data) {
- self.fileList = (data.result || []).map(function(file) {
- return new Item(file, self.currentPath);
- });
- self.buildTree(path);
- });
+ if(self.searchModalActive){
+ return self.searchlist(null).then(function(data) {
+ self.fileList = (data.result || []).map(function(file) {
+ return new Item(file, self.currentPath);
+ });
+ self.buildTree(path);
+ });
+ }else{
+ return self.list().then(function(data) {
+ self.fileList = (data.result || []).map(function(file) {
+ return new Item(file, self.currentPath);
+ });
+ self.buildTree(path);
+ });
+ }
};
- PolicyNavigator.prototype.policylist = function(finalpath) {
+ PolicyNavigator.prototype.searchlist = function(policyList) {
var self = this;
var deferred = $q.defer();
- var path = finalpath;
- var data = {params: {
- mode: 'LIST',
- onlyFolders: false,
- path: '/' + path
- }};
+ var path = self.currentPath.join('/');
+ var data;
+ if(policyList == null){
+ data = {params: {
+ mode: 'SEARCHLIST',
+ onlyFolders: false,
+ path: '/' + path
+ }};
+ }else{
+ data = {params: {
+ mode: 'SEARCHLIST',
+ onlyFolders: false,
+ path: '/' + path,
+ policyList : policyList
+ }};
+ }
+
self.requesting = true;
self.fileList = [];
self.error = '';
- $http.post(policyManagerConfig.listUrl, data).success(function(data) {
+ $http.post(policyManagerConfig.searchListUrl, data).success(function(data) {
self.deferredHandler(data, deferred);
}).error(function(data) {
self.deferredHandler(data, deferred, 'Unknown error listing, check the response');
@@ -131,16 +156,15 @@
return deferred.promise;
};
- PolicyNavigator.prototype.policyrefresh = function(finalpath) {
- var self = this;
- var path = finalpath;
- self.currentPath = path;
- return self.policylist(finalpath).then(function(data) {
- self.fileList = (data.result || []).map(function(file) {
- return new Item(file, self.currentPath);
- });
- self.buildTree(path);
- });
+ PolicyNavigator.prototype.searchrefresh = function(policyList) {
+ var self = this;
+ var path = self.currentPath.join('/');
+ return self.searchlist(policyList).then(function(data) {
+ self.fileList = (data.result || []).map(function(file) {
+ return new Item(file, self.currentPath);
+ });
+ self.buildTree(path);
+ });
};