diff --git a/package-lock.json b/package-lock.json index 81d4795..d1c5b5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,6 @@ "@angular/router": "17.3.5", "@auth0/auth0-angular": "^2.2.1", "@fortawesome/fontawesome-free": "^6.5.1", - "@ngx-formly/core": "^6.1.8", - "@ngx-formly/material": "^6.1.8", "@types/node": "^20.14.2", "canvas-confetti": "^1.9.3", "confetti-js": "^0.0.18", @@ -3896,30 +3894,6 @@ "webpack": "^5.54.0" } }, - "node_modules/@ngx-formly/core": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-6.1.8.tgz", - "integrity": "sha512-WVInXYF/fJx7aNUn8y8mqLUaotxAmxbdMzC5GJwJ4oNa8a2kmwWIBAzfoe7YhyWR/t/pGANTu9tsYZaFtQxPVQ==", - "dependencies": { - "tslib": "^2.0.0" - }, - "peerDependencies": { - "@angular/forms": ">=13.2.0", - "rxjs": "^6.5.3 || ^7.0.0" - } - }, - "node_modules/@ngx-formly/material": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/@ngx-formly/material/-/material-6.1.8.tgz", - "integrity": "sha512-J7g/hL5g4zQQFz58TXZexhxNjicoHPRi6a+3lWKSSSv+zVyJrEy2ZFqohviHA5rm66esSHOpO2yWm0wQsjbmWA==", - "dependencies": { - "tslib": "^2.0.0" - }, - "peerDependencies": { - "@angular/material": ">=13.0.0", - "@ngx-formly/core": "6.1.8" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -17582,22 +17556,6 @@ "integrity": "sha512-0heI0yHUckdGI8uywu/wkp24KR/tdYMKYJOaYIU+9JydyN1zJRpbR7x0thddl7+k/zu2ZGbfFdv1779Ecw/xdA==", "dev": true }, - "@ngx-formly/core": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/@ngx-formly/core/-/core-6.1.8.tgz", - "integrity": "sha512-WVInXYF/fJx7aNUn8y8mqLUaotxAmxbdMzC5GJwJ4oNa8a2kmwWIBAzfoe7YhyWR/t/pGANTu9tsYZaFtQxPVQ==", - "requires": { - "tslib": "^2.0.0" - } - }, - "@ngx-formly/material": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/@ngx-formly/material/-/material-6.1.8.tgz", - "integrity": "sha512-J7g/hL5g4zQQFz58TXZexhxNjicoHPRi6a+3lWKSSSv+zVyJrEy2ZFqohviHA5rm66esSHOpO2yWm0wQsjbmWA==", - "requires": { - "tslib": "^2.0.0" - } - }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/package.json b/package.json index a26fe53..e0d6ff2 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,6 @@ "@angular/router": "17.3.5", "@auth0/auth0-angular": "^2.2.1", "@fortawesome/fontawesome-free": "^6.5.1", - "@ngx-formly/core": "^6.1.8", - "@ngx-formly/material": "^6.1.8", "@types/node": "^20.14.2", "canvas-confetti": "^1.9.3", "confetti-js": "^0.0.18", diff --git a/src/app/admin/admin.component.ts b/src/app/admin/admin.component.ts index 70335f0..d2bedfa 100644 --- a/src/app/admin/admin.component.ts +++ b/src/app/admin/admin.component.ts @@ -1,7 +1,7 @@ import { Component, inject, OnInit, signal } from '@angular/core'; import { Observable } from 'rxjs'; import { AuthService, User } from '@auth0/auth0-angular'; -import { AsyncPipe, JsonPipe, NgForOf, NgIf, NgTemplateOutlet } from '@angular/common'; +import { AsyncPipe, NgTemplateOutlet } from '@angular/common'; import { BlindLevelTabComponent } from './blind-level/blind-level-tab.component'; import { SeriesTabComponent } from './series/series-tab.component'; import { TournamentTabComponent } from './tournament/tournament-tab.component'; @@ -37,7 +37,6 @@ import { TimerStateService } from '../timer/services/timer-state.service'; AsyncPipe, MatSidenavModule, MatToolbarModule, - NgForOf, FormsModule, NullsafePrimitivePipe, MatCheckboxModule, @@ -45,8 +44,6 @@ import { TimerStateService } from '../timer/services/timer-state.service'; MatMenuModule, RouterOutlet, RouterLink, - JsonPipe, - NgIf, NgTemplateOutlet, RouterLinkActive ] diff --git a/src/app/admin/blind-level/admin-blind-level/admin-blind-level.component.ts b/src/app/admin/blind-level/admin-blind-level/admin-blind-level.component.ts index ee3213e..5f38394 100644 --- a/src/app/admin/blind-level/admin-blind-level/admin-blind-level.component.ts +++ b/src/app/admin/blind-level/admin-blind-level/admin-blind-level.component.ts @@ -18,9 +18,15 @@ import { CreatePauseComponent } from '../create-pause/create-pause.component'; @Component({ selector: 'app-admin-blind-level', + templateUrl: './admin-blind-level.component.html', standalone: true, - imports: [CommonModule, AppHeaderComponent, MatButtonModule, UserImageRoundComponent, RouterLink], - templateUrl: './admin-blind-level.component.html' + imports: [ + CommonModule, + AppHeaderComponent, + MatButtonModule, + UserImageRoundComponent, + RouterLink + ] }) export class AdminBlindLevelComponent implements OnInit { diff --git a/src/app/admin/blind-level/blind-level-tab.component.html b/src/app/admin/blind-level/blind-level-tab.component.html index b70d4f1..e470a24 100644 --- a/src/app/admin/blind-level/blind-level-tab.component.html +++ b/src/app/admin/blind-level/blind-level-tab.component.html @@ -36,9 +36,10 @@

Blind Levels

ALL - + + @for (d of durations$ | async; track d) { {{ d }} min - + } diff --git a/src/app/admin/blind-level/blind-level-tab.component.ts b/src/app/admin/blind-level/blind-level-tab.component.ts index 0afaacc..8919125 100644 --- a/src/app/admin/blind-level/blind-level-tab.component.ts +++ b/src/app/admin/blind-level/blind-level-tab.component.ts @@ -8,7 +8,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { map, shareReplay, switchMap, take, tap } from 'rxjs/operators'; import { DEFAULT_DIALOG_POSITION } from '../../shared/const/app.const'; import { CreateBlindLevelComponent } from './create-blind-level/create-blind-level.component'; -import { AsyncPipe, DecimalPipe, NgForOf, NgIf, NgTemplateOutlet } from '@angular/common'; +import { AsyncPipe, DecimalPipe, NgTemplateOutlet } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; import { UserImageRoundComponent } from '../../shared/components/user-image-round/user-image-round.component'; import { RouterLink } from '@angular/router'; @@ -26,8 +26,6 @@ import { FormsModule } from '@angular/forms'; imports: [ AsyncPipe, MatButtonModule, - NgForOf, - NgIf, UserImageRoundComponent, RouterLink, DecimalPipe, diff --git a/src/app/admin/blind-level/create-blind-level/create-blind-level.component.html b/src/app/admin/blind-level/create-blind-level/create-blind-level.component.html index fff1afb..1f6edfc 100644 --- a/src/app/admin/blind-level/create-blind-level/create-blind-level.component.html +++ b/src/app/admin/blind-level/create-blind-level/create-blind-level.component.html @@ -33,9 +33,11 @@

name="sb" /> - - Small Blind must be equal or smaller than Big Blind - + @if (model.sb() > model.bb()) { + + Small Blind must be equal or smaller than Big Blind + + } diff --git a/src/app/admin/blind-level/create-blind-level/create-blind-level.component.ts b/src/app/admin/blind-level/create-blind-level/create-blind-level.component.ts index 5119271..58ab2f6 100644 --- a/src/app/admin/blind-level/create-blind-level/create-blind-level.component.ts +++ b/src/app/admin/blind-level/create-blind-level/create-blind-level.component.ts @@ -5,7 +5,6 @@ import { catchError, take, tap } from 'rxjs/operators'; import { BlindLevel, BlindLevelModel } from '../../../shared/interfaces/blind-level.interface'; import { MatButtonModule } from '@angular/material/button'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { NgIf } from '@angular/common'; import { BaseAddDialogComponent } from '../../../shared/components/base-add-dialog/base-add-dialog.component'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -18,7 +17,6 @@ import { of } from 'rxjs'; imports: [ FormsModule, MatButtonModule, - NgIf, MatFormFieldModule, MatInputModule, ] diff --git a/src/app/admin/blind-level/create-pause/create-pause.component.ts b/src/app/admin/blind-level/create-pause/create-pause.component.ts index 72b5f21..eedf778 100644 --- a/src/app/admin/blind-level/create-pause/create-pause.component.ts +++ b/src/app/admin/blind-level/create-pause/create-pause.component.ts @@ -5,7 +5,6 @@ import { catchError, take, tap } from 'rxjs/operators'; import { BlindLevel, BlindLevelModel } from '../../../shared/interfaces/blind-level.interface'; import { MatButtonModule } from '@angular/material/button'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { NgIf } from '@angular/common'; import { BaseAddDialogComponent } from '../../../shared/components/base-add-dialog/base-add-dialog.component'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatFormFieldModule } from '@angular/material/form-field'; @@ -19,7 +18,6 @@ import { of } from 'rxjs'; imports: [ FormsModule, MatButtonModule, - NgIf, MatCheckboxModule, MatFormFieldModule, MatInputModule diff --git a/src/app/admin/blind-structure/admin-blind-structure/admin-blind-structure.component.ts b/src/app/admin/blind-structure/admin-blind-structure/admin-blind-structure.component.ts index abb2bc7..513d158 100644 --- a/src/app/admin/blind-structure/admin-blind-structure/admin-blind-structure.component.ts +++ b/src/app/admin/blind-structure/admin-blind-structure/admin-blind-structure.component.ts @@ -1,5 +1,5 @@ import { Component, DestroyRef, inject, OnInit } from '@angular/core'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; +import { AsyncPipe } from '@angular/common'; import { combineLatest, defer, iif, Observable, of, ReplaySubject } from 'rxjs'; import { BlindStructure } from '../../../shared/interfaces/blind-structure.interface'; import { User } from '@auth0/auth0-angular'; @@ -29,10 +29,8 @@ import { BlindLevel } from '../../../shared/interfaces/blind-level.interface'; RouterLink, AppHeaderComponent, AsyncPipe, - NgFor, MatButtonModule, - BlindStructureViewComponent, - NgIf + BlindStructureViewComponent ] }) export class AdminBlindStructureComponent implements OnInit { diff --git a/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.html b/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.html index 3b87d0e..7f5e751 100644 --- a/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.html +++ b/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.html @@ -19,7 +19,8 @@

Blind Structures

No of Blind Levels Actions - + + @for (blindStructure of blindStructures$ | async; track blindStructure.id) { @@ -42,6 +43,6 @@

Blind Structures

-
+ } diff --git a/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.ts b/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.ts index 4f6bc89..57f9de9 100644 --- a/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.ts +++ b/src/app/admin/blind-structure/blind-structure-tab/blind-structure-tab.component.ts @@ -8,10 +8,10 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { shareReplay, switchMap, take, tap } from 'rxjs/operators'; import { MatButtonModule } from '@angular/material/button'; import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ConfirmationDialogComponent } from '../../../dialogs/confirmation-dialog/confirmation-dialog.component'; import { DEFAULT_DIALOG_POSITION } from '../../../shared/const/app.const'; import { CreateBlindStructureComponent } from '../create-blind-structure/create-blind-structure.component'; +import { AsyncPipe } from '@angular/common'; @Component({ selector: 'app-blind-structure-tab', @@ -20,9 +20,7 @@ import { CreateBlindStructureComponent } from '../create-blind-structure/create- imports: [ MatButtonModule, RouterLink, - NgFor, - AsyncPipe, - NgIf + AsyncPipe ] }) export class BlindStructureTabComponent implements OnInit { diff --git a/src/app/admin/blind-structure/create-blind-structure/create-blind-structure.component.ts b/src/app/admin/blind-structure/create-blind-structure/create-blind-structure.component.ts index 4c853c0..c6ed2e4 100644 --- a/src/app/admin/blind-structure/create-blind-structure/create-blind-structure.component.ts +++ b/src/app/admin/blind-structure/create-blind-structure/create-blind-structure.component.ts @@ -15,7 +15,15 @@ import { take, tap } from 'rxjs/operators'; templateUrl: './create-blind-structure.component.html', styleUrls: ['./create-blind-structure.component.scss'], standalone: true, - imports: [CommonModule, FormsModule, MatButtonModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule, UserImageRoundComponent] + imports: [ + CommonModule, + FormsModule, + MatButtonModule, + MatFormFieldModule, + MatInputModule, + ReactiveFormsModule, + UserImageRoundComponent + ] }) export class CreateBlindStructureComponent implements OnInit { diff --git a/src/app/admin/branding/admin-branding/admin-branding.component.ts b/src/app/admin/branding/admin-branding/admin-branding.component.ts index 35cb105..2d20427 100644 --- a/src/app/admin/branding/admin-branding/admin-branding.component.ts +++ b/src/app/admin/branding/admin-branding/admin-branding.component.ts @@ -17,7 +17,12 @@ import { MatButtonModule } from '@angular/material/button'; @Component({ selector: 'app-admin-branding', standalone: true, - imports: [CommonModule, AppHeaderComponent, MatButtonModule, RouterLink], + imports: [ + CommonModule, + AppHeaderComponent, + MatButtonModule, + RouterLink + ], templateUrl: './admin-branding.component.html', }) export class AdminBrandingComponent implements OnInit { diff --git a/src/app/admin/branding/branding-tab.component.html b/src/app/admin/branding/branding-tab.component.html index fbc31ba..86c6294 100644 --- a/src/app/admin/branding/branding-tab.component.html +++ b/src/app/admin/branding/branding-tab.component.html @@ -19,7 +19,8 @@

Brandings

Name Description - + + @for (branding of brandings$ | async; track branding.id) { @@ -48,6 +49,6 @@

Brandings

-
+ } diff --git a/src/app/admin/branding/branding-tab.component.ts b/src/app/admin/branding/branding-tab.component.ts index 4b53509..f82f510 100644 --- a/src/app/admin/branding/branding-tab.component.ts +++ b/src/app/admin/branding/branding-tab.component.ts @@ -9,7 +9,7 @@ import { ConfirmationDialogComponent } from '../../dialogs/confirmation-dialog/c import { Branding } from '../../shared/interfaces/branding.interface'; import { BrandingApiService } from '../../shared/services/api/branding-api.service'; import { CreateBrandingComponent } from './create-branding/create-branding.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; +import { AsyncPipe } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; import { RouterLink } from '@angular/router'; @@ -21,8 +21,6 @@ import { RouterLink } from '@angular/router'; imports: [ AsyncPipe, MatButtonModule, - NgForOf, - NgIf, RouterLink ] }) diff --git a/src/app/admin/branding/create-branding/create-branding.component.ts b/src/app/admin/branding/create-branding/create-branding.component.ts index 47a68b3..6015836 100644 --- a/src/app/admin/branding/create-branding/create-branding.component.ts +++ b/src/app/admin/branding/create-branding/create-branding.component.ts @@ -1,12 +1,10 @@ import { Component, computed, inject, OnInit, signal } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { FormlyModule } from '@ngx-formly/core'; +import { FormsModule } from '@angular/forms'; import { Branding, BrandingModel } from '../../../shared/interfaces/branding.interface'; import { BrandingApiService } from '../../../shared/services/api/branding-api.service'; import { catchError, take, tap } from 'rxjs/operators'; import { MatButtonModule } from '@angular/material/button'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { NgIf } from '@angular/common'; import { BaseAddDialogComponent } from '../../../shared/components/base-add-dialog/base-add-dialog.component'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -16,7 +14,12 @@ import { of } from 'rxjs'; selector: 'app-create-branding', templateUrl: './create-branding.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, FormlyModule, MatButtonModule, NgIf, MatFormFieldModule, MatInputModule] + imports: [ + FormsModule, + MatButtonModule, + MatFormFieldModule, + MatInputModule + ] }) export class CreateBrandingComponent extends BaseAddDialogComponent implements OnInit { diff --git a/src/app/admin/location/admin-location/admin-location.component.ts b/src/app/admin/location/admin-location/admin-location.component.ts index d643e52..206ca87 100644 --- a/src/app/admin/location/admin-location/admin-location.component.ts +++ b/src/app/admin/location/admin-location/admin-location.component.ts @@ -17,7 +17,12 @@ import { MatButtonModule } from '@angular/material/button'; @Component({ selector: 'app-admin-location', standalone: true, - imports: [CommonModule, AppHeaderComponent, MatButtonModule, RouterLink], + imports: [ + CommonModule, + AppHeaderComponent, + MatButtonModule, + RouterLink + ], templateUrl: './admin-location.component.html', }) export class AdminLocationComponent implements OnInit { diff --git a/src/app/admin/location/create-location/create-location.component.ts b/src/app/admin/location/create-location/create-location.component.ts index b4a74c4..8ab9935 100644 --- a/src/app/admin/location/create-location/create-location.component.ts +++ b/src/app/admin/location/create-location/create-location.component.ts @@ -1,12 +1,10 @@ import { Component, computed, inject, OnInit, signal } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { FormlyModule } from '@ngx-formly/core'; +import { FormsModule } from '@angular/forms'; import { LocationApiService } from '../../../shared/services/api/location-api.service'; import { Location, LocationModel } from '../../../shared/interfaces/location.interface'; import { catchError, take, tap } from 'rxjs/operators'; import { MatButtonModule } from '@angular/material/button'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { NgIf } from '@angular/common'; import { BaseAddDialogComponent } from '../../../shared/components/base-add-dialog/base-add-dialog.component'; import { CreatePauseComponent } from '../../blind-level/create-pause/create-pause.component'; import { of } from 'rxjs'; @@ -17,7 +15,12 @@ import { MatInputModule } from '@angular/material/input'; selector: 'app-create-location', templateUrl: './create-location.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, FormlyModule, MatButtonModule, NgIf, MatFormFieldModule, MatInputModule] + imports: [ + FormsModule, + MatButtonModule, + MatFormFieldModule, + MatInputModule + ] }) export class CreateLocationComponent extends BaseAddDialogComponent implements OnInit { diff --git a/src/app/admin/location/location-tab.component.html b/src/app/admin/location/location-tab.component.html index ca6632e..b95789d 100644 --- a/src/app/admin/location/location-tab.component.html +++ b/src/app/admin/location/location-tab.component.html @@ -18,7 +18,7 @@

Locations

Image Name - + @for (location of locations$ | async; track location.id) { @@ -48,7 +48,7 @@

Locations

-
+ } diff --git a/src/app/admin/location/location-tab.component.ts b/src/app/admin/location/location-tab.component.ts index 305d60f..cb1680e 100644 --- a/src/app/admin/location/location-tab.component.ts +++ b/src/app/admin/location/location-tab.component.ts @@ -9,7 +9,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { shareReplay, switchMap, take, tap } from 'rxjs/operators'; import { DEFAULT_DIALOG_POSITION } from '../../shared/const/app.const'; import { ConfirmationDialogComponent } from '../../dialogs/confirmation-dialog/confirmation-dialog.component'; -import { AsyncPipe, DecimalPipe, NgForOf, NgIf } from '@angular/common'; +import { AsyncPipe, DecimalPipe } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; import { RouterLink } from '@angular/router'; @@ -18,7 +18,13 @@ import { RouterLink } from '@angular/router'; templateUrl: './location-tab.component.html', styleUrls: ['./location-tab.component.scss'], standalone: true, - imports: [CreateLocationComponent, AsyncPipe, DecimalPipe, MatButtonModule, NgForOf, NgIf, RouterLink] + imports: [ + CreateLocationComponent, + AsyncPipe, + DecimalPipe, + MatButtonModule, + RouterLink + ] }) export class LocationTabComponent implements OnInit { diff --git a/src/app/admin/players/admin-player/admin-player.component.ts b/src/app/admin/players/admin-player/admin-player.component.ts index e6fe099..22af75d 100644 --- a/src/app/admin/players/admin-player/admin-player.component.ts +++ b/src/app/admin/players/admin-player/admin-player.component.ts @@ -19,9 +19,16 @@ import { ThatsMeDialogComponent } from '../../../welcome/components/dialogs/that @Component({ selector: 'app-admin-player', + templateUrl: './admin-player.component.html', standalone: true, - imports: [CommonModule, AppHeaderComponent, RouterLink, MatButtonModule, MatTabsModule, UserImageRoundComponent], - templateUrl: './admin-player.component.html' + imports: [ + CommonModule, + AppHeaderComponent, + RouterLink, + MatButtonModule, + MatTabsModule, + UserImageRoundComponent + ] }) export class AdminPlayerComponent implements OnInit { diff --git a/src/app/admin/players/players-tab/players-tab.component.ts b/src/app/admin/players/players-tab/players-tab.component.ts index 0d0a2d1..e9f3b5e 100644 --- a/src/app/admin/players/players-tab/players-tab.component.ts +++ b/src/app/admin/players/players-tab/players-tab.component.ts @@ -17,7 +17,12 @@ import { CreatePlayerComponent } from '../../../dialogs/create-player/create-pla @Component({ selector: 'app-players-tab', standalone: true, - imports: [CommonModule, MatButtonModule, RouterLink, UserImageRoundComponent], + imports: [ + CommonModule, + MatButtonModule, + RouterLink, + UserImageRoundComponent + ], templateUrl: './players-tab.component.html', }) export class PlayersTabComponent implements OnInit { diff --git a/src/app/admin/series/admin-series/admin-series.component.ts b/src/app/admin/series/admin-series/admin-series.component.ts index 804a5f8..cddaa06 100644 --- a/src/app/admin/series/admin-series/admin-series.component.ts +++ b/src/app/admin/series/admin-series/admin-series.component.ts @@ -27,7 +27,18 @@ import { UserWithImageComponent } from '../../../shared/components/user-with-ima @Component({ selector: 'app-admin-series', standalone: true, - imports: [CommonModule, AppHeaderComponent, MatButtonModule, MatTabsModule, UserImageRoundComponent, RouterLink, MatFormFieldModule, MatOptionModule, MatSelectModule, UserWithImageComponent], + imports: [ + CommonModule, + AppHeaderComponent, + MatButtonModule, + MatTabsModule, + UserImageRoundComponent, + RouterLink, + MatFormFieldModule, + MatOptionModule, + MatSelectModule, + UserWithImageComponent + ], templateUrl: './admin-series.component.html', }) export class AdminSeriesComponent implements OnInit { diff --git a/src/app/admin/series/create-series/create-series.component.html b/src/app/admin/series/create-series/create-series.component.html index 7f2e579..f1a7b81 100644 --- a/src/app/admin/series/create-series/create-series.component.html +++ b/src/app/admin/series/create-series/create-series.component.html @@ -8,9 +8,73 @@

+ + Name + + + + + Short Description + + + + + Long Description + + + + + Branding + + @for (branding of allBrandings$ | async; track branding) { + + {{ branding.label }} + + } + + + + + Points Formula + + @for (formula of formulas$ | async; track formula) { + + {{ formula.label }} + + } + + + Learn more about formulas - + + % of Pot to Final Tournament + + + + + Max Amount of Pot to Final Tournament + + + + + Number of Tournaments in Series + + + + + Number of Finalists + + + + + Password + + + +

This password is used for sharing series information with users without login.

+ + + Owner email + + + + + Is Test? + + + + Show Prices in Series overview? + + + + Show non-ITM places in Series overview? + + + + Show Eliminations in Series overview? + + + + Show Live Ticker in Series overview? + + + + Show average Rank in Series overview? + + + @if (isLoadingAdd) { +
+ +
+ }
diff --git a/src/app/dialogs/add-pause/add-pause.component.ts b/src/app/dialogs/add-pause/add-pause.component.ts index 1fd7c83..8e0150b 100644 --- a/src/app/dialogs/add-pause/add-pause.component.ts +++ b/src/app/dialogs/add-pause/add-pause.component.ts @@ -1,44 +1,44 @@ -import { Component, DestroyRef, inject, OnInit } from '@angular/core'; -import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { FormlyFieldConfig, FormlyFormOptions, FormlyModule } from '@ngx-formly/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { FormlyFieldService } from '../../shared/services/util/formly-field.service'; +import { Component, computed, DestroyRef, inject, OnInit, signal } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { BlindLevelApiService } from '../../shared/services/api/blind-level-api.service'; import { TournamentApiService } from '../../shared/services/api/tournament-api.service'; -import { AuthService } from '@auth0/auth0-angular'; -import { BehaviorSubject, combineLatest } from 'rxjs'; -import { shareReplay, take, tap } from 'rxjs/operators'; +import { BehaviorSubject, combineLatest, of } from 'rxjs'; +import { catchError, shareReplay, take, tap } from 'rxjs/operators'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { BlindLevel } from '../../shared/interfaces/blind-level.interface'; import { MatButtonModule } from '@angular/material/button'; import { MatRadioModule } from '@angular/material/radio'; import { BlindStructureApiService } from '../../shared/services/api/blind-structure-api.service'; +import { BaseAddDialogComponent } from '../../shared/components/base-add-dialog/base-add-dialog.component'; +import { AddPlayerComponent } from '../add-player/add-player.component'; +import { AddPauseModel } from './add-pause-model.interface'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatOptionModule } from '@angular/material/core'; +import { MatSelectModule } from '@angular/material/select'; @Component({ selector: 'app-add-pause', templateUrl: './add-pause.component.html', styleUrls: ['./add-pause.component.scss'], standalone: true, - imports: [MatRadioModule, FormsModule, ReactiveFormsModule, FormlyModule, MatButtonModule] + imports: [ + MatRadioModule, + FormsModule, + MatButtonModule, + MatFormFieldModule, + MatOptionModule, + MatSelectModule + ] }) -export class AddPauseComponent implements OnInit { +export class AddPauseComponent extends BaseAddDialogComponent implements OnInit { - form = new FormGroup({}); - options: FormlyFormOptions = {}; - model: { - blindId: number | undefined, - parentId: number - }; - fields: FormlyFieldConfig[]; - - private dialogRef: MatDialogRef = inject(MatDialogRef); data: { tId: number | undefined, sId: number | undefined, position: number } = inject(MAT_DIALOG_DATA); - private formlyFieldService: FormlyFieldService = inject(FormlyFieldService); private blindApiService: BlindLevelApiService = inject(BlindLevelApiService); private tournamentApiService: TournamentApiService = inject(TournamentApiService); private blindStructureApiService: BlindStructureApiService = inject(BlindStructureApiService); @@ -49,6 +49,8 @@ export class AddPauseComponent implements OnInit { private filterDurationTrigger$ = new BehaviorSubject(0); ngOnInit(): void { + this.initModel(); + const allBlinds$ = this.blindApiService.getAll$().pipe( shareReplay(1) ); @@ -76,9 +78,6 @@ export class AddPauseComponent implements OnInit { value: b.id }) ); - - this.initModel(); - this.initFields(); }) ).subscribe(); } @@ -93,52 +92,52 @@ export class AddPauseComponent implements OnInit { private initModel(): void { this.model = { - blindId: undefined, - parentId: this.data.tId ?? this.data.sId ?? -1 + blindId: signal(undefined), + parentId: signal(this.data.tId ?? this.data.sId ?? -1), + isValid: computed(() => this.model.blindId() !== undefined) }; } - private initFields(): void { - this.fields = [ - this.formlyFieldService.getDefaultSelectField('blindId', 'Blind Level', true, this.allPauses) - ]; - } - onFilterDurationChange(event: number): void { this.filterDurationTrigger$.next(event); } - onSubmit(model: { blindId: number | undefined, parentId: number }): void { - if (model.blindId && model.parentId && model.parentId >= 0) { + onSubmit(): void { + if (this.model.blindId() && this.model.parentId() && this.model.parentId() >= 0) { + this.isLoadingAdd = true; if (this.data.tId) { - this.tournamentApiService.addPause$(model.blindId, model.parentId, this.data.position).pipe( + this.tournamentApiService.addPause$(this.model.blindId()!, this.model.parentId(), this.data.position).pipe( take(1), tap(() => { if (this.dialogRef) { this.dialogRef.close(true); + this.isLoadingAdd = false; } + }), + catchError(() => { + this.isLoadingAdd = false; + return of(null); }) ).subscribe(); } if (this.data.sId) { - this.blindStructureApiService.addPause$(model.blindId, model.parentId, this.data.position).pipe( + this.blindStructureApiService.addPause$(this.model.blindId()!, this.model.parentId(), this.data.position).pipe( take(1), tap(() => { if (this.dialogRef) { this.dialogRef.close(true); + this.isLoadingAdd = false; } + }), + catchError(() => { + this.isLoadingAdd = false; + return of(null); }) ).subscribe(); } } } - closeDialog(event: Event): void { - event.preventDefault(); - - this.dialogRef.close(false); - } - } diff --git a/src/app/dialogs/add-player/add-player.component.ts b/src/app/dialogs/add-player/add-player.component.ts index a667c5a..793f0d2 100644 --- a/src/app/dialogs/add-player/add-player.component.ts +++ b/src/app/dialogs/add-player/add-player.component.ts @@ -1,7 +1,6 @@ import { Component, computed, inject, OnInit, signal, Signal, WritableSignal } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { FormlyModule } from '@ngx-formly/core'; +import { FormsModule } from '@angular/forms'; import { catchError, switchMap, take, tap } from 'rxjs/operators'; import { TournamentApiService } from '../../shared/services/api/tournament-api.service'; import { Tournament } from '../../shared/interfaces/tournament.interface'; @@ -15,7 +14,6 @@ import { FinishApiService } from '../../shared/services/api/finish-api.service'; import { Finish } from '../../shared/interfaces/finish.interface'; import { UserImageRoundComponent } from '../../shared/components/user-image-round/user-image-round.component'; import { MatButtonModule } from '@angular/material/button'; -import { NgFor, NgIf } from '@angular/common'; import { TournamentService } from '../../shared/services/util/tournament.service'; import { TimerStateService } from '../../timer/services/timer-state.service'; import { AddPlayerModel } from './add-player-model.interface'; @@ -31,7 +29,15 @@ import { UserWithImageComponent } from '../../shared/components/user-with-image/ templateUrl: './add-player.component.html', styleUrls: ['./add-player.component.scss'], standalone: true, - imports: [NgIf, FormsModule, ReactiveFormsModule, FormlyModule, MatButtonModule, NgFor, UserImageRoundComponent, MatFormFieldModule, MatOptionModule, MatSelectModule, UserWithImageComponent] + imports: [ + FormsModule, + MatButtonModule, + UserImageRoundComponent, + MatFormFieldModule, + MatOptionModule, + MatSelectModule, + UserWithImageComponent + ] }) export class AddPlayerComponent extends BaseAddDialogComponent implements OnInit { diff --git a/src/app/dialogs/add-rebuy/add-rebuy.component.ts b/src/app/dialogs/add-rebuy/add-rebuy.component.ts index 96d012f..bdf8aaf 100644 --- a/src/app/dialogs/add-rebuy/add-rebuy.component.ts +++ b/src/app/dialogs/add-rebuy/add-rebuy.component.ts @@ -1,6 +1,5 @@ import { Component, computed, inject, OnInit, signal, Signal } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { FormlyModule } from '@ngx-formly/core'; +import { FormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { catchError, switchMap, take, tap } from 'rxjs/operators'; import { FetchService } from '../../shared/services/fetch.service'; @@ -10,7 +9,7 @@ import { defer, iif, of } from 'rxjs'; import { NotificationService } from '../../shared/services/notification.service'; import { TournamentService } from '../../shared/services/util/tournament.service'; import { UserImageRoundComponent } from '../../shared/components/user-image-round/user-image-round.component'; -import { DatePipe, JsonPipe, NgFor, NgIf } from '@angular/common'; +import { DatePipe } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; import { TimerStateService } from '../../timer/services/timer-state.service'; import { AddRebuyModel } from './add-rebuy-model.interface'; @@ -26,7 +25,16 @@ import { UserWithImageComponent } from '../../shared/components/user-with-image/ templateUrl: './add-rebuy.component.html', styleUrls: ['./add-rebuy.component.scss'], standalone: true, - imports: [FormsModule, ReactiveFormsModule, FormlyModule, MatButtonModule, NgIf, NgFor, UserImageRoundComponent, DatePipe, JsonPipe, MatFormFieldModule, MatOptionModule, MatSelectModule, UserWithImageComponent] + imports: [ + FormsModule, + MatButtonModule, + UserImageRoundComponent, + DatePipe, + MatFormFieldModule, + MatOptionModule, + MatSelectModule, + UserWithImageComponent + ] }) export class AddRebuyComponent extends BaseAddDialogComponent implements OnInit { diff --git a/src/app/dialogs/add-tournament/add-tournament-model.interface.ts b/src/app/dialogs/add-tournament/add-tournament-model.interface.ts new file mode 100644 index 0000000..4a1956a --- /dev/null +++ b/src/app/dialogs/add-tournament/add-tournament-model.interface.ts @@ -0,0 +1,7 @@ +import { Signal, WritableSignal } from '@angular/core'; + +export interface AddTournamentModel { + seriesId: WritableSignal; + tournamentId: WritableSignal; + isValid: Signal; +} diff --git a/src/app/dialogs/add-tournament/add-tournament.component.html b/src/app/dialogs/add-tournament/add-tournament.component.html index 3848a77..e74d94c 100644 --- a/src/app/dialogs/add-tournament/add-tournament.component.html +++ b/src/app/dialogs/add-tournament/add-tournament.component.html @@ -1,19 +1,41 @@
- + + Tournament * + + @for (tournament of allTournaments; track tournament) { + + {{ tournament.label }} + + } + + + + + + @if (isLoadingAdd) { +
+ +
+ }
diff --git a/src/app/dialogs/add-tournament/add-tournament.component.scss b/src/app/dialogs/add-tournament/add-tournament.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/dialogs/add-tournament/add-tournament.component.ts b/src/app/dialogs/add-tournament/add-tournament.component.ts index cfb398b..d6a8346 100644 --- a/src/app/dialogs/add-tournament/add-tournament.component.ts +++ b/src/app/dialogs/add-tournament/add-tournament.component.ts @@ -1,71 +1,75 @@ -import { Component, DestroyRef, inject, OnInit } from '@angular/core'; -import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { FormlyFieldConfig, FormlyFormOptions, FormlyModule } from '@ngx-formly/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { FormlyFieldService } from '../../shared/services/util/formly-field.service'; +import { Component, computed, DestroyRef, inject, OnInit, signal } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { TournamentApiService } from '../../shared/services/api/tournament-api.service'; import { SeriesApiService } from '../../shared/services/api/series-api.service'; -import { take, tap } from 'rxjs/operators'; +import { catchError, take, tap } from 'rxjs/operators'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatButtonModule } from '@angular/material/button'; import { Series } from '../../shared/interfaces/series.interface'; +import { BaseAddDialogComponent } from '../../shared/components/base-add-dialog/base-add-dialog.component'; +import { AddTournamentModel } from './add-tournament-model.interface'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatOptionModule } from '@angular/material/core'; +import { MatSelectModule } from '@angular/material/select'; +import { of } from 'rxjs'; @Component({ selector: 'app-add-tournament', templateUrl: './add-tournament.component.html', - styleUrls: ['./add-tournament.component.scss'], standalone: true, - imports: [FormsModule, ReactiveFormsModule, FormlyModule, MatButtonModule] + imports: [ + FormsModule, + MatButtonModule, + MatFormFieldModule, + MatOptionModule, + MatSelectModule + ] }) -export class AddTournamentComponent implements OnInit { +export class AddTournamentComponent extends BaseAddDialogComponent implements OnInit { - form = new FormGroup({}); - options: FormlyFormOptions = {}; - model: { seriesId: number, tournamentId: number | undefined }; - fields: FormlyFieldConfig[]; - - private dialogRef: MatDialogRef = inject(MatDialogRef); data: { series: Series } = inject(MAT_DIALOG_DATA); private tournamentApiService: TournamentApiService = inject(TournamentApiService); - private formlyFieldService: FormlyFieldService = inject(FormlyFieldService); private seriesApiService: SeriesApiService = inject(SeriesApiService); private destroyRef: DestroyRef = inject(DestroyRef); allTournaments: { label: string, value: number }[]; ngOnInit(): void { + this.initModel(); + this.tournamentApiService.getAllWithoutSeries$().pipe( takeUntilDestroyed(this.destroyRef), tap((t: { label: string, value: number }[]) => { this.allTournaments = t; - this.initModel(); - this.initFields(); }) ).subscribe(); } initModel(): void { this.model = { - seriesId: this.data.series.id, - tournamentId: undefined + seriesId: signal(this.data.series.id), + tournamentId: signal(undefined), + isValid: computed(() => this.model.tournamentId() !== undefined) }; } - initFields(): void { - this.fields = [ - this.formlyFieldService.getDefaultSelectField('tournamentId', 'Tournament', true, this.allTournaments) - ]; - } + onSubmit(): void { + this.isLoadingAdd = true; - onSubmit(model: { seriesId: number, tournamentId: number | undefined }): void { - if (model.seriesId && model.tournamentId) { - this.seriesApiService.addTournament$(model.tournamentId, this.data.series.id).pipe( + if (this.model.seriesId() && this.model.tournamentId()) { + this.seriesApiService.addTournament$(this.model.tournamentId()!, this.data.series.id).pipe( take(1), tap(() => { if (this.dialogRef) { this.dialogRef.close(); + this.isLoadingAdd = false; } + }), + catchError(() => { + this.isLoadingAdd = false; + return of(null); }) ).subscribe(); } diff --git a/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.ts index e2ea9ad..006c3a0 100644 --- a/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { MatButtonModule } from '@angular/material/button'; @Component({ @@ -7,7 +7,10 @@ import { MatButtonModule } from '@angular/material/button'; templateUrl: './confirmation-dialog.component.html', styleUrls: ['./confirmation-dialog.component.scss'], standalone: true, - imports: [MatDialogModule, MatButtonModule] + imports: [ + MatDialogModule, + MatButtonModule + ] }) export class ConfirmationDialogComponent { diff --git a/src/app/dialogs/create-player/create-player.component.ts b/src/app/dialogs/create-player/create-player.component.ts index 9abdf3b..f8877e1 100644 --- a/src/app/dialogs/create-player/create-player.component.ts +++ b/src/app/dialogs/create-player/create-player.component.ts @@ -9,14 +9,19 @@ import { MatInputModule } from '@angular/material/input'; import { MatFormFieldModule } from '@angular/material/form-field'; import { UserImageRoundComponent } from '../../shared/components/user-image-round/user-image-round.component'; import { FormsModule } from '@angular/forms'; -import { JsonPipe, NgIf } from '@angular/common'; @Component({ selector: 'app-edit-player', templateUrl: './create-player.component.html', styleUrls: ['./create-player.component.scss'], standalone: true, - imports: [FormsModule, UserImageRoundComponent, MatFormFieldModule, MatInputModule, MatButtonModule, NgIf, JsonPipe] + imports: [ + FormsModule, + UserImageRoundComponent, + MatFormFieldModule, + MatInputModule, + MatButtonModule, + ] }) export class CreatePlayerComponent implements OnInit { diff --git a/src/app/dialogs/make-deal/make-deal-model.interface.ts b/src/app/dialogs/make-deal/make-deal-model.interface.ts new file mode 100644 index 0000000..823c81e --- /dev/null +++ b/src/app/dialogs/make-deal/make-deal-model.interface.ts @@ -0,0 +1,3 @@ +export interface MakeDealModel { + [key: string]: number; +} diff --git a/src/app/dialogs/make-deal/make-deal.component.html b/src/app/dialogs/make-deal/make-deal.component.html index a9c7eda..df6e031 100644 --- a/src/app/dialogs/make-deal/make-deal.component.html +++ b/src/app/dialogs/make-deal/make-deal.component.html @@ -16,16 +16,22 @@

- + + @for (payout of model | keyvalue; track payout) { + + {{ +payout.key + 1 }} + + + }

+ + + + @if (isLoadingAdd) { +
+ +
+ } + diff --git a/src/app/dialogs/make-deal/make-deal.component.ts b/src/app/dialogs/make-deal/make-deal.component.ts index c9c0b23..48003f6 100644 --- a/src/app/dialogs/make-deal/make-deal.component.ts +++ b/src/app/dialogs/make-deal/make-deal.component.ts @@ -1,11 +1,8 @@ import { Component, inject, OnInit, WritableSignal } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; import { Tournament } from '../../shared/interfaces/tournament.interface'; import { SeriesMetadata } from '../../shared/interfaces/series.interface'; import { Player } from '../../shared/interfaces/player.interface'; -import { FormlyFieldConfig, FormlyFormOptions, FormlyModule } from '@ngx-formly/core'; -import { FormGroup, FormsModule } from '@angular/forms'; -import { FormlyFieldService } from '../../shared/services/util/formly-field.service'; +import { FormsModule } from '@angular/forms'; import { forkJoin, Observable, of } from 'rxjs'; import { ServerResponse } from '../../shared/interfaces/server-response'; import { FinishApiService } from '../../shared/services/api/finish-api.service'; @@ -18,33 +15,36 @@ import { TEventType } from '../../shared/enums/t-event-type.enum'; import { MatButtonModule } from '@angular/material/button'; import { TournamentService } from '../../shared/services/util/tournament.service'; import { TimerStateService } from '../../timer/services/timer-state.service'; +import { BaseAddDialogComponent } from '../../shared/components/base-add-dialog/base-add-dialog.component'; +import { MakeDealModel } from './make-deal-model.interface'; +import { KeyValuePipe } from '@angular/common'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; @Component({ selector: 'app-make-deal', templateUrl: './make-deal.component.html', styleUrls: ['./make-deal.component.scss'], standalone: true, - imports: [FormsModule, FormlyModule, MatButtonModule] + imports: [ + FormsModule, + MatButtonModule, + KeyValuePipe, + MatFormFieldModule, + MatInputModule + ] }) -export class MakeDealComponent implements OnInit { +export class MakeDealComponent extends BaseAddDialogComponent implements OnInit { tournament: WritableSignal; metadata: WritableSignal; - private dialogRef: MatDialogRef = inject(MatDialogRef); - - form = new FormGroup({}); - options: FormlyFormOptions = {}; - fields: FormlyFieldConfig[]; - model: { [key: string]: number } = {}; - toDistribute: number = 0; rankAfterDeal: number; total: number = 0; keys: string[]; private finishApiService: FinishApiService = inject(FinishApiService); - private formlyFieldService: FormlyFieldService = inject(FormlyFieldService); private fetchService: FetchService = inject(FetchService); private tournamentService: TournamentService = inject(TournamentService); private rankingService: RankingService = inject(RankingService); @@ -53,6 +53,7 @@ export class MakeDealComponent implements OnInit { private state: TimerStateService = inject(TimerStateService); ngOnInit(): void { + this.model = {}; this.tournament = this.state.tournament; this.metadata = this.state.metadata; @@ -78,7 +79,6 @@ export class MakeDealComponent implements OnInit { const remainingPlaces = Array.from({length: noOfRemainingPlaces}, (_, i) => i + 1); this.rankAfterDeal = remainingPlaces.reduce((acc, curr) => acc + curr, 0) / remainingPlaces.length; - this.fields = []; this.keys = []; remainingPlayers.forEach( @@ -86,17 +86,14 @@ export class MakeDealComponent implements OnInit { const key = player.id.toString(); this.keys.push(key); this.model[key] = 0; - - this.fields.push({ - ...this.formlyFieldService.getDefaultNumberField(key, player.name, true), - }); }); } - modelChange(model: { [key: string]: number }): void { + modelChange(key: string, amount: number): void { this.total = 0; + this.model[key] = amount; - this.keys.forEach(k => this.total += model[k]); + this.keys.forEach(k => this.total += this.model[k]); } distributeEvenly(event: Event): void { @@ -106,18 +103,19 @@ export class MakeDealComponent implements OnInit { const even = total / noOfRemainingPlaces; - this.keys.forEach((key: string) => this.form.get(key)?.patchValue(even)); - - this.form.updateValueAndValidity(); + this.keys.forEach((key: string) => this.model[key] = even); + this.total = total; } - onSubmit(model: { [key: string]: number }): void { + onSubmit(): void { + this.isLoadingAdd = true; + const streams: Observable[] = []; this.keys.forEach(k => { streams.push( this.finishApiService.post$({ playerId: +k, - price: model[k], + price: this.model[k], rank: this.rankAfterDeal, tournamentId: this.tournament().id, timestamp: -1, @@ -127,10 +125,6 @@ export class MakeDealComponent implements OnInit { forkJoin(streams).pipe( take(1), - catchError(() => { - this.notificationService.error(`Error making Deal`); - return of(null); - }), tap(() => { this.notificationService.success('Deal was made'); }), @@ -159,7 +153,7 @@ export class MakeDealComponent implements OnInit { this.keys.forEach(k => { const name = this.tournament().players.filter(e => e.id === +k)[0].name; - message += `
${name}: ${model[k]}.-`; + message += `
${name}: ${this.model[k]}.-`; }); return this.tEventApiService.post$(this.tournament().id, message, TEventType.DEAL); @@ -170,7 +164,14 @@ export class MakeDealComponent implements OnInit { if (this.dialogRef) { this.dialogRef.close(); } - }) + + this.isLoadingAdd = false; + }), + catchError(() => { + this.notificationService.error(`Error making Deal`); + this.isLoadingAdd = false; + return of(null); + }), ).subscribe(); } diff --git a/src/app/dialogs/map-player/map-player.component.html b/src/app/dialogs/map-player/map-player.component.html index b32b84f..0b6bf36 100644 --- a/src/app/dialogs/map-player/map-player.component.html +++ b/src/app/dialogs/map-player/map-player.component.html @@ -23,11 +23,11 @@

(selectionChange)="selectPlayer($event.value)" name="model" > - + @for (p of allMappablePlayers; track p.id) { {{ p.name }} - + } } diff --git a/src/app/dialogs/map-player/map-player.component.ts b/src/app/dialogs/map-player/map-player.component.ts index b030963..73385fe 100644 --- a/src/app/dialogs/map-player/map-player.component.ts +++ b/src/app/dialogs/map-player/map-player.component.ts @@ -10,7 +10,6 @@ import { MatButtonModule } from '@angular/material/button'; import { MatOptionModule } from '@angular/material/core'; import { MatSelectModule } from '@angular/material/select'; import { MatFormFieldModule } from '@angular/material/form-field'; -import { NgFor, NgIf } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { NotificationService } from '../../shared/services/notification.service'; import { ConnectionRequestState } from '../../shared/enums/connection-request-state.enum'; @@ -20,7 +19,13 @@ import { ConnectionRequestState } from '../../shared/enums/connection-request-st templateUrl: './map-player.component.html', styleUrls: ['./map-player.component.scss'], standalone: true, - imports: [FormsModule, NgIf, MatFormFieldModule, MatSelectModule, NgFor, MatOptionModule, MatButtonModule] + imports: [ + FormsModule, + MatFormFieldModule, + MatSelectModule, + MatOptionModule, + MatButtonModule + ] }) export class MapPlayerComponent implements OnInit { @@ -35,6 +40,7 @@ export class MapPlayerComponent implements OnInit { private fetchService: FetchService = inject(FetchService); private notificationService: NotificationService = inject(NotificationService); + // TODO signal allMappablePlayers: Player[]; model: WritableSignal; diff --git a/src/app/dialogs/modify-payout/modify-payout.component.html b/src/app/dialogs/modify-payout/modify-payout.component.html index 02eea19..4d260d6 100644 --- a/src/app/dialogs/modify-payout/modify-payout.component.html +++ b/src/app/dialogs/modify-payout/modify-payout.component.html @@ -46,4 +46,19 @@

> ADAPT PAYOUTS + + + + @if (isLoadingAdd) { +
+ +
+ } + diff --git a/src/app/dialogs/modify-payout/modify-payout.component.ts b/src/app/dialogs/modify-payout/modify-payout.component.ts index 67029b5..860118e 100644 --- a/src/app/dialogs/modify-payout/modify-payout.component.ts +++ b/src/app/dialogs/modify-payout/modify-payout.component.ts @@ -78,7 +78,6 @@ export class ModifyPayoutComponent extends BaseAddDialogComponent; + name: WritableSignal; + shortDesc: WritableSignal; + longDesc: WritableSignal; + branding: WritableSignal; + finalTournament: WritableSignal; + rankFormula: WritableSignal; + ftFormula: WritableSignal; + percentage: WritableSignal; + maxAmountPerTournament: WritableSignal; + noOfTournaments: WritableSignal; + finalists: WritableSignal; + password: WritableSignal; + temp: WritableSignal; + locked: WritableSignal; + ownerEmail: WritableSignal; + showPrices: WritableSignal; + showNonItmPlaces: WritableSignal; + showEliminations: WritableSignal; + showLiveTicker: WritableSignal; + showAverageRank: WritableSignal; + isValid: Signal; +} + export interface SeriesMetadata { id: number; rankFormula: RankFormula; diff --git a/src/app/shared/interfaces/tournament.interface.ts b/src/app/shared/interfaces/tournament.interface.ts index febc95c..ae20cac 100644 --- a/src/app/shared/interfaces/tournament.interface.ts +++ b/src/app/shared/interfaces/tournament.interface.ts @@ -6,6 +6,7 @@ import { Elimination } from './elimination.interface'; import { TEvent } from './t-event.interface'; import { TournamentSettings } from './tournament-settings.interface'; import { RankFormula } from './rank-formula.interface'; +import { Signal, WritableSignal } from '@angular/core'; export interface TournamentBase { id: number; @@ -78,3 +79,30 @@ export interface TournamentModel extends Omit { date: string; rankFormula: number | null; } + +export interface CreateTournamentModel { + id: WritableSignal; + name: WritableSignal; + date: WritableSignal; + maxPlayers: WritableSignal; + startStack: WritableSignal; + initialPricePool: WritableSignal; + buyInAmount: WritableSignal; + noOfRebuys: WritableSignal; + rebuyAmount: WritableSignal; + addonStack: WritableSignal; + noOfReEntries: WritableSignal; + addonAmount: WritableSignal; + withRebuy: WritableSignal; + withAddon: WritableSignal; + withReEntry: WritableSignal; + rebuyStack: WritableSignal; + withBounty: WritableSignal; + bountyAmount: WritableSignal; + payout: WritableSignal; + rankFormula: WritableSignal; + location: WritableSignal; + temp: WritableSignal; + password: WritableSignal; + isValid: Signal; +} diff --git a/src/app/timer/components/tournament/overview/blind-level-overview/blind-level-overview.component.ts b/src/app/timer/components/tournament/overview/blind-level-overview/blind-level-overview.component.ts index be574a1..7dd87a9 100644 --- a/src/app/timer/components/tournament/overview/blind-level-overview/blind-level-overview.component.ts +++ b/src/app/timer/components/tournament/overview/blind-level-overview/blind-level-overview.component.ts @@ -12,7 +12,7 @@ import { import { BlindLevel } from '../../../../../shared/interfaces/blind-level.interface'; import { BlindLevelTextPipe } from '../../../../../shared/pipes/blind-level-text.pipe'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { DecimalPipe, JsonPipe, NgFor, NgIf } from '@angular/common'; +import { DecimalPipe } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; import { TimerStateService } from '../../../../services/timer-state.service'; import { RouterLink } from '@angular/router'; @@ -24,14 +24,11 @@ import { TournamentSettings } from '../../../../../shared/interfaces/tournament- styles: [':host{display: contents}'], standalone: true, imports: [ - NgIf, MatTooltipModule, - NgFor, DecimalPipe, BlindLevelTextPipe, MatButtonModule, RouterLink, - JsonPipe, ], }) export class BlindLevelOverviewComponent implements OnInit { diff --git a/src/app/timer/components/tournament/overview/buttons/buttons.component.ts b/src/app/timer/components/tournament/overview/buttons/buttons.component.ts index f110ecb..fca7df0 100644 --- a/src/app/timer/components/tournament/overview/buttons/buttons.component.ts +++ b/src/app/timer/components/tournament/overview/buttons/buttons.component.ts @@ -21,7 +21,7 @@ import { MatDialog } from '@angular/material/dialog'; import { RankingService } from '../../../../../shared/services/util/ranking.service'; import { MenuDialogComponent } from './menu-dialog/menu-dialog.component'; import { TableDrawDialogComponent } from '../../../../../dialogs/table-draw/table-draw-dialog.component'; -import { AsyncPipe, DecimalPipe, DOCUMENT, NgForOf, NgIf, NgStyle, NgTemplateOutlet } from '@angular/common'; +import { AsyncPipe, DecimalPipe, DOCUMENT, NgStyle, NgTemplateOutlet } from '@angular/common'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatButtonModule } from '@angular/material/button'; import { SeriesMetadata } from '../../../../../shared/interfaces/series.interface'; @@ -42,11 +42,9 @@ declare var anime: any; styleUrls: ['./buttons.component.scss'], standalone: true, imports: [ - NgIf, MatButtonModule, MatTooltipModule, DecimalPipe, - NgForOf, NgStyle, NgTemplateOutlet, AnimationBubbleBoyComponent, diff --git a/src/app/timer/components/tournament/overview/buttons/menu-dialog/menu-dialog.component.html b/src/app/timer/components/tournament/overview/buttons/menu-dialog/menu-dialog.component.html index 6d85fbc..9bc3783 100644 --- a/src/app/timer/components/tournament/overview/buttons/menu-dialog/menu-dialog.component.html +++ b/src/app/timer/components/tournament/overview/buttons/menu-dialog/menu-dialog.component.html @@ -96,7 +96,7 @@
Seat Open
@if (isProOrAdmin() && isRebuyPhaseFinished()) {
-
Make Deal
+
Make Deal {{ isTournamentFinished() }} , {{ isTournamentLocked() }} , {{ isITM() }}