Skip to content

Commit

Permalink
fix(admin): correctly display group action buttons on a tree view
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
HejdaJakub committed Oct 31, 2023
1 parent 5ff7566 commit 188e801
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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;
Expand All @@ -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,
]);
Expand Down

0 comments on commit 188e801

Please sign in to comment.