From 97832708ef615e7c32413e3c462ea669d5856450 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Fri, 11 Oct 2019 09:15:43 +0800 Subject: feat: optimize the code for the service-list component Change-Id: I99c497d700c988fcb6569a4a907ca2a5489f08bf Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- .../services-list/services-list.component.html | 36 ++++++++++------------ .../services-list/services-list.component.less | 5 ++- .../services-list/services-list.component.ts | 26 ++++++---------- 3 files changed, 31 insertions(+), 36 deletions(-) (limited to 'usecaseui-portal/src/app') 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 431228d8..a82c8a2b 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 @@ -55,7 +55,7 @@ - +
- @@ -90,31 +90,30 @@ {{data["service-instance-name"] || data.nsName}} {{data["service-instance-id"] || data.nsInstanceId}} -

+

{{data.serviceDomain}}

- {{data.tips}} - + {{data.tips}} + Available - + Unavailable - - - -
    @@ -154,7 +153,6 @@ - - - --> +
    - +
    { this.customerList = data.map(item => ({ name: item["subscriber-name"], id: item["global-customer-id"] }) ); if(data.length !== 0){ - // this.customerList2 = data.map(item => ({ name: item["subscriber-name"], id: item["global-customer-id"] }) ); this.customerSelected = this.customerList[0]; this.choseCustomer(); } @@ -156,9 +153,6 @@ export class ServicesListComponent implements OnInit { // Create modal box 2 (dialog box) create ------------------------------- isVisible = false; - - - createModal(): void { this.isVisible = true; } @@ -347,6 +341,7 @@ export class ServicesListComponent implements OnInit { } } }) + console.log(this.tableData) this.loading = false; }, (err) => { console.log(err); @@ -513,39 +508,38 @@ export class ServicesListComponent implements OnInit { service["serviceType"] = this.serviceTypeSelected; service.childServiceInstances.forEach((item) => { - if (item.serviceDomain == "SITE") { + if (item.serviceDomain === "SITE") { service.siteSer.push(item); - } else if (item.serviceDomain == "SDWAN") { + } else if (item.serviceDomain === "SDWAN") { service.sdwanSer.push(item); } }) - if (service["serviceDomain"] == 'CCVPN' || service["serviceDomain"] == 'SOTN') { + if (service["serviceDomain"] === 'CCVPN' || service["serviceDomain"] === 'SOTN') { this.detailshow = true; if (typeNum == 1) { this.upDateShow = false; } else { this.upDateShow = true; } - } else if (service["serviceDomain"] == 'E2E Service' || service["serviceDomain"] == 'Network Service') { + } else if (service["serviceDomain"] === 'E2E Service' || service["serviceDomain"] === 'Network Service') { this.detailshow2 = true; } this.listDisplay = true; this.detailData = service; - console.log(service); } - deleteModelVisible = false; + deleteModalVisible = false; terminationType = "graceful"; gracefulTerminationTimeout = 120; // delete Model show deleteModel(service) { this.thisService = service; - this.deleteModelVisible = true; + this.deleteModalVisible = true; } deleteOk(templatedeletestarting, templateDeleteSuccessFaild) { - this.deleteModelVisible = false; + this.deleteModalVisible = false; this.loadingAnimateShow = true; if (this.thisService["serviceDomain"] == "Network Service") { this.deleteNsService(this.thisService, templateDeleteSuccessFaild); @@ -556,7 +550,7 @@ export class ServicesListComponent implements OnInit { } deleteCancel() { - this.deleteModelVisible = false; + this.deleteModalVisible = false; } deleteNotification(template: TemplateRef<{}>): void { -- cgit 1.2.3-korg