From 8d76f797320677cb4b1ea0881c391348b172207b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 15 Aug 2023 08:14:45 +0200 Subject: [PATCH] Hide members columns #79 --- kdb-web/package.json | 2 +- .../components/levels/levels.component.html | 18 ++--- .../components/levels/levels.component.ts | 2 +- .../server/members/members.component.html | 80 +++++++++++-------- .../view/server/members/members.component.ts | 14 ++-- kdb-web/src/assets/i18n/de.json | 36 ++++----- kdb-web/src/assets/version.json | 2 +- 7 files changed, 80 insertions(+), 74 deletions(-) diff --git a/kdb-web/package.json b/kdb-web/package.json index bfe9eed3..998a4411 100644 --- a/kdb-web/package.json +++ b/kdb-web/package.json @@ -1,6 +1,6 @@ { "name": "kdb-web", - "version": "1.1.dev79_hide_table_attributes", + "version": "1.1.dev79_hide_table_columns", "scripts": { "ng": "ng", "update-version": "ts-node-esm update-version.ts", diff --git a/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.html b/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.html index 114143e0..9e059391 100644 --- a/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.html +++ b/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.html @@ -20,7 +20,7 @@
-
{{'view.server.levels.headers.' + item.name | translate}}
+
{{'common.' + item.name | translate}}
@@ -39,7 +39,7 @@ - +
{{'common.id' | translate}}
@@ -48,28 +48,28 @@
-
{{'view.server.levels.headers.name' | translate}}
+
{{'common.name' | translate}}
-
{{'view.server.levels.headers.color' | translate}}
+
{{'common.color' | translate}}
-
{{'view.server.levels.headers.min_xp' | translate}}
+
{{'common.min_xp' | translate}}
-
{{'view.server.levels.headers.permissions' | translate}}
+
{{'common.permissions' | translate}}
@@ -94,7 +94,7 @@ - +
@@ -103,7 +103,7 @@ + placeholder="{{'common.name' | translate}}">
@@ -117,7 +117,7 @@ - + {{level.id}} diff --git a/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.ts b/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.ts index 1a5461a6..4ae5bb94 100644 --- a/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.ts +++ b/kdb-web/src/app/modules/view/server/levels/components/levels/levels.component.ts @@ -74,7 +74,7 @@ export class LevelsComponent extends ComponentWithTable implements OnInit, OnDes private sidebar: SidebarService, private route: ActivatedRoute ) { - super("level", ["name", "color", "min_xp", "permissions"]); + super("level", ["id", "name", "color", "min_xp", "permissions"]); } public ngOnInit(): void { diff --git a/kdb-web/src/app/modules/view/server/members/members.component.html b/kdb-web/src/app/modules/view/server/members/members.component.html index cc51f4a2..ea3d2e52 100644 --- a/kdb-web/src/app/modules/view/server/members/members.component.html +++ b/kdb-web/src/app/modules/view/server/members/members.component.html @@ -9,11 +9,21 @@
-
- {{members.length}} {{'common.of' | translate}} - {{dt.totalRecords}} - - {{'view.server.members.members' | translate}} +
+
+ {{members.length}} {{'common.of' | translate}} + {{dt.totalRecords}} + + {{'view.server.members.members' | translate}} +
+ +
+ + +
{{'common.' + item.name | translate}}
+
+
+
@@ -26,51 +36,51 @@ - +
{{'common.id' | translate}}
- +
{{'common.discord_id' | translate}}
- +
-
{{'view.server.members.headers.name' | translate}}
+
{{'common.name' | translate}}
- +
-
{{'view.server.members.headers.xp' | translate}}
+
{{'common.xp' | translate}}
- +
-
{{'view.server.members.headers.ontime' | translate}}
+
{{'common.ontime' | translate}}
- +
-
{{'view.server.members.headers.left_server' | translate}}
+
{{'common.left_server' | translate}}
- +
-
{{'view.server.members.headers.level' | translate}}
+
{{'common.level' | translate}}
@@ -95,31 +105,31 @@ - +
- +
- +
- +
- - - + + +
- +
- +
- +
@@ -130,7 +140,7 @@ - + {{member.id}} @@ -140,7 +150,7 @@ - + {{member.discordId}} @@ -150,7 +160,7 @@ - + {{member.name}} @@ -160,7 +170,7 @@ - + - + {{member.ontime}} @@ -182,7 +192,7 @@ - + {{!member.leftServer | bool}} @@ -192,10 +202,10 @@ - + - + {{member.level.name}} diff --git a/kdb-web/src/app/modules/view/server/members/members.component.ts b/kdb-web/src/app/modules/view/server/members/members.component.ts index e46afb61..6786adad 100644 --- a/kdb-web/src/app/modules/view/server/members/members.component.ts +++ b/kdb-web/src/app/modules/view/server/members/members.component.ts @@ -20,19 +20,17 @@ import { UpdateUserMutationResult } from "../../../../models/graphql/result.mode import { ActivatedRoute } from "@angular/router"; import { Level } from "../../../../models/data/level.model"; import { Server } from "../../../../models/data/server.model"; +import { ComponentWithTable } from "../../../../base/component-with-table"; @Component({ selector: "app-members", templateUrl: "./members.component.html", styleUrls: ["./members.component.scss"] }) -export class MembersComponent implements OnInit, OnDestroy { +export class MembersComponent extends ComponentWithTable implements OnInit, OnDestroy { members!: User[]; levels!: MenuItem[]; - leftServerOptions = [ - { label: this.translate.instant("common.bool_as_string.true"), value: false }, - { label: this.translate.instant("common.bool_as_string.false"), value: true } - ]; + leftServerOptions: { label: string; value: boolean; }[] = []; loading = true; clonedUsers: { [s: string]: User; } = {}; @@ -93,6 +91,7 @@ export class MembersComponent implements OnInit, OnDestroy { private data: DataService, private route: ActivatedRoute ) { + super("member", ["id", "discord_id", "name", "xp", "ontime", "left_server", "level"]); } ngOnInit(): void { @@ -112,9 +111,14 @@ export class MembersComponent implements OnInit, OnDestroy { return { label: level.name, value: level }; }); }); + this.leftServerOptions = [ + { label: this.translate.instant("common.bool_as_string.true"), value: false }, + { label: this.translate.instant("common.bool_as_string.false"), value: true } + ]; this.loadNextPage(); }); } + public ngOnDestroy(): void { this.unsubscriber.next(); this.unsubscriber.complete(); diff --git a/kdb-web/src/assets/i18n/de.json b/kdb-web/src/assets/i18n/de.json index ec3aa22a..9659ea62 100644 --- a/kdb-web/src/assets/i18n/de.json +++ b/kdb-web/src/assets/i18n/de.json @@ -2,15 +2,6 @@ "admin": { "auth_users": { "header": "Benutzer", - "headers": { - "active": "Aktiv", - "auth_role": "Rolle", - "first_name": "Vorname", - "last_name": "Nachname", - "password": "Passwort", - "role": "Rolle", - "users": "Benutzer" - }, "message": { "cannot_delete_user": "Benutzer kann nicht gelöscht werden", "invalid_email": "Ungültige E-Mail", @@ -131,6 +122,20 @@ } }, "common": { + "active": "Aktiv", + "auth_role": "Rolle", + "first_name": "Vorname", + "last_name": "Nachname", + "password": "Passwort", + "role": "Rolle", + "users": "Benutzer", + "color": "Farbe", + "min_xp": "Min. XP", + "permissions": "Rechte", + "left_server": "Aktiv", + "level": "Level", + "ontime": "Ontime", + "xp": "XP", "404": "404 - Der Eintrag konnte nicht gefunden werden", "actions": "Aktionen", "add": "Hinzufügen", @@ -447,12 +452,6 @@ "header": "Server", "levels": { "header": "Level", - "headers": { - "color": "Farbe", - "min_xp": "Min. XP", - "name": "Name", - "permissions": "Rechte" - }, "levels": "Level", "message": { "level_create": "Level erstellt", @@ -473,13 +472,6 @@ }, "members": { "header": "Mitglieder", - "headers": { - "left_server": "Aktiv", - "level": "Level", - "name": "Name", - "ontime": "Ontime", - "xp": "XP" - }, "members": "Mitgliedern", "message": { "user_change_failed": "Benutzeränderung fehlgeschlagen", diff --git a/kdb-web/src/assets/version.json b/kdb-web/src/assets/version.json index 4a930e41..d2369dd9 100644 --- a/kdb-web/src/assets/version.json +++ b/kdb-web/src/assets/version.json @@ -2,6 +2,6 @@ "WebVersion": { "Major": "1", "Minor": "1", - "Micro": "dev79_hide_table_attributes" + "Micro": "dev79_hide_table_columns" } } \ No newline at end of file