Fixed hidden columns #1.1.0.rc4 #346

Merged
edraft merged 1 commits from 1.1.0.rc4 into 1.1.0 2023-08-17 21:27:32 +02:00
10 changed files with 41 additions and 10 deletions
Showing only changes of commit 2956dcb9c2 - Show all commits

View File

@ -1 +1,26 @@
# -*- coding: utf-8 -*-
"""
bot Keksdose bot
~~~~~~~~~~~~~~~~~~~
Discord bot for the Keksdose discord Server
:copyright: (c) 2022 - 2023 sh-edraft.de
:license: MIT, see LICENSE for more details.
"""
__title__ = "bot_graphql.model"
__author__ = "Sven Heidemann"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
__version__ = "1.1.0rc4"
from collections import namedtuple
# imports
VersionInfo = namedtuple("VersionInfo", "major minor micro")
version_info = VersionInfo(major="1", minor="1", micro="0.rc4")

View File

@ -15,7 +15,7 @@ export class ComponentWithTable {
return this._hiddenColumns;
}
private name: string = "";
public name: string = "";
public columns: Column[] = [];
constructor(

View File

@ -16,7 +16,7 @@
</ng-container>
{{'admin.auth_users.users' | translate}}
</div>
<app-multi-select-columns [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
<app-multi-select-columns [table]="name" [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
</div>
<div class="table-caption-btn-wrapper btn-wrapper">

View File

@ -1,13 +1,13 @@
<div class="table-caption-column-select">
<p-multiSelect display="chip" [options]="columns" [(ngModel)]="hiddenColumns" optionLabel="name" placeholder="{{'common.hidden_columns' | translate}}" [filter]=false>
<ng-template let-value pTemplate="selectedItems">
<div *ngFor="let item of hiddenColumns; let i = index;">
<ng-template pTemplate="selectedItems">
<div *ngFor="let item of visibleHiddenColumns; let i = index;">
<div *ngIf="item.name">
{{'common.' + item.name | translate}}<span *ngIf="i < columns.length-1">,</span>
</div>
<div *ngIf="!item.name">{{'common.hidden_columns' | translate}}</div>
</div>
<div *ngIf="!hiddenColumns || hiddenColumns.length === 0">{{'common.hidden_columns' | translate}}</div>
<div *ngIf="!visibleHiddenColumns || visibleHiddenColumns.length === 0">{{'common.hidden_columns' | translate}}</div>
</ng-template>
<ng-template let-item pTemplate="item">

View File

@ -10,6 +10,8 @@ export class MultiSelectColumnsComponent {
@Input() columns: Column[] = [];
private _hiddenColumns: Column[] = [];
@Input() table: String = "";
@Input()
set hiddenColumns(columns: Column[]) {
this._hiddenColumns = columns;
@ -20,5 +22,9 @@ export class MultiSelectColumnsComponent {
return this._hiddenColumns;
}
get visibleHiddenColumns(): Column[] {
return this._hiddenColumns.filter(x => x.key.startsWith(`${this.table}_`));
}
@Output() hiddenColumnsChange: EventEmitter<Column[]> = new EventEmitter<Column[]>();
}

View File

@ -17,7 +17,7 @@
{{'view.server.achievements.achievements' | translate}}
</div>
<app-multi-select-columns [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
<app-multi-select-columns [table]="name" [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
</div>
<div class="table-caption-btn-wrapper btn-wrapper">

View File

@ -16,7 +16,7 @@
</ng-container>
{{'view.server.auto_roles.rules.auto_roles' | translate}}
</div>
<app-multi-select-columns [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
<app-multi-select-columns [table]="name" [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
</div>
<div class="table-caption-btn-wrapper btn-wrapper">

View File

@ -17,7 +17,7 @@
{{'view.server.auto_roles.auto_roles' | translate}}
</div>
<app-multi-select-columns [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
<app-multi-select-columns [table]="name" [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
</div>
<div class="table-caption-btn-wrapper btn-wrapper">

View File

@ -17,7 +17,7 @@
{{'view.server.levels.levels' | translate}}
</div>
<app-multi-select-columns [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
<app-multi-select-columns [table]="name" [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
</div>
<div class="table-caption-btn-wrapper btn-wrapper">

View File

@ -17,7 +17,7 @@
{{'view.server.members.members' | translate}}
</div>
<app-multi-select-columns [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
<app-multi-select-columns [table]="name" [columns]="columns" [(hiddenColumns)]="hiddenColumns"></app-multi-select-columns>
</div>
<div class="table-caption-btn-wrapper btn-wrapper">