From 3bc6917ecd7c3fb22c8a65d5279179fc2bb4d6aa Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Fri, 21 Jun 2019 16:20:00 +0530 Subject: Replace windows alert with Notification component Removed windows.alert across files and replaced it with notification component Issue-ID: CCSDK-1381 Change-Id: If521c92544a1639b2fafb07163163844817c1c7a Signed-off-by: Arundathi Patil --- .../resource-definition/resource-edit/resource-edit.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts') diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts index 4603c529f..2da1287ba 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts @@ -30,6 +30,7 @@ import { JsonEditorComponent, JsonEditorOptions } from 'ang-jsoneditor'; import { Observable } from 'rxjs'; import { A11yModule } from '@angular/cdk/a11y'; import { ResourceEditService } from './resource-edit.service'; +import { NotificationHandlerService } from 'src/app/common/core/services/notification-handler.service'; @Component({ selector: 'app-resource-edit', @@ -47,7 +48,7 @@ export class ResourceEditComponent implements OnInit { @ViewChild(JsonEditorComponent) editor: JsonEditorComponent; options = new JsonEditorOptions(); - constructor(private store: Store, private resourceEditService: ResourceEditService) { + constructor(private store: Store, private resourceEditService: ResourceEditService, private alertService: NotificationHandlerService) { this.rdState = this.store.select('resources'); this.options.mode = 'text'; this.options.modes = [ 'text', 'tree', 'view']; @@ -100,10 +101,10 @@ export class ResourceEditComponent implements OnInit { saveToBackend() { this.resourceEditService.saveResource(this.data) .subscribe(response=>{ - window.alert("save success"); + this.alertService.success("save success") }, error=>{ - window.alert('Error saving resources'); + this.alertService.error('Error saving resources'); }) } } -- cgit 1.2.3-korg