* ========================LICENSE_END===================================
*/
-import { Component, Input, OnInit } from "@angular/core";
+import { Component, Input, OnInit, OnChanges, SimpleChanges} from "@angular/core";
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) {}
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() minimiseTrigger: boolean;
isVisible: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
this.isVisible.next(false);
}
+ ngOnChanges(changes: SimpleChanges): void {
+ if(changes['minimiseTrigger']){
+ this.isVisible.next(false);
+ }
+ }
+
public loadTypeInfo() {
if (this.policyTypeId && this.policyTypeId !== "") {
this.policyService