-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): improve interface to deal with large amount of datas + …
…improve sharing message
- Loading branch information
1 parent
ad578ed
commit 696960e
Showing
8 changed files
with
264 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
{ | ||
"name": "retroski", | ||
"version": "1.1.2", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng build", | ||
"watch": "ng build --watch --configuration development", | ||
"test": "ng test", | ||
"lint": "biome lint --write src", | ||
"format": "biome format --write src", | ||
"postbuild": "cp src/.htaccess dist/" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/animations": "^19.0.5", | ||
"@angular/common": "^19.0.5", | ||
"@angular/compiler": "^19.0.5", | ||
"@angular/core": "^19.0.5", | ||
"@angular/forms": "^19.0.5", | ||
"@angular/platform-browser": "^19.0.5", | ||
"@angular/platform-browser-dynamic": "^19.0.5", | ||
"@angular/router": "^19.0.5", | ||
"@angular/service-worker": "^19.0.5", | ||
"date-fns": "4.1.0", | ||
"dexie": "^4.0.9", | ||
"excalibur": "0.30.2", | ||
"pocketbase": "0.22.1", | ||
"rxjs": "~7.8.0", | ||
"tslib": "^2.3.0", | ||
"zone.js": "~0.15.0" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "^19.0.5", | ||
"@angular/cli": "^19.0.5", | ||
"@angular/compiler-cli": "^19.0.5", | ||
"@biomejs/biome": "1.9.4", | ||
"@types/jasmine": "~5.1.0", | ||
"@types/node": "22.10.2", | ||
"jasmine-core": "~5.1.0", | ||
"karma": "~6.4.0", | ||
"karma-chrome-launcher": "~3.2.0", | ||
"karma-coverage": "~2.2.0", | ||
"karma-jasmine": "~5.1.0", | ||
"karma-jasmine-html-reporter": "~2.1.0", | ||
"typescript": "~5.6.3", | ||
"vite": "^5.0.0" | ||
} | ||
} | ||
"name": "retroski", | ||
"version": "1.1.2", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng build", | ||
"watch": "ng build --watch --configuration development", | ||
"test": "ng test", | ||
"lint": "biome lint --write src", | ||
"format": "biome format --write src", | ||
"postbuild": "cp src/.htaccess dist/", | ||
"preview": "http-server ./dist" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/animations": "^19.0.5", | ||
"@angular/common": "^19.0.5", | ||
"@angular/compiler": "^19.0.5", | ||
"@angular/core": "^19.0.5", | ||
"@angular/forms": "^19.0.5", | ||
"@angular/platform-browser": "^19.0.5", | ||
"@angular/platform-browser-dynamic": "^19.0.5", | ||
"@angular/router": "^19.0.5", | ||
"@angular/service-worker": "^19.0.5", | ||
"date-fns": "4.1.0", | ||
"dexie": "^4.0.9", | ||
"excalibur": "0.30.2", | ||
"pocketbase": "0.22.1", | ||
"rxjs": "~7.8.0", | ||
"tslib": "^2.3.0", | ||
"zone.js": "~0.15.0" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "^19.0.5", | ||
"@angular/cli": "^19.0.5", | ||
"@angular/compiler-cli": "^19.0.5", | ||
"@biomejs/biome": "1.9.4", | ||
"@types/jasmine": "~5.1.0", | ||
"@types/node": "22.10.2", | ||
"jasmine-core": "~5.1.0", | ||
"karma": "~6.4.0", | ||
"karma-chrome-launcher": "~3.2.0", | ||
"karma-coverage": "~2.2.0", | ||
"karma-jasmine": "~5.1.0", | ||
"karma-jasmine-html-reporter": "~2.1.0", | ||
"typescript": "~5.6.3", | ||
"vite": "^5.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
181 changes: 110 additions & 71 deletions
181
src/app/pages/online-event/online-event.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,122 @@ | ||
<app-toolbar> | ||
<ng-container ngProjectAs="left-actions"> | ||
<app-button-icon | ||
icon="close" | ||
(click)="goBack()" | ||
></app-button-icon> | ||
<app-button-icon icon="close" (click)="goBack()"></app-button-icon> | ||
</ng-container> | ||
</app-toolbar> | ||
<div class="retro-content"> | ||
@if (event()) { | ||
<div class="retro-title">Event : <span class="tertiary">{{ event()!.name }}</span></div> | ||
<div class="retro-text">Track : <span class="tertiary">{{ track()?.fullName }}</span></div> | ||
<div class="retro-text">Event type : <span class="tertiary">{{ event()!.racesLimit ? 'Race' : 'Time-attack' }}</span></div> | ||
@if (!event()!.racesLimit) { | ||
<div class="retro-subtitle">Ranking</div> | ||
} @else { | ||
<div class="retro-subtitle">Race final ranking</div> | ||
} | ||
<div class="retro-list"> | ||
@for (ranking of rankings(); track ranking; let index = $index) { | ||
<app-ranking-line | ||
[class.current]="ranking.name === user?.name" | ||
[position]="index + 1" | ||
[name]="ranking.name" | ||
[time]="index === 0 ? ranking.formattedTime : ranking.getDiffTime(rankings()![0].time)" | ||
[isDiff]="index > 0" | ||
> | ||
</app-ranking-line> | ||
} | ||
@if (!rankings()) { | ||
<div class="retro-placeholder">Loading ranking</div> | ||
} @else if(!rankings()?.length) { | ||
@if (event()!.racesLimit) { | ||
<div class="retro-placeholder">No riders have finished all races yet</div> | ||
} @else { | ||
<div class="retro-placeholder">No riders have completed a ride yet</div> | ||
} | ||
} | ||
<div class="retro-title"> | ||
Event : <span class="tertiary">{{ event()!.name }}</span> | ||
</div> | ||
<div class="retro-text"> | ||
Track : <span class="tertiary">{{ track()?.fullName }}</span> | ||
</div> | ||
<div class="retro-text"> | ||
Event type : | ||
<span class="tertiary">{{ | ||
event()!.racesLimit ? "Race" : "Time-attack" | ||
}}</span> | ||
</div> | ||
<div class="retro-subtitle"> | ||
<span | ||
class="alternative" | ||
[class.active]="rankingsDisplay() === 'top'" | ||
(click)="rankingsDisplay.set('top')" | ||
> | ||
Top 10 | ||
</span> | ||
<span | ||
class="alternative" | ||
[class.active]="rankingsDisplay() === 'full'" | ||
(click)="rankingsDisplay.set('full')" | ||
> | ||
Full ranking | ||
</span> | ||
</div> | ||
<div class="retro-list"> | ||
@for (ranking of (rankingsDisplay() === 'top' ? topRankings() : | ||
rankings()); track ranking; let index = $index) { | ||
<app-ranking-line | ||
[class.current]="ranking.name === user?.name" | ||
[position]="index + 1" | ||
[name]="ranking.name" | ||
[time]=" | ||
index === 0 | ||
? ranking.formattedTime | ||
: ranking.getDiffTime(rankings()![0].time) | ||
" | ||
[isDiff]="index > 0" | ||
> | ||
</app-ranking-line> | ||
} @if (!rankings()) { | ||
<div class="retro-placeholder">Loading ranking</div> | ||
} @else if(!rankings()?.length) { @if (event()!.racesLimit) { | ||
<div class="retro-placeholder"> | ||
No riders have finished all races yet | ||
</div> | ||
<div class="retro-subtitle">All results</div> | ||
<div class="retro-list"> | ||
@for (result of results(); track result) { | ||
<app-result-line | ||
[type]="event()!.racesLimit ? 'race' : 'time-attack'" | ||
[rideNumber]="result.rideNumber" | ||
[name]="result.rider" | ||
[time]="result.formattedTime" | ||
[current]="result.rider === user?.name" | ||
></app-result-line> | ||
} | ||
@if (!results()) { | ||
<div class="retro-placeholder">Loading results</div> | ||
} @else if(!results()?.length) { | ||
<div class="retro-placeholder">No results yet</div> | ||
} | ||
</div> | ||
@if (event()!.racesLimit) { | ||
<div class="retro-subtitle">Remaining races | ||
@if (remainingRaces()?.length) { | ||
({{ remainingRaces()?.length }}/{{ event()!.racesLimit }}) | ||
} | ||
</div> | ||
@for (race of remainingRaces(); track race; let index = $index) { | ||
<app-result-line | ||
type="race" | ||
[rideNumber]="race" | ||
[current]="index === 0" | ||
[track]="track()?.fullName" | ||
></app-result-line> | ||
} | ||
@if (!remainingRaces()) { | ||
<div class="retro-placeholder">Loading remaining races</div> | ||
} @else if(!remainingRaces()?.length) { | ||
<div class="retro-placeholder">You have completed all races</div> | ||
} | ||
} @else { | ||
<div class="retro-placeholder">No riders have completed a ride yet</div> | ||
} } | ||
</div> | ||
<div class="retro-subtitle"> | ||
<span | ||
class="alternative" | ||
[class.active]="resultsDisplay() === 'last'" | ||
(click)="resultsDisplay.set('last')" | ||
> | ||
Last results | ||
</span> | ||
<span | ||
class="alternative" | ||
[class.active]="resultsDisplay() === 'all'" | ||
(click)="resultsDisplay.set('all')" | ||
> | ||
All results | ||
</span> | ||
</div> | ||
<div class="retro-list"> | ||
@for (result of (resultsDisplay() === 'last' ? lastResults() : | ||
results()); track result) { | ||
<app-result-line | ||
[type]="event()!.racesLimit ? 'race' : 'time-attack'" | ||
[rideNumber]="result.rideNumber" | ||
[name]="result.rider" | ||
[time]="result.formattedTime" | ||
[current]="result.rider === user?.name" | ||
></app-result-line> | ||
} @if (!results()) { | ||
<div class="retro-placeholder">Loading results</div> | ||
} @else if(!results()?.length) { | ||
<div class="retro-placeholder">No results yet</div> | ||
} | ||
} @else { | ||
<div class="retro-placeholder">Loading event</div> | ||
</div> | ||
@if (event()!.racesLimit) { | ||
<div class="retro-subtitle"> | ||
Remaining races @if (remainingRaces()?.length) { ({{ | ||
remainingRaces()?.length | ||
}}/{{ event()!.racesLimit }}) } | ||
</div> | ||
@for (race of remainingRaces(); track race; let index = $index) { | ||
<app-result-line | ||
type="race" | ||
[rideNumber]="race" | ||
[current]="index === 0" | ||
[track]="track()?.fullName" | ||
></app-result-line> | ||
} @if (!remainingRaces()) { | ||
<div class="retro-placeholder">Loading remaining races</div> | ||
} @else if(!remainingRaces()?.length) { | ||
<div class="retro-placeholder">You have completed all races</div> | ||
} } } @else { | ||
<div class="retro-placeholder">Loading event</div> | ||
} | ||
</div> | ||
<div class="retro-footer"> | ||
<button class="retro-button" routerLink="/online-race/{{ event()?.id }}" [disabled]="event()?.racesLimit && !remainingRaces()?.length">Start riding</button> | ||
<button | ||
class="retro-button" | ||
routerLink="/online-race/{{ event()?.id }}" | ||
[disabled]="event()?.racesLimit && !remainingRaces()?.length" | ||
> | ||
Start riding | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.