1ifix: Fix service-list page bug 42/105742/4
authorcyuamber <xuranyjy@chinamobile.com>
Fri, 10 Apr 2020 04:04:39 +0000 (12:04 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Fri, 10 Apr 2020 05:29:08 +0000 (13:29 +0800)
Change-Id: Ie61afcb2a9e07ba58416af5ef3f5ad2f07e37402
Issue-ID: USECASEUI-369
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/proxy.conf.json
usecaseui-portal/src/app/core/models/dataInterface.ts
usecaseui-portal/src/app/views/onboard-vnf-vm/onboard-vnf-vm.component.ts
usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.html
usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.ts
usecaseui-portal/src/app/views/services/services-list/services-list.component.html
usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts

index 0e71b7d..d96a964 100644 (file)
@@ -1,6 +1,6 @@
 {
     "/api/usecaseui-server/v1": {
-        "target": "http://192.168.235.56:30280",
+        "target": "https://192.168.235.77:30283",
         "secure": false,
         "logLevel": "debug",
         "changeOrigin": true
index 969651f..0017a60 100644 (file)
@@ -1,6 +1,6 @@
 enum baseUrl{
     baseUrl = '/api/usecaseui-server/v1'  //online
-    // baseUrl = 'http://10.73.191.100:8082'    //local two
+    // baseUrl = 'https://192.168.235.77:30283'    //local two
 }
 
 interface servicesTableData {
index 682f48c..6bfdf49 100644 (file)
@@ -197,11 +197,11 @@ export class OnboardVnfVmComponent implements OnInit {
             let sameData = nsData.filter((nssdc) => { return !this.nsTableData.find((nsvfc) => { return nsvfc.id == nssdc.uuid }) });
             this.nsTableData = this.nsTableData.concat(sameData);
           }, (err) => {
-            console.error(err);
+            this.msg.error(err);
             this.isSpinning = false;
           })
       }, (err) => {
-        console.error(err);
+        this.msg.error(err);
         this.isSpinning = false;
       })
   }
index 93a2bd5..cbc5f3e 100644 (file)
@@ -7,7 +7,7 @@
     <div class="select-list">
         <span> {{"i18nTextDefine_Customer" | translate}} : </span>
         <nz-select [(ngModel)]="currentCustomer.name" nzAllowClear
-            (ngModelChange)="customerChange()">
+            (ngModelChange)="customerChange(currentCustomer)">
             <nz-option *ngFor="let item of customerList" [nzValue]="item.name" [nzLabel]="item.name"></nz-option>
         </nz-select>
     </div>
index 72817bc..cf7404d 100644 (file)
@@ -1,5 +1,6 @@
 import { Component, OnInit, Input, Output, EventEmitter  } from '@angular/core';
 import { ServiceListService } from '../../../../core/services/serviceList.service';
