Fide ID: {{ person.fideId }}
Birthday: {{ person.birthday }}
diff --git a/website/src/app/chess-settings/chess-update-event/chess-update-event.component.ts b/website/src/app/chess-settings/chess-update-event/chess-update-event.component.ts
index 7399c050..1120ca8c 100644
--- a/website/src/app/chess-settings/chess-update-event/chess-update-event.component.ts
+++ b/website/src/app/chess-settings/chess-update-event/chess-update-event.component.ts
@@ -1,11 +1,10 @@
-import {Component, OnInit, inject, signal} from '@angular/core';
+import {Component, computed, inject, OnInit, signal} from '@angular/core';
import {ChessService} from "../../core/services/chess.service";
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms";
import {
ChessEvent,
- ChessEventCategory,
+ ChessEventCategory, ChessPlatform,
Person,
- SearchChessEvent,
WriteChessEvent
} from "../../core/models/chess/chess.models";
import {Fieldset} from "primeng/fieldset";
@@ -18,9 +17,11 @@ import {InputText} from "primeng/inputtext";
import {FaIconComponent} from "@fortawesome/angular-fontawesome";
import {NgIf} from "@angular/common";
import {PickList} from "primeng/picklist";
-import {LazyLoad} from "../../core/models/lazy-load.model";
import {rxResource} from "@angular/core/rxjs-interop";
import {EventIconPipe} from "../../core/pipes/gender-icon.pipe";
+import {Textarea} from "primeng/textarea";
+import {of} from "rxjs";
+import {Select} from "primeng/select";
@Component({
selector: 'app-chess-update-event',
@@ -37,7 +38,9 @@ import {EventIconPipe} from "../../core/pipes/gender-icon.pipe";
NgIf,
PickList,
FormsModule,
- EventIconPipe
+ EventIconPipe,
+ Textarea,
+ Select
],
templateUrl: './chess-update-event.component.html',
styleUrl: './chess-update-event.component.scss'
@@ -48,14 +51,35 @@ export class ChessUpdateEventComponent implements OnInit{
events = signal
([])
selectedEvent = signal(undefined)
+ selectedParticipants = rxResource({
+ request: () => ({eventId: this.selectedEvent()?.id}),
+ loader: (params) => {
+ const eventId = params.request.eventId
+ if (eventId == undefined)
+ return of([])
+ return this.chessService.eventParticipants(eventId)
+ }
+ })
categories = rxResource({
loader: () => this.chessService.eventCategories(),
})
- allPersons: Person[] = [];
- personsToSelect: Person[] = [];
- participants: Person[] = [];
+ allPersonsS = signal([])
+ participantsS = computed(() => {
+ return this.selectedParticipants.value() ?? []
+ })
+ personsToSelectS = computed(() => {
+ const eventParticipants = this.selectedParticipants.value() ?? [];
+ return this.allPersonsS().filter(person => !eventParticipants?.some(participant => participant.id == person.id))
+ })
+
+ platforms = [
+ ChessPlatform.FIDE,
+ ChessPlatform.CHESSCOM,
+ ChessPlatform.FREESTYLE,
+ ChessPlatform.LICHESS
+ ]
formGroup: FormGroup = new FormGroup({
id: new FormControl({
@@ -88,6 +112,16 @@ export class ChessUpdateEventComponent implements OnInit{
]),
url: new FormControl(null),
embedUrl: new FormControl(null),
+ internalComment: new FormControl(''),
+ platform: new FormControl(
+ {
+ value: null,
+ disabled: false
+ }, [
+ Validators.required,
+ Validators.nullValidator
+ ]
+ ),
categories: new FormControl({
value: [],
disabled: false
@@ -99,32 +133,22 @@ export class ChessUpdateEventComponent implements OnInit{
ngOnInit(): void {
this.chessService.persons().subscribe(persons => {
- this.allPersons = [...persons];
- this.resetParticipantsSelect()
+ this.allPersonsS.set(persons)
+ })
+ this.loadEvents()
+ }
+
+ loadEvents() {
+ this.chessService.events().subscribe(events => {
+ this.events.set(events)
})
}
onEventSelect(event: ChessEvent | undefined){
this.selectedEvent.set(event);
- this.resetParticipantsSelect()
this.patchForm()
}
- private resetParticipantsSelect(){
- this.personsToSelect = [...[]]
- this.participants = [...[]]
- this.resetSourceTargetFilter()
- let selectedEvent = this.selectedEvent();
- if(selectedEvent){
- const eventParticipants = selectedEvent.participants as Person[];
- this.participants = [...eventParticipants];
- const notParticipating = this.allPersons.filter(person => !eventParticipants?.some(participant => participant.id == person.id))
- this.personsToSelect = [...notParticipating]
- } else {
- this.personsToSelect = [...this.allPersons]
- this.participants = [...[]]
- }
- }
patchForm(){
const selectedEvent = this.selectedEvent();
@@ -150,10 +174,11 @@ export class ChessUpdateEventComponent implements OnInit{
dateFrom: dateFrom ?? null,
dateTo: dateTo ?? null,
url: selectedEvent.url ?? '',
+ internalComment: selectedEvent.internalComment ?? '',
+ platform: selectedEvent.platform ?? null,
embedUrl: selectedEvent.embedUrl ?? '',
categories: selectedEvent.categories ?? [],
});
- this.resetParticipantsSelect()
}
save() {
@@ -171,20 +196,16 @@ export class ChessUpdateEventComponent implements OnInit{
dateTo: dateTo,
url: this.formGroup.controls['url'].value,
embedUrl: this.formGroup.controls['embedUrl'].value,
+ internalComment: this.formGroup.controls['internalComment'].value,
+ platform: this.formGroup.controls['platform'].value,
categoryIds: (this.formGroup.controls['categories'].value as ChessEventCategory[]).map(value => value.id),
- participantsIds: this.participants.map(value => value.id)
+ participantsIds: this.participantsS().map(value => value.id)
};
const id = this.formGroup.controls['id'].value ?? ""
this.chessService.saveEvent(id, event).subscribe(newEvent => {
this.clear()
- let isNewEvent = !this.events().some(old => old.id === newEvent.id);
- if (isNewEvent){
- this.events.update(value => [...value, newEvent])
- } else {
- const newEvents = this.events().map(old => old.id === newEvent.id ? newEvent : old);
- this.events.set(newEvents)
- }
+ this.loadEvents()
})
}
@@ -201,80 +222,10 @@ export class ChessUpdateEventComponent implements OnInit{
clear() {
this.formGroup.reset();
this.selectedEvent.set(undefined);
- this.resetParticipantsSelect();
}
confirmDelete() {
}
- lazyLoadEvents(lazyLoad: LazyLoad) {
- this.chessService.searchEvents(lazyLoad.data).subscribe(newEvents => {
- const filtered = newEvents.filter(event => this.events().every(oldEvent => oldEvent.id !== event.id))
- if(filtered.length != 0){
- this.events.update(value => [...value, ...filtered])
- }
- })
- }
-
-
-
-
-
-
-
-
- // TODO sourceHeader and targetHeader are temporary because f PrimeNGs Filters are f broken
- sourceSearchText: string = "";
- targetSearchText: string = "";
- beforeSourceSearchPersons: Person[] = [];
- beforeTargetSearchPersons: Person[] = [];
-
- onSourceSearch() {
- if(this.sourceSearchText === ""){
- if(this.beforeSourceSearchPersons.length == 0){
- return;
- }
- this.personsToSelect = [...this.beforeSourceSearchPersons]
- return;
- }
-
- if(this.beforeSourceSearchPersons.length == 0){
- this.beforeSourceSearchPersons = [...this.personsToSelect]
- }
-
- const filtered = this.personsToSelect.filter(person =>
- person.firstname.toLowerCase().includes(this.sourceSearchText.toLowerCase()) ||
- person.lastname.toLowerCase().includes(this.sourceSearchText.toLowerCase())
- )
- this.personsToSelect = [...filtered]
- }
-
- onTargetSearch() {
- if(this.targetSearchText === ""){
- if(this.beforeTargetSearchPersons.length == 0){
- return;
- }
- this.participants = [...this.beforeTargetSearchPersons]
- return;
- }
-
- if(this.beforeTargetSearchPersons.length == 0){
- this.beforeTargetSearchPersons = [...this.participants]
- }
-
- const filtered = this.participants.filter(person =>
- person.firstname.toLowerCase().includes(this.targetSearchText.toLowerCase()) ||
- person.lastname.toLowerCase().includes(this.targetSearchText.toLowerCase())
- )
- this.participants = [...filtered]
- }
-
- resetSourceTargetFilter(){
- this.sourceSearchText = "";
- this.targetSearchText = "";
- this.beforeSourceSearchPersons = [...[]];
- this.beforeTargetSearchPersons = [...[]];
- }
-
}
diff --git a/website/src/app/chess-settings/chess-update-game/chess-update-game.component.html b/website/src/app/chess-settings/chess-update-game/chess-update-game.component.html
index 3255e712..46fbb83e 100644
--- a/website/src/app/chess-settings/chess-update-game/chess-update-game.component.html
+++ b/website/src/app/chess-settings/chess-update-game/chess-update-game.component.html
@@ -5,8 +5,8 @@
-
-
+
+
@@ -35,16 +35,12 @@
- |
Username |
Platform |
-
-
- |
{{ account.username }} |
{{ account.platform }} |
diff --git a/website/src/app/chess-settings/chess-update-game/chess-update-game.component.ts b/website/src/app/chess-settings/chess-update-game/chess-update-game.component.ts
index 77e052ff..b52da118 100644
--- a/website/src/app/chess-settings/chess-update-game/chess-update-game.component.ts
+++ b/website/src/app/chess-settings/chess-update-game/chess-update-game.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject, signal, computed} from '@angular/core';
+import {Component, computed, inject, signal} from '@angular/core';
import {FieldsetModule} from "primeng/fieldset";
import {ChessService} from "../../core/services/chess.service";
import {Account, ChessEvent, Person} from "../../core/models/chess/chess.models";
@@ -14,6 +14,7 @@ import {CardModule} from "primeng/card";
import {SelectChessEventComponent} from "../select-chess-event/select-chess-event.component";
import {SelectChessPersonComponent} from "../select-chess-person/select-chess-person.component";
import {rxResource} from "@angular/core/rxjs-interop";
+import {of} from "rxjs";
@Component({
selector: 'app-chess-update-game',
@@ -42,7 +43,15 @@ export class ChessUpdateGameComponent {
})
selectedEvent = signal(undefined)
- persons = computed(() => this.selectedEvent()?.participants ?? [])
+ persons = rxResource({
+ request: () => ({eventId: this.selectedEvent()?.id}),
+ loader: (params) => {
+ const eventId = params.request.eventId
+ if(eventId == undefined)
+ return of([])
+ return this.chessService.eventParticipants(eventId)
+ }
+ })
selectedPersons = signal([]);
accounts = computed(() => this.selectedPersons().flatMap(value => value.accounts))
diff --git a/website/src/app/chess-settings/chess-update-person/chess-update-person.component.html b/website/src/app/chess-settings/chess-update-person/chess-update-person.component.html
index 25f4e44a..c0741eef 100644
--- a/website/src/app/chess-settings/chess-update-person/chess-update-person.component.html
+++ b/website/src/app/chess-settings/chess-update-person/chess-update-person.component.html
@@ -25,11 +25,6 @@
-
-
-
-
-
diff --git a/website/src/app/chess-settings/chess-update-person/chess-update-person.component.ts b/website/src/app/chess-settings/chess-update-person/chess-update-person.component.ts
index 1168379f..1ae30965 100644
--- a/website/src/app/chess-settings/chess-update-person/chess-update-person.component.ts
+++ b/website/src/app/chess-settings/chess-update-person/chess-update-person.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject, signal} from '@angular/core';
+import {Component, inject, OnInit, signal} from '@angular/core';
import {DropdownModule} from "primeng/dropdown";
import {DividerModule} from "primeng/divider";
import {FieldsetModule} from "primeng/fieldset";
@@ -64,11 +64,6 @@ export class ChessUpdatePersonComponent implements OnInit{
}, [
Validators.required,
]),
- fideId: new FormControl({
- value: '',
- disabled: false
- }, [
- ]),
federation: new FormControl({
value: '',
disabled: false
@@ -113,7 +108,6 @@ export class ChessUpdatePersonComponent implements OnInit{
id: selectedPerson?.id ?? '',
firstname: selectedPerson?.firstname ?? '',
lastname: selectedPerson?.lastname ?? '',
- fideId: selectedPerson?.fideId ?? '',
federation: selectedPerson?.federation ?? '',
birthday: birthday ?? null,
gender: selectedPerson?.gender ?? null,
@@ -141,7 +135,6 @@ export class ChessUpdatePersonComponent implements OnInit{
const person: WritePerson = {
firstname: this.formGroup.controls['firstname'].value,
lastname: this.formGroup.controls['lastname'].value,
- fideId: this.formGroup.controls['fideId'].value,
federation: this.formGroup.controls['federation'].value,
birthday: birthday,
gender: this.formGroup.controls['gender'].value,
diff --git a/website/src/app/chess-settings/select-chess-event-category/select-chess-event-category.component.spec.ts b/website/src/app/chess-settings/select-chess-event-category/select-chess-event-category.component.spec.ts
index ab485234..0a650664 100644
--- a/website/src/app/chess-settings/select-chess-event-category/select-chess-event-category.component.spec.ts
+++ b/website/src/app/chess-settings/select-chess-event-category/select-chess-event-category.component.spec.ts
@@ -1,6 +1,6 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
+import {ComponentFixture, TestBed} from '@angular/core/testing';
-import { SelectChessEventCategoryComponent } from './select-chess-event-category.component';
+import {SelectChessEventCategoryComponent} from './select-chess-event-category.component';
describe('SelectChessEventCategoryComponent', () => {
let component: SelectChessEventCategoryComponent;
diff --git a/website/src/app/chess-settings/select-chess-event/select-chess-event.component.html b/website/src/app/chess-settings/select-chess-event/select-chess-event.component.html
index 3ef2d32b..871f318a 100644
--- a/website/src/app/chess-settings/select-chess-event/select-chess-event.component.html
+++ b/website/src/app/chess-settings/select-chess-event/select-chess-event.component.html
@@ -5,20 +5,14 @@
selectionMode="single"
(onRowSelect)="onSelectionChange()"
(onRowUnselect)="onSelectionChange()"
- [scrollable]="true"
- scrollHeight="400px"
- [rows]="pageSize"
- [virtualScroll]="true"
- [virtualScrollItemSize]="virtualPageSize"
- [lazy]="true"
- (onLazyLoad)="lazyLoad($event)"
+ [paginator]="true"
+ [rows]="10"
>
Title |
Category |
Location |
- Nr. of Participants |
From |
To |
Url |
@@ -58,7 +52,6 @@
|
|
- |
{{ event.location }} |
- {{ event.participants.length }} |
{{ event.dateFrom }} |
{{ event.dateTo }} |
|
diff --git a/website/src/app/chess-settings/select-chess-event/select-chess-event.component.ts b/website/src/app/chess-settings/select-chess-event/select-chess-event.component.ts
index 3017b43e..68dab158 100644
--- a/website/src/app/chess-settings/select-chess-event/select-chess-event.component.ts
+++ b/website/src/app/chess-settings/select-chess-event/select-chess-event.component.ts
@@ -1,14 +1,13 @@
-import {Component, OnInit, input, output, inject, signal} from '@angular/core';
-import {TableLazyLoadEvent, TableModule} from "primeng/table";
-import {ChessEvent, ChessEventCategory, SearchChessEvent} from "../../core/models/chess/chess.models";
+import {Component, inject, input, OnInit, output, signal} from '@angular/core';
+import {TableModule} from "primeng/table";
+import {ChessEvent, ChessEventCategory} from "../../core/models/chess/chess.models";
import {InputTextModule} from "primeng/inputtext";
import {FormsModule} from "@angular/forms";
import {FaIconComponent} from "@fortawesome/angular-fontawesome";
import {faCheck, faXmark} from "@fortawesome/free-solid-svg-icons";
import {NgForOf} from "@angular/common";
import {ConfirmDialogModule} from "primeng/confirmdialog";
-import {FilterMetadata, FilterService, SelectItem} from "primeng/api";
-import {LazyLoad} from "../../core/models/lazy-load.model";
+import {FilterService, SelectItem} from "primeng/api";
@Component({
selector: 'app-select-chess-event',
@@ -28,10 +27,6 @@ export class SelectChessEventComponent implements OnInit{
readonly events = input([]);
readonly selectedEventEmitter = output();
- readonly lazyLoadEventEmitter = output>();
-
- pageSize = 100 // TODO https://github.com/primefaces/primeng/issues/17106
- virtualPageSize = this.pageSize/2
selectedEvent = signal(undefined);
@@ -83,29 +78,4 @@ export class SelectChessEventComponent implements OnInit{
return "color: green"
}
- lazyLoad($event: TableLazyLoadEvent) {
- console.log($event)
-
- const last = $event.last // TODO maybe first + rows??? What happens when filter?
- if(last == undefined){
- return
- }
-
- const data: SearchChessEvent = {
- title: ($event.filters?.['title'] as FilterMetadata)?.value ?? '',
- category: ($event.filters?.['categories'] as FilterMetadata)?.value ?? '',
- location: ($event.filters?.['location'] as FilterMetadata)?.value ?? '',
- url: ($event.filters?.['url'] as FilterMetadata)?.value ?? '',
- embedUrl: ($event.filters?.['url'] as FilterMetadata)?.value ?? '',
- pageNumber: Math.round(last / this.pageSize),
- pageSize: this.pageSize,
- }
-
- const lazyLoad: LazyLoad = {
- data: data,
- event: $event
- }
- this.lazyLoadEventEmitter.emit(lazyLoad)
- }
-
}
diff --git a/website/src/app/chess-settings/select-chess-person/select-chess-person.component.html b/website/src/app/chess-settings/select-chess-person/select-chess-person.component.html
index 28aa3454..54c49ec4 100644
--- a/website/src/app/chess-settings/select-chess-person/select-chess-person.component.html
+++ b/website/src/app/chess-settings/select-chess-person/select-chess-person.component.html
@@ -10,7 +10,6 @@
>
- |
Firstname |
Lastname |
Fide Id |
@@ -19,7 +18,6 @@
Gender |
- |
-
-
- |
{{ person.firstname }} |
{{ person.lastname }} |
{{ person.fideId }} |
{{ person.federation }} |
{{ person.birthday }} |
- |
+ |
diff --git a/website/src/app/chess-settings/select-chess-person/select-chess-person.component.ts b/website/src/app/chess-settings/select-chess-person/select-chess-person.component.ts
index 8237fa53..7226b0bc 100644
--- a/website/src/app/chess-settings/select-chess-person/select-chess-person.component.ts
+++ b/website/src/app/chess-settings/select-chess-person/select-chess-person.component.ts
@@ -5,6 +5,7 @@ import {PaginatorModule} from "primeng/paginator";
import {TableModule} from "primeng/table";
import {FaIconComponent} from "@fortawesome/angular-fontawesome";
import {EventIconPipe} from "../../core/pipes/gender-icon.pipe";
+import {NgIf} from "@angular/common";
@Component({
selector: 'app-select-chess-person',
@@ -13,7 +14,8 @@ import {EventIconPipe} from "../../core/pipes/gender-icon.pipe";
PaginatorModule,
TableModule,
FaIconComponent,
- EventIconPipe
+ EventIconPipe,
+ NgIf
],
templateUrl: './select-chess-person.component.html',
styleUrl: './select-chess-person.component.scss'
diff --git a/website/src/app/chess/chess-event/chess-event-games/chess-event-games.component.ts b/website/src/app/chess/chess-event/chess-event-games/chess-event-games.component.ts
index 74eca0a5..923487c6 100644
--- a/website/src/app/chess/chess-event/chess-event-games/chess-event-games.component.ts
+++ b/website/src/app/chess/chess-event/chess-event-games/chess-event-games.component.ts
@@ -1,8 +1,8 @@
-import {Component, OnChanges, SimpleChanges, input, output, inject, computed} from '@angular/core';
-import {ChessEvent, ChessGame} from "../../../core/models/chess/chess.models";
+import {Component, computed, inject, input, output} from '@angular/core';
+import {ChessEvent} from "../../../core/models/chess/chess.models";
import {ChessService} from "../../../core/services/chess.service";
import {rxResource} from "@angular/core/rxjs-interop";
-import { of } from 'rxjs';
+import {of} from 'rxjs';
@Component({
selector: 'app-chess-event-games',
@@ -15,12 +15,12 @@ export class ChessEventGamesComponent {
readonly event = input();
games = rxResource({
- request: () => ({event: this.event()}),
+ request: () => ({eventId: this.event()?.id}),
loader: (params) => {
- let event = this.event();
- if(event == undefined || event.id == undefined)
+ let eventId = params.request.eventId;
+ if(eventId == undefined)
return of([])
- return this.chessService.eventGames(event.id)
+ return this.chessService.eventGames(eventId)
}
})
computedHaveContent = computed(() => {
diff --git a/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.html b/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.html
index cb607f51..d12c3cb8 100644
--- a/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.html
+++ b/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.html
@@ -1,25 +1,26 @@
-
-
+
{{'chess.event.participants' | translate}}
+
+
+
+ {{'general.sort' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- {{'chess.event.participant.firstname' | translate}} |
- {{'chess.event.participant.lastname' | translate}} |
- {{'chess.event.federation' | translate}} |
- {{'chess.event.birthday' | translate}} |
- {{'chess.event.fide' | translate}} |
-
-
-
-
- {{ participant.firstname }} |
- {{ participant.lastname }} |
- {{ participant.federation }} |
- {{ participant.birthday }} |
- |
-
-
-
diff --git a/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.ts b/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.ts
index 897df899..82f4d58d 100644
--- a/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.ts
+++ b/website/src/app/chess/chess-event/chess-event-participants/chess-event-participants.component.ts
@@ -1,33 +1,96 @@
-import {Component, OnChanges, SimpleChanges, input, inject, computed} from '@angular/core';
-import {Button} from "primeng/button";
+import {Component, computed, effect, inject, input, signal} from '@angular/core';
import {CardModule} from "primeng/card";
-import {NgIf} from "@angular/common";
-import {TableModule} from "primeng/table";
-import {RouterNavigationService} from "../../../core/services/router-navigation.service";
-import {ChessService} from "../../../core/services/chess.service";
+import {NgForOf, NgIf} from "@angular/common";
import {TranslateModule} from "@ngx-translate/core";
-import {ChessEvent, Person} from "../../../core/models/chess/chess.models";
+import {Account, ChessEvent, Person} from "../../../core/models/chess/chess.models";
+import {rxResource} from "@angular/core/rxjs-interop";
+import {of} from "rxjs";
+import {ChessService} from "../../../core/services/chess.service";
+import {ChessPlayerCardComponent} from "../chess-player-card/chess-player-card.component";
+import {SelectButton} from "primeng/selectbutton";
+import {FormsModule} from "@angular/forms";
+import {RadioButton} from "primeng/radiobutton";
+import {Fieldset} from "primeng/fieldset";
@Component({
selector: 'app-chess-event-participants',
imports: [
- Button,
CardModule,
NgIf,
- TableModule,
- TranslateModule
+ TranslateModule,
+ NgForOf,
+ ChessPlayerCardComponent,
+ SelectButton,
+ FormsModule,
+ RadioButton,
+ Fieldset
],
templateUrl: './chess-event-participants.component.html',
styleUrl: './chess-event-participants.component.scss'
})
export class ChessEventParticipantsComponent {
- private readonly navigationService = inject(RouterNavigationService);
+ private readonly chessService = inject(ChessService);
readonly event = input();
- protected readonly participants = computed(() => this.event()?.participants ?? [])
+ protected readonly participants = rxResource({
+ request: () => ({eventId: this.event()?.id}),
+ loader: (params) => {
+ let eventId = params.request.eventId;
+ if(eventId == undefined)
+ return of([])
+ return this.chessService.eventParticipants(eventId)
+ }
+ })
+
+ sortedParticipants = computed(() => {
+ const _participants = this.participants.value() ?? []
+ const sortBy = this.selectedSort()
+ return this.sortParticipants(_participants, sortBy)
+ })
- openFide(fideId: string) {
- this.navigationService.open("https://ratings.fide.com/profile/" + fideId)
+ sortOptions: SortBy[] = [
+ {name: 'chess.event.sort.firstname', value: SortByValue.firstname},
+ {name: 'chess.event.sort.lastname', value: SortByValue.lastname},
+ {name: 'chess.event.sort.federation', value: SortByValue.federation},
+ {name: 'chess.event.sort.birthday', value: SortByValue.birthday}
+ ];
+ selectedSort = signal(SortByValue.lastname);
+
+ personsPlatformAccount(participant: Person): Account[] {
+ const eventPlatform = this.event()?.platform
+ if(eventPlatform == undefined)
+ return []
+ return participant.accounts.filter(value => value.platform == eventPlatform)
}
+ sortParticipants(_participants: Person[], value: SortByValue) {
+ switch (value) {
+ case SortByValue.federation:
+ return _participants.sort((a, b) => (a.federation || '').localeCompare(b.federation || ''))
+ case SortByValue.firstname:
+ return _participants.sort((a, b) => a.firstname.localeCompare(b.firstname))
+ case SortByValue.lastname:
+ return _participants.sort((a, b) => a.lastname.localeCompare(b.lastname))
+ case SortByValue.birthday:
+ return _participants.sort((a, b) => {
+ const dateA = a.birthday ? new Date(a.birthday).getTime() : 0;
+ const dateB = b.birthday ? new Date(b.birthday).getTime() : 0;
+ return dateB - dateA;
+ })
+ default:
+ return _participants;
+ }
+ }
+
+}
+
+interface SortBy {
+ name: string;
+ value: SortByValue;
+}
+enum SortByValue {
+ firstname = 'firstname',
+ lastname = 'lastname',
+ federation = 'federation',
+ birthday = 'birthday'
}
diff --git a/website/src/app/chess/chess-event/chess-event.component.html b/website/src/app/chess/chess-event/chess-event.component.html
index 34f8f7a2..9d61c725 100644
--- a/website/src/app/chess/chess-event/chess-event.component.html
+++ b/website/src/app/chess/chess-event/chess-event.component.html
@@ -17,15 +17,23 @@
-
-
-
-
- {{'chess.event.location' | translate}}: {{ event.value()?.location }}
- {{'chess.event.date-from' | translate}}: {{ event.value()?.dateFrom }}
- {{'chess.event.date-to' | translate}}: {{ event.value()?.dateTo }}
+
+
+ {{_event.title}}
+ {{categories()}}
+
+ {{'chess.event.organizer' | translate}}: {{'chess.platform.' + platform | translate}}
+ {{'chess.event.location' | translate}}: {{ location }}
+ {{'chess.event.date-from' | translate}}: {{ dateFrom }}
+ {{'chess.event.date-to' | translate}}: {{ dateTo }}
+
+
+
+
@@ -37,13 +45,6 @@
-
-
-
-
-
diff --git a/website/src/app/chess/chess-event/chess-event.component.ts b/website/src/app/chess/chess-event/chess-event.component.ts
index 0552cddf..31e6d939 100644
--- a/website/src/app/chess/chess-event/chess-event.component.ts
+++ b/website/src/app/chess/chess-event/chess-event.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject, computed, signal, Signal, WritableSignal, resource, OnDestroy} from '@angular/core';
+import {Component, computed, inject, OnDestroy, Signal, signal, WritableSignal} from '@angular/core';
import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser";
import {ActivatedRoute} from '@angular/router';
import {ChessService} from "../../core/services/chess.service";
@@ -14,7 +14,7 @@ import {DividerModule} from "primeng/divider";
import {Tab, TabList, TabPanel, TabPanels, Tabs} from "primeng/tabs";
import {Avatar} from "primeng/avatar";
import {rxResource} from "@angular/core/rxjs-interop";
-import {EMPTY, Observable} from "rxjs";
+import {EMPTY} from "rxjs";
@Component({
selector: 'app-chess-events',
@@ -48,9 +48,10 @@ export class ChessEventComponent implements OnDestroy {
event = rxResource({
request: () => ({id: this.eventId()}),
loader: (param) => {
- if(param.request.id == undefined)
+ let id = param.request.id;
+ if(id == undefined)
return EMPTY
- return this.chessService.event(param.request.id)
+ return this.chessService.event(id)
}
})
embedUrl: Signal = computed(() => {
diff --git a/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.html b/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.html
new file mode 100644
index 00000000..f678b7a2
--- /dev/null
+++ b/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.html
@@ -0,0 +1,19 @@
+
+
+
+ {{player()?.firstname}} {{player()?.lastname}}
+
+
+
+
+
+ {{'chess.event.federation' | translate}}: {{ federation }}
+ {{'chess.event.birthday' | translate}}: {{ birthday }}
+
+
+
+
+
+
diff --git a/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.scss b/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.ts b/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.ts
new file mode 100644
index 00000000..59679a31
--- /dev/null
+++ b/website/src/app/chess/chess-event/chess-player-card/chess-player-card.component.ts
@@ -0,0 +1,36 @@
+import {Component, inject, input} from '@angular/core';
+import {Card} from "primeng/card";
+import {Button} from "primeng/button";
+import {Account, Person} from "../../../core/models/chess/chess.models";
+import {TranslatePipe} from "@ngx-translate/core";
+import {NgForOf, NgIf} from "@angular/common";
+import {RouterNavigationService} from "../../../core/services/router-navigation.service";
+import {EventIconPipe} from "../../../core/pipes/gender-icon.pipe";
+import {FaIconComponent} from "@fortawesome/angular-fontawesome";
+
+@Component({
+ selector: 'app-chess-player-card',
+ imports: [
+ Card,
+ Button,
+ TranslatePipe,
+ NgIf,
+ NgForOf,
+ EventIconPipe,
+ FaIconComponent
+ ],
+ templateUrl: './chess-player-card.component.html',
+ styleUrl: './chess-player-card.component.scss'
+})
+export class ChessPlayerCardComponent {
+ private readonly navigationService = inject(RouterNavigationService);
+
+ player = input()
+ accounts = input();
+
+ openAccount(account: Account) {
+ this.navigationService.open(account.url)
+ }
+
+ protected readonly length = length;
+}
diff --git a/website/src/app/chess/chess-events-list/chess-events-list.component.ts b/website/src/app/chess/chess-events-list/chess-events-list.component.ts
index 1c1a1a85..52b9992f 100644
--- a/website/src/app/chess/chess-events-list/chess-events-list.component.ts
+++ b/website/src/app/chess/chess-events-list/chess-events-list.component.ts
@@ -1,9 +1,8 @@
-import {Component, OnInit, inject, computed} from '@angular/core';
+import {Component, computed, inject} from '@angular/core';
import {ChessService} from "../../core/services/chess.service";
import {CardModule} from "primeng/card";
import {NgForOf, NgIf} from "@angular/common";
import {RouterLink} from "@angular/router";
-import {ChessEventCategoryWithEvents} from "../../core/models/chess/chess.models";
import {TimelineModule} from "primeng/timeline";
import {FaIconComponent} from "@fortawesome/angular-fontawesome";
import {ScrollTopModule} from "primeng/scrolltop";
diff --git a/website/src/app/chess/chess-navigation/chess-navigation.component.spec.ts b/website/src/app/chess/chess-navigation/chess-navigation.component.spec.ts
index cc445170..2aaeefca 100644
--- a/website/src/app/chess/chess-navigation/chess-navigation.component.spec.ts
+++ b/website/src/app/chess/chess-navigation/chess-navigation.component.spec.ts
@@ -1,6 +1,6 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
+import {ComponentFixture, TestBed} from '@angular/core/testing';
-import { ChessNavigationComponent } from './chess-navigation.component';
+import {ChessNavigationComponent} from './chess-navigation.component';
describe('ChessNavigationComponent', () => {
let component: ChessNavigationComponent;
diff --git a/website/src/app/chess/chess-navigation/chess-navigation.component.ts b/website/src/app/chess/chess-navigation/chess-navigation.component.ts
index 96c882d7..ea8b6a30 100644
--- a/website/src/app/chess/chess-navigation/chess-navigation.component.ts
+++ b/website/src/app/chess/chess-navigation/chess-navigation.component.ts
@@ -1,5 +1,12 @@
-import {Component, inject, computed} from '@angular/core';
-import {faAngleDown, faCalendarDays, faChessQueen, faGears, faHouse, faNewspaper} from "@fortawesome/free-solid-svg-icons";
+import {Component, computed, inject} from '@angular/core';
+import {
+ faAngleDown,
+ faCalendarDays,
+ faChessQueen,
+ faGears,
+ faHouse,
+ faNewspaper
+} from "@fortawesome/free-solid-svg-icons";
import {Badge} from "primeng/badge";
import {Divider} from "primeng/divider";
import {FaIconComponent} from "@fortawesome/angular-fontawesome";
@@ -14,7 +21,7 @@ import {PermissionService} from "../../core/services/permission.service";
import {MenuItem} from "primeng/api";
import {Permissions} from "../../core/config/permissions";
import {ChessEvent} from "../../core/models/chess/chess.models";
-import { EventIconPipe } from 'src/app/core/pipes/event-icon.pipe';
+import {EventIconPipe} from 'src/app/core/pipes/event-icon.pipe';
import {EventIconColorPipe} from "../../core/pipes/event-icon-color.pipe";
import {rxResource} from "@angular/core/rxjs-interop";
diff --git a/website/src/app/chess/chess-news/chess-news.component.ts b/website/src/app/chess/chess-news/chess-news.component.ts
index 7c42f3b1..7494831b 100644
--- a/website/src/app/chess/chess-news/chess-news.component.ts
+++ b/website/src/app/chess/chess-news/chess-news.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit} from '@angular/core';
+import {Component} from '@angular/core';
import {Message} from "primeng/message";
@Component({
diff --git a/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.spec.ts b/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.spec.ts
index 724c68bc..8c05fd4a 100644
--- a/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.spec.ts
+++ b/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.spec.ts
@@ -1,6 +1,6 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
+import {ComponentFixture, TestBed} from '@angular/core/testing';
-import { ChessRecentUpcomingEventsComponent } from './chess-recent-upcoming-events.component';
+import {ChessRecentUpcomingEventsComponent} from './chess-recent-upcoming-events.component';
describe('ChessEventsRecentUpcomingComponent', () => {
let component: ChessRecentUpcomingEventsComponent;
diff --git a/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.ts b/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.ts
index ca6ad2e8..569a2577 100644
--- a/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.ts
+++ b/website/src/app/chess/chess-recent-upcoming-events/chess-recent-upcoming-events.component.ts
@@ -1,6 +1,5 @@
-import {Component, OnInit, inject, computed} from '@angular/core';
+import {Component, computed, inject} from '@angular/core';
import {ChessService} from "../../core/services/chess.service";
-import {ChessEvent} from "../../core/models/chess/chess.models";
import {FaIconComponent} from "@fortawesome/angular-fontawesome";
import {PrimeTemplate} from "primeng/api";
import {Timeline} from "primeng/timeline";
diff --git a/website/src/app/chess/chess.component.ts b/website/src/app/chess/chess.component.ts
index e205f0c4..4bf3b854 100644
--- a/website/src/app/chess/chess.component.ts
+++ b/website/src/app/chess/chess.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {SplitterModule} from "primeng/splitter";
import {HeaderService} from "../core/services/header.service";
import {Sides} from "../core/config/sides";
diff --git a/website/src/app/core/config/language.config.ts b/website/src/app/core/config/language.config.ts
index d49f122b..86434754 100644
--- a/website/src/app/core/config/language.config.ts
+++ b/website/src/app/core/config/language.config.ts
@@ -1,8 +1,7 @@
-import { Injectable, inject } from '@angular/core';
+import {inject, Injectable} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {Language} from '../models/language.model';
import {Subject} from "rxjs";
-import {PrimeNG} from "primeng/config";
export const languages: Language[] = [
{
diff --git a/website/src/app/core/interceptors/auth-cookie.interceptor.ts b/website/src/app/core/interceptors/auth-cookie.interceptor.ts
deleted file mode 100644
index 7abe7ef5..00000000
--- a/website/src/app/core/interceptors/auth-cookie.interceptor.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Injectable} from "@angular/core";
-import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from "@angular/common/http";
-import {Observable} from "rxjs";
-
-@Injectable()
-export class AuthCookieInterceptor implements HttpInterceptor{
-
- intercept(req: HttpRequest, next: HttpHandler): Observable> {
- const modifiedRequest = req.clone({
- withCredentials: true,
- });
- return next.handle(modifiedRequest);
- }
-
-}
diff --git a/website/src/app/core/interceptors/auth-jwt.interceptor.ts b/website/src/app/core/interceptors/auth-jwt.interceptor.ts
index 9f1e46c2..c25e8021 100644
--- a/website/src/app/core/interceptors/auth-jwt.interceptor.ts
+++ b/website/src/app/core/interceptors/auth-jwt.interceptor.ts
@@ -1,4 +1,4 @@
-import { Injectable, inject } from "@angular/core";
+import {inject, Injectable} from "@angular/core";
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from "@angular/common/http";
import {Observable} from "rxjs";
import {AuthService} from "../services/auth.service";
diff --git a/website/src/app/core/models/admin/admin.model.ts b/website/src/app/core/models/admin/admin.model.ts
new file mode 100644
index 00000000..5eddf7d7
--- /dev/null
+++ b/website/src/app/core/models/admin/admin.model.ts
@@ -0,0 +1,112 @@
+export enum Status {
+ UP = 'UP',
+ DOWN = 'DOWN',
+ OUT_OF_SERVICE = 'OUT_OF_SERVICE',
+ UNKNOWN = 'UNKNOWN'
+}
+
+export interface Application {
+ name: string
+ buildVersion: string | null;
+ status: Status
+ statusTimestamp: string;
+ instances: Instance[];
+}
+
+export interface Instance {
+ id: string;
+ version: number;
+ registration: Registration;
+ registered: boolean;
+ statusInfo: StatusInfo;
+ statusTimestamp: string;
+ info: Info;
+ endpoints: Endpoint[];
+ buildVersion: string | null;
+ tags: Record;
+}
+
+export interface Registration {
+ name: string;
+ managementUrl: string;
+ healthUrl: string;
+ serviceUrl: string;
+ source: string;
+ metadata: Record;
+}
+
+export interface StatusInfo {
+ status: Status;
+ details: Record;
+}
+
+export interface StatusDetail {
+ status: Status;
+ description?: string;
+ details?: Record;
+ components?: Record;
+}
+
+export interface Info {
+ java?: JavaInfo;
+ os?: OSInfo;
+ process?: ProcessInfo;
+ ssl?: SSLInfo;
+}
+
+export interface JavaInfo {
+ version: string;
+ vendor: VendorInfo;
+ runtime: RuntimeInfo;
+ jvm: JVMInfo;
+}
+
+export interface VendorInfo {
+ name: string;
+}
+
+export interface RuntimeInfo {
+ name: string;
+ version: string;
+}
+
+export interface JVMInfo {
+ name: string;
+ vendor: string;
+ version: string;
+}
+
+export interface OSInfo {
+ name: string;
+ version: string;
+ arch: string;
+}
+
+export interface ProcessInfo {
+ pid: number;
+ parentPid: number;
+ owner: string;
+ cpus: number;
+ memory: MemoryInfo;
+}
+
+export interface MemoryInfo {
+ heap: HeapInfo;
+ nonHeap: HeapInfo;
+}
+
+export interface HeapInfo {
+ max: number;
+ committed: number;
+ used: number;
+ init: number;
+}
+
+export interface SSLInfo {
+ bundles: unknown[];
+}
+
+export interface Endpoint {
+ id: string;
+ url: string;
+}
diff --git a/website/src/app/core/models/chess/chess.models.ts b/website/src/app/core/models/chess/chess.models.ts
index d07f46cd..54c7713b 100644
--- a/website/src/app/core/models/chess/chess.models.ts
+++ b/website/src/app/core/models/chess/chess.models.ts
@@ -4,7 +4,6 @@ export interface Person {
id: string
firstname:string
lastname:string
- fideId?:string
federation?:string
birthday?:string
gender: Gender
@@ -14,7 +13,6 @@ export interface Person {
export interface WritePerson {
firstname:string
lastname:string
- fideId?:string
federation?:string
birthday?:string
gender: Gender
@@ -40,7 +38,8 @@ export interface Account {
export enum ChessPlatform{
CHESSCOM="CHESSCOM",
LICHESS="LICHESS",
- OVER_THE_BOARD="OVER_THE_BOARD"
+ FIDE="FIDE",
+ FREESTYLE="FREESTYLE"
}
export enum ChessGameType{
@@ -59,8 +58,9 @@ export interface ChessEvent {
embedUrl: string | undefined;
dateFrom: string | undefined;
dateTo: string | undefined;
+ internalComment: string;
+ platform: ChessPlatform;
categories: ChessEventCategory[];
- participants: Person[];
}
export interface WriteChessEvent {
@@ -70,6 +70,8 @@ export interface WriteChessEvent {
dateTo: string | undefined;
url: string | undefined;
embedUrl: string | undefined;
+ internalComment: string;
+ platform: ChessPlatform;
categoryIds: string[];
participantsIds: string[];
}
diff --git a/website/src/app/core/pipes/gender-icon.pipe.ts b/website/src/app/core/pipes/gender-icon.pipe.ts
index 23cfee04..867f1f90 100644
--- a/website/src/app/core/pipes/gender-icon.pipe.ts
+++ b/website/src/app/core/pipes/gender-icon.pipe.ts
@@ -8,10 +8,10 @@ import {faMars, faVenus, faVenusMars} from "@fortawesome/free-solid-svg-icons";
})
export class EventIconPipe implements PipeTransform {
- transform(person: Person): IconDefinition {
- if(person.gender == Gender.MALE)
+ transform(gender: Gender): IconDefinition {
+ if(gender == Gender.MALE)
return faMars
- if (person.gender == Gender.FEMALE)
+ if (gender == Gender.FEMALE)
return faVenus
return faVenusMars;
}
diff --git a/website/src/app/core/services/admin.service.ts b/website/src/app/core/services/admin.service.ts
new file mode 100644
index 00000000..02e52876
--- /dev/null
+++ b/website/src/app/core/services/admin.service.ts
@@ -0,0 +1,21 @@
+import {inject, Injectable} from "@angular/core";
+import {HttpClient} from "@angular/common/http";
+import {catchError, Observable} from "rxjs";
+import {environment} from "../../../environments/environment";
+import {HttpErrorHandler} from "../config/http-error-handler.service";
+import {UserInfoService} from "./user-info.service";
+import {Application} from "../models/admin/admin.model";
+
+@Injectable({providedIn: 'root'})
+export class AdminService {
+ private readonly http = inject(HttpClient);
+ private readonly httpErrorConfig = inject(HttpErrorHandler);
+ private readonly userInfoService = inject(UserInfoService);
+
+ applications(): Observable {
+ return this.http.get(environment.adminService + '/applications', {headers: {"Accept": "application/json"}})
+ .pipe(catchError(err => this.httpErrorConfig.handleError(err, this.userInfoService)));
+ }
+
+
+}
diff --git a/website/src/app/core/services/auth.service.ts b/website/src/app/core/services/auth.service.ts
index 395cdac9..d5923236 100644
--- a/website/src/app/core/services/auth.service.ts
+++ b/website/src/app/core/services/auth.service.ts
@@ -1,4 +1,4 @@
-import { Injectable, inject } from "@angular/core";
+import {inject, Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {Authentication, AuthenticationResponse, Register, RegisterResponse} from "../models/authentication.model";
import {environment} from "../../../environments/environment";
@@ -37,9 +37,6 @@ export class AuthService {
logout(){
localStorage.removeItem('Authentication');
- this.http.post(environment.authenticationService + '/logout', {})
- .pipe(catchError(err => this.httpErrorConfig.handleError(err, this.userInfoService)))
- .subscribe();
this.logoutEmitter.next();
this.router.home()
}
diff --git a/website/src/app/core/services/chess.service.ts b/website/src/app/core/services/chess.service.ts
index 1fba2681..3e80ed74 100644
--- a/website/src/app/core/services/chess.service.ts
+++ b/website/src/app/core/services/chess.service.ts
@@ -1,14 +1,17 @@
-import { Injectable, inject } from "@angular/core";
+import {inject, Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {
Account,
ChessEvent,
- ChessEventCategory, ChessEventCategoryWithEvents,
+ ChessEventCategory,
+ ChessEventCategoryWithEvents,
ChessGame,
Person,
SearchChessEvent,
SearchPerson,
- WriteChessEvent, WriteChessEventCategory, WritePerson
+ WriteChessEvent,
+ WriteChessEventCategory,
+ WritePerson
} from "../models/chess/chess.models";
import {catchError, Observable} from "rxjs";
import {environment} from "../../../environments/environment";
diff --git a/website/src/app/core/services/fitness.service.ts b/website/src/app/core/services/fitness.service.ts
index b171c79d..c44b4e4f 100644
--- a/website/src/app/core/services/fitness.service.ts
+++ b/website/src/app/core/services/fitness.service.ts
@@ -1,4 +1,4 @@
-import { Injectable, inject } from "@angular/core";
+import {inject, Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {catchError, Observable} from "rxjs";
import {environment} from "../../../environments/environment";
diff --git a/website/src/app/core/services/music.service.ts b/website/src/app/core/services/music.service.ts
index c979b6b3..2e16b46f 100644
--- a/website/src/app/core/services/music.service.ts
+++ b/website/src/app/core/services/music.service.ts
@@ -1,4 +1,4 @@
-import { Injectable, inject } from "@angular/core";
+import {inject, Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {HttpErrorHandler} from "../config/http-error-handler.service";
import {UserInfoService} from "./user-info.service";
diff --git a/website/src/app/core/services/permission.service.ts b/website/src/app/core/services/permission.service.ts
index 048c2921..dd76ff88 100644
--- a/website/src/app/core/services/permission.service.ts
+++ b/website/src/app/core/services/permission.service.ts
@@ -1,4 +1,4 @@
-import { Injectable, inject } from "@angular/core";
+import {inject, Injectable} from "@angular/core";
import {AuthService} from "./auth.service";
import {jwtDecode} from "jwt-decode";
import {JwtPayload} from "../models/jwtPayload.model";
diff --git a/website/src/app/core/services/router-navigation.service.ts b/website/src/app/core/services/router-navigation.service.ts
index 813eaf71..aaa24865 100644
--- a/website/src/app/core/services/router-navigation.service.ts
+++ b/website/src/app/core/services/router-navigation.service.ts
@@ -1,5 +1,5 @@
import {Router} from '@angular/router';
-import { Injectable, inject } from '@angular/core';
+import {inject, Injectable} from '@angular/core';
@Injectable({
providedIn: 'root'
diff --git a/website/src/app/fitness-settings/fitness-login/fitness-login.component.ts b/website/src/app/fitness-settings/fitness-login/fitness-login.component.ts
index e53583d8..cae2b14c 100644
--- a/website/src/app/fitness-settings/fitness-login/fitness-login.component.ts
+++ b/website/src/app/fitness-settings/fitness-login/fitness-login.component.ts
@@ -1,4 +1,4 @@
-import { Component, inject } from '@angular/core';
+import {Component, inject} from '@angular/core';
import {Button} from "primeng/button";
import {FitnessService} from "../../core/services/fitness.service";
import {RouterNavigationService} from "../../core/services/router-navigation.service";
diff --git a/website/src/app/fitness-settings/fitness-settings.component.ts b/website/src/app/fitness-settings/fitness-settings.component.ts
index e369d4e3..393351bb 100644
--- a/website/src/app/fitness-settings/fitness-settings.component.ts
+++ b/website/src/app/fitness-settings/fitness-settings.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {HeaderService} from "../core/services/header.service";
import {Sides} from "../core/config/sides";
import {FitnessLoginComponent} from "./fitness-login/fitness-login.component";
diff --git a/website/src/app/fitness/fitness-profile/fitness-profile.component.ts b/website/src/app/fitness/fitness-profile/fitness-profile.component.ts
index 6796d09e..d419d76f 100644
--- a/website/src/app/fitness/fitness-profile/fitness-profile.component.ts
+++ b/website/src/app/fitness/fitness-profile/fitness-profile.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {FitnessService} from "../../core/services/fitness.service";
import {Profile} from "../../core/models/fitness/profile.model";
import {NgIf} from "@angular/common";
diff --git a/website/src/app/fitness/fitness-sleep/fitness-sleep.component.ts b/website/src/app/fitness/fitness-sleep/fitness-sleep.component.ts
index ee5613be..c22c0eb5 100644
--- a/website/src/app/fitness/fitness-sleep/fitness-sleep.component.ts
+++ b/website/src/app/fitness/fitness-sleep/fitness-sleep.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {FitnessService} from "../../core/services/fitness.service";
import {Sleep} from "../../core/models/fitness/sleep.model";
import {SleepStagesChartComponent} from "./sleep-stages-chart/sleep-stages-chart.component";
diff --git a/website/src/app/fitness/fitness-sleep/sleep-stages-chart/sleep-stages-chart.component.ts b/website/src/app/fitness/fitness-sleep/sleep-stages-chart/sleep-stages-chart.component.ts
index e9add4cd..4678944a 100644
--- a/website/src/app/fitness/fitness-sleep/sleep-stages-chart/sleep-stages-chart.component.ts
+++ b/website/src/app/fitness/fitness-sleep/sleep-stages-chart/sleep-stages-chart.component.ts
@@ -1,4 +1,4 @@
-import { Component, ElementRef, OnChanges, SimpleChanges, input, viewChild, inject } from '@angular/core';
+import {Component, ElementRef, inject, input, OnChanges, SimpleChanges, viewChild} from '@angular/core';
import {SleepStage} from "../../../core/models/fitness/sleep.model";
import * as d3 from "d3";
diff --git a/website/src/app/fitness/fitness-weight/fitness-weight.component.ts b/website/src/app/fitness/fitness-weight/fitness-weight.component.ts
index a4b55334..5f280ce7 100644
--- a/website/src/app/fitness/fitness-weight/fitness-weight.component.ts
+++ b/website/src/app/fitness/fitness-weight/fitness-weight.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {Weight} from "../../core/models/fitness/weight.model";
import {FitnessService} from "../../core/services/fitness.service";
import {ChartModule} from "primeng/chart";
diff --git a/website/src/app/fitness/fitness.component.ts b/website/src/app/fitness/fitness.component.ts
index 6e9745c0..5dc8649d 100644
--- a/website/src/app/fitness/fitness.component.ts
+++ b/website/src/app/fitness/fitness.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {HeaderService} from "../core/services/header.service";
import {Sides} from "../core/config/sides";
import {FitnessWeightComponent} from "./fitness-weight/fitness-weight.component";
diff --git a/website/src/app/header/header.component.ts b/website/src/app/header/header.component.ts
index 580605bc..7a40c39d 100644
--- a/website/src/app/header/header.component.ts
+++ b/website/src/app/header/header.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject, OnDestroy, signal} from '@angular/core';
+import {Component, inject, OnDestroy, signal} from '@angular/core';
import {NavigationComponent} from "./navigation/navigation.component";
import {TranslateModule, TranslateService} from "@ngx-translate/core";
import {DropdownModule} from "primeng/dropdown";
diff --git a/website/src/app/header/navigation/navigation.component.ts b/website/src/app/header/navigation/navigation.component.ts
index b587180e..108d8537 100644
--- a/website/src/app/header/navigation/navigation.component.ts
+++ b/website/src/app/header/navigation/navigation.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject, signal, computed, OnDestroy} from '@angular/core';
+import {Component, inject, OnDestroy, OnInit, signal} from '@angular/core';
import {MenubarModule} from "primeng/menubar";
import {MenuItem} from "primeng/api";
import {TranslateModule} from "@ngx-translate/core";
diff --git a/website/src/app/home/home-card/home-card.component.spec.ts b/website/src/app/home/home-card/home-card.component.spec.ts
index 33c01f41..b2ede2a6 100644
--- a/website/src/app/home/home-card/home-card.component.spec.ts
+++ b/website/src/app/home/home-card/home-card.component.spec.ts
@@ -1,6 +1,6 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
+import {ComponentFixture, TestBed} from '@angular/core/testing';
-import { HomeCardComponent } from './home-card.component';
+import {HomeCardComponent} from './home-card.component';
describe('HomeCardComponent', () => {
let component: HomeCardComponent;
diff --git a/website/src/app/language-select/language-select.component.ts b/website/src/app/language-select/language-select.component.ts
index c656e69f..517027de 100644
--- a/website/src/app/language-select/language-select.component.ts
+++ b/website/src/app/language-select/language-select.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject, signal} from '@angular/core';
+import {Component, inject, OnInit, signal} from '@angular/core';
import {LanguageConfig} from "../core/config/language.config";
import {TranslateModule} from "@ngx-translate/core";
import {DropdownModule} from "primeng/dropdown";
diff --git a/website/src/app/login/login.component.ts b/website/src/app/login/login.component.ts
index ea3ca50b..fb4684ef 100644
--- a/website/src/app/login/login.component.ts
+++ b/website/src/app/login/login.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject, signal} from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms";
import {Button} from "primeng/button";
import {InputTextModule} from "primeng/inputtext";
@@ -62,6 +62,7 @@ export class LoginComponent implements OnInit{
if(username == "" || password == "")
return;
+ this.authService.logout();
this.authService.login(username, password)
}
diff --git a/website/src/app/logout/logout.component.ts b/website/src/app/logout/logout.component.ts
index b2b89c3e..4d0b2c7f 100644
--- a/website/src/app/logout/logout.component.ts
+++ b/website/src/app/logout/logout.component.ts
@@ -1,4 +1,4 @@
-import {Component, inject, signal, OnDestroy} from '@angular/core';
+import {Component, inject, OnDestroy, signal} from '@angular/core';
import {faArrowRightFromBracket} from "@fortawesome/free-solid-svg-icons";
import {FaIconComponent} from "@fortawesome/angular-fontawesome";
import {AuthService} from "../core/services/auth.service";
diff --git a/website/src/app/microservice-overview/microservice-overview.component.html b/website/src/app/microservice-overview/microservice-overview.component.html
index e69de29b..c73ff582 100644
--- a/website/src/app/microservice-overview/microservice-overview.component.html
+++ b/website/src/app/microservice-overview/microservice-overview.component.html
@@ -0,0 +1 @@
+
diff --git a/website/src/app/microservice-overview/microservice-overview.component.ts b/website/src/app/microservice-overview/microservice-overview.component.ts
index c4e0fedd..b8c10f65 100644
--- a/website/src/app/microservice-overview/microservice-overview.component.ts
+++ b/website/src/app/microservice-overview/microservice-overview.component.ts
@@ -1,16 +1,20 @@
import {Component, inject, OnInit} from '@angular/core';
import {HeaderService} from "../core/services/header.service";
import {Sides} from "../core/config/sides";
+import {MsApplicationsComponent} from "./ms-applications/ms-applications.component";
@Component({
selector: 'app-microservice-overview',
- imports: [],
+ imports: [
+ MsApplicationsComponent
+ ],
templateUrl: './microservice-overview.component.html',
styleUrl: './microservice-overview.component.scss'
})
export class MicroserviceOverviewComponent implements OnInit{
private readonly headerService = inject(HeaderService);
+
ngOnInit(): void {
this.headerService.changeTitle(Sides.microservices.translationKey)
}
diff --git a/website/src/app/microservice-overview/ms-application/ms-application.component.html b/website/src/app/microservice-overview/ms-application/ms-application.component.html
new file mode 100644
index 00000000..0890b6d8
--- /dev/null
+++ b/website/src/app/microservice-overview/ms-application/ms-application.component.html
@@ -0,0 +1,23 @@
+
+
+ {{application()?.name}}
+
+
+
+
+ {{instance.id}}
+
+
+
+
+ {{ detail.key }}
+
+
+ {{detail2.key}}: {{detail2.value}}
+
+
+
+
+
+
+
diff --git a/website/src/app/microservice-overview/ms-application/ms-application.component.scss b/website/src/app/microservice-overview/ms-application/ms-application.component.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/website/src/app/microservice-overview/ms-application/ms-application.component.ts b/website/src/app/microservice-overview/ms-application/ms-application.component.ts
new file mode 100644
index 00000000..3b66aeaf
--- /dev/null
+++ b/website/src/app/microservice-overview/ms-application/ms-application.component.ts
@@ -0,0 +1,29 @@
+import {Component, input} from '@angular/core';
+import {Card} from "primeng/card";
+import {KeyValuePipe, NgForOf} from "@angular/common";
+import {Application} from "../../core/models/admin/admin.model";
+import {MsStatusIconPipe} from "../pipes/ms-status-icon.pipe";
+import {FaIconComponent} from "@fortawesome/angular-fontawesome";
+import {MsStatusStylePipe} from "../pipes/ms-status-style.pipe";
+import {Accordion, AccordionContent, AccordionHeader, AccordionPanel} from "primeng/accordion";
+
+@Component({
+ selector: 'app-ms-application',
+ imports: [
+ Card,
+ NgForOf,
+ MsStatusIconPipe,
+ FaIconComponent,
+ MsStatusStylePipe,
+ KeyValuePipe,
+ AccordionPanel,
+ AccordionHeader,
+ AccordionContent,
+ Accordion
+ ],
+ templateUrl: './ms-application.component.html',
+ styleUrl: './ms-application.component.scss'
+})
+export class MsApplicationComponent {
+ application = input()
+}
diff --git a/website/src/app/microservice-overview/ms-applications/ms-applications.component.html b/website/src/app/microservice-overview/ms-applications/ms-applications.component.html
new file mode 100644
index 00000000..5b062ab0
--- /dev/null
+++ b/website/src/app/microservice-overview/ms-applications/ms-applications.component.html
@@ -0,0 +1,12 @@
+
diff --git a/website/src/app/microservice-overview/ms-applications/ms-applications.component.scss b/website/src/app/microservice-overview/ms-applications/ms-applications.component.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/website/src/app/microservice-overview/ms-applications/ms-applications.component.ts b/website/src/app/microservice-overview/ms-applications/ms-applications.component.ts
new file mode 100644
index 00000000..fb9e3139
--- /dev/null
+++ b/website/src/app/microservice-overview/ms-applications/ms-applications.component.ts
@@ -0,0 +1,23 @@
+import {Component, inject} from '@angular/core';
+import {NgForOf, NgIf} from "@angular/common";
+import {AdminService} from "../../core/services/admin.service";
+import {rxResource} from "@angular/core/rxjs-interop";
+import {MsApplicationComponent} from "../ms-application/ms-application.component";
+
+@Component({
+ selector: 'app-ms-applications',
+ imports: [
+ NgForOf,
+ NgIf,
+ MsApplicationComponent
+ ],
+ templateUrl: './ms-applications.component.html',
+ styleUrl: './ms-applications.component.scss'
+})
+export class MsApplicationsComponent {
+ private readonly adminService = inject(AdminService);
+
+ applications = rxResource({
+ loader: () => this.adminService.applications()
+ })
+}
diff --git a/website/src/app/microservice-overview/pipes/ms-status-icon.pipe.ts b/website/src/app/microservice-overview/pipes/ms-status-icon.pipe.ts
new file mode 100644
index 00000000..27828bc4
--- /dev/null
+++ b/website/src/app/microservice-overview/pipes/ms-status-icon.pipe.ts
@@ -0,0 +1,34 @@
+import {Pipe, PipeTransform} from '@angular/core';
+import {IconDefinition} from "@fortawesome/angular-fontawesome";
+import {faCircleCheck, faCircleExclamation, faCircleQuestion, faCircleXmark} from "@fortawesome/free-solid-svg-icons";
+import {Status} from "../../core/models/admin/admin.model";
+
+@Pipe({
+ name: 'msStatusIcon'
+})
+export class MsStatusIconPipe implements PipeTransform {
+
+ transform(value: String | undefined, ...args: unknown[]): IconDefinition {
+ if (value === undefined) {
+ return faCircleQuestion
+ }
+
+ if (value === Status.UP) {
+ return faCircleCheck
+ }
+
+ if (value === Status.DOWN) {
+ return faCircleXmark
+ }
+
+ if (value === Status.UNKNOWN) {
+ return faCircleQuestion
+ }
+ if (value === Status.OUT_OF_SERVICE){
+ return faCircleExclamation
+ }
+
+ return faCircleQuestion
+ }
+
+}
diff --git a/website/src/app/microservice-overview/pipes/ms-status-style.pipe.ts b/website/src/app/microservice-overview/pipes/ms-status-style.pipe.ts
new file mode 100644
index 00000000..1d2ca443
--- /dev/null
+++ b/website/src/app/microservice-overview/pipes/ms-status-style.pipe.ts
@@ -0,0 +1,32 @@
+import {Pipe, PipeTransform} from '@angular/core';
+import {Status} from "../../core/models/admin/admin.model";
+
+@Pipe({
+ name: 'msStatusStyle'
+})
+export class MsStatusStylePipe implements PipeTransform {
+
+ transform(value: String | undefined, ...args: unknown[]): String {
+ if (value === undefined) {
+ return "color: yellow"
+ }
+
+ if (value === Status.UP) {
+ return "color: green"
+ }
+
+ if (value === Status.DOWN) {
+ return "color: red"
+ }
+
+ if (value === Status.UNKNOWN) {
+ return "color: yellow"
+ }
+ if (value === Status.OUT_OF_SERVICE){
+ return "color: orange"
+ }
+
+ return "color: yellow"
+ }
+
+}
diff --git a/website/src/app/music-settings/music-login/music-login.component.ts b/website/src/app/music-settings/music-login/music-login.component.ts
index dade2747..23332ddb 100644
--- a/website/src/app/music-settings/music-login/music-login.component.ts
+++ b/website/src/app/music-settings/music-login/music-login.component.ts
@@ -1,4 +1,4 @@
-import { Component, inject } from '@angular/core';
+import {Component, inject} from '@angular/core';
import {Button} from "primeng/button";
import {RouterNavigationService} from "../../core/services/router-navigation.service";
import {MusicService} from "../../core/services/music.service";
diff --git a/website/src/app/music-settings/music-settings.component.ts b/website/src/app/music-settings/music-settings.component.ts
index 30822e27..13cbe8e1 100644
--- a/website/src/app/music-settings/music-settings.component.ts
+++ b/website/src/app/music-settings/music-settings.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {HeaderService} from "../core/services/header.service";
import {Sides} from "../core/config/sides";
import {MusicLoginComponent} from "./music-login/music-login.component";
diff --git a/website/src/app/music/music.component.ts b/website/src/app/music/music.component.ts
index 525c8d45..e8d067f3 100644
--- a/website/src/app/music/music.component.ts
+++ b/website/src/app/music/music.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, inject } from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {HeaderService} from "../core/services/header.service";
import {Sides} from '../core/config/sides';
diff --git a/website/src/app/mytheme.ts b/website/src/app/mytheme.ts
index e8c5e52d..11d9d107 100644
--- a/website/src/app/mytheme.ts
+++ b/website/src/app/mytheme.ts
@@ -1,5 +1,5 @@
import Lara from "@primeng/themes/lara";
-import { definePreset } from "@primeng/themes";
+import {definePreset} from "@primeng/themes";
export const MyPreset = definePreset(Lara, {
semantic: {
diff --git a/website/src/app/register/register.component.ts b/website/src/app/register/register.component.ts
index 2403db51..52365767 100644
--- a/website/src/app/register/register.component.ts
+++ b/website/src/app/register/register.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit, inject} from '@angular/core';
+import {Component, inject, OnInit} from '@angular/core';
import {Button} from "primeng/button";
import {CardModule} from "primeng/card";
import {FloatLabelModule} from "primeng/floatlabel";
diff --git a/website/src/app/shared/defer-placeholder/defer-placeholder.component.spec.ts b/website/src/app/shared/defer-placeholder/defer-placeholder.component.spec.ts
index e2c121a0..4311ea38 100644
--- a/website/src/app/shared/defer-placeholder/defer-placeholder.component.spec.ts
+++ b/website/src/app/shared/defer-placeholder/defer-placeholder.component.spec.ts
@@ -1,6 +1,6 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
+import {ComponentFixture, TestBed} from '@angular/core/testing';
-import { DeferPlaceholderComponent } from './defer-placeholder.component';
+import {DeferPlaceholderComponent} from './defer-placeholder.component';
describe('DeferPlaceholderComponent', () => {
let component: DeferPlaceholderComponent;
diff --git a/website/src/assets/i18n/de.json b/website/src/assets/i18n/de.json
index cdfb9ecd..671a298f 100644
--- a/website/src/assets/i18n/de.json
+++ b/website/src/assets/i18n/de.json
@@ -25,22 +25,29 @@
"size": "Anz."
},
"event": {
+ "account": "Account",
"birthday": "Geburtstag",
"chess-com": "Chess.com",
"date-from": "Von",
"date-to": "Bis",
"details": "Details",
"federation": "Verband",
- "fide": "Fide",
- "fide-website": "Fide Webseite",
"games": "Partien",
"location": "Standort",
+ "open-account": "Account öffnen",
"open-official-website": "Offizielle Webseite öffnen",
+ "organizer": "Veranstalter",
"participant": {
"firstname": "Vorname",
"lastname": "Nachname"
},
"participants": "Teilnehmer",
+ "sort": {
+ "birthday": "Geburtstag",
+ "federation": "Verband",
+ "firstname": "Vorname",
+ "lastname": "Nachname"
+ },
"title": "Titel"
},
"home": {
@@ -56,6 +63,12 @@
"player-analysis": "Player Analysis",
"settings": "Einstellungen"
},
+ "platform": {
+ "CHESSCOM": "Chess.com",
+ "FIDE": "Fide",
+ "FREESTYLE": "Freestyle",
+ "LICHESS": "Lichess"
+ },
"player": {
"firstname": "Vorname",
"lastname": "Nachname",
@@ -81,6 +94,9 @@
"fitness-settings": {
"title": "Fitness Einstellungen"
},
+ "general": {
+ "sort": "Sortieren"
+ },
"home": {
"about-me": {
"button": "Zu über mich",
diff --git a/website/src/assets/i18n/en.json b/website/src/assets/i18n/en.json
index 297c4688..4a30bb4a 100644
--- a/website/src/assets/i18n/en.json
+++ b/website/src/assets/i18n/en.json
@@ -25,22 +25,29 @@
"size": "Size"
},
"event": {
+ "account": "Account",
"birthday": "Birthday",
"chess-com": "Chess.com",
"date-from": "From",
"date-to": "Until",
"details": "Details",
"federation": "Federation",
- "fide": "Fide",
- "fide-website": "Fide Website",
"games": "Games",
"location": "Location",
+ "open-account": "Open account",
"open-official-website": "Open official website",
+ "organizer": "Organizer",
"participant": {
"firstname": "Firstname",
"lastname": "Lastname"
},
"participants": "Participants",
+ "sort": {
+ "birthday": "Birthday",
+ "federation": "Federation",
+ "firstname": "Firstname",
+ "lastname": "Lastname"
+ },
"title": "Title"
},
"home": {
@@ -56,6 +63,12 @@
"player-analysis": "Player Analysis",
"settings": "Settings"
},
+ "platform": {
+ "CHESSCOM": "Chess.com",
+ "FIDE": "Fide",
+ "FREESTYLE": "Freestyle",
+ "LICHESS": "Lichess"
+ },
"player": {
"firstname": "Firstname",
"lastname": "Lastname",
@@ -81,6 +94,9 @@
"fitness-settings": {
"title": "Fitness Settings"
},
+ "general": {
+ "sort": "Sort"
+ },
"home": {
"about-me": {
"button": "Go to about me",
| |