summaryrefslogtreecommitdiffstats
path: root/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2019-06-21 16:20:00 +0530
committerArundathi Patil <arundpil@in.ibm.com>2019-06-21 16:20:13 +0530
commit3bc6917ecd7c3fb22c8a65d5279179fc2bb4d6aa (patch)
tree701568eb26e38dcc77bcc98da16296f3af0d53f0 /cds-ui/client/src/app/feature-modules/resource-definition/resource-edit
parentda79303b367ed5d4f12a279a401dee379f38147e (diff)
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 <arundpil@in.ibm.com>
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/resource-definition/resource-edit')
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts7
1 files changed, 4 insertions, 3 deletions
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<IAppState>, private resourceEditService: ResourceEditService) {
+ constructor(private store: Store<IAppState>, 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');
})
}
}