+import { NzMessageService } from 'ng-zorro-antd';
 
 @Component({
   selector: 'app-create-model',
@@ -29,7 +30,10 @@ export class CreateModelComponent implements OnInit {
   createData: Object = {};
   loadingAnimateShow: boolean = false;
 
-  constructor( private http: ServiceListService) {}
+  constructor(
+      private http: ServiceListService,
+      private msg: NzMessageService
+  ) {}
 
   ngOnInit() {
     this.serviceTypes = this.serviceTypeList;
@@ -50,18 +54,20 @@ export class CreateModelComponent implements OnInit {
   getAlltemplates() {
     this.http.getAllServiceTemplates(this.templateTypeSelected)
       .subscribe((data) => {
-        this.templates = data;
-        if (this.templateTypeSelected == "Network Service") {
-          this.templates = data.filter((d) => {
-            return typeof d.packageInfo.csarName == "string";
-          }).map((item) => {
-            let cName = item.packageInfo.csarName.split("/").reverse()[0];
-            return { name: cName, id: item.csarId, packageInfo: item.packageInfo }
-          });
+        if(data.length!==0){
+            this.templates = data;
+            if (this.templateTypeSelected == "Network Service") {
+                this.templates = data.filter((d) => {
+                    return typeof d.packageInfo.csarName == "string";
+                }).map((item) => {
+                    let cName = item.packageInfo.csarName.split("/").reverse()[0];
+                    return { name: cName, id: item.csarId, packageInfo: item.packageInfo }
+                });
+            }
+            this.currentTemplate = this.templates[0];
         }
-        this.currentTemplate = this.templates[0];
       }, (err) => {
-        console.log(err);
+        this.msg.error(err);
       })
   }
 
@@ -83,7 +89,8 @@ export class CreateModelComponent implements OnInit {
     this.loadingAnimateShow = false;
   }
 
-  customerChange(): void {
+  customerChange(value): void {
+    this.currentCustomer = value;
     this.getServiceType();
   }
 
@@ -95,6 +102,10 @@ export class CreateModelComponent implements OnInit {
   }
 
   handleOk(): void {
+      if(this.templates.length === 0){
+          this.msg.warning('Template is required.');
+          return
+      }
     if (this.templateTypeSelected === "SOTN" || this.templateTypeSelected === "CCVPN" || this.templateTypeSelected === "MDONS") {
         this.createData = {
             commonParams: {
index b444274..5885029 100644 (file)
                             </ul>
                         </td>
                     </tr>
-                    <tr class="childtr" [nzExpand]="data.expand" *ngFor="let item of data.childServiceInstances?data.childServiceInstances[0]:[]">
+                    <tr class="childtr" [nzExpand]="data.expand" *ngFor="let item of data.childServiceInstances?data.childServiceInstances:[]">
                         <td></td>
                         <td></td>
                         <td>{{item["service-instance-id"] || item.nsInstanceId || item.vnfInstanceId}}</td>
index adac12d..96d19cf 100644 (file)
@@ -210,7 +210,6 @@ export class ServicesListComponent implements OnInit {
                     if (typeof item == "string") {
                         item = JSON.parse(item);
                     }
-
                     item["iconMore"] = this.iconMore;
                     if (item["serviceDomain"] === "Network Service") {
                         if (item["vnfInfo"]) {
@@ -283,6 +282,7 @@ export class ServicesListComponent implements OnInit {
                                     item["tips"] = this.listSortMasters["operationTypes"].find((its) => {
                                         return its["sortCode"] == item["operationType"] && its["language"] == this.language
                                     })["sortValue"] + '\xa0\xa0\xa0' + item["status"];
+                                    this.getTableData();
                                 }
                             }
                             let id = item["nsInstanceId"] || item["service-instance-id"];
@@ -296,11 +296,15 @@ export class ServicesListComponent implements OnInit {
                                 item["tips"] = this.listSortMasters["operationTypes"].find((its) => {
                                     return its["sortCode"] == item["operationType"] && its["language"] == this.language
                                 })["sortValue"] + '\xa0\xa0\xa0' + item["status"];
+                                this.getTableData();
                             })
                         } else {
                             let updata = (prodata) => {
                                 item["rate"] = prodata.progress || 0;
-                                if(item["rate"] > 100) item["status"] = prodata.status;
+                                if(item["rate"] > 100) {
+                                    item["status"] = prodata.status;
+                                    this.getTableData();
+                                }
                                 item["tips"] = this.listSortMasters["operationTypes"].find((its) => {
                                     return its["sortCode"] === item["operationType"] && its["language"] === this.language
                                 })["sortValue"] + '\xa0\xa0\xa0' + (item["rate"] > 100? item["status"] : prodata.progress + '%');
@@ -318,6 +322,7 @@ export class ServicesListComponent implements OnInit {
                                 item["tips"] = this.listSortMasters["operationTypes"].find((its) => {
                                     return its["sortCode"] == item["operationType"] && its["language"] == this.language
                                 })["sortValue"] + '\xa0\xa0\xa0' + item["status"];
+                                this.getTableData();
                             })
                         }
                     }
@@ -361,7 +366,6 @@ export class ServicesListComponent implements OnInit {
                         }
                     }
                 })
-                console.log(this.tableData)
                 this.loading = false;
             }, (err) => {
                 console.log(err);
@@ -567,6 +571,7 @@ export class ServicesListComponent implements OnInit {
                     newData.tips = this.listSortMasters["operationTypes"].find((its) => {
                         return its["sortCode"] == newData["statusClass"] && its["language"] == this.language
                     })["sortValue"] + '\xa0\xa0\xa0' + newData["status"];
+                    this.getTableData();
                 }
             };
             let queryParams = { serviceId: data["serviceId"], operationId: data["operationId"], operationType: "1001" };
@@ -648,6 +653,7 @@ export class ServicesListComponent implements OnInit {
                     newData.tips = this.listSortMasters["operationTypes"].find((its) => {
                         return its["sortCode"] == newData["statusClass"] && its["language"] == this.language
                     })["sortValue"] + '\xa0\xa0\xa0' + newData["status"];
+                    this.getTableData();
                 }
             }
             let queryParams = { serviceId: data["serviceId"], operationId: data["operationId"], operationType: "1001" };
@@ -720,6 +726,7 @@ export class ServicesListComponent implements OnInit {
                     newData.tips = this.listSortMasters["operationTypes"].find((its) => {
                         return its["sortCode"] == newData["statusClass"] && its["language"] == this.language
                     })["sortValue"] + '\xa0\xa0\xa0' + newData["status"];
+                    this.getTableData();
                 }
             }
             let queryParams = { serviceId: data["serviceId"], operationId: data["operationId"], operationType: "1001" };
@@ -812,6 +819,7 @@ export class ServicesListComponent implements OnInit {
                             newData.tips = this.listSortMasters["operationTypes"].find((its) => {
                                 return its["sortCode"] == newData["statusClass"] && its["language"] == this.language
                             })["sortValue"] + '\xa0\xa0\xa0' + newData["status"];
+                            this.getTableData();
                         }
                     }
 
@@ -831,6 +839,7 @@ export class ServicesListComponent implements OnInit {
                     let hasUndone = this.tableData.some((item) => {
                         return item.rate < 100;
                     })
+                    console.log(hasUndone,"------ hasUndone")
                     if (!hasUndone) {
                         setTimeout(() => {
                             this.getTableData();
index 330360a..5410a0f 100644 (file)
@@ -64,7 +64,7 @@ export class SlicingBusinessTableComponent implements OnInit {
                 if(slicing_business_list !==null && slicing_business_list.length >0){
                     this.listOfData = slicing_business_list.map((item, index) => {
                         if (item.last_operation_progress && item.last_operation_type && Number(item.last_operation_progress) < 100) {
-                            let updata = (prodata: { operation_progress: string }) => {
+                            let updata = (prodata: { operation_progress: string })   => {
                                 item.last_operation_progress = prodata.operation_progress || item.last_operation_progress;
                             };
                             let obj = {