X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fpolicy%2Fpolicy-control.component.ts;h=feb4cfb6f6e6adf2af13d8cfc88fe77ec6e96f9c;hb=90295c9a25c27628164eed0c66d0a89df587525b;hp=df49c76ecb1ab968b1734a44d66f7ccaafedfa71;hpb=da0dd4633b71e93fdb7948741c1e1e85ae201d92;p=portal%2Fnonrtric-controlpanel.git diff --git a/webapp-frontend/src/app/policy/policy-control.component.ts b/webapp-frontend/src/app/policy/policy-control.component.ts index df49c76..feb4cfb 100644 --- a/webapp-frontend/src/app/policy/policy-control.component.ts +++ b/webapp-frontend/src/app/policy/policy-control.component.ts @@ -21,20 +21,30 @@ import { Component, OnInit } from "@angular/core"; import { PolicyTypes } from "@interfaces/policy.types"; import { PolicyService } from "@services/policy/policy.service"; +import { PolicyTypeComponent } from "./policy-type/policy-type.component" @Component({ selector: "nrcp-policy-control", templateUrl: "./policy-control.component.html", styleUrls: ["./policy-control.component.scss"] }) + export class PolicyControlComponent implements OnInit { - policyTypeIds: Array; + policyTypeIds = []; + ptComponent: PolicyTypeComponent; - constructor(private policyService: PolicyService) {} + constructor(private policyService: PolicyService) { + this.ptComponent = new PolicyTypeComponent(policyService); + } ngOnInit() { + this.refreshTables(); + } + + refreshTables() { this.policyService.getPolicyTypes().subscribe((policyType: PolicyTypes) => { - this.policyTypeIds = policyType.policytype_ids; + this.policyTypeIds = policyType.policytype_ids.sort(); }); + this.ptComponent.toggleVisible(); } }