X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fpolicy-models%2FEditor%2Fjs%2Fentities%2Fitem.js;h=017f49ddc52fb93e89e5cd835ca8d3e4b6ccdc6c;hb=710011b4fb147bf100c52c4b0425160bba88a0fd;hp=0e095a841e7109ec81fa620eee0335c53260e125;hpb=7727ac7ce0b25e07dcdc1a29962356c6bf9c94d9;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 0e095a841..017f49ddc 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 @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * 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. @@ -30,6 +30,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun version: model && model.version || '', createdBy: model && model.createdBy || '', modifiedBy: model && model.modifiedBy || '', + roleType: model && model.roleType || '', content: model && model.content || '', recursive: false, sizeKb: function() { @@ -50,10 +51,6 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun this.model = angular.copy(rawModel); this.tempModel = angular.copy(rawModel); - function parseMySQLDate(mysqlDate) { - var d = (mysqlDate || '').toString().split(/[- :]/); - return new Date(d[0], d[1] - 1, d[2], d[3], d[4], d[5]); - } }; Item.prototype.update = function() { @@ -84,7 +81,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,11 +136,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; - } + 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'); @@ -152,7 +149,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun }); return deferred.promise; }; - + Item.prototype.copy = function() { var self = this; var deferred = $q.defer(); @@ -249,7 +246,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun }); return deferred.promise; }; - + Item.prototype.getDescribePolicyContent = function() { var self = this; var deferred = $q.defer(); @@ -262,8 +259,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun self.error = ''; $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'); @@ -315,7 +311,7 @@ angular.module('abs').factory('item', ['$http', '$q', 'policyManagerConfig', fun }); return deferred.promise; }; - + Item.prototype.removePolicy = function() { var self = this; var deferred = $q.defer();