From e169f12091920a6bce64b8d245797f5b6263a6ca Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 18 Aug 2023 15:59:56 +0200 Subject: [PATCH] Improved table responsive mode #1.1.0.rc5 --- .../auth-user/auth-user.component.html | 8 + ...t (conflicted copy 2023-08-18 152854).scss | 0 .../multi-select-columns.component.scss | 214 +++++++++++++++ ...t (conflicted copy 2023-08-18 152854).scss | 0 .../config-list/config-list.component.scss | 232 ++++++++++++++++ ...t (conflicted copy 2023-08-18 152854).scss | 0 .../feature-flag-list.component.scss | 243 +++++++++++++++++ ...t (conflicted copy 2023-08-18 152854).scss | 0 .../hideable-header.component.scss | 254 ++++++++++++++++++ .../achievement/achievement.component.html | 8 + .../auto-roles-rules.component.html | 5 + .../auto-roles/auto-roles.component.html | 9 +- .../components/levels/levels.component.html | 7 + .../server/members/members.component.html | 9 + kdb-web/src/styles.scss | 17 ++ 15 files changed, 1004 insertions(+), 2 deletions(-) create mode 100644 kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component (conflicted copy 2023-08-18 152854).scss create mode 100644 kdb-web/src/app/modules/shared/components/config-list/config-list.component (conflicted copy 2023-08-18 152854).scss create mode 100644 kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component (conflicted copy 2023-08-18 152854).scss create mode 100644 kdb-web/src/app/modules/shared/components/hideable-header/hideable-header.component (conflicted copy 2023-08-18 152854).scss diff --git a/kdb-web/src/app/modules/admin/auth-users/components/auth-user/auth-user.component.html b/kdb-web/src/app/modules/admin/auth-users/components/auth-user/auth-user.component.html index 835e7bf6..5e81d634 100644 --- a/kdb-web/src/app/modules/admin/auth-users/components/auth-user/auth-user.component.html +++ b/kdb-web/src/app/modules/admin/auth-users/components/auth-user/auth-user.component.html @@ -123,6 +123,7 @@ + {{'common.first_name' | translate}}: + {{'common.last_name' | translate}}: + {{'common.email' | translate}}: + {{'common.active' | translate}}: + {{'common.auth_role' | translate}}: + {{'common.password' | translate}}: + {{'common.created_at' | translate}}: {{user.createdAt | date:'dd.MM.yy HH:mm'}} @@ -200,6 +207,7 @@ + {{'common.modified_at' | translate}}: {{user.modifiedAt | date:'dd.MM.yy HH:mm'}} diff --git a/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component (conflicted copy 2023-08-18 152854).scss b/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component (conflicted copy 2023-08-18 152854).scss new file mode 100644 index 00000000..e69de29b diff --git a/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.scss b/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.scss index e69de29b..1e3c6195 100644 --- a/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.scss +++ b/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.scss @@ -0,0 +1,214 @@ + +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 685 +Content-Type: application/octet-stream +X-File-MD5: 1d28256a85a8151eda5ddb0eee5cfb41 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MultiSelectColumnsComponent } from './multi-select-columns.component'; + +describe('MultiSelectColumnsComponent', () => { + let component: MultiSelectColumnsComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MultiSelectColumnsComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(MultiSelectColumnsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 880 +Content-Type: application/octet-stream +X-File-MD5: 24258891482f4097bd6573c263a5ee80 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.ts + +import { Component, EventEmitter, Input, Output } from "@angular/core"; +import { Column } from "../../../../base/component-with-table"; + +@Component({ + selector: "app-multi-select-columns", + templateUrl: "./multi-select-columns.component.html", + styleUrls: ["./multi-select-columns.component.scss"] +}) +export class MultiSelectColumnsComponent { + @Input() columns: Column[] = []; + + private _hiddenColumns: Column[] = []; + @Input() table: String = ""; + + @Input() + set hiddenColumns(columns: Column[]) { + this._hiddenColumns = columns; + this.hiddenColumnsChange.emit(columns); + } + + get hiddenColumns(): Column[] { + return this._hiddenColumns; + } + + get visibleHiddenColumns(): Column[] { + return this._hiddenColumns.filter(x => x.key?.startsWith(`${this.table}_`)); + } + + @Output() hiddenColumnsChange: EventEmitter = new EventEmitter(); +} + +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 199 +Content-Type: application/octet-stream +X-File-MD5: 625262cf0af1c5538f6fa7bbe71b41a0 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/base/hideable-component.spec.ts + +import { HideableComponent } from './hideable-component'; + +describe('HideableComponent', () => { + it('should create an instance', () => { + expect(new HideableComponent()).toBeTruthy(); + }); +}); + +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 379 +Content-Type: application/octet-stream +X-File-MD5: 739e92fabd3a9534351c0a3504d01d9b +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/base/hideable-component.ts + +import { Directive, HostBinding, Input } from "@angular/core"; +import { ComponentWithTable } from "../../../base/component-with-table"; + +@Directive() +export class HideableComponent { + @HostBinding("class.hidden-column") + get hidden() { + return !(this.parent?.isColumnVisible(this.column) ?? true); + }; + + @Input() column!: string; + @Input() parent!: ComponentWithTable; +} + +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 2593 +Content-Type: application/octet-stream +X-File-MD5: cb7466e3bdbb7d60d74f2dd62b75b6dc +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/config-list/config-list.component.html + +
+
+
+ {{translationKey | translate}}: +
+
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
+ + +
+
+
+
+
+
+ +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 0 +Content-Type: application/octet-stream +X-File-MD5: d41d8cd98f00b204e9800998ecf8427e +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/config-list/config-list.component.scss + + +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 628 +Content-Type: application/octet-stream +X-File-MD5: 3ae713f045160ae23d9e2d7d39c47cc8 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/config-list/config-list.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConfigListComponent } from './config-list.component'; + +describe('ConfigListComponent', () => { + let component: ConfigListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ConfigListComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ConfigListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._jr8hB+CSPa28lAJeDsUSxu1VQRGpqI1S +Content-Length: 1909 +Content-Type: application/octet-stream +X-File-MD5: ef17560ccaae24eb4ab2d2bea3dfef3e +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/config-list/config-list.component.ts + +import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; +import { Table } from "primeng/table"; + +@Component({ + selector: "app-config-list", + templateUrl: "./config-list.component.html", diff --git a/kdb-web/src/app/modules/shared/components/config-list/config-list.component (conflicted copy 2023-08-18 152854).scss b/kdb-web/src/app/modules/shared/components/config-list/config-list.component (conflicted copy 2023-08-18 152854).scss new file mode 100644 index 00000000..e69de29b diff --git a/kdb-web/src/app/modules/shared/components/config-list/config-list.component.scss b/kdb-web/src/app/modules/shared/components/config-list/config-list.component.scss index e69de29b..d87b606f 100644 --- a/kdb-web/src/app/modules/shared/components/config-list/config-list.component.scss +++ b/kdb-web/src/app/modules/shared/components/config-list/config-list.component.scss @@ -0,0 +1,232 @@ + +--boundary_.oOo._it/29I5GYOGQacfyrk8Hzb13cRhzjKUr +Content-Length: 628 +Content-Type: application/octet-stream +X-File-MD5: 3ae713f045160ae23d9e2d7d39c47cc8 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/config-list/config-list.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConfigListComponent } from './config-list.component'; + +describe('ConfigListComponent', () => { + let component: ConfigListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ConfigListComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ConfigListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._it/29I5GYOGQacfyrk8Hzb13cRhzjKUr +Content-Length: 1909 +Content-Type: application/octet-stream +X-File-MD5: ef17560ccaae24eb4ab2d2bea3dfef3e +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/config-list/config-list.component.ts + +import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; +import { Table } from "primeng/table"; + +@Component({ + selector: "app-config-list", + templateUrl: "./config-list.component.html", + styleUrls: ["./config-list.component.scss"] +}) +export class ConfigListComponent { + internal_data: any[] = []; + + @Input() translationKey: string = ""; + @Input() options?: Array; + @Input() optionLabel?: string = ""; + @Input() optionValue?: string = ""; + + @Input() + set data(val: any[]) { + this.dataChange.emit(val); + let id = 0; + this.internal_data = val.map(value => { + value = { id: id, value: value }; + id++; + return value; + }); + } + + get data() { + return this.getData(); + } + + @Output() dataChange: EventEmitter = new EventEmitter(); + clonedData: { [s: number]: any } = {}; + + private getData(): any[] { + return this.internal_data.map(value => { + return value.value; + }); + } + + addNew(table: Table) { + const id = this.internal_data.length == 0 ? 1 : Math.max.apply(Math, this.internal_data.map(value => { + return value.id ?? 0; + })) + 1; + const newItem = { id: id, value: "" }; + this.internal_data.push(newItem); + + table.initRowEdit(newItem); + const index = this.internal_data.findIndex(l => l.id == newItem.id); + this.editInit(newItem, index); + } + + editInit(value: any, index: number) { + this.clonedData[index] = { ...value }; + } + + delete(index: number) { + this.internal_data.splice(index, 1); + this.dataChange.emit(this.getData()); + } + + editSave(value: any, index: number) { + if (!value.value || this.internal_data[index] == this.clonedData[index]) { + return; + } + + delete this.clonedData[index]; + this.dataChange.emit(this.getData()); + } + + editCancel(index: number) { + this.internal_data[index] = this.clonedData[index]; + delete this.clonedData[index]; + } +} + +--boundary_.oOo._it/29I5GYOGQacfyrk8Hzb13cRhzjKUr +Content-Length: 2620 +Content-Type: application/octet-stream +X-File-MD5: 5e6ef4e04375f2a95479719a36283e37 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.html + +
+
+
+ {{'common.feature_flags' | translate}}: +
+
+ + +
+
+ +
+
+
+ + + + + + + + + {{value.value.key}} + + + + + + + + + + + + + + +
+ + + + + +
+ + +
+
+
+
+
+
+ +--boundary_.oOo._it/29I5GYOGQacfyrk8Hzb13cRhzjKUr +Content-Length: 0 +Content-Type: application/octet-stream +X-File-MD5: d41d8cd98f00b204e9800998ecf8427e +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.scss + + +--boundary_.oOo._it/29I5GYOGQacfyrk8Hzb13cRhzjKUr +Content-Length: 664 +Content-Type: application/octet-stream +X-File-MD5: 37fdfe67d5f5a8a8c2a405cf3a5b3bc5 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FeatureFlagListComponent } from './feature-flag-list.component'; + +describe('FeatureFlagListComponent', () => { + let component: FeatureFlagListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ FeatureFlagListComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(FeatureFlagListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._it/29I5GYOGQacfyrk8Hzb13cRhzjKUr +Content-Length: 1293 +Content-Type: application/octet-stream +X-File-MD5: ede63687557453dc3854bba967467dab +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.ts + +import { Component, OnInit } from "@angular/core"; +import { ConfigListComponent } from "../config-list/config-list.component"; +import { Table } from "primeng/table"; +import { PossibleFeatureFlagsQuery } from "../../../../models/graphql/query.model"; +import { DataService } from "../../../../services/data/data.service"; + +@Component({ + selector: \ No newline at end of file diff --git a/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component (conflicted copy 2023-08-18 152854).scss b/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component (conflicted copy 2023-08-18 152854).scss new file mode 100644 index 00000000..e69de29b diff --git a/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.scss b/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.scss index e69de29b..991a7f5c 100644 --- a/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.scss +++ b/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.scss @@ -0,0 +1,243 @@ + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 664 +Content-Type: application/octet-stream +X-File-MD5: 37fdfe67d5f5a8a8c2a405cf3a5b3bc5 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FeatureFlagListComponent } from './feature-flag-list.component'; + +describe('FeatureFlagListComponent', () => { + let component: FeatureFlagListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ FeatureFlagListComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(FeatureFlagListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 1293 +Content-Type: application/octet-stream +X-File-MD5: ede63687557453dc3854bba967467dab +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/feature-flag-list/feature-flag-list.component.ts + +import { Component, OnInit } from "@angular/core"; +import { ConfigListComponent } from "../config-list/config-list.component"; +import { Table } from "primeng/table"; +import { PossibleFeatureFlagsQuery } from "../../../../models/graphql/query.model"; +import { DataService } from "../../../../services/data/data.service"; + +@Component({ + selector: "app-feature-flag-list", + templateUrl: "./feature-flag-list.component.html", + styleUrls: ["./feature-flag-list.component.scss"] +}) +export class FeatureFlagListComponent extends ConfigListComponent implements OnInit { + featureFlags: string[] = []; + + + constructor( + private dataService: DataService + ) { + super(); + } + + ngOnInit() { + this.dataService.query("{possibleFeatureFlags}" + ).subscribe(data => { + this.featureFlags = data.possibleFeatureFlags; + }); + } + + override addNew(table: Table) { + const id = this.internal_data.length == 0 ? 1 : Math.max.apply(Math, this.internal_data.map(value => { + return value.id ?? 0; + })) + 1; + const newItem = { id: id, value: { key: "", value: false } }; + this.internal_data.push(newItem); + + table.initRowEdit(newItem); + const index = this.internal_data.findIndex(l => l.id == newItem.id); + this.editInit(newItem, index); + } +} + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 26 +Content-Type: application/octet-stream +X-File-MD5: e85920b944bbffbc7960571f70b55f05 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-column/hideable-column.component.html + + + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 1 +Content-Type: application/octet-stream +X-File-MD5: 68b329da9893e34099c7d8ad5cb9c940 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-column/hideable-column.component.scss + + + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 656 +Content-Type: application/octet-stream +X-File-MD5: 507dfa7c61fbafbcdea5003a30024135 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-column/hideable-column.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HideableColumnComponent } from './hideable-column.component'; + +describe('HideableColumnComponent', () => { + let component: HideableColumnComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ HideableColumnComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(HideableColumnComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 418 +Content-Type: application/octet-stream +X-File-MD5: 8741a48f8100c9f6db27f9a720fd5b46 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-column/hideable-column.component.ts + +import { Component, Input } from "@angular/core"; +import { HideableComponent } from "../../base/hideable-component"; + +@Component({ + selector: "[hideable-td]", + templateUrl: "./hideable-column.component.html", + styleUrls: ["./hideable-column.component.scss"] +}) +export class HideableColumnComponent extends HideableComponent { + @Input("hideable-td") override column!: string; + + constructor() { + super(); + } + +} + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 297 +Content-Type: application/octet-stream +X-File-MD5: 292d9c607ea51632d90597cf5e693b4b +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-header/hideable-header.component.html + + + + + +
+ +
+ + + + + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 0 +Content-Type: application/octet-stream +X-File-MD5: d41d8cd98f00b204e9800998ecf8427e +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-header/hideable-header.component.scss + + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 656 +Content-Type: application/octet-stream +X-File-MD5: d5d1643bc0a64485679b2514ae9473f6 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-header/hideable-header.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HideableHeaderComponent } from './hideable-header.component'; + +describe('HideableHeaderComponent', () => { + let component: HideableHeaderComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ HideableHeaderComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(HideableHeaderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 455 +Content-Type: application/octet-stream +X-File-MD5: ab629fca59b67e4fafb0876fef35306e +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/hideable-header/hideable-header.component.ts + +import { Component, Input } from "@angular/core"; +import { HideableComponent } from "../../base/hideable-component"; + +@Component({ + selector: "[hideable-th]", + templateUrl: "./hideable-header.component.html", + styleUrls: ["./hideable-header.component.scss"] +}) +export class HideableHeaderComponent extends HideableComponent { + @Input("hideable-th") override column!: string; + @Input() sortable: boolean = false; + constructor() { + super(); + } + +} + +--boundary_.oOo._H1x5z3eY/ud1zeDI7D2/UcT9gomF2WOe +Content-Length: 713 +Content-Type: application/octet-stream +X-File-MD5: b22ca70e7da1b717860dee4d0ca1d62d +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.html + + + + +

{{translationKey | translate}} {{'common.history.header' | translate}}

+ +
+
+
+
+ {{getAttributeTranslationKey(item.key) | translate}} +
+
+ -> +
+
+ {{item.value}} +
+
+
+
+
+ +--boundary_.oOo._daAGe7she4XSHxDe7WcIB0TGtNyzt3jc +Content-Length: 0 +Content-Type: application/octet-stream +X-File-MD5: d41d8cd98f00b204e9800998ecf8427e +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.scss + + +--boundary_.oOo._daAGe7she4XSHxDe7WcIB0TGtNyzt3jc +Content-Length: 628 +Content-Type: application/octet-stream +X-File-MD5: 9402788f75ea5a8623d79889ad424bd2 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.spec.ts + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HistoryBtnComponent } from './history-btn.component'; + +describe('HistoryBtnComponent', () => { + let component: HistoryBtnComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ HistoryBtnComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(HistoryBtnComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); + +--boundary_.oOo._daAGe7she4XSHxDe7WcIB0TGtNyzt3jc +Content-Length: 2980 +Content-Type: application/octet-stream +X-File-MD5: afeaecdcc76b91f894e35534d725e0b5 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.ts + +import { Component, Input, OnInit } from "@angular/core"; +import { History } from "../../../../models/data/data.model"; +import { UserListQuery } from "../../../../models/graphql/query.model"; +import { Server } from "../../../../models/data/server.model"; +import { DataService } from "../../../../services/data/data.service"; +import { AuthService } from "../../../../services/auth/auth.service"; +import { SpinnerService } from "../../../../services/spinner/spinner.service"; +import { ToastService } from "../../../../services/toast/toast.service"; +import { ConfirmationDialogService } from "../../../../services/confirmation-dialog/confirmation-dialog.service"; +import { FormBuilder } from "@angular/forms"; +import { TranslateService } from "@ngx-translate/core"; +import { ActivatedRoute } from "@angular/router"; +import { SidebarService } from "../../../../services/sidebar/sidebar.service"; + +@Component({ + selector: "app-history-btn", + templateUrl: "./history-btn.component.html", + styleUrls: ["./history-btn.component.scss"] +}) +export class HistoryBtnComponent implements OnInit { + + @Input() id: number = 0; + @Input() query: string = ""; + @Input() translationKey: string = ""; + + public history: History[] = []; + + public showSidebar: boolean = false; + private server: Server = {}; + + public constructor( + private authService: AuthService, + private spinner: SpinnerService, + private toastService: ToastService, + private confirmDialog: ConfirmationDialogService, + private fb: FormBuilder, + private translate: TranslateService, + private data: DataService, + private route: ActivatedRoute, + private sidebar: SidebarService + ) { + } + + public ngOnInit(): void { + this.server = this.sidebar.server$.value ?? {}; + } + + private findVal(object: any, key: string) { + var value; + Object.keys(object).some((k: string) => { + if (k === key) { + value = object[k]; + return true; + } + if (object[k] && typeof object[k] === "object") { + value = this.findVal(object[k], key); + return value !== undefined; + } + return null; + }); + return value; + } + + public openHistory(): void { + this.showSidebar = true; + this.data.query(this.query, { + serverId: this.server.id, id: this.id + }, + (x: { servers: Server[] }) => { + return x.servers[0]; + } + ).subscribe(data => { + this.history = this.findVal(data, "history") ?? []; + this.spinner.hideSpinner(); + }); + + + let oldHistory: Partial = {}; + for (const history of this.history) { + const attributes = Object.keys(history).map((key) => { + return key; + }); + for (const attribute of attributes) { + if (history[attribute] === oldHistory[attribute]) { + delete oldHistory[attribute]; + } + } + + oldHistory = history; + } + } + + public getAttributeTranslationKey(key: string): string { + return `common.history.${key}`; + } + +} + +--boundary_.oOo._daAGe7she4XSHxDe7WcIB0TGtNyzt3jc +Content-Length: 388 +Content-Type: application/octet-stream +X-File-MD5: 9c37a4c3e13b9de4de01ae1a75483c17 +X-File-Mtime: 1692365334 +X-File-Path: /Schreibtisch/git_sh-edraft_de/kd_discord_bot/kdb-web/src/app/modules/view/server/achievements/achievements-routing.module.ts + +import {NgModule} from "@angular/core"; +import {RouterModule, Routes} from "@angular/router"; +import { AchievementComponent } from "./components/achievement/achievement.component"; + +const routes: Routes = [ + + {path: '', component: AchievementComponent}, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class AchievementsRoutingModule { + +} + +--boundary_.oOo._daAGe7she4XSHxDe7WcIB0TGtNyzt3jc diff --git a/kdb-web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html b/kdb-web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html index 3dda6d09..52f73c62 100644 --- a/kdb-web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html +++ b/kdb-web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html @@ -125,6 +125,7 @@ + {{'common.id' | translate}}: {{achievement.id}} @@ -136,6 +137,7 @@ + {{'common.name' | translate}}: @@ -147,6 +149,7 @@ + {{'common.description' | translate}}: @@ -158,6 +161,7 @@ + {{'common.attribute' | translate}}: + {{'common.operator' | translate}}: @@ -181,6 +186,7 @@ + {{'common.value' | translate}}: @@ -210,6 +216,7 @@ + {{'common.created_at' | translate}}: {{achievement.createdAt | date:'dd.MM.yy HH:mm'}} @@ -220,6 +227,7 @@ + {{'common.modified_at' | translate}}: {{achievement.modifiedAt | date:'dd.MM.yy HH:mm'}} diff --git a/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles-rules/auto-roles-rules.component.html b/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles-rules/auto-roles-rules.component.html index f88b09fc..269d0329 100644 --- a/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles-rules/auto-roles-rules.component.html +++ b/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles-rules/auto-roles-rules.component.html @@ -92,6 +92,7 @@ + {{'common.id' | translate}}: {{autoRoleRule.id}} @@ -103,6 +104,7 @@ + {{'common.role' | translate}}: + {{'common.emoji' | translate}}: + {{'common.created_at' | translate}}: {{autoRoleRule.createdAt | date:'dd.MM.yy HH:mm'}} @@ -152,6 +156,7 @@ + {{'common.modified_at' | translate}}: {{autoRoleRule.modifiedAt | date:'dd.MM.yy HH:mm'}} diff --git a/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles/auto-roles.component.html b/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles/auto-roles.component.html index 02fd6229..bee0c5c7 100644 --- a/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles/auto-roles.component.html +++ b/kdb-web/src/app/modules/view/server/auto-role/components/auto-roles/auto-roles.component.html @@ -117,6 +117,7 @@ + {{'common.id' | translate}}: {{autoRole.id}} @@ -128,6 +129,7 @@ + {{'common.channel_id' | translate}}: + {{'common.channel_name' | translate}}: {{autoRole.channelName}} @@ -151,6 +154,7 @@ + {{'common.message_id' | translate}}: @@ -162,6 +166,7 @@ + {{'common.rule_count' | translate}}: {{autoRole.autoRoleRuleCount}} @@ -173,6 +178,7 @@ + {{'common.created_at' | translate}}: {{autoRole.createdAt | date:'dd.MM.yy HH:mm'}} @@ -184,6 +190,7 @@ + {{'common.modified_at' | translate}}: {{autoRole.modifiedAt | date:'dd.MM.yy HH:mm'}} @@ -196,8 +203,6 @@
- -