Browse Source

fix(lib): convert pageSize to signal

pull/6556/head
KenTandrian 3 weeks ago
parent
commit
33347624ce
  1. 4
      libs/ui/src/lib/holdings-table/holdings-table.component.html
  2. 7
      libs/ui/src/lib/holdings-table/holdings-table.component.ts

4
libs/ui/src/lib/holdings-table/holdings-table.component.html

@ -193,7 +193,7 @@
</table>
</div>
<mat-paginator class="d-none" [pageSize]="pageSize" />
<mat-paginator class="d-none" [pageSize]="pageSize()" />
@if (isLoading()) {
<ngx-skeleton-loader
@ -206,7 +206,7 @@
/>
}
@if (dataSource.data.length > pageSize && !isLoading()) {
@if (dataSource.data.length > pageSize() && !isLoading()) {
<div class="my-3 text-center">
<button mat-stroked-button (click)="onShowAllHoldings()">
<ng-container i18n>Show all</ng-container>

7
libs/ui/src/lib/holdings-table/holdings-table.component.ts

@ -9,10 +9,10 @@ import {
CUSTOM_ELEMENTS_SCHEMA,
ChangeDetectionStrategy,
Component,
Input,
computed,
effect,
input,
model,
output,
viewChild
} from '@angular/core';
@ -46,13 +46,12 @@ import { GfValueComponent } from '../value/value.component';
templateUrl: './holdings-table.component.html'
})
export class GfHoldingsTableComponent {
@Input() pageSize = Number.MAX_SAFE_INTEGER;
public readonly hasPermissionToOpenDetails = input(true);
public readonly hasPermissionToShowQuantities = input(true);
public readonly hasPermissionToShowValues = input(true);
public readonly holdings = input.required<PortfolioPosition[]>();
public readonly locale = input(getLocale());
public readonly pageSize = model(Number.MAX_SAFE_INTEGER);
public readonly holdingClicked = output<AssetProfileIdentifier>();
@ -118,7 +117,7 @@ export class GfHoldingsTableComponent {
}
protected onShowAllHoldings() {
this.pageSize = Number.MAX_SAFE_INTEGER;
this.pageSize.set(Number.MAX_SAFE_INTEGER);
setTimeout(() => {
this.dataSource.paginator = this.paginator();

Loading…
Cancel
Save