Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensuring groups are removed on King of the Mountain #399

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-605h-blueviolet.svg)]()
[![Time](https://img.shields.io/badge/development-605.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
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ public List<Fight> generateNextFights(Tournament tournament, String createdBy) {
return fights;
}

@Override
public void removeGroup(Tournament tournament, Integer level, Integer groupIndex) {
//King of the mountain generate a group by fight. Can be deleted.
groupProvider.delete(groupProvider.getGroupByLevelAndIndex(tournament, level, groupIndex));
}

private List<Team> getGroupTeams(Tournament tournament, int level) {
final List<Team> existingTeams = teamProvider.getAll(tournament);
final List<Team> teams = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ spring.messages.basename=language/language

#Database Access
spring.jpa.open-in-view=false
spring.kendo.datasource.jpa.hibernate.ddl-auto=create-drop
spring.kendo.datasource.platform=h2
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
spring.kendo.datasource.jdbc-url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_UPPER=false
spring.kendo.datasource.username=sa
spring.kendo.datasource.password=
spring.kendo.datasource.jpa.hibernate.ddl-auto=update
spring.kendo.datasource.platform=postgresql
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.kendo.datasource.jdbc-url=jdbc:postgresql://192.168.17.8:5432/postgres
spring.kendo.datasource.username=user
spring.kendo.datasource.password=dmk29dmssa4sa4sa4sa4saa
spring.kendo.datasource.initialize=true
spring.kendo.datasource.test-while-idle=true

Expand All @@ -49,7 +49,7 @@ spring.jpa.properties.hibernate.javax.cache.missing_cache_strategy=create
spring.main.allow-circular-references=true

#Security
database.encryption.key=12345
database.encryption.key=
jwt.expiration=1200000
jwt.guest.expiration=3600000
jwt.secret=
Expand Down
15 changes: 11 additions & 4 deletions frontend/src/app/views/fight-list/fight-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,17 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On
}
}
if (this.selectedGroup) {
this.groupService.update(this.selectedGroup).subscribe(() => {
this.messageService.infoMessage("fightDeleted");
this.refreshFights();
});
if (this.tournament.type == TournamentType.KING_OF_THE_MOUNTAIN) {
this.groupService.deleteGroup(this.selectedGroup).subscribe((): void => {
this.messageService.infoMessage("fightDeleted");
this.refreshFights();
});
} else {
this.groupService.update(this.selectedGroup).subscribe((): void => {
this.messageService.infoMessage("fightDeleted");
this.refreshFights();
});
}
}
}
});
Expand Down
Loading