From 5431f6e5c621a094c33d01b2be89762b80273434 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 11 Apr 2019 02:05:56 +0200 Subject: Add Loop name Add Loop name in UI + removal of useless javascript code Issue-ID: CLAMP-313 Change-Id: Iba72f3bfcf2a0bf2731120c77b17f41ed7ac77f6 Signed-off-by: sebdet --- .../partials/portfolios/clds_modelling.html | 36 +------------- .../resources/designer/scripts/CldsModelService.js | 4 +- .../resources/designer/scripts/DashboardCtrl.js | 56 ---------------------- .../META-INF/resources/designer/scripts/app.js | 55 --------------------- 4 files changed, 3 insertions(+), 148 deletions(-) diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/clds_modelling.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/clds_modelling.html index f98fd952..3b2e3123 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/clds_modelling.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/clds_modelling.html @@ -498,7 +498,7 @@ width: 14px; Closed Loop Modeler - + No LOOP loaded yet   @@ -514,9 +514,7 @@ width: 14px; - - + @@ -525,36 +523,6 @@ width: 14px; - - -
diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js index 90cdc0d7..b0977be0 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -68,11 +68,9 @@ app var def = $q.defer(); var sets = []; var svcUrl = "/restservices/clds/v2/loop/" + modelName; - //var svcUrl = "/restservices/clds/v1/clds/model/" + modelName; $http.get(svcUrl).success(function(data) { - //var clModel = '{"name": "ClosedLoopTest","lastComputedState":"DESIGN","svgRepresentation": "representation","globalPropertiesJson": [{"name":"service","value":["4cc5b45a-1f63-4194-8100-cd8e14248c92"]},{"name":"vf","value":["07e266fc-49ab-4cd7-8378-ca4676f1b9ec"]},{"name":"actionSet","value":["vnfRecipe"]},{"name":"location","value":["DC1"]},{"name":"deployParameters","value":{"location_id":"","service_id":"","policy_id":"AUTO_GENERATED_POLICY_ID_AT_SUBMIT"}}], "blueprint": "yaml","lastComputedState": "DESIGN","operationalPolicies": [ {"name": "OpPolicyTest", "configurationsJson": { "policy1": [{"name": "pname","value": "policy1"},{"name": "pid","value": "0"},{"name": "timeout","value": "345"},{"policyConfigurations": [[{"name": "recipe","value": ["restart"]},{"name": "maxRetries","value": ["3"]},{"name": "retryTimeLimit","value": ["180"]},{"name": "_id","value": ["6TtHGPq"]},{"name": "parentPolicy","value": [""]},{"name": "actor","value": ["APPC"]},{"name": "recipeInput","value": [""]},{"name": "recipeLevel","value": ["VM"]},{"name": "targetResourceId","value": ["07e266fc-49ab-4cd7-8378-ca4676f1b9ec"]},{"name": "targetResourceIdOther","value": [""]},{"name": "enableGuardPolicy","value": ["on"]},{"name": "guardPolicyType","value": ["GUARD_YAML"]},{"name": "guardTargets","value": [".*"]},{"name": "minGuard","value": ["1"]},{"name": "maxGuard","value": ["1"]},{"name": "limitGuard","value": ["1"]},{"name": "timeUnitsGuard","value": ["minute"]},{"name": "timeWindowGuard","value": ["10"]},{"name": "guardActiveStart","value": ["00:00:01-05:00"]},{"name": "guardActiveEnd","value": ["00:00:00-05:00"]}]]}]} }],"microServicePolicies": [{"name": "tca","properties": "", "shared": true,"policyTosca": "tosca","jsonRepresentation": {"schema":{"title":"DCAE TCA Config","type":"object","required":["name","eventName"],"properties":{"name":{"propertyOrder":101,"title":"Name","type":"string","default":"New_Set"},"eventName":{"propertyOrder":102,"title":"EventName","type":"string","enum":["event1","event2"]},"clSchemaType":{"propertyOrder":103,"title":"Control Loop Schema Type","type":"string","enum":["","type1","type2"]},"threshold":{"propertyOrder":104,"title":"Threshold","format":"tabs","type":"array","items":{"type":"object","title":"Threshold","required":["metric","operator"],"properties":{"metric":{"propertyOrder":1001,"title":"Metric","type":"string","enum":["metric1","metric2"]},"operator":{"propertyOrder":1003,"default":">","title":"Operator","type":"string","enum":[">","<","=","<=",">="]}, "clEventStatus":{"propertyOrder":1004,"title":"Closed Loop Event Status","type":"string","enum":["","ONSET","ABATED"]}}}}}}}}],"loopLogs": [{ } ] }'; - //cl_props = JSON.parse(clModel); cl_props = data; + $("#loop_name").text(getLoopName()); def.resolve(data); }).error(function(data) { def.reject("Open Model not successful"); diff --git a/src/main/resources/META-INF/resources/designer/scripts/DashboardCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/DashboardCtrl.js index 005a6934..f60b4744 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/DashboardCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/DashboardCtrl.js @@ -38,7 +38,6 @@ angular.module('clds-app').controller( $rootScope.isModel = false; $rootScope.isPalette = false; $rootScope.isTestSet = false; - $rootScope.isRequirementCoverage = false; $rootScope.ispropertyExplorer = false; $rootScope.parameters; $scope.orientation = "horizontal"; @@ -53,45 +52,7 @@ angular.module('clds-app').controller( console.log("interval"); }, $scope.autosaveInterval); - $rootScope.onSelectActivityModel = function(obj) { - console.log("onSelectActivityModel"); - $rootScope.isPalette = true; - $rootScope.isTestSet = false; - $rootScope.isRequirementCoverage = false; - $rootScope.ispropertyExplorer = false; - $("#activity_modeler").prev().css("display", "block"); - $('div').find('.k-expand-next').click(); - if (obj == undefined) { - document.getElementById("modeler_name").textContent = "Activity Modeler"; - } else { - selected_model = obj; - document.getElementById("modeler_name").textContent = "Activity Modeler" + " - " + selected_model; - } - $rootScope.modelName = selected_model; - $rootScope.modeltestset = list_model_test_sets[selected_model]; - if (list_model_schema_extensions[selected_model] == null) { - if (list_model_schema_extensions[$rootScope.utmModels.name] != null) { - list_model_schema_extensions[selected_model] = jQuery.extend(true, {}, - list_model_schema_extensions[$rootScope.utmModels.name]); - } else { - list_model_schema_extensions[selected_model] = {}; - } - } - $rootScope.initProjectExplorer(); - changecolor(selected_model); - }; - $scope.selectActivityTestSet = function() { - - console.log("selectActivityTestSet"); - $rootScope.isPalette = false; - $rootScope.isRequirementCoverage = false; - $rootScope.isTestset = true; - document.getElementById("modeler_name").textContent = "UTM Test Set"; - $('div').find('.k-collapse-next').click(); - $rootScope.modeltestset = list_model_test_sets[selected_model]; - $rootScope.$apply(); - }; $scope.showPalette = function() { console.log("showPalette"); @@ -106,21 +67,4 @@ angular.module('clds-app').controller( }; $scope.showTDSSView = true; } ]); -function changecolor(selected_model) { - - console.log("changecolor"); - var i = 0; - // var modelNames =[]; - $(".models").each(function(i) { - console.log("each"); - var model_value = $(this).text().trim(); - // modelName.push(model_value); - if (model_value == selected_model || model_value == "") { - $(this).addClass("selectedcolor"); - } else { - $(this).removeClass("selectedcolor"); - } - i++; - }); -} diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js index 8f98f708..2a2994ab 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -390,61 +390,6 @@ function($scope, $rootScope, $timeout, dialogs) { var dlg = dialogs.notify('Error', msg); } - $scope.reviewTestSet = function() { - - $rootScope.modeltestset = list_model_test_sets[selected_model]; - $rootScope.isPalette = false; - $rootScope.isTestset = true; - $rootScope.isRequirementCoverage = false; - document.getElementById("modeler_name").textContent = "UTM Test Set"; - $('div').find('.k-collapse-next').click(); - }; - $scope.requirementCoverage = function() { - - $rootScope.testCaseRequirements = []; - $rootScope.validTestRequirementArray = []; - $rootScope.validTestRequirements = {}; - $rootScope.modeltestset = list_model_test_sets[selected_model]; - var allPathDetails = []; - $scope.currentSelectedModel = {}; - $rootScope.pathDetailsList = list_model_path_details[selected_model]; - for (var x = 0; x < allPathDetails.length; x++) { - var tempPathDetails = allPathDetails[x]; - if (tempPathDetails != null) { - for (var i = 0; i < tempPathDetails.length; i++) { - var pathDetails = tempPathDetails[i]; - if (pathDetails.requirement !== '' - && pathDetails.requirement !== null) { - $rootScope.testCaseRequirements - .push(pathDetails.requirement); - } - } - } - } - for (var p = 0; p < $rootScope.modeltestset.activityTestCases.length; p++) { - var activityTestCases = $rootScope.modeltestset.activityTestCases[p]; - if (activityTestCases.mappedRequirements != null) { - for (var i = 0; i < activityTestCases.mappedRequirements.length; i++) { - var testCaseNames = $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]]; - if (testCaseNames == null) { - testCaseNames = []; - } - if (activityTestCases.version != null) - var testCase = activityTestCases.testCaseName + "_" - + activityTestCases.version; - else - var testCase = activityTestCases.testCaseName; - testCaseNames.push(testCase); - $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]] = testCaseNames; - } - } - } - $rootScope.isPalette = false; - $rootScope.isTestset = false; - $rootScope.isRequirementCoverage = true; - document.getElementById("modeler_name").textContent = "Test Case / Requirement Coverage"; - $('div').find('.k-collapse-next').click(); - }; $scope.activityModelling = function() { }; -- cgit 1.2.3-korg