Skip to content

Commit 589744e

Browse files
committed
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.
1 parent 37602be commit 589744e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libs/perun/components/src/lib/group-menu/group-menu.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
1+
import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
22
import { GroupFlatNode } from '@perun-web-apps/perun/models';
33
import { GuiAuthResolver } from '@perun-web-apps/perun/services';
44

@@ -7,7 +7,7 @@ import { GuiAuthResolver } from '@perun-web-apps/perun/services';
77
templateUrl: './group-menu.component.html',
88
styleUrls: ['./group-menu.component.scss'],
99
})
10-
export class GroupMenuComponent implements OnInit {
10+
export class GroupMenuComponent implements OnChanges {
1111
@Input() group: GroupFlatNode;
1212
@Input() disabled = false;
1313
@Input() displayButtons: boolean;
@@ -21,7 +21,7 @@ export class GroupMenuComponent implements OnInit {
2121

2222
constructor(private authResolver: GuiAuthResolver) {}
2323

24-
ngOnInit(): void {
24+
ngOnChanges(): void {
2525
this.syncAuth = this.authResolver.isAuthorized('forceGroupSynchronization_Group_policy', [
2626
this.group,
2727
]);

0 commit comments

Comments
 (0)