From aef5d4ba9128c0cc4418b6dd9e12533b3d76bc84 Mon Sep 17 00:00:00 2001 From: xg353y Date: Mon, 11 Feb 2019 13:50:16 +0100 Subject: Remove SDC query Remove the query to SDC to get Service/VF related parameters. Also remove the UI which triggers the SDC query. Issue-ID: CLAMP-290 Change-Id: Ie7864942b91c022a3a7329c17ab2785448aae9ff Signed-off-by: xg353y --- .../partials/portfolios/global_properties.html | 92 +---- .../designer/partials/portfolios/refresh_asdc.html | 146 -------- .../resources/designer/scripts/CldsModelService.js | 36 -- .../designer/scripts/CldsOpenModelCtrl.js | 7 - .../designer/scripts/GlobalPropertiesCtrl.js | 10 +- .../META-INF/resources/designer/scripts/aOnBoot.js | 108 +----- .../META-INF/resources/designer/scripts/app.js | 23 -- src/main/resources/META-INF/resources/swagger.html | 383 ++++++++------------- 8 files changed, 149 insertions(+), 656 deletions(-) delete mode 100644 src/main/resources/META-INF/resources/designer/partials/portfolios/refresh_asdc.html (limited to 'src/main/resources/META-INF') diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html index 811f6b716..c47e90a49 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html @@ -47,28 +47,6 @@
-
- - -
- -
-
-
- - -
- - -
-
-
@@ -125,63 +103,8 @@ -
- 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 9d4598b8e..0e44aec16 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -117,34 +117,6 @@ app handleQueryToBackend(def, action, deployUrl, requestData); return def.promise; }; - this.getASDCServices = function() { - - var def = $q.defer(); - var sets = []; - var svcUrl = "/restservices/clds/v1/clds/sdc/services/"; - $http.get(svcUrl).success(function(data) { - - def.resolve(data); - }).error(function(data) { - - def.reject("sdc Services not found"); - }); - return def.promise; - }; - this.getASDCService = function(uuid) { - - var def = $q.defer(); - var sets = []; - var svcUrl = "/restservices/clds/v1/clds/sdc/services/" + uuid; - $http.get(svcUrl).success(function(data) { - - def.resolve(data); - }).error(function(data) { - - def.reject("SDC service not found"); - }); - return def.promise; - }; this.getModel = function(modelName) { var def = $q.defer(); @@ -373,8 +345,6 @@ app .remove('ThisLink'); document.getElementById('Refresh Status').classList .remove('ThisLink'); - document.getElementById('Refresh ASDC').classList - .remove('ThisLink'); } // enable/disable menu options based on permittedActionCd // list @@ -392,10 +362,4 @@ app this.checkPermittedActionCd(permittedActionCd, 'UnDeploy', 'UNDEPLOY'); } - this.getASDCServices().then(function(pars) { - - var obj = JSON.parse(pars); - var services = obj.service; - asdc_Services = services - }); } ]); diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js index a64af7467..2b7c62589 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js @@ -51,8 +51,6 @@ function($scope, $rootScope, $modalInstance, $window, $uibModalInstance, cldsMod }); $scope.paramsRetry = function() { // $("#paramsWarn").hide(); - var currentValue = $("#service").val() == null ? previous : $( - "#service").val(); $("#ridinSpinners").css("display", "") loadSharedPropertyByService(currentValue, true, callBack); $("#ridinSpinners").css("display", "none") @@ -71,11 +69,6 @@ function($scope, $rootScope, $modalInstance, $window, $uibModalInstance, cldsMod $scope.close(); } } - $scope.refreshASDC = function() { - $("#ridinSpinners").css("display", "") - var bool = loadSharedPropertyByService(undefined, true, callBack); - $("#ridinSpinners").css("display", "none"); - } cldsTemplateService.getSavedTemplate().then(function(pars) { $scope.templateNamel = [] for (var i = 0; i < pars.length; i++) { diff --git a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js index f4c658ce1..21572a5f2 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js @@ -31,15 +31,9 @@ app.controller('GlobalPropertiesCtrl', [ function($scope, $rootScope, $uibModalInstance, cldsModelService, $location, dialogs, cldsTemplateService) { $scope.$watch('name', function(newValue, oldValue) { - var services = asdc_Services + setASDCFields() - // add blank service item as the default service, to force user chose - // the correct service by themselves - $("#service").append("") - for (k in services) { - $("#service").append( - "") - } + var el = elementMap["global"]; if (el !== undefined) { for (var i = 0; i < el.length; i++) { diff --git a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js index b69cfea08..11ad5fa95 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js +++ b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js @@ -142,56 +142,7 @@ function setMultiSelect() { } function loadSharedPropertyByService(onChangeUUID, refresh, callBack) { - var uuid = onChangeUUID; - if (uuid === undefined) { - uuid = elementMap["global"] && elementMap["global"].length > 0 ? - elementMap["global"][0].value : ""; - } - var share = null, - serviceUrl = '/restservices/clds/v1/clds/properties/' + uuid; - if (refresh) { - serviceUrl = '/restservices/clds/v1/clds/properties/' + uuid + '?refresh=true'; - } - - $.ajax({ - async: false, - dataType: "json", - url: serviceUrl, - success: function(data) { - vf_Services = JSON.parse(data); setASDCFields() - if (refresh) { - $("#paramsWarnrefresh").hide(); - } - if ($("#paramsWarn")) { - $("#paramsWarn").hide(); - } - if (callBack && _.isFunction(callBack)) { - callBack(true); - } - }, - error: function(s, a, err) { - if (refresh) { - $("#paramsWarnrefresh").show(); - } - if ($("#paramsWarn")) { - $("#paramsWarn").show(); - } - - $('#servName').text($("#service option:selected").text()); - if (callBack && _.isFunction(callBack)) { - callBack(false); - } - console.log(err) - console.log(s) - console.log(a) - }, - timeout: 100000 - - }); - - //vf_Services=share['shared']['byService'][uuid]; - //location_values = share['global']['location']; } function loadSharedPropertyByServiceProperties(callBack) { @@ -218,45 +169,8 @@ function loadSharedPropertyByServiceProperties(callBack) { } function setASDCFields() { - if (vf_Services === null || vf_Services === undefined) { - loadSharedPropertyByService() - } else { try { - $("#vf").empty().multiselect("refresh"); - $("#location").empty().multiselect("refresh"); - $("#actionSet").empty().multiselect("refresh"); - $("#vfc").empty().multiselect("refresh"); - $("#paramsWarn").hide(); - var uuid = Object.keys(vf_Services['shared']['byService'])[0]; - - var vf_values = vf_Services['shared']['byService'][uuid] && - vf_Services['shared']['byService'][uuid]['vf'] && - _.keys(vf_Services['shared']['byService'][uuid]['vf']).length > 0 ? - vf_Services['shared']['byService'][uuid]['vf'] : null; - - var selectedVF = {} - for (let e in elementMap["global"]) { - if (elementMap['global'][e].name === "vf") { - selectedVF = elementMap['global'][e].value[0] - } - } - - var vfc_values2 = selectedVF && - vf_Services['shared']['byVf'][selectedVF] && - vf_Services['shared']['byVf'][selectedVF]['vfc'] && - _.keys(vf_Services['shared']['byVf'][selectedVF]['vfc']).length > 0 ? - vf_Services['shared']['byVf'][selectedVF]['vfc'] : null; - - if (vf_values) { - for (key in vf_values) { - if ($("#vf").length > 0) { - $("#vf").append("