From 3316e8d2a893fcaf8cddff1dd47fa0d6d106487c Mon Sep 17 00:00:00 2001 From: zhangab Date: Tue, 15 May 2018 16:49:07 +0800 Subject: fix e2e service template bug for ns detail show Change-Id: I53f0f8273fac3f6e26b69c98882cd78ebe262d6d Issue-ID: USECASEUI-115 Signed-off-by: zhangab --- .../scripts/controller/ServiceTemplateService.js | 6 ++- .../uui/fusion/scripts/controller/lcmController.js | 52 +++++++++++++++++++++- .../scripts/view-models/create-service-dialog.html | 41 +++++++++-------- 3 files changed, 77 insertions(+), 22 deletions(-) (limited to 'usecaseui-lcm') diff --git a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js index acb61f92..ad1818dd 100644 --- a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js +++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js @@ -108,6 +108,7 @@ headers: uuiHeaders }).then(function(response){ var inputRsp = response.data; + console.log(inputRsp); processFun(inputRsp); }); }, @@ -139,6 +140,7 @@ headers: uuiHeaders }).then(function(response){ var sdnControllers = response.data; + console.log(sdnControllers); var result = sdnControllers.map(function (sdn) { return { name: sdn['thirdparty-sdnc-id'], @@ -172,7 +174,7 @@ reqParas[parameter.name] = parameter.value.value; } } else { - newreqParas[parameter.name] = parameter.value; + reqParas[parameter.name] = parameter.value; } }); @@ -222,7 +224,7 @@ // console.log(requestBody); // console.log(JSON.stringify(requestBody)); - return false; + // return false; return $http({ url: url+'/services', method: 'POST', diff --git a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js index ffdb622d..a7091f83 100644 --- a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js +++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js @@ -173,7 +173,6 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', ' } ); - }; ctrl.deleteService = function (serviceInstance) { @@ -198,6 +197,55 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', ' ServiceTemplateService.deleteService(serviceInstance.serviceInstanceId, ctrl.customer, ctrl.serviceType, successFun); }; + ctrl.upDateService = function (serviceInstance) { + + var modalInstance = $uibModal.open({ + ariaLabelledBy: 'modal-title', + ariaDescribedBy: 'modal-body', + templateUrl: 'app/uui/fusion/scripts/view-models/scale-service-dialog.html', + controller: 'scaleServiceCtrl', + controllerAs: 'ctrl', + resolve: { + customer: function () { + return ctrl.customer; + }, + serviceType: function () { + return ctrl.serviceType; + }, + serviceInstance: serviceInstance + } + }); + modalInstance.result.then( + function (result) { + console.log(result); + console.log(serviceInstance); + var successFun = function (result) { + ctrl.alerts.push({ + type: 'success', + msg: result + }); + ServiceTemplateService.getServiceInstances(ctrl.customer.id, ctrl.serviceType.value, function (instances) { + ctrl.serviceInstances = instances; + }); + } + var failFun = function (reason) { + console.log(reason) + ctrl.alerts.push({ + type: 'danger', + msg: reason + }); + } + openServiceProgressDialog(result.serviceId, result.operationId, 'Scale Service', successFun, failFun); + }, + function (reason) { + console.log('receive cancel button clicked!'); + console.log(reason); + $log.info('Modal dismissed at: ' + new Date()); + } + ); + + }; + ctrl.packageOnboard = function (onboardPackage) { if (onboardPackage.type === 'NS') { var processFun = function (response) { @@ -360,6 +408,7 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', ' }); return { nodeTemplateName: nestedTemplate.name, + customizationUuid:nestedTemplate.customizationUuid, invariantUUID: nestedTemplate.invariantUUID, uuid: nestedTemplate.uuid, type: nestedTemplate.type, @@ -374,6 +423,7 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', ' segments: segmentsPara }; ctrl.service = service; + console.log(service); }; ctrl.service = { serviceName: '', diff --git a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html index 263656f5..810fe81f 100644 --- a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html +++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html @@ -60,24 +60,7 @@
-
- -
- -
-
- -
-
- -
-
+
{{segment.nodeTemplateName}}