import { UiService } from '../services/ui/ui.service';
import { HttpErrorResponse } from '@angular/common/http';
import { FormGroup, FormControl, Validators } from '@angular/forms';
+import { ChangeDetectorRef } from '@angular/core';
@Component({
}
constructor(
+ private cdr: ChangeDetectorRef,
private dataService: PolicyService,
private errorService: ErrorDialogService,
private notificationService: NotificationService,
this.policyInstanceId = data.instanceId;
this.policyTypeName = data.name;
this.jsonSchemaObject = data.createSchema;
- this.jsonObject = this.parseJson(data.instanceJson);
+ this.jsonObject = data.instanceJson;
this.ric = data.ric;
}
}
ngAfterViewInit() {
+ this.cdr.detectChanges();
}
get ricSelector() { return this.instanceForm.get('ricSelector'); }
{
next(_) {
self.notificationService.success('Policy ' + self.policyTypeName + ':' + self.policyInstanceId +
- ' submitted');
+ ' submitted');
},
error(error: HttpErrorResponse) {
self.errorService.displayError('Submit failed: ' + error.error);
export function getPolicyDialogProperties(policyTypeSchema: PolicyTypeSchema, instance: PolicyInstance, darkMode: boolean): MatDialogConfig {
const createSchema = policyTypeSchema.schemaObject;
- const instanceId = instance ? instance.id : null;
- const instanceJson = instance ? instance.json : null;
+ const instanceId = instance ? instance.policy_id : null;
+ const instanceJson = instance ? instance.policy_data : null;
const name = policyTypeSchema.name;
- const ric = instance ? instance.ric : null;
+ const ric = instance ? instance.ric_id : null;
return {
maxWidth: '1200px',
maxHeight: '900px',