Fixed sorting

This commit is contained in:
Sven Heidemann 2023-10-15 16:18:09 +02:00
parent 8f26835d72
commit 89199004c4
6 changed files with 11 additions and 8 deletions

View File

@ -31,7 +31,8 @@
"icmplib==3.0.4", "icmplib==3.0.4",
"ariadne==0.20.1", "ariadne==0.20.1",
"cryptography==41.0.4", "cryptography==41.0.4",
"discord==2.3.2" "discord==2.3.2",
"bs4==0.0.1"
], ],
"DevDependencies": [ "DevDependencies": [
"cpl-cli==2023.4.0.post3", "cpl-cli==2023.4.0.post3",

4
web/package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "kdb-web", "name": "web",
"version": "1.2.0", "version": "1.2.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "kdb-web", "name": "web",
"version": "1.2.0", "version": "1.2.0",
"dependencies": { "dependencies": {
"@angular/animations": "^15.1.4", "@angular/animations": "^15.1.4",

View File

@ -52,4 +52,4 @@
"tslib": "^2.4.1", "tslib": "^2.4.1",
"typescript": "~4.9.5" "typescript": "~4.9.5"
} }
} }

View File

@ -5,9 +5,11 @@ import { ComponentWithTable } from "../../../base/component-with-table";
export class HideableComponent { export class HideableComponent {
@HostBinding("class.hidden-column") @HostBinding("class.hidden-column")
get hidden() { get hidden() {
return !(this.parent?.isColumnVisible(this.column) ?? true); const column = this.subColumn ?? this.column;
return !(this.parent?.isColumnVisible(column) ?? true);
}; };
@Input() column!: string; @Input() column!: string;
@Input() subColumn!: string;
@Input() parent!: ComponentWithTable; @Input() parent!: ComponentWithTable;
} }

View File

@ -2,7 +2,7 @@
<ng-content></ng-content> <ng-content></ng-content>
</ng-template> </ng-template>
<div *ngIf="sortable; else without" [pSortableColumn]="column"> <div *ngIf="sortable; else without" [pSortableColumn]="subColumn ?? column">
<ng-container *ngTemplateOutlet="content"></ng-container> <ng-container *ngTemplateOutlet="content"></ng-container>
</div> </div>

View File

@ -72,10 +72,10 @@
</div> </div>
</th> </th>
<th hideable-th="level" [parent]="this" [sortable]="true"> <th hideable-th="level" subColumn="level.min_xp" [parent]="this" [sortable]="true">
<div class="table-header-label"> <div class="table-header-label">
<div class="table-header-text">{{'common.level' | translate}}</div> <div class="table-header-text">{{'common.level' | translate}}</div>
<p-sortIcon field="level.name" class="table-header-icon"></p-sortIcon> <p-sortIcon field="level" class="table-header-icon"></p-sortIcon>
</div> </div>
</th> </th>