fix e2e service template bug for ns detail show 67/47567/1
authorzhangab <zhanganbing@chinamobile.com>
Tue, 15 May 2018 08:49:07 +0000 (16:49 +0800)
committerzhangab <zhanganbing@chinamobile.com>
Tue, 15 May 2018 08:50:04 +0000 (16:50 +0800)
Change-Id: I53f0f8273fac3f6e26b69c98882cd78ebe262d6d
Issue-ID: USECASEUI-115
Signed-off-by: zhangab <zhanganbing@chinamobile.com>
usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js
usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js
usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html

index acb61f9..ad1818d 100644 (file)
          headers: uuiHeaders
        }).then(function(response){
          var inputRsp = response.data;
+         console.log(inputRsp);
          processFun(inputRsp);
        });
      },
          headers: uuiHeaders
        }).then(function(response){
          var sdnControllers = response.data;
+         console.log(sdnControllers);
          var result = sdnControllers.map(function (sdn) {
            return {
              name: sdn['thirdparty-sdnc-id'],
                reqParas[parameter.name] = parameter.value.value;
              }
            } else {
-            newreqParas[parameter.name] = parameter.value;
+             reqParas[parameter.name] = parameter.value;
            }
          });
 
 
       //  console.log(requestBody);
       //  console.log(JSON.stringify(requestBody));
-       return false;
+      //  return false;
        return $http({
          url: url+'/services',
          method: 'POST',
index ffdb622..a7091f8 100644 (file)
@@ -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: '',
index 263656f..810fe81 100644 (file)
     </uib-tab>
     <uib-tab heading="Template Parameters">
       <div id='templateParasTab' style="margin-top:20px;">
-        <div ng-repeat="parameter in ctrl.service.parameters" class="mT15 form-group" style="margin-left:0px;">
-          <label class="col-sm-5 control-label">
-            <span>{{parameter.name}}</span><span ng-if="parameter.isRequired" class="required">*</span>
-          </label>
-          <div ng-if="parameter.type === 'string' || parameter.type === 'boolean' || parameter.type === 'integer'" class="col-sm-5">
-            <input type="text"  name="{{parameter.description}}" class="form-control" ng-model="parameter.value" placeholder="{{parameter.name}}" value="{{parameter.defaultValue}}" ng-readonly="{{parameter.readonly}}"/>
-          </div>
-          <div ng-if="parameter.type === 'vf_location'" class="col-sm-5">
-            <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.value for option in ctrl.locations">
-              <option value="">--select--</option>
-            </select>
-          </div>
-          <div ng-if="parameter.type === 'sdn_controller'" class="col-sm-5">
-            <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.value for option in ctrl.sdnControllers">
-              <option value="">--select--</option>
-            </select>
-          </div>
-        </div>
+
         <fieldset ng-repeat="segment in ctrl.service.segments" style="margin-left:25px;">
           <legend>{{segment.nodeTemplateName}}</legend>
           <!-- <div class="form-group" style="margin-left:0px;margin-bottom:5px;">
               <input type="text"  name="{{segment_parameter.description}}" class="form-control" ng-model="segment_parameter.value" placeholder="{{segment_parameter.name}}" value="{{segment_parameter.defaultValue}}" ng-readonly="{{segment_parameter.readonly}}"/>
             </div>
             <div ng-if="segment_parameter.type === 'vf_location'" class="col-sm-5">
-              <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="segment_parameter.value" ng-options="option.value for option in ctrl.locations">
+              <select class="form-control" style ="padding-top: 1px;padding-bottom: 0px;" ng-model="segment_parameter.value" ng-options="option.name for option in ctrl.locations">
                 <option value="">--select--</option>
               </select>
             </div>
             </div>
           </div>
         </fieldset>
+          <legend>Service Inputs</legend>
+        <div ng-repeat="parameter in ctrl.service.parameters" class="mT15 form-group" style="margin-left:0px;">
+          <label class="col-sm-5 control-label">
+            <span>{{parameter.name}}</span><span ng-if="parameter.isRequired" class="required">*</span>
+          </label>
+          <div ng-if="parameter.type === 'string' || parameter.type === 'boolean' || parameter.type === 'integer'" class="col-sm-5">
+            <input type="text"  name="{{parameter.description}}" class="form-control" ng-model="parameter.value" placeholder="{{parameter.name}}" value="{{parameter.defaultValue}}" ng-readonly="{{parameter.readonly}}"/>
+          </div>
+          <div ng-if="parameter.type === 'vf_location'" class="col-sm-5">
+            <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.name for option in ctrl.locations">
+              <option value="">--select--</option>
+            </select>
+          </div>
+          <div ng-if="parameter.type === 'sdn_controller'" class="col-sm-5">
+            <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.value for option in ctrl.sdnControllers">
+              <option value="">--select--</option>
+            </select>
+          </div>
+        </div>
+
       </div>
     </uib-tab>
   </uib-tabset>