summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2020-04-10 12:04:39 +0800
committercyuamber <xuranyjy@chinamobile.com>2020-04-10 13:29:08 +0800
commit03d4bf6a3fe3f5259abb915b7e120bf38ca17d0c (patch)
treee5c1c6441729a66f3ad1f0bec02ea1515d87a8f9 /usecaseui-portal/src/app/views
parent829fc14cd97f236d854472e4a872b59c42367cc5 (diff)
1ifix: Fix service-list page bug
Change-Id: Ie61afcb2a9e07ba58416af5ef3f5ad2f07e37402 Issue-ID: USECASEUI-369 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views')
-rw-r--r--usecaseui-portal/src/app/views/onboard-vnf-vm/onboard-vnf-vm.component.ts4
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.html2
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.ts35
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/services-list.component.html2
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/services-list.component.ts15
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts2
6 files changed, 40 insertions, 20 deletions
diff --git a/usecaseui-portal/src/app/views/onboard-vnf-vm/onboard-vnf-vm.component.ts b/usecaseui-portal/src/app/views/onboard-vnf-vm/onboard-vnf-vm.component.ts
index 682f48cf..6bfdf498 100644
--- a/usecaseui-portal/src/app/views/onboard-vnf-vm/onboard-vnf-vm.component.ts
+++ b/usecaseui-portal/src/app/views/onboard-vnf-vm/onboard-vnf-vm.component.ts
@@ -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;
})
}
diff --git a/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.html b/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.html
index 93a2bd50..cbc5f3e3 100644
--- a/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.html
+++ b/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.html
@@ -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>
diff --git a/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.ts b/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.ts
index 72817bc2..cf7404d8 100644
--- a/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/create-model/create-model.component.ts
@@ -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: {
diff --git a/usecaseui-portal/src/app/views/services/services-list/services-list.component.html b/usecaseui-portal/src/app/views/services/services-list/services-list.component.html
index b4442747..58850290 100644
--- a/usecaseui-portal/src/app/views/services/services-list/services-list.component.html
+++ b/usecaseui-portal/src/app/views/services/services-list/services-list.component.html
@@ -130,7 +130,7 @@
</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>
diff --git a/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts b/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
index adac12d1..96d19cfe 100644
--- a/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
@@ -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();
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts
index 330360ac..5410a0f4 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts
@@ -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 = {