Merge pull request #4758 from GabrielInTheWorld/util-fixes
Hotfix for pagination in motion-list
This commit is contained in:
commit
5e33c500c3
@ -124,23 +124,24 @@ export abstract class ListViewBaseComponent<
|
||||
this.dataSource.paginator._intl.itemsPerPageLabel = this.translate.instant('items per page');
|
||||
}
|
||||
|
||||
// TODO: Add subscription to this.subscriptions
|
||||
if (this.modelFilterListService && this.modelSortService) {
|
||||
// filtering and sorting
|
||||
this.modelFilterListService.initFilters(this.getModelListObservable());
|
||||
this.modelSortService.initSorting(this.modelFilterListService.outputObservable);
|
||||
this.modelSortService.outputObservable.subscribe(data => this.setDataSource(data));
|
||||
this.subscriptions.push(this.modelSortService.outputObservable.subscribe(data => this.setDataSource(data)));
|
||||
} else if (this.modelFilterListService) {
|
||||
// only filter service
|
||||
this.modelFilterListService.initFilters(this.getModelListObservable());
|
||||
this.modelFilterListService.outputObservable.subscribe(data => this.setDataSource(data));
|
||||
this.subscriptions.push(
|
||||
this.modelFilterListService.outputObservable.subscribe(data => this.setDataSource(data))
|
||||
);
|
||||
} else if (this.modelSortService) {
|
||||
// only sorting
|
||||
this.modelSortService.initSorting(this.getModelListObservable());
|
||||
this.modelSortService.outputObservable.subscribe(data => this.setDataSource(data));
|
||||
this.subscriptions.push(this.modelSortService.outputObservable.subscribe(data => this.setDataSource(data)));
|
||||
} else {
|
||||
// none of both
|
||||
this.getModelListObservable().subscribe(data => this.setDataSource(data));
|
||||
this.subscriptions.push(this.getModelListObservable().subscribe(data => this.setDataSource(data)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,8 +157,6 @@
|
||||
>
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
|
||||
</span>
|
||||
<span *ngSwitchCase="'tiles'">
|
||||
<os-grid-layout>
|
||||
@ -182,6 +180,8 @@
|
||||
</os-grid-layout>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<mat-paginator [style.display]="selectedView === 'list' ? 'block' : 'none'" class="on-transition-fade" [pageSizeOptions]="pageSize"></mat-paginator>
|
||||
</mat-drawer-container>
|
||||
|
||||
<mat-menu #motionListMenu="matMenu">
|
||||
|
@ -492,6 +492,9 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
|
||||
public onChangeView(value: string): void {
|
||||
this.selectedView = value;
|
||||
this.storage.set('motionListView', value);
|
||||
if (value === 'list') {
|
||||
this.initTable();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user