From 188e801346f4bd7c5b3e59336bfc46af72aa432f Mon Sep 17 00:00:00 2001 From: HejdaJakub Date: Tue, 31 Oct 2023 08:26:25 +0100 Subject: [PATCH] fix(admin): correctly display group action buttons on a tree view * On a tree view group action buttons were sometimes incorrectly displayed. * The auth check was moved to the ngOnChanges hook, so now it works correctly also after refreshing/changing view type. --- .../components/src/lib/group-menu/group-menu.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/perun/components/src/lib/group-menu/group-menu.component.ts b/libs/perun/components/src/lib/group-menu/group-menu.component.ts index 641c5a20e..64521794a 100644 --- a/libs/perun/components/src/lib/group-menu/group-menu.component.ts +++ b/libs/perun/components/src/lib/group-menu/group-menu.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; import { GroupFlatNode } from '@perun-web-apps/perun/models'; import { GuiAuthResolver } from '@perun-web-apps/perun/services'; @@ -7,7 +7,7 @@ import { GuiAuthResolver } from '@perun-web-apps/perun/services'; templateUrl: './group-menu.component.html', styleUrls: ['./group-menu.component.scss'], }) -export class GroupMenuComponent implements OnInit { +export class GroupMenuComponent implements OnChanges { @Input() group: GroupFlatNode; @Input() disabled = false; @Input() displayButtons: boolean; @@ -21,7 +21,7 @@ export class GroupMenuComponent implements OnInit { constructor(private authResolver: GuiAuthResolver) {} - ngOnInit(): void { + ngOnChanges(): void { this.syncAuth = this.authResolver.isAuthorized('forceGroupSynchronization_Group_policy', [ this.group, ]);