X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fpolicy-models%2FEditor%2Fjs%2Fentities%2Fitem.js;h=26cdf67c361d12daec2a502f7d02698385556c4f;hb=refs%2Fchanges%2F20%2F82720%2F5;hp=2b1fd3469d4b7b93c4896b1165b66a5eeeb19aa7;hpb=a330af579866dacbe595e2e4ad1dd29cd3c96945;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/entities/item.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/entities/item.js index 2b1fd3469..26cdf67c3 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/entities/item.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/js/entities/item.js @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ECOMP Policy Engine + * ONAP Policy Engine * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,10 +26,11 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun path: path || [], type: model && model.type || 'file', size: model && parseInt(model.size || 0), - date: parseMySQLDate(model && model.date), + date: model && model.date, version: model && model.version || '', createdBy: model && model.createdBy || '', modifiedBy: model && model.modifiedBy || '', + roleType: model && model.roleType || '', content: model && model.content || '', recursive: false, sizeKb: function() { @@ -84,7 +85,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun this.update(); return deferred.resolve(data); }; - + Item.prototype.createFolder = function() { var self = this; var deferred = $q.defer(); @@ -139,6 +140,11 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun self.inprocess = true; self.error = ''; $http.post(policyManagerConfig.renameUrl, data).success(function(data) { + if(data.result.error != undefined){ + var value = data.result.error; + value = value.replace("rename" , "move"); + data.result.error = value; + } self.deferredHandler(data, deferred); }).error(function(data) { self.deferredHandler(data, deferred, 'Error Occured While Moving'); @@ -147,7 +153,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun }); return deferred.promise; }; - + Item.prototype.copy = function() { var self = this; var deferred = $q.defer(); @@ -170,7 +176,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun }; - Item.prototype.getContent = function() { + Item.prototype.getContent = function(policyNavigator) { var self = this; var deferred = $q.defer(); var data = {params: { @@ -185,6 +191,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun var json = data.result; var policy = JSON.parse(json); self.policy = policy; + self.itemContent = policyNavigator; console.log(policy); self.deferredHandler(data, deferred); }).error(function(data) { @@ -243,7 +250,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun }); return deferred.promise; }; - + Item.prototype.getDescribePolicyContent = function() { var self = this; var deferred = $q.defer(); @@ -257,7 +264,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun $http.post(policyManagerConfig.describePolicyUrl, data).success(function(data) { self.tempModel.content = self.model.content = data.html; var describeTemplate = self.tempModel.content; - + self.deferredHandler(data, deferred); }).error(function(data) { self.deferredHandler(data, deferred, 'Error Occured While retrieving the Policy Data to Describe'); @@ -309,7 +316,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun }); return deferred.promise; }; - + Item.prototype.removePolicy = function() { var self = this; var deferred = $q.defer(); @@ -339,9 +346,5 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun return !this.isFolder() && policyManagerConfig.isEditableFilePattern.test(this.model.name); }; - /*Item.prototype.isImage = function() { - return policyManagerConfig.isImageFilePattern.test(this.model.name); - };*/ - return Item; }]);