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
Decouple policy instance components
[portal/nonrtric-controlpanel.git]
/
webapp-frontend
/
src
/
app
/
policy
/
ric-selector
/
ric-selector.component.ts
diff --git
a/webapp-frontend/src/app/policy/ric-selector/ric-selector.component.ts
b/webapp-frontend/src/app/policy/ric-selector/ric-selector.component.ts
index
996d9a0
..
15e1a61
100644
(file)
--- a/
webapp-frontend/src/app/policy/ric-selector/ric-selector.component.ts
+++ b/
webapp-frontend/src/app/policy/ric-selector/ric-selector.component.ts
@@
-18,7
+18,7
@@
// ========================LICENSE_END===================================
// /
// ========================LICENSE_END===================================
// /
-import { Component, Input, OnInit } from "@angular/core";
+import { Component, Input, OnInit
, Output
} from "@angular/core";
import {
AbstractControl,
ControlContainer,
import {
AbstractControl,
ControlContainer,
@@
-28,8
+28,10
@@
import {
FormGroupDirective,
Validators,
} from "@angular/forms";
FormGroupDirective,
Validators,
} from "@angular/forms";
+import { EventEmitter } from "@angular/core";
import { Rics } from "src/app/interfaces/ric";
import { PolicyService } from "src/app/services/policy/policy.service";
import { Rics } from "src/app/interfaces/ric";
import { PolicyService } from "src/app/services/policy/policy.service";
+import { MatSelectChange } from "@angular/material/select";
@Component({
selector: "nrcp-ric-selector",
@Component({
selector: "nrcp-ric-selector",
@@
-40,9
+42,13
@@
import { PolicyService } from "src/app/services/policy/policy.service";
],
})
export class RicSelectorComponent implements OnInit {
],
})
export class RicSelectorComponent implements OnInit {
- @Input() instanceForm: FormGroup;
@Input() policyTypeName: string = "";
@Input() policyTypeName: string = "";
- ric: string;
+ @Output() selectedRic: EventEmitter<string> = new EventEmitter<string>();
+
+ ric: string = null;
+ instanceForm: FormGroup = new FormGroup({
+ ricSelector: new FormControl(this.ric, [Validators.required]),
+ });
allRics: string[] = [];
constructor(
allRics: string[] = [];
constructor(
@@
-51,17
+57,12
@@
export class RicSelectorComponent implements OnInit {
) {}
ngOnInit(): void {
) {}
ngOnInit(): void {
- this.instanceForm.addControl(
- "ricSelector",
- new FormControl(this.ric, [Validators.required])
- );
-
console.log("Ric:", this.ric);
this.fetchRics();
}
console.log("Ric:", this.ric);
this.fetchRics();
}
-
get selectedRic(): string
{
-
return this.ric
;
+
onRicChanged(newvalue: MatSelectChange): void
{
+
this.selectedRic.emit(newvalue.value)
;
}
get ricSelector(): AbstractControl {
}
get ricSelector(): AbstractControl {