Skip to content

Commit

Permalink
Merge pull request #511 from softwaremagico/508-ranking-is-shown-too-…
Browse files Browse the repository at this point in the history
…often-on-fight-list

508 ranking is shown too often on fight list
  • Loading branch information
softwaremagico authored Oct 21, 2024
2 parents 6a42233 + b9ffc5f commit 06f868a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 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-653h-blueviolet.svg)]()
[![Time](https://img.shields.io/badge/development-653.5h-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
16 changes: 7 additions & 9 deletions frontend/src/app/views/fight-list/fight-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,6 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
}

this.resetFilter();
//Use a timeout or refresh before the components are drawn.
setTimeout((): void => {
if (!this.selectFirstUnfinishedDuel() && this.getUnties().length === 0
&& this.tournament.type !== TournamentType.KING_OF_THE_MOUNTAIN && this.tournament.type !== TournamentType.BUBBLE_SORT
&& this.tournament.type !== TournamentType.SENBATSU) {
this.showTeamsClassification(true);
}
}, 1000);
}

private setLevelTagVisibility(sortedGroups: Group[]): void {
Expand Down Expand Up @@ -607,6 +599,7 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
const dialogRef: MatDialogRef<TeamRankingComponent> = this.dialog.open(TeamRankingComponent, {
panelClass: 'pop-up-panel',
width: '85vw',
restoreFocus: false,
data: {tournament: this.tournament, group: this.selectedGroup, finished: fightsFinished}
});
dialogRef.afterClosed().subscribe(result => {
Expand Down Expand Up @@ -690,7 +683,7 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
if (this.getFights().length < this.groups[0].teams.length - 1) {
this.addElement();
} else {
this.showClassification();
this.showFightsFinishedMessage();
}
} else {
// Tournament, each group must have a winner. Show for each group the winners.
Expand Down Expand Up @@ -748,6 +741,7 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
} else {
if (showClassification && this.tournament.type !== TournamentType.KING_OF_THE_MOUNTAIN
&& this.tournament.type !== TournamentType.BUBBLE_SORT && this.tournament.type !== TournamentType.SENBATSU) {
this.showFightsFinishedMessage();
this.showClassification();
}
this.finishTournament(new Date());
Expand All @@ -765,6 +759,10 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
}
}

showFightsFinishedMessage(): void {
this.messageService.infoMessage("fightsEnded");
}

finishTournament(date: Date | undefined): void {
if (!this.tournament.finishedAt && date) {
this.tournament.finishedAt = date;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -732,5 +732,6 @@
"senbatsuRungLength": "Distància entre desafiaments",
"senbatsuRungLengthHint": "La disparitat màxima permesa a la capacitat entre dos competidors per tal d'establir un desafiament.",
"reverseOrder": "Invertir",
"reverseOrderHint": "Invertir l'ordre dels equips."
"reverseOrderHint": "Invertir l'ordre dels equips.",
"fightsEnded": "Tots els partits s'han acabat."
}
3 changes: 2 additions & 1 deletion frontend/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,5 +710,6 @@
"senbatsuRungLength": "Distanz zwischen Desafíos",
"senbatsuRungLengthHint": "Der maximal zulässige Leistungsunterschied zwischen zwei Teilnehmern zum Zwecke der Festlegung einer Herausforderung.",
"reverseOrder": "Reverse",
"reverseOrderHint": "Kehren Sie die Reihenfolge der Teams um."
"reverseOrderHint": "Kehren Sie die Reihenfolge der Teams um.",
"fightsEnded": "Alle Spiele sind vorbei."
}
3 changes: 2 additions & 1 deletion frontend/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -727,5 +727,6 @@
"senbatsuRungLength": "Challenge distance",
"senbatsuRungLengthHint": "The maximum allowable disparity in ability between two competitors for the purpose of establishing a challenge.",
"reverseOrder": "Reverse",
"reverseOrderHint": "Reverse teams' order"
"reverseOrderHint": "Reverse teams' order",
"fightsEnded": "All matches have finished."
}
3 changes: 2 additions & 1 deletion frontend/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -728,5 +728,6 @@
"senbatsuRungLength": "Distancia entre desafíos",
"senbatsuRungLengthHint": "La disparidad máxima permitida en la capacidad entre dos competidores con el fin de establecer un desafío.",
"reverseOrder": "Invertir",
"reverseOrderHint": "Invertir el orden de los equipos."
"reverseOrderHint": "Invertir el orden de los equipos.",
"fightsEnded": "Todos los partidos han terminado."
}
3 changes: 2 additions & 1 deletion frontend/src/assets/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -716,5 +716,6 @@
"senbatsuRungLength": "Distanza tra i desafíos",
"senbatsuRungLengthHint": "La massima disparità consentita nell'abilità tra due concorrenti allo scopo di stabilire una sfida.",
"reverseOrder": "Invertire",
"reverseOrderHint": "Invertire l'ordine delle squadre."
"reverseOrderHint": "Invertire l'ordine delle squadre.",
"fightsEnded": "Tutti gli incontri sono finiti."
}
3 changes: 2 additions & 1 deletion frontend/src/assets/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,5 +710,6 @@
"senbatsuRungLength": "Afstand tussen de veilige afstanden",
"senbatsuRungLengthHint": "Het maximaal toegestane verschil in bekwaamheid tussen twee concurrenten met als doel een uitdaging aan te gaan.",
"reverseOrder": "Reverse",
"reverseOrderHint": "Draai de volgorde van de teams om."
"reverseOrderHint": "Draai de volgorde van de teams om.",
"fightsEnded": "Alle spellen zijn voorbij."
}

0 comments on commit 06f868a

Please sign in to comment.