X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fpolicy-models%2FEditor%2FPolicyTemplateController%2FDCAEMicroServicePolicyController.js;h=4cee2128d0cbca2d3937744b1ba39653635ead9d;hb=b831c6a3df8e1dc9017ae5e8ad002dc3b1002aab;hp=cffa46f53ce68c1f7abb33da8e7b99b6c480db29;hpb=06e02108525c3e5e8c85de233aef3bb332173c00;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js index cffa46f53..4cee2128d 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js @@ -33,7 +33,7 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind policyType : "Config", configPolicyType : "Micro Service" } - }; + } $scope.refresh = function(){ if($scope.refreshCheck){ @@ -224,7 +224,7 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind layer++; if(layer > 4){ layer = 1 - }; + } div.className += ' children_group border' + layer; //here is div with a group of children. } } @@ -349,11 +349,9 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind } }; - var splitDash = '-'; var splitEqual = '='; var splitComma = ','; var splitcolon = ':'; - var splitsemicolon = ";"; var splitEnum = "],"; var plainAttributeKeys = []; var matching = []; @@ -388,7 +386,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind document.getElementById("msPolicyloader").style.visibility = "hidden"; $scope.$apply(function(){ - var plainAttributeKeys = []; $scope.dcaeModelData = data[0].dcaeModelData; $scope.dcaeJsonDate = data[0].jsonValue; $scope.dataOrderInfo = null; @@ -415,7 +412,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind $scope.temp.policy.priority = headDefautlsData.priority; } - var enumAttributes = $scope.dcaeModelData.enumValues; var annotation = $scope.dcaeModelData.annotation; var dictionary = $scope.microServiceAttributeDictionaryDatas; @@ -435,7 +431,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind if (dictionary!= null && dictionary.length>1){ for (m=0; m < dictionary.length; m += 1){ - var keyCompare = dictionary[m].name; var valueCompare = dictionary[m].value; var valueModel = dictionary[m].modelName; var conpairService = serviceName; @@ -699,8 +694,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind var double = "double"; var boolean = "boolean"; var baseLevel = level; - var list = "list"; - var String = "String"; var attributekey = ""; @@ -1167,7 +1160,7 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind layer++; if(layer > 4){ layer = 1 - }; + } firstChild_element.className += ' children_group border' + layer; //here is div with a group of children. } } @@ -1212,11 +1205,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind $scope.labelLayout = function(labelValue, lableName, labelManyKey ){ var label = document.createElement("Label") var divID = labelValue; - if (labelValue.endsWith('.')){ - var workingLabel = labelValue.substring(0, labelValue.length-1); - }else { - var workingLabel = labelValue; - } if (labelValue.length < 1){ divID = "DynamicTemplate"; @@ -1274,7 +1262,7 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind layer++; if(layer > 4){ layer = 1 - }; + } divTag.className += ' children_group border' + layer; //here is div with a group of children. } if(required){ @@ -1295,7 +1283,7 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind layer++; if(layer > 4){ layer = 1 - }; + } divTag.className += ' children_group border' + layer; //here is div with a group of children. } if(required){ @@ -1336,7 +1324,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind label.appendChild(labeltext); isRequired = true; //set required as true for matching element }else { - var labeltext = document.createTextNode(attributeName); if(isRequired){ var requiredLabName = attributeName+ " * "; labeltext = document.createTextNode(requiredLabName); @@ -1507,17 +1494,8 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind function onlyUnique(value, index, self) { return self.indexOf(value) === index; - }; - - - function checkDictionary(value){ - for (i = 0; i < $scope.microServiceAttributeDictionaryDatas.length; i++) { - if ($scope.microServiceAttributeDictionaryDatas[i].name.localeCompare(value)){ - return true; - } - } - } + $scope.savePolicy = function(policy){ if(policy.itemContent != undefined){ $scope.refreshCheck = true; @@ -1626,7 +1604,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind $scope.validatePolicy = function(policy){ document.getElementById("validate").innerHTML = ""; var splitAt = '*'; - var dot ='.'; var jsonPolicy = {}; if(plainAttributeKeys != null){ for(a = 0; a < plainAttributeKeys.length; a++){ @@ -1750,13 +1727,6 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind }); }; - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - // Switch Click $('.Switch').click(function() { // Check If Enabled (Has 'On' Class)