diff options
author | Sébastien Determe <sebastien.determe@intl.att.com> | 2019-03-29 08:50:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-29 08:50:43 +0000 |
commit | 3ad0ff8210c6d988696efb9cc1f6af38fc3cf32b (patch) | |
tree | cadfbcd3f30b97c740d4fd71e2244dbafe3f9a02 /src/main | |
parent | e8cbe6139e76d5d48bfd9db6a14789a0ee17adaa (diff) | |
parent | c62d1b74275b8d5e9d4cef6c308ef16440cfa500 (diff) |
Merge "Rework the UI"
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js | 66 | ||||
-rw-r--r-- | src/main/resources/META-INF/resources/designer/scripts/app.js | 23 |
2 files changed, 21 insertions, 68 deletions
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 3dc4d003e..a71e6caa6 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -80,10 +80,8 @@ app return def.promise; }; this.getSavedModel = function() { - var def = $q.defer(); var sets = []; - //var svcUrl = "/restservices/clds/v1/clds/model-names"; var svcUrl = "/restservices/clds/v2/loop/getAllNames"; $http.get(svcUrl).success(function(data) { @@ -94,53 +92,29 @@ app }); return def.promise; }; - this.setModel = function(modelName, controlNamePrefixIn, bpmnTextIn, - propTextIn) { - - var def = $q.defer(); - var sets = []; - var svcUrl = "/restservices/clds/v1/clds/model/" + modelName; - var svcRequest = { - name : modelName, - controlNamePrefix : controlNamePrefixIn, - bpmnText : bpmnTextIn, - propText : propTextIn - }; - $http.put(svcUrl, svcRequest).success(function(data) { - def.resolve(data); - }).error(function(data) { - - def.reject("Save Model not successful"); - }); - return def.promise; - }; - this.processAction = function(uiAction, modelName, controlNamePrefixIn, - bpmnTextIn, propTextIn, svgXmlIn, - templateName, typeID, deploymentId) { - + this.processAction = function(uiAction, modelName) { var def = $q.defer(); var sets = []; - // console.log(svgXmlIn); - var svcUrl = "/restservices/clds/v1/clds/"; var svcAction = uiAction.toLowerCase(); - if (svcAction == "save" || svcAction == "refresh") { - svcUrl = svcUrl + "model/" + modelName; - } else if (svcAction == "test") { - svcUrl = svcUrl + "action/submit/" + modelName + "?test=true"; - } else { - svcUrl = svcUrl + "action/" + svcAction + "/" + modelName; - } - var svcRequest = { - name : modelName, - controlNamePrefix : controlNamePrefixIn, - bpmnText : bpmnTextIn, - propText : propTextIn, - imageText : svgXmlIn, - templateName : templateName, - typeId : typeID, - deploymentId : deploymentId - }; - handleQueryToBackend(def, svcAction, svcUrl, svcRequest); + var svcUrl = "/restservices/clds/v2/loop/" + "action/" + svcAction + "/" + modelName; + + $http.put(svcUrl).success( + function(data) { + def.resolve(data); + alertService.alertMessage("Action Successful: " + svcAction, 1) + // update deploymentID, lastUpdatedStatus + setLastUpdatedStatus(data.lastUpdatedStatus); + setDeploymentStatusURL(data.dcaeDeploymentStatusUrl); + setDeploymentID(data.dcaeDeploymentId); + setStatus(); + enableDisableMenuOptions(); + }).error( + function(data) { + def.resolve(data); + alertService.alertMessage("Action Failure: " + svcAction, 2); + def.reject(svcAction + " not successful"); + }); + return def.promise; }; this.manageAction = function(modelName, typeId, typeName) { 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 1b77bf82d..9ba7b82cd 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -545,39 +545,18 @@ function($scope, $rootScope, $timeout, dialogs) { }); }; $scope.cldsPerformAction = function(uiAction) { - var modelName = selected_model; - var controlNamePrefix = "ClosedLoop-"; - var bpmnText = modelXML; - // serialize model properties - var propText = JSON.stringify(elementMap); - var templateName = selected_template - var svgXml = $("#svgContainer").html(); console.log("cldsPerformAction: " + uiAction + " modelName=" + modelName); - console.log("cldsPerformAction: " + uiAction - + " controlNamePrefix=" + controlNamePrefix); - console.log("cldsPerformAction: " + uiAction + " bpmnText=" - + bpmnText); - console.log("cldsPerformAction: " + uiAction + " propText=" - + propText); - console.log("cldsPerformAction: " + uiAction + " typeID=" + typeID); - console.log("cldsPerformAction: " + uiAction + " deploymentId=" - + deploymentId); - cldsModelService.processAction(uiAction, modelName, - controlNamePrefix, bpmnText, propText, svgXml, templateName, - typeID, deploymentId).then(function(pars) { + cldsModelService.processAction(uiAction, modelName).then(function(pars) { console.log("cldsPerformAction: pars=" + pars); - cldsModelService.processRefresh(pars); }, function(data) { }); }; $scope.refreshStatus = function() { - var modelName = selected_model; - var svgXml = $("#svgContainer").html(); console.log("refreStatus modelName=" + modelName); cldsModelService.getModel(modelName).then(function(pars) { console.log("refreStatus: pars=" + pars); |