Skip to content

Commit

Permalink
Merge branch 'dev' into robot.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Suboyyy authored Sep 23, 2024
2 parents da37e15 + 8b57546 commit 10994ba
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
Binary file modified public/icons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/app/(dashboard)/admin/users/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const columnTitles = {
scannedLabel: 'Scanné',
permissionsLabel: 'Permissions',
teamName: 'Équipe',
status: 'Rôle',
tournamentName: 'Tournoi',
place: 'Place',
};
Expand Down Expand Up @@ -79,6 +80,7 @@ const Users = () => {
lockedLabel: true,
paidLabel: true,
scannedLabel: true,
status: true,
permissionsLabel: true,
teamName: true,
tournamentName: true,
Expand Down
4 changes: 1 addition & 3 deletions src/modules/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export const registerUser = async (user: RegisterUser) => {
return;
}

delete user.passwordConfirmation;
delete user.legalRepresentativeAccepted;
await API.post('auth/register', user);
await API.post('auth/register', { ...user, passwordConfirmation: undefined, legalRepresentativeAccepted: undefined });
toast.success('Inscription réussie, vérifie tes emails');
return true;
};
Expand Down
18 changes: 17 additions & 1 deletion src/modules/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,31 @@ const initialState: UsersAction = {
};

const format = (users: Array<UserWithTeamAndMessageAndTournamentInfo>) => {
function userType(type: string) {
switch (type) {
case UserType.player:
return 'Joueur';
case UserType.coach:
return 'Coach';
case UserType.spectator:
return 'Spectateur';
case UserType.attendant:
return 'Accompagnateur';
default:
return type;
}
}

return users.map((user) => ({
...user,
fullname: `${user.firstname} ${user.lastname}`,
tournamentName: user.team ? user.team.tournament.name : '',
teamName: user.team ? user.team.name : user.type === UserType.spectator ? '(spectateur)' : '',
teamName: user.team ? user.team.name : '',
lockedLabel: user.team && user.team.lockedAt ? '✔' : '✖',
paidLabel: user.hasPaid ? '✔' : '✖',
scannedLabel: user.scannedAt ? '✔' : '✖',
permissionsLabel: user.permissions.join(', ') || '',
status: user.type ? userType(user.type) : '',
}));
};

Expand Down

0 comments on commit 10994ba

Please sign in to comment.