Code Review
/
portal
/
nonrtric-controlpanel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add tests of PolicyInstanceDialog
[portal/nonrtric-controlpanel.git]
/
webapp-frontend
/
src
/
app
/
policy
/
policy-instance-dialog
/
policy-instance-dialog.component.ts
diff --git
a/webapp-frontend/src/app/policy/policy-instance-dialog/policy-instance-dialog.component.ts
b/webapp-frontend/src/app/policy/policy-instance-dialog/policy-instance-dialog.component.ts
index
f649911
..
f1ff68f
100644
(file)
--- a/
webapp-frontend/src/app/policy/policy-instance-dialog/policy-instance-dialog.component.ts
+++ b/
webapp-frontend/src/app/policy/policy-instance-dialog/policy-instance-dialog.component.ts
@@
-40,7
+40,6
@@
import {
PolicyInstance,
PolicyTypeSchema,
} from "../../interfaces/policy.types";
PolicyInstance,
PolicyTypeSchema,
} from "../../interfaces/policy.types";
-import { formatJsonString } from "../no-type-policy-editor/no-type-policy-editor.component";
@Component({
selector: "nrcp-policy-instance-dialog",
@Component({
selector: "nrcp-policy-instance-dialog",
@@
-69,13
+68,13
@@
export class PolicyInstanceDialogComponent implements OnInit, AfterViewInit {
this.policyJson = data.instanceJson;
this.jsonSchemaObject = data.createSchema;
this.policyInstance.ric_id = data.ric;
this.policyJson = data.instanceJson;
this.jsonSchemaObject = data.createSchema;
this.policyInstance.ric_id = data.ric;
+ this.policyInstance.service_id = "controlpanel";
}
ngOnInit() {
this.ui.darkModeState.subscribe((isDark) => {
this.darkMode = isDark;
});
}
ngOnInit() {
this.ui.darkModeState.subscribe((isDark) => {
this.darkMode = isDark;
});
- this.formatNoTypePolicyJson();
}
// Do not remove! Needed to avoid "Expression has changed after it was checked" warning
}
// Do not remove! Needed to avoid "Expression has changed after it was checked" warning
@@
-83,16
+82,6
@@
export class PolicyInstanceDialogComponent implements OnInit, AfterViewInit {
this.cdr.detectChanges();
}
this.cdr.detectChanges();
}
- private formatNoTypePolicyJson() {
- if (!this.typeHasSchema()) {
- if (this.policyInstance.policy_data) {
- this.policyJson = formatJsonString(this.policyInstance.policy_data);
- } else {
- this.policyJson = "{}";
- }
- }
- }
-
onSelectedRicChanged(newRic: string): void {
this.policyInstance.ric_id = newRic;
}
onSelectedRicChanged(newRic: string): void {
this.policyInstance.ric_id = newRic;
}