From 412591dfe0119dbec84c3783cd94590810884580 Mon Sep 17 00:00:00 2001 From: Janis Eccarius Date: Sun, 21 Jun 2026 21:37:44 +0200 Subject: [PATCH] feat(tournaments): remove external server add/remove UI Servers are now env-var configured; the Servers dialog, add form, remove buttons, and TournamentServerService are all deleted. Co-Authored-By: Claude Sonnet 4.6 --- .../tournaments/tournaments.component.html | 41 ++---------------- .../tournaments/tournaments.component.ts | 42 ------------------- src/app/services/tournament-server.service.ts | 8 ---- 3 files changed, 3 insertions(+), 88 deletions(-) diff --git a/src/app/pages/tournaments/tournaments.component.html b/src/app/pages/tournaments/tournaments.component.html index bbad48d..cd0d2db 100644 --- a/src/app/pages/tournaments/tournaments.component.html +++ b/src/app/pages/tournaments/tournaments.component.html @@ -271,7 +271,7 @@ @if (serversLoading) {
Loading servers…
} @else if (servers.length === 0) { -

No external servers registered yet.

+

No external servers registered.

} @else {
@for (s of servers; track s.id) { @@ -280,49 +280,14 @@ {{ s.label }} {{ s.url }}
- } } -
-

Add server

-
- - -
-
- - -
- @if (addServerError) { -
{{ addServerError }}
- } -
- - -
+
+
-
} diff --git a/src/app/pages/tournaments/tournaments.component.ts b/src/app/pages/tournaments/tournaments.component.ts index 48ab90e..bead045 100644 --- a/src/app/pages/tournaments/tournaments.component.ts +++ b/src/app/pages/tournaments/tournaments.component.ts @@ -71,11 +71,6 @@ export class TournamentsComponent implements OnInit { showServersDialog = false; servers: ExternalTournamentServer[] = []; serversLoading = false; - newServerLabel = ''; - newServerUrl = ''; - addingServer = false; - addServerError: string | null = null; - removingServerId: string | null = null; ngOnInit(): void { this.authService.currentUser$ @@ -248,9 +243,6 @@ export class TournamentsComponent implements OnInit { } openServersDialog(): void { - this.newServerLabel = ''; - this.newServerUrl = ''; - this.addServerError = null; this.showServersDialog = true; this.serversLoading = true; this.tournamentServerService.list() @@ -265,40 +257,6 @@ export class TournamentsComponent implements OnInit { this.showServersDialog = false; } - addServer(): void { - const label = this.newServerLabel.trim(); - const url = this.newServerUrl.trim(); - if (!label || !url || this.addingServer) return; - this.addingServer = true; - this.addServerError = null; - this.tournamentServerService.register(label, url).subscribe({ - next: server => { - this.addingServer = false; - this.servers = [...this.servers, server]; - this.newServerLabel = ''; - this.newServerUrl = ''; - this.loadTournaments(); - }, - error: err => { - this.addingServer = false; - this.addServerError = err.error?.error ?? 'Failed to add server.'; - } - }); - } - - removeServer(id: string): void { - if (this.removingServerId) return; - this.removingServerId = id; - this.tournamentServerService.remove(id).subscribe({ - next: () => { - this.removingServerId = null; - this.servers = this.servers.filter(s => s.id !== id); - this.loadTournaments(); - }, - error: () => { this.removingServerId = null; } - }); - } - private loadTournaments(): void { this.tournamentService.list() .pipe(takeUntilDestroyed(this.destroyRef)) diff --git a/src/app/services/tournament-server.service.ts b/src/app/services/tournament-server.service.ts index 5a2774c..a122c6c 100644 --- a/src/app/services/tournament-server.service.ts +++ b/src/app/services/tournament-server.service.ts @@ -20,12 +20,4 @@ export class TournamentServerService { list(): Observable { return this.http.get(this.base); } - - register(label: string, url: string): Observable { - return this.http.post(this.base, { label, url }); - } - - remove(id: string): Observable { - return this.http.delete(`${this.base}/${id}`); - } }