1
0
Fork 0
mirror of https://codeberg.org/beerbrawl/beerbrawl.git synced 2024-09-23 01:30:52 +02:00

refactor(#162): unify the word used for closing a snackbar

This commit is contained in:
FreshGuy32 2024-06-21 17:41:57 +00:00
parent 4ef1eaf468
commit 363c73b47f
12 changed files with 14 additions and 14 deletions

View file

@ -25,7 +25,7 @@ export class CopyLinkDialogComponent {
} }
showNotification(): void { showNotification(): void {
this.snackBar.open('Copied link to clipboard!', 'OK', { this.snackBar.open('Copied link to clipboard!', 'Close', {
duration: 2500, duration: 2500,
}); });
} }

View file

@ -61,7 +61,7 @@ export class QualificationMatchLineComponent {
}); });
if (results) { if (results) {
this.snackBar.open('Match results updated', 'Dismiss', { duration: 3000 }); this.snackBar.open('Match results updated', 'Close', { duration: 3000 });
this.match.update(() => results); this.match.update(() => results);
this.onMatchUpdate.emit(results); this.onMatchUpdate.emit(results);
} }

View file

@ -51,7 +51,7 @@ export class TournamentTeamEditComponent {
const errorMessage = const errorMessage =
typeof err.error === 'string' ? err.error : 'Failed to update team'; typeof err.error === 'string' ? err.error : 'Failed to update team';
this.snackBar.open(errorMessage, 'Dismiss', { this.snackBar.open(errorMessage, 'Close', {
duration: 5000, duration: 5000,
}); });
}, },

View file

@ -250,7 +250,7 @@ export class EditKnockoutPhaseTreeComponent implements OnInit {
}) })
.pipe( .pipe(
tap(() => { tap(() => {
this.snackBar.open(`Marked drinks for team ${team.name} as collected`, 'Dismiss', { this.snackBar.open(`Marked drinks for team ${team.name} as collected`, 'Close', {
duration: 2500, duration: 2500,
}); });
}), }),

View file

@ -61,14 +61,14 @@ export class TeamSignupComponent {
.pipe( .pipe(
catchError((e: HttpErrorResponse) => { catchError((e: HttpErrorResponse) => {
if (Array.isArray(e.error?.errors)) { if (Array.isArray(e.error?.errors)) {
this.snackBar.open(e.error.errors.join(', '), 'Dismiss', { duration: 5000 }); this.snackBar.open(e.error.errors.join(', '), 'Close', { duration: 5000 });
return []; return [];
} }
if (!('signupTeamResult' in e.error)) { if (!('signupTeamResult' in e.error)) {
const errorMessage = const errorMessage =
typeof e.error === 'string' ? e.error : 'Failed to register team; invalid request'; typeof e.error === 'string' ? e.error : 'Failed to register team; invalid request';
this.snackBar.open(errorMessage, 'Dismiss', { duration: 5000 }); this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
return []; return [];
} }

View file

@ -133,7 +133,7 @@ export class TournamentCreateComponent {
} else { } else {
errorMessage = error.error; errorMessage = error.error;
} }
this.snackBar.open('Error: ' + errorMessage, 'OK', { this.snackBar.open('Error: ' + errorMessage, 'Close', {
duration: 5000, duration: 5000,
}); });
} }

View file

@ -95,7 +95,7 @@ export class TournamentEditMatchResultsDialogComponent {
const errorMessage = const errorMessage =
typeof err.error === 'string' ? err.error : 'Failed to update match results'; typeof err.error === 'string' ? err.error : 'Failed to update match results';
this.snackBar.open(errorMessage, 'Dismiss', { this.snackBar.open(errorMessage, 'Close', {
duration: 5000, duration: 5000,
}); });
}, },

View file

@ -163,7 +163,7 @@ export class TournamentEditComponent implements OnInit {
errorMessage = error.error; errorMessage = error.error;
} }
} }
this.snackBar.open('Error: ' + errorMessage, 'OK', { this.snackBar.open('Error: ' + errorMessage, 'Close', {
duration: 5000, duration: 5000,
}); });
} }

View file

@ -66,7 +66,7 @@ export class TournamentOverviewComponent implements OnInit {
} else { } else {
errorMessage = error.error; errorMessage = error.error;
} }
this.snackBar.open(errorMessage, 'OK', { this.snackBar.open(errorMessage, 'Close', {
duration: 5000, duration: 5000,
}); });
} }

View file

@ -217,7 +217,7 @@ export class TournamentQualificationPhaseComponent implements OnInit, OnDestroy
).then(() => { ).then(() => {
this.snackBar.open( this.snackBar.open(
`Marked drinks for team ${markTeamDrinksPickedUpDto.participantDto.name} as collected`, `Marked drinks for team ${markTeamDrinksPickedUpDto.participantDto.name} as collected`,
'Dismiss', 'Close',
{ duration: 2500 }, { duration: 2500 },
); );
this.loadData(); this.loadData();

View file

@ -31,7 +31,7 @@ export class UpdateUserComponent {
updateUser(dto: UserLoginDto) { updateUser(dto: UserLoginDto) {
this.userService.update(this.authService.getUsername()!, dto).subscribe({ this.userService.update(this.authService.getUsername()!, dto).subscribe({
next: () => { next: () => {
this.snackBar.open('Successfully updated user', 'OK', { duration: 3000 }); this.snackBar.open('Successfully updated user', 'Close', { duration: 3000 });
this.authService.logoutUser(); this.authService.logoutUser();
this.dialogRef.close(); this.dialogRef.close();
this.router.navigate(['/']); this.router.navigate(['/']);
@ -55,7 +55,7 @@ export class UpdateUserComponent {
} else { } else {
errorMessage = error.error; errorMessage = error.error;
} }
this.snackBar.open('Error: ' + errorMessage, 'OK', { this.snackBar.open('Error: ' + errorMessage, 'Close', {
duration: 5000, duration: 5000,
}); });
} }

View file

@ -86,7 +86,7 @@ export class UserDetailComponent implements OnInit {
} else { } else {
errorMessage = error.error; errorMessage = error.error;
} }
this.snackBar.open(errorMessage, 'OK', { this.snackBar.open(errorMessage, 'Close', {
duration: 5000, duration: 5000,
}); });
} }