Merge pull request #4569 from tsiegleauq/list-view-page-size

Enlarge page size
This commit is contained in:
Emanuel Schütze 2019-04-04 22:47:38 +02:00 committed by GitHub
commit bb98e9b120
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 94 additions and 80 deletions

View File

@ -112,7 +112,7 @@
*matRowDef="let row; columns: getColumnDefinition()" *matRowDef="let row; columns: getColumnDefinition()"
></mat-row> ></mat-row>
</mat-table> </mat-table>
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator> <mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
</mat-drawer-container> </mat-drawer-container>
<mat-menu #agendaMenu="matMenu"> <mat-menu #agendaMenu="matMenu">

View File

@ -16,10 +16,14 @@
</os-head-bar> </os-head-bar>
<mat-drawer-container class="on-transition-fade"> <mat-drawer-container class="on-transition-fade">
<os-sort-filter-bar [filterCount]="filteredCount" [filterService]="filterService" [sortService]="sortService" <os-sort-filter-bar
(searchFieldChange)="searchFilter($event)"> [filterCount]="filteredCount"
[filterService]="filterService"
[sortService]="sortService"
(searchFieldChange)="searchFilter($event)"
>
</os-sort-filter-bar> </os-sort-filter-bar>
<mat-table class="os-listview-table on-transition-fade" [dataSource]="dataSource" matSort> <mat-table class="os-listview-table on-transition-fade" [dataSource]="dataSource" matSort>
<!-- slector column --> <!-- slector column -->
<ng-container matColumnDef="selector"> <ng-container matColumnDef="selector">
<mat-header-cell *matHeaderCellDef mat-sort-header class="icon-cell"></mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header class="icon-cell"></mat-header-cell>
@ -66,11 +70,11 @@
*matRowDef="let row; columns: getColumnDefintion()" *matRowDef="let row; columns: getColumnDefintion()"
> >
</mat-row> </mat-row>
</mat-table> </mat-table>
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator> <mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
<mat-menu #assignmentMenu="matMenu"> <mat-menu #assignmentMenu="matMenu">
<div *ngIf="!isMultiSelect"> <div *ngIf="!isMultiSelect">
<button mat-menu-item *osPerms="'assignment.can_manage'" (click)="toggleMultiSelect()"> <button mat-menu-item *osPerms="'assignment.can_manage'" (click)="toggleMultiSelect()">
<mat-icon>library_add</mat-icon> <mat-icon>library_add</mat-icon>
@ -88,10 +92,15 @@
<span translate>Select all</span> <span translate>Select all</span>
</button> </button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<button mat-menu-item class="red-warning-text" *osPerms="'assignment.can_manage'" (click)="deleteSelected()"> <button
mat-menu-item
class="red-warning-text"
*osPerms="'assignment.can_manage'"
(click)="deleteSelected()"
>
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
<span translate>Delete</span> <span translate>Delete</span>
</button> </button>
</div> </div>
</mat-menu> </mat-menu>
</mat-drawer-container> </mat-drawer-container>

View File

@ -45,6 +45,11 @@ export abstract class ListViewBaseComponent<V extends BaseViewModel, M extends B
*/ */
private paginationStorageObject: { [key: string]: number }; private paginationStorageObject: { [key: string]: number };
/**
* Determine the default page size of paginated list views
*/
public pageSize = [50, 100, 150, 200, 250];
/** /**
* The table itself * The table itself
*/ */

View File

@ -55,7 +55,7 @@
<mat-row *matRowDef="let row; columns: getRowDef()" (click)="onClickRow(row)"></mat-row> <mat-row *matRowDef="let row; columns: getRowDef()" (click)="onClickRow(row)"></mat-row>
</mat-table> </mat-table>
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator> <mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
<mat-menu #historyMenu="matMenu"> <mat-menu #historyMenu="matMenu">
<button mat-menu-item class="red-warning-text" (click)="onDeleteAllButton()"> <button mat-menu-item class="red-warning-text" (click)="onDeleteAllButton()">

View File

@ -141,7 +141,7 @@
></mat-row> ></mat-row>
</mat-table> </mat-table>
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator> <mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
<mat-menu #singleFileMenu="matMenu"> <mat-menu #singleFileMenu="matMenu">
<ng-template matMenuContent let-file="file"> <ng-template matMenuContent let-file="file">

View File

@ -145,7 +145,7 @@
</mat-row> </mat-row>
</mat-table> </mat-table>
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator> <mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
</mat-drawer-container> </mat-drawer-container>
<mat-menu #motionListMenu="matMenu"> <mat-menu #motionListMenu="matMenu">

View File

@ -42,4 +42,4 @@
<mat-row (click)="selectItem(row, $event)" *matRowDef="let row; columns: ['name']"></mat-row> <mat-row (click)="selectItem(row, $event)" *matRowDef="let row; columns: ['name']"></mat-row>
</mat-table> </mat-table>
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator> <mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>

View File

@ -104,7 +104,7 @@
</mat-row> </mat-row>
</mat-table> </mat-table>
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator> <mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
<mat-menu #userMenu="matMenu"> <mat-menu #userMenu="matMenu">
<div *ngIf="!isMultiSelect"> <div *ngIf="!isMultiSelect">