Change-Id: Iadcd87a2dd683e666461769658648c344b22426a
Issue-ID: NONRTRIC-488
Signed-off-by: maximesson <maxime.bonneau@est.tech>
-<nrcp-policy-type *ngFor="let policyTypeId of this.policyTypeIds" [policyTypeId]="policyTypeId"></nrcp-policy-type>
+<nrcp-policy-type *ngFor="let policyTypeId of this.policyTypeIds" [policyTypeId]="policyTypeId" [minimiseTrigger]="minimiseTrigger"></nrcp-policy-type>
<div *ngIf="this.policyTypeIds.length==0">There are no policy types to display.</div>
\ No newline at end of file
<div *ngIf="this.policyTypeIds.length==0">There are no policy types to display.</div>
\ No newline at end of file
import { PolicyTypes } from "@interfaces/policy.types";
import { PolicyService } from "@services/policy/policy.service";
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",
@Component({
selector: "nrcp-policy-control",
export class PolicyControlComponent implements OnInit {
policyTypeIds = [];
export class PolicyControlComponent implements OnInit {
policyTypeIds = [];
- ptComponent: PolicyTypeComponent;
+ minimiseTrigger: boolean = false;
constructor(private policyService: PolicyService) {
constructor(private policyService: PolicyService) {
- this.ptComponent = new PolicyTypeComponent(policyService);
refreshTables() {
this.policyService.getPolicyTypes().subscribe((policyType: PolicyTypes) => {
this.policyTypeIds = policyType.policytype_ids.sort();
refreshTables() {
this.policyService.getPolicyTypes().subscribe((policyType: PolicyTypes) => {
this.policyTypeIds = policyType.policytype_ids.sort();
+ this.minimiseTrigger = !this.minimiseTrigger;
- this.ptComponent.toggleVisible();
* ========================LICENSE_END===================================
*/
* ========================LICENSE_END===================================
*/
-import { Component, Input, OnInit } from "@angular/core";
+import { Component, Input, OnInit, OnChanges} from "@angular/core";
import { BehaviorSubject } from "rxjs";
import { PolicyType, PolicyTypeSchema } from "@interfaces/policy.types";
import { PolicyService } from "@app/services/policy/policy.service";
import { BehaviorSubject } from "rxjs";
import { PolicyType, PolicyTypeSchema } from "@interfaces/policy.types";
import { PolicyService } from "@app/services/policy/policy.service";
+import "@policy/policy-control.component";
class PolicyTypeInfo {
constructor(public type: PolicyTypeSchema) {}
class PolicyTypeInfo {
constructor(public type: PolicyTypeSchema) {}
templateUrl: "./policy-type.component.html",
styleUrls: ["./policy-type.component.scss"],
})
templateUrl: "./policy-type.component.html",
styleUrls: ["./policy-type.component.scss"],
})
-export class PolicyTypeComponent implements OnInit {
+export class PolicyTypeComponent implements OnInit, OnChanges {
@Input() policyTypeId: string;
@Input() policyTypeId: string;
+ @Input() minimiseTrigger: boolean;
isVisible: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
isVisible: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
this.isVisible.next(false);
}
this.isVisible.next(false);
}
+ ngOnChanges(): void {
+ this.isVisible.next(false);
+ }
+
public loadTypeInfo() {
if (this.policyTypeId && this.policyTypeId !== "") {
this.policyService
public loadTypeInfo() {
if (this.policyTypeId && this.policyTypeId !== "") {
this.policyService