Improved sorting #130
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
export interface Sort {
|
||||
sortColumn?: string;
|
||||
sortDirection?: string;
|
||||
sortDirection?: SortDirection;
|
||||
}
|
||||
|
||||
export enum SortDirection {
|
||||
ASC = "ASC",
|
||||
DESC = "DESC",
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ import { Server } from "../../../../../models/data/server.model";
|
||||
import { catchError } from "rxjs/operators";
|
||||
import { Queries } from "../../../../../models/graphql/queries.model";
|
||||
import { Page } from "../../../../../models/graphql/filter/page.model";
|
||||
import { Sort } from "../../../../../models/graphql/filter/sort.model";
|
||||
import { Sort, SortDirection } from "../../../../../models/graphql/filter/sort.model";
|
||||
import { Query } from "../../../../../models/graphql/query.model";
|
||||
import { SidebarService } from "../../../../../services/sidebar/sidebar.service";
|
||||
|
||||
@@ -106,7 +106,7 @@ export class DashboardComponent implements OnInit {
|
||||
|
||||
this.sort = {
|
||||
sortColumn: event.sortField ?? "",
|
||||
sortDirection: event.sortOrder === 1 ? "asc" : event.sortOrder === -1 ? "desc" : "asc"
|
||||
sortDirection: event.sortOrder === 1 ? SortDirection.ASC : event.sortOrder === -1 ? SortDirection.DESC: SortDirection.ASC
|
||||
};
|
||||
|
||||
if (event.filters) {
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th pSortableColumn="id">
|
||||
<th class="table-header-small" pSortableColumn="id">
|
||||
<div class="table-header-label">
|
||||
<div class="table-header-text">{{'view.server.members.headers.id' | translate}}</div>
|
||||
<p-sortIcon field="id" class="table-header-icon"></p-sortIcon>
|
||||
@@ -61,10 +61,10 @@
|
||||
</div>
|
||||
</th>
|
||||
|
||||
<th class="table-header-small-dropdown" pSortableColumn="level">
|
||||
<th class="table-header-small-dropdown" pSortableColumn="level.name">
|
||||
<div class="table-header-label">
|
||||
<div class="table-header-text">{{'view.server.members.headers.level' | translate}}</div>
|
||||
<p-sortIcon field="level" class="table-header-icon"></p-sortIcon>
|
||||
<p-sortIcon field="level.name" class="table-header-icon"></p-sortIcon>
|
||||
</div>
|
||||
</th>
|
||||
|
||||
|
Reference in New Issue
Block a user