From 4c0888d947642016d51c6e2e2e682d2bb9d6c112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schmidt?= <9435005+AnSch1510@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:47:04 +0200 Subject: [PATCH 1/3] remove theme_color and background_color --- src/client/public/manifest.webmanifest | 2 -- src/client/src/index.html | 1 - 2 files changed, 3 deletions(-) diff --git a/src/client/public/manifest.webmanifest b/src/client/public/manifest.webmanifest index e4fcce2..50c8dd0 100644 --- a/src/client/public/manifest.webmanifest +++ b/src/client/public/manifest.webmanifest @@ -1,8 +1,6 @@ { "name": "Minigolf Freitag", "short_name": "Minigolf Freitag", - "theme_color": "#9e48d9", - "background_color": "#13276c", "display": "standalone", "scope": "./", "start_url": "./events", diff --git a/src/client/src/index.html b/src/client/src/index.html index f937e89..5ff12e2 100644 --- a/src/client/src/index.html +++ b/src/client/src/index.html @@ -9,7 +9,6 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" /> - From 80bbb164aa62a9fc64ec837f3e02d639ab554e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schmidt?= <9435005+AnSch1510@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:06:06 +0200 Subject: [PATCH 2/3] add user by entering name to search box --- .../components/users/user-dialog/user-dialog.component.ts | 7 ++++++- src/client/src/app/components/users/users.component.html | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client/src/app/components/users/user-dialog/user-dialog.component.ts b/src/client/src/app/components/users/user-dialog/user-dialog.component.ts index 2a7cd7f..3318cf4 100644 --- a/src/client/src/app/components/users/user-dialog/user-dialog.component.ts +++ b/src/client/src/app/components/users/user-dialog/user-dialog.component.ts @@ -150,7 +150,7 @@ export class UserDialogComponent { ); } - public open(user?: User) { + public edit(user: User) { this.userToUpdate.set(user); this.form.reset( user @@ -169,6 +169,11 @@ export class UserDialogComponent { this.visible.set(true); } + public create(user: string) { + this.form.reset({ alias: user }); + this.visible.set(true); + } + protected onAddAvoid(user: User) { this.form.controls.preferences.controls.avoid.setValue([...this.avoid(), user.id]); } diff --git a/src/client/src/app/components/users/users.component.html b/src/client/src/app/components/users/users.component.html index 784cdfd..e6f8334 100644 --- a/src/client/src/app/components/users/users.component.html +++ b/src/client/src/app/components/users/users.component.html @@ -26,7 +26,7 @@
@@ -42,7 +42,7 @@ [rounded]="true" [text]="true" size="small" - (onClick)="dialog.open(user)" + (onClick)="dialog.edit(user)" /> Date: Mon, 1 Jul 2024 22:30:47 +0200 Subject: [PATCH 3/3] add user count to users page --- .../app/components/users/users.component.html | 16 ++++++++++++++++ .../src/app/components/users/users.component.ts | 14 +++++++++++++- src/client/src/app/i18n/de.json | 4 ++++ src/client/src/app/i18n/en.json | 4 ++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/client/src/app/components/users/users.component.html b/src/client/src/app/components/users/users.component.html index e6f8334..2c440a8 100644 --- a/src/client/src/app/components/users/users.component.html +++ b/src/client/src/app/components/users/users.component.html @@ -54,6 +54,22 @@ />
} +
+

+ {{ translations.users_footer_admins() }}: + {{ admins().length }} + +

+

+ {{ translations.users_footer_players() }}: + {{ players().length }} + +

+
diff --git a/src/client/src/app/components/users/users.component.ts b/src/client/src/app/components/users/users.component.ts index 4a111fe..7c7f666 100644 --- a/src/client/src/app/components/users/users.component.ts +++ b/src/client/src/app/components/users/users.component.ts @@ -54,7 +54,19 @@ export class UsersComponent { protected readonly translations = inject(TranslateService).translations; protected readonly filter = signal(''); - protected readonly users = computed(() => this.filterUsers(this._allUsers(), this.filter())); + protected readonly players = computed(() => + this.filterUsers( + this._allUsers().filter(x => !x.roles.includes('admin')), + this.filter() + ) + ); + protected readonly admins = computed(() => + this.filterUsers( + this._allUsers().filter(x => x.roles.includes('admin')), + this.filter() + ) + ); + protected readonly users = computed(() => this.admins().concat(this.players())); protected readonly isLoading = computed(() => isActionBusy(this._actionState())); protected readonly hasFailed = computed(() => hasActionFailed(this._actionState())); diff --git a/src/client/src/app/i18n/de.json b/src/client/src/app/i18n/de.json index ffacb3e..2685084 100644 --- a/src/client/src/app/i18n/de.json +++ b/src/client/src/app/i18n/de.json @@ -170,6 +170,10 @@ "title": "Benutzer löschen", "text": "Möchtest du den Benutzer \"{{alias}}\" wirklich löschen?" }, + "footer": { + "players": "Spieler", + "admins": "Administratoren" + }, "dialog": { "addHeader": "Benutzer hinzufügen", "editHeader": "Benutzer \"{{alias}}\" bearbeiten", diff --git a/src/client/src/app/i18n/en.json b/src/client/src/app/i18n/en.json index b2d0ad0..1b3c642 100644 --- a/src/client/src/app/i18n/en.json +++ b/src/client/src/app/i18n/en.json @@ -170,6 +170,10 @@ "title": "Delete user", "text": "Are you sure you want to delete user \"{{alias}}\"?" }, + "footer": { + "players": "Players", + "admins": "Admins" + }, "dialog": { "addHeader": "Add user", "editHeader": "Edit user \"{{alias}}\"",