From 5bdc5c68c3e7ebc24a7a5ca1e379c1e4ecead2fd Mon Sep 17 00:00:00 2001 From: cyuamber Date: Fri, 6 Dec 2019 21:34:38 +0800 Subject: feat: Added tooltip for failed requests Change-Id: Iab417a0f2c641cde56c06abef6010d5a813f2935 Issue-ID: USECASEUI-368 Signed-off-by: cyuamber --- .../notification/notification.component.html | 16 +++++++++++++++- .../notification/notification.component.ts | 4 ++-- .../slicing-task-model.component.html | 5 +++-- .../slicing-task-model.component.ts | 22 +++++++++++++++++----- 4 files changed, 37 insertions(+), 10 deletions(-) (limited to 'usecaseui-portal/src') diff --git a/usecaseui-portal/src/app/shared/components/notification/notification.component.html b/usecaseui-portal/src/app/shared/components/notification/notification.component.html index f20fd48c..0a40da9a 100644 --- a/usecaseui-portal/src/app/shared/components/notification/notification.component.html +++ b/usecaseui-portal/src/app/shared/components/notification/notification.component.html @@ -5,7 +5,7 @@ {{notificationAttributes.status}} -
+
{{(notificationAttributes.action === 'OnboardingState'? notificationAttributes.title : "i18nTextDefine_"+notificationAttributes.title) | translate}}  {{"i18nTextDefine_"+notificationAttributes.action | translate}}  {{"i18nTextDefine_"+notificationAttributes.status | translate}} @@ -45,6 +45,20 @@
{{"i18nTextDefine_Close" | translate}}
+ +
+
+ {{ notificationAttributes.title}}  + {{ notificationAttributes.action }}  {{notificationAttributes.status}} +
+
+
+

{{notificationAttributes.title}} id: 

+ {{ notificationAttributes.name }} +
+
+
{{"i18nTextDefine_Close" | translate}}
+
diff --git a/usecaseui-portal/src/app/shared/components/notification/notification.component.ts b/usecaseui-portal/src/app/shared/components/notification/notification.component.ts index de0df083..18f91b35 100644 --- a/usecaseui-portal/src/app/shared/components/notification/notification.component.ts +++ b/usecaseui-portal/src/app/shared/components/notification/notification.component.ts @@ -9,6 +9,7 @@ import { NzNotificationService } from 'ng-zorro-antd'; export class NotificationComponent implements OnInit { @ViewChild('notificationModel')notificationModel: any; @Input()isServicesList: boolean; + @Input()parentComponent: string; @Input()customerSelected: object; notificationAttributes: { @@ -21,8 +22,7 @@ export class NotificationComponent implements OnInit { constructor(private notification: NzNotificationService) { } - ngOnInit() { - } + ngOnInit() { } setNotification({ title, imgPath, action, status, name }):void{ this.notificationAttributes = { title, imgPath, action, status, name }; diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html index 19c83728..666fa16b 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html @@ -95,5 +95,6 @@ (paramsDataChange)="changeParams($event)" > - - \ No newline at end of file + + + \ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts index 9d0e3aec..ff64dfe1 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts @@ -1,4 +1,5 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core'; +import { NzMessageService } from 'ng-zorro-antd'; import { SlicingTaskServices } from '../../../../../core/services/slicingTaskServices'; @Component({ @@ -11,8 +12,9 @@ export class SlicingTaskModelComponent implements OnInit { @Input() moduleTitle: string; @Input() taskId: string; @Output() cancel = new EventEmitter(); + @ViewChild('notification') notification1: any; - constructor(private http: SlicingTaskServices) { } + constructor(private http: SlicingTaskServices, private message: NzMessageService) { } // 配置审核详情 checkDetail: any[] = [{}]; @@ -189,9 +191,12 @@ export class SlicingTaskModelComponent implements OnInit { const { nsi_service_instances, record_number } = result_body; this.slicingInstances.total = record_number; this.slicingInstances.list.push(...nsi_service_instances); - this.slicingInstances.isLoading = false; - this.slicingInstances.flag = false; + } else { + this.message.error('Failed to get slicing instance ID') } + this.slicingInstances.isLoading = false; + this.slicingInstances.flag = false; + }) } @@ -203,6 +208,8 @@ export class SlicingTaskModelComponent implements OnInit { const { result_header: { result_code }, result_body, record_number} = res; if (+result_code === 200) { this.subnetDataFormatting(result_body, record_number) + } else { + this.message.error('Failed to get slicing subnet instance ID') } }) this.slicingInstances.list.forEach (item => { @@ -286,6 +293,8 @@ export class SlicingTaskModelComponent implements OnInit { item.flag = false; } }) + } else { + this.message.error('Failed to get slicing subnet instance ID'); } }) } @@ -335,11 +344,14 @@ export class SlicingTaskModelComponent implements OnInit { } let reqBody = {...checkDetail[0], business_demand_info: businessRequirement[0], nst_info: NSTinfo[0], nsi_nssi_info}; delete reqBody.service_snssai; + this.notification1.notificationStart('Task', 'Sumbit', this.taskId) this.http.submitSlicing(reqBody).subscribe (res => { const { result_header: { result_code } } = res; if (+result_code === 200) { - console.log('成功提交') this.handleCancel(); + this.notification1.notificationSuccess('Task', 'Sumbit', this.taskId) + } else { + this.notification1.notificationFailed('Task', 'Sumbit', this.taskId) } }) } -- cgit 1.2.3-korg