Removed unused variables and unused methods.
Removed empty ';' statements.
Combined if's that had no content.
Not doing any formatting for javascript right now.
Licenses.
Issue-ID: POLICY-2134
Change-Id: Ib5ec178bd34154281509f57ed15f704e26101f05
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
* ============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.
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope,function(row){
- var msg = 'row selected ' + row.isSelected;
});
gridApi.selection.on.rowSelectionChangedBatch($scope,function(rows){
- var msg = 'rows changed ' + rows.length;
});
};
* ============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.
if(!regex.test(brmsParamDictionaryData.ruleName)) {
Notification.error("Enter Valid Rule Name without spaces or special characters");
}else{
- var file = $scope.MyFile;
var uuu = "saveDictionary/brms_dictionary/save_BRMSParam";
var postData={brmsParamDictionaryData: brmsParamDictionaryData, userid: userid};
$.ajax({
$scope.close = function() {
$modalInstance.close();
};
-});
\ No newline at end of file
+});
* ============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.
$scope.editRainyDayTreatment = message.rainyDayDictionaryData;
$scope.saveDecisionTreatments = function(rainyDayDictionaryData) {
- var finalData = extend(rainyDayDictionaryData, $scope.treatmentDatas[0]);
var uuu = "saveDictionary/decision_dictionary/save_RainyDay";
var postData={rainyDayDictionaryData: rainyDayDictionaryData, userid: userid};
$.ajax({
});
};
- function extend(obj, src) {
- for (var key in src) {
- if (src.hasOwnProperty(key)) obj[key] = src[key];
- }
- return obj;
- }
-
$scope.treatmentDatas = [{"userDataTypeValues" : $scope.treatments}];
$scope.addNewTreatment = function() {
$scope.treatments.push({});
$scope.close = function() {
$modalInstance.close();
};
-});
\ No newline at end of file
+});
* ============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.
if(!regex.test(attributeDictionaryData.xacmlId)) {
Notification.error("Enter Valid Attribute Name without spaces or special characters");
}else{
- var finalData = extend(attributeDictionaryData, $scope.attributeDatas[0]);
var uuu = "saveDictionary/attribute_dictionary/save_attribute";
var postData={attributeDictionaryData: attributeDictionaryData, userid: userid};
$.ajax({
$scope.close = function() {
$modalInstance.close();
};
-});
\ No newline at end of file
+});
* ============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.
$scope.temp.policy = {
policyType : "Action"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
}
$scope.modal('createNewPolicy', true);
$scope.temp.policy = "";
- };
+ }
$scope.modal = function(id, hide) {
return $('#' + id).modal(hide ? 'hide' : 'show');
}, function (error) {
console.log("failed");
});
-
- function extend(obj, src) {
- for (var key in src) {
- if (src.hasOwnProperty(key)) obj[key] = src[key];
- }
- return obj;
- }
$scope.saveActionPolicy = function(policy){
if(policy.itemContent != undefined){
$scope.temp.policy.ruleAlgorithmschoices.splice(lastItem);
};
-}]);
\ No newline at end of file
+}]);
* ============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.
policyType : "Config",
configPolicyType : "BRMS_Param"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
});
};
- function extend(obj, src) {
- for (var key in src) {
- if (src.hasOwnProperty(key)) obj[key] = src[key];
- }
- return obj;
- }
-
if(!$scope.temp.policy.editPolicy && !$scope.temp.policy.readOnly){
$scope.temp.policy.attributes = [];
}else{
var lastItem = $scope.temp.policy.attributes.length-1;
$scope.temp.policy.attributes.splice(lastItem);
};
-}]);
\ No newline at end of file
+}]);
* ============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.
policyType : "Config",
configPolicyType : "BRMS_Raw"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
});
};
- function extend(obj, src) {
- for (var key in src) {
- if (src.hasOwnProperty(key)) obj[key] = src[key];
- }
- return obj;
- }
-
if(!$scope.temp.policy.editPolicy && !$scope.temp.policy.readOnly){
$scope.temp.policy.attributes = [];
}else{
var lastItem = $scope.temp.policy.attributes.length-1;
$scope.temp.policy.attributes.splice(lastItem);
};
-}]);
\ No newline at end of file
+}]);
* ============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.
policyType : "Config",
configPolicyType : "Base"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
var lastItem = $scope.temp.policy.attributes.length-1;
$scope.temp.policy.attributes.splice(lastItem);
};
-}]);
\ No newline at end of file
+}]);
* ============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.
policyType : "Config",
configPolicyType : "ClosedLoop_Fault"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
$scope.trapItemNo = 0;
$scope.TrapTriggerSignatureDatas = [{"triggermainSignatures" : $scope.temp.policy.triggerTrapSignatures}];
$scope.addTrapTriggerButton = function(indexId) {
- if(trapCollection.indexOf(indexId) !== -1){
-
- }else{
+ if(trapCollection.indexOf(indexId) === -1){
$scope.temp.policy.triggerTrapSignatures[indexId] = [];
trapCollection.push(indexId);
}
$scope.FaultTriggerSignatureDatas = [{"verificationSignatures" : $scope.temp.policy.triggerfaultSignatures}];
$scope.addVerTriggerButton = function(indexId) {
$scope.verificationdisabled = false;
- if(faultCollection.indexOf(indexId) !== -1){
-
- }else{
+ if(faultCollection.indexOf(indexId) === -1){
$scope.temp.policy.triggerfaultSignatures[indexId] = [];
faultCollection.push(indexId);
}
};
-}]);
\ No newline at end of file
+}]);
* ============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.
policyType : "Config",
configPolicyType : "ClosedLoop_PM"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
});
};
-}]);
\ No newline at end of file
+}]);
policyType : "Config",
configPolicyType : "Micro Service"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
layer++;
if(layer > 4){
layer = 1
- };
+ }
div.className += ' children_group border' + layer; //here is div with a group of children.
}
}
}
};
- var splitDash = '-';
var splitEqual = '=';
var splitComma = ',';
var splitcolon = ':';
- var splitsemicolon = ";";
var splitEnum = "],";
var plainAttributeKeys = [];
var matching = [];
document.getElementById("msPolicyloader").style.visibility = "hidden";
$scope.$apply(function(){
- var plainAttributeKeys = [];
$scope.dcaeModelData = data[0].dcaeModelData;
$scope.dcaeJsonDate = data[0].jsonValue;
$scope.dataOrderInfo = null;
$scope.temp.policy.priority = headDefautlsData.priority;
}
- var enumAttributes = $scope.dcaeModelData.enumValues;
var annotation = $scope.dcaeModelData.annotation;
var dictionary = $scope.microServiceAttributeDictionaryDatas;
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;
var double = "double";
var boolean = "boolean";
var baseLevel = level;
- var list = "list";
- var String = "String";
var attributekey = "";
layer++;
if(layer > 4){
layer = 1
- };
+ }
firstChild_element.className += ' children_group border' + layer; //here is div with a group of children.
}
}
$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";
layer++;
if(layer > 4){
layer = 1
- };
+ }
divTag.className += ' children_group border' + layer; //here is div with a group of children.
}
if(required){
layer++;
if(layer > 4){
layer = 1
- };
+ }
divTag.className += ' children_group border' + layer; //here is div with a group of children.
}
if(required){
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);
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;
$scope.validatePolicy = function(policy){
document.getElementById("validate").innerHTML = "";
var splitAt = '*';
- var dot ='.';
var jsonPolicy = {};
if(plainAttributeKeys != null){
for(a = 0; a < plainAttributeKeys.length; a++){
});
};
- 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)
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
- * Copyright (C) 2017-2018 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.
policyType : "Decision"
}
}
- ;
$scope.refresh = function() {
if ($scope.refreshCheck) {
console.log("failed");
});
- function extend(obj, src) {
- for (var key in src) {
- if (src.hasOwnProperty(key))
- obj[key] = src[key];
- }
- return obj;
- }
-
$scope.saveDecisionPolicy = function(policy) {
if (policy.itemContent != undefined) {
$scope.refreshCheck = true;
}
});
};
-} ]);
\ No newline at end of file
+} ]);
* ============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.
console.log("failed");
});
- function extend(obj, src) {
- for (var key in src) {
- if (src.hasOwnProperty(key)) obj[key] = src[key];
- }
- return obj;
- }
-
$scope.viewFWRule = function(policy){
console.log(policy);
var uuu = "policyController/ViewFWPolicyRule.htm";
$scope.temp.policy.fwattributes.splice(lastItem);
};
-}]);
\ No newline at end of file
+}]);
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-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.
policyType : "Config",
configPolicyType : "Optimization"
}
- };
+ }
$scope.refresh = function(){
if($scope.refreshCheck){
}
};
- var splitDash = '-';
var splitEqual = '=';
var splitComma = ',';
var splitcolon = ':';
- var splitsemicolon = ";";
var splitEnum = "],";
var plainAttributeKeys = [];
var matching = [];
data: JSON.stringify(postData),
success : function(data){
$scope.$apply(function(){
- var plainAttributeKeys = [];
$scope.optimizationModelData = data[0].optimizationModelData;
$scope.optimizationJsonDate = data[0].jsonValue;
$scope.dataOrderInfo = null;
$scope.temp.policy.priority = "";
}
- var enumAttributes = $scope.optimizationModelData.enumValues;
var annotation = $scope.optimizationModelData.annotation;
var dictionary = $scope.microServiceAttributeDictionaryDatas;
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;
var label = $scope.labelManyKeys[i];
// first add parent/label level
for (k = 0; k < unique.length; k++){
- var newindex = unique[k].lastIndexOf("@");
var newKey = unique[k].substring(0, index);
if(label == newKey){
//Check this label has bee created or not
}
}]);/**
*
- */
\ No newline at end of file
+ */
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() {
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) {
* ============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.
this.showSuccess = function(heading, messageBody){
- var modalInstance = $modal.open({
+ $modal.open({
templateUrl: 'modal_informative.html',
controller: 'modalpopupController',
resolve: {
});
};
this.showFailure = function(heading, messageBody){
- var modalInstance = $modal.open({
+ $modal.open({
templateUrl: 'modal_warning.html',
controller: 'modalpopupController',
resolve: {
};
this.showMessage = function(heading, messageBody){
- var modalInstance = $modal.open({
+ $modal.open({
templateUrl: 'modal_message.html',
controller: 'modalpopupController',
resolve: {
};
this.showWarning = function(heading, messageBody){
- var modalInstance = $modal.open({
+ $modal.open({
templateUrl: 'modal_warning_message.html',
controller: 'modalpopupController',
resolve: {
modalInstance = undefined;
});
};
- }]);
\ No newline at end of file
+ }]);