summaryrefslogtreecommitdiffstats
path: root/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-06-25 18:57:41 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-25 18:57:41 +0000
commited124819a2c928d895ba275d51eadc97afdf5a09 (patch)
tree9e4d2180c54c968f1d2093731a892c70c2f17353 /cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts
parenteba8ca3300290460f3df5e984b6de92d06de222f (diff)
parent3bc6917ecd7c3fb22c8a65d5279179fc2bb4d6aa (diff)
Merge "Replace windows alert with Notification component"
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts')
-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');
})
}
}