Skip to content

Commit

Permalink
Improved arrow position
Browse files Browse the repository at this point in the history
  • Loading branch information
softwaremagico committed Jun 17, 2024
1 parent 05bba08 commit c56d624
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/softwaremagico/KendoTournamentManager)](https://github.com/softwaremagico/KendoTournamentManager)
[![GitHub last commit](https://img.shields.io/github/last-commit/softwaremagico/KendoTournamentManager)](https://github.com/softwaremagico/KendoTournamentManager)
[![CircleCI](https://circleci.com/gh/softwaremagico/KendoTournamentManager.svg?style=shield)](https://circleci.com/gh/softwaremagico/KendoTournamentManager)
[![Time](https://img.shields.io/badge/development-626.5h-blueviolet.svg)]()
[![Time](https://img.shields.io/badge/development-625h-blueviolet.svg)]()

[![Powered by](https://img.shields.io/badge/powered%20by%20java-orange.svg?logo=OpenJDK&logoColor=white)]()
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=kendo-tournament-backend&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=kendo-tournament-backend)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</marker>
</defs>

<line [attr.x1]="x1" [attr.y1]="y1" [attr.x2]="x2-(arrow_size/2)" [attr.y2]="y2" class="arrow"
[style.stroke]="color"
<line [attr.x1]="x1" [attr.y1]="y1" [attr.x2]="x2-(arrow_size/2)" [attr.y2]="y2" class="arrow" [style.stroke]="color"
[style.stroke-dasharray]="(winner==0) ? '1 0' : '10 5'"/>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ export class ArrowComponent implements OnInit {
this.y2 += ArrowComponent.WINNER_SEPARATION;
}
}
//Arrows define the height of the brackets. Put 300 px to show correctly the group.
this.height = Math.max(this.y2, this.y1) + ArrowComponent.ARROW_SIZE / 2 + BracketsMeasures.GROUP_HIGH + BracketsMeasures.GROUP_SEPARATION;
this.height = Math.max(this.y2, this.y1) + ArrowComponent.ARROW_SIZE / 2;
this.width = Math.max(this.x2, this.x1);
}

Expand Down
19 changes: 9 additions & 10 deletions frontend/src/app/views/fight-list/fight-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
matTooltip="{{'groups' | translate}}">
<mat-icon class="kendo-icon" svgIcon="brackets"></mat-icon>
</button>
<mat-divider [vertical]="true" class="timer-divider"
*ngIf="(RbacActivity.EDIT_FIGHT | rbac : this.rbacService.getActivities())"></mat-divider>
<mat-divider [vertical]="true" class="timer-divider" *ngIf="(RbacActivity.EDIT_FIGHT | rbac : this.rbacService.getActivities())"></mat-divider>
<button (click)="finishDuel()" *ngIf="(RbacActivity.EDIT_FIGHT | rbac : this.rbacService.getActivities())
&& (!selectedDuel || selectedDuel?.finished == false)"
[disabled]="!selectedDuel || (tournament && tournament.locked)"
Expand Down Expand Up @@ -112,16 +111,16 @@
</button>
<mat-divider [vertical]="true" *ngIf="(RbacActivity.READ_TEAMS_RANKINGS | rbac : this.rbacService.getActivities()) ||
(RbacActivity.READ_COMPETITORS_RANKINGS | rbac : this.rbacService.getActivities())"></mat-divider>
<button (click)="showTeamsClassification(areAllDuelsOver())"
*ngIf="(RbacActivity.READ_TEAMS_RANKINGS | rbac : this.rbacService.getActivities())"
<button (click)="showTeamsClassification(areAllDuelsOver())" *ngIf="((tournament && tournament.teamSize && tournament.teamSize>1) || (tournament && tournament.type === kingOfTheMountainType))
&& (RbacActivity.READ_TEAMS_RANKINGS | rbac : this.rbacService.getActivities())"
[disabled]="!groups[0] || !groups[0].fights || groups[0].fights.length == 0"
[matTooltipShowDelay]="500" color="primary"
mat-button
matTooltip="{{'teamsRanking' | translate}}">
<mat-icon class="kendo-icon" svgIcon="teams-classification"></mat-icon>
</button>
<button (click)="showCompetitorsClassification()"
*ngIf="(tournament && tournament.teamSize && tournament.teamSize>1) && (RbacActivity.READ_COMPETITORS_RANKINGS | rbac : this.rbacService.getActivities())"
*ngIf="(RbacActivity.READ_COMPETITORS_RANKINGS | rbac : this.rbacService.getActivities())"
[disabled]="!groups[0] || !groups[0].fights || groups[0].fights.length == 0"
[matTooltipShowDelay]="500"
class="competitors-classification" color="primary"
Expand All @@ -145,10 +144,10 @@
</div>
<div class="filter-shiaijo" *ngIf="tournament!=undefined && tournament!.shiaijos! > 1">
<div class="shiaijo-label">
{{ 'shiaijo'| translate }}
{{'shiaijo'| translate}}
</div>
<div class="shiaijo-name" (click)="changeShiaijo()" (keydown)="changeShiaijo()">
{{ getShiaijoTag() }}
<div class="shiaijo-name" (click)="changeShiaijo()" (keydown)="changeShiaijo()" >
{{getShiaijoTag()}}
</div>
</div>
<app-filter (filterChanged)="filter($event)" (reset)="filter('')" [resetValue]="resetFilterValue"></app-filter>
Expand All @@ -164,10 +163,10 @@
<div *ngFor="let group of groups" class="fight-list">
<h2 *ngIf="showLevelTags && showLevelOfGroup.get(group) && filteredLevels.includes(group.level)"
[ngClass]="{'level-name-hidden': groups.length < 2 || filteredFights.get(group.id!)?.length == 0}"
class="level-name">{{ 'level' | translate }} {{ group.level + 1 }}</h2>
class="level-name">{{'level' | translate}} {{group.level + 1}}</h2>
<h3 *ngIf="filteredFights.get(group.id!)?.length! > 0"
[ngClass]="{'group-name-hidden': groups.length < 2 || filteredFights.get(group.id!)?.length == 0}"
class="group-name">{{ 'group' | translate }} {{ group.index + 1 }}</h3>
class="group-name">{{'group' | translate}} {{group.index + 1}}</h3>
<div *ngIf="filteredFights.get(group.id!)?.length! > 0"
[ngClass]="{'fights-of-group': groups.length > 1 && filteredFights.get(group.id!)?.length! > 0}">
<fight (click)="selectFight(fight)" (keydown)="selectFight(fight)" (onSelectedDuel)="selectDuel($event)"
Expand Down
17 changes: 7 additions & 10 deletions frontend/src/app/views/fight-list/fight-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,18 +722,17 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
}
}

//this.selectedGroup = this.groups.find((group: Group): boolean => group.fights.indexOf(fight) >= 0)!;

selectDuel(duel: Duel): void {
this.selectedDuel = duel;
this.duelChangedService.isDuelUpdated.next(duel);
if (duel) {
this.selectedGroup = this.groups.find((group: Group): boolean => group.unties.indexOf(duel) >= 0)!;
if (duel.duration) {
this.timeChangedService.isElapsedTimeChanged.next(duel.duration);
} else {
this.timeChangedService.isElapsedTimeChanged.next(0);
}
}
if (duel) {
if (duel.totalDuration) {
this.timeChangedService.isTotalTimeChanged.next(duel.totalDuration);
} else {
Expand All @@ -747,8 +746,8 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
}

areAllDuelsOver(): boolean {
const fights: Fight[] | undefined = this.selectedGroup ? this.filteredFights.get(this.selectedGroup!.id!) : this.getFights();
const unties: Duel[] | undefined = this.selectedGroup ? this.filteredUnties.get(this.selectedGroup!.id!) : this.getUnties();
const fights: Fight[] = this.getFights();
const unties: Duel[] = this.getUnties();
if (fights) {
for (const fight of fights) {
for (const duel of fight.duels) {
Expand All @@ -757,11 +756,9 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
}
}
}
if (unties) {
for (const duel of unties) {
if (!duel.finished) {
return false;
}
for (const duel of unties) {
if (!duel.finished) {
return false;
}
}
}
Expand Down

0 comments on commit c56d624

Please sign in to comment.