Skip to content

Commit

Permalink
Merge pull request #353 from softwaremagico/344-tree-panel-for-guest-…
Browse files Browse the repository at this point in the history
…users

Hiding controls for guest user.
  • Loading branch information
softwaremagico authored Mar 23, 2024
2 parents 844bf81 + 7722b89 commit f93264c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<div class="container" cdkDropListGroup>
<div>
<div *ngIf="!droppingDisabled"
<div *ngIf="!droppingDisabled && (RbacActivity.EDIT_GROUP | rbac : this.rbacService.getActivities())"
(cdkDropListDropped)="removeTeam($event)" [cdkDropListData]="teamListData.filteredTeams"
cdkDropList cdkDropListSortingDisabled="true"
class="teams-container">
<team-list [teamListData]="teamListData" [minify]="true"></team-list>
<team-list
[teamListData]="teamListData" [minify]="true"></team-list>
</div>
<div *ngIf="!droppingDisabled" class="button-container" mat-dialog-actions>
<button (click)="sortedGroups()"
*ngIf="(RbacActivity.EDIT_GROUP | rbac : this.rbacService.getActivities())"
[disabled]="groupsDisabled || (tournament && tournament.locked)"
mat-flat-button
mat-raised-button>
<mat-icon class="kendo-icon" svgIcon="sorted"></mat-icon>
{{'sorted' | translate}}
</button>
<button (click)="randomGroups()"
*ngIf="(RbacActivity.EDIT_GROUP | rbac : this.rbacService.getActivities())"
[disabled]="groupsDisabled || (tournament && tournament.locked)"
mat-flat-button
mat-raised-button>
<mat-icon>casino</mat-icon>
{{'random' | translate}}
</button>
<button (click)="askToRemoveAllTeams()"
*ngIf="(RbacActivity.CLEAN_UP_GROUPS | rbac : this.rbacService.getActivities())"
[disabled]="groupsDisabled || (tournament && tournament.locked)" [matTooltipShowDelay]="500"
mat-flat-button
mat-raised-button
Expand All @@ -31,7 +35,9 @@
</button>
</div>
</div>
<button (click)="downloadAsPdf()"
<button
*ngIf="!droppingDisabled && (RbacActivity.DOWNLOAD_GROUPS_PDF | rbac : this.rbacService.getActivities())"
(click)="downloadAsPdf()"
class="floating-button" color="picture" mat-flat-button mat-mini-fab
type="button">
<mat-icon color="primary">download_file</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class TournamentBracketsEditorComponent implements OnChanges, OnInit, OnD
private topicSubscription: Subscription;

constructor(private teamService: TeamService, private groupService: GroupService, private groupLinkService: GroupLinkService,
private rbacService: RbacService, private systemOverloadService: SystemOverloadService, private dialog: MatDialog,
public rbacService: RbacService, private systemOverloadService: SystemOverloadService, private dialog: MatDialog,
private groupsUpdatedService: GroupsUpdatedService, private numberOfWinnersUpdatedService: NumberOfWinnersUpdatedService,
private rxStompService: RxStompService, private environmentService: EnvironmentService) {
}
Expand Down Expand Up @@ -333,4 +333,6 @@ export class TournamentBracketsEditorComponent implements OnChanges, OnInit, OnD
this.groupsUpdatedService.areTeamListUpdated.next([]);
})
}

protected readonly RbacActivity = RbacActivity;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
<div class="upper-menu">
<div class="cell">
<button (click)="goBackToFights()"
*ngIf="(RbacActivity.READ_ALL_TOURNAMENTS | rbac : this.rbacService.getActivities())"
*ngIf="(RbacActivity.READ_ALL_FIGHTS | rbac : this.rbacService.getActivities())"
[matTooltipShowDelay]="500" color="secondary"
color="primary" mat-button
matTooltip="{{'back' | translate}}">
<mat-icon>arrow_back</mat-icon>
</button>
<button (click)="addGroup()" *ngIf="(RbacActivity.CREATE_GROUP | rbac : this.rbacService.getActivities())"
[disabled]="!(groupsLevelZero.length < totalTeams / 2) || groupsDisabled || (tournament && tournament.locked)" [matTooltipShowDelay]="500"
[disabled]="!(groupsLevelZero.length < totalTeams / 2) || groupsDisabled || (tournament && tournament.locked)"
[matTooltipShowDelay]="500"
class="add-button"
color="primary" mat-button
matTooltip="{{'addFight' | translate}}">
Expand Down Expand Up @@ -40,7 +41,9 @@
matTooltip="{{'delete' | translate}}">
<mat-icon>clear</mat-icon>
</button>
<mat-divider [vertical]="true"></mat-divider>
<mat-divider [vertical]="true"
*ngIf="(numberOfWinners == 2) && (RbacActivity.CREATE_FIGHT | rbac : this.rbacService.getActivities())"
></mat-divider>
<button (click)="openConfirmationGenerateElementsDialog()"
*ngIf="isWizardEnabled && (RbacActivity.CREATE_FIGHT | rbac : this.rbacService.getActivities())"
[disabled]="groupsDisabled || (tournament && tournament.locked)"
Expand All @@ -49,7 +52,9 @@
matTooltip="{{'wizard' | translate}}">
<mat-icon>auto_fix_high</mat-icon>
</button>
<mat-divider [vertical]="true"></mat-divider>
<mat-divider [vertical]="true"
*ngIf="(numberOfWinners == 2) && (RbacActivity.DOWNLOAD_GROUPS_PDF | rbac : this.rbacService.getActivities())"
></mat-divider>
<button (click)="downloadPDF()"
*ngIf="isWizardEnabled && (RbacActivity.DOWNLOAD_GROUPS_PDF | rbac : this.rbacService.getActivities())"
[matTooltipShowDelay]="500"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.page-content {
min-height: 83vh;
min-height: 100vh;
overflow-y: auto;
width: 100%;
padding-left: 20px;
Expand Down

0 comments on commit f93264c

Please sign in to comment.