diff --git a/client/stillbox/src/app/calls/calls.component.ts b/client/stillbox/src/app/calls/calls.component.ts index e3ac643..95cbc38 100644 --- a/client/stillbox/src/app/calls/calls.component.ts +++ b/client/stillbox/src/app/calls/calls.component.ts @@ -166,6 +166,7 @@ export class CallsComponent { 'duration', ]; curPage = { pageIndex: 0, pageSize: 0 }; + curLen = 0; currentSet!: CallRecord[]; currentServerPage = 0; // page is never 0, forces load isLoading = true; @@ -198,7 +199,7 @@ export class CallsComponent { isAllSelected() { const numSelected = this.selection.selected.length; - const numRows = this.curPage.pageSize; + const numRows = this.curLen; return numSelected === numRows; } @@ -334,6 +335,11 @@ export class CallsComponent { ); }), ); + this.subscriptions.add( + this.callsResult.subscribe((cr) => { + this.curLen = cr.length; + }), + ); } resetFilter() { diff --git a/client/stillbox/src/app/incidents/incident/incident.component.spec.ts b/client/stillbox/src/app/incidents/incident/incident.component.spec.ts index d5de18b..320229b 100644 --- a/client/stillbox/src/app/incidents/incident/incident.component.spec.ts +++ b/client/stillbox/src/app/incidents/incident/incident.component.spec.ts @@ -8,9 +8,8 @@ describe('IncidentComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [IncidentComponent] - }) - .compileComponents(); + imports: [IncidentComponent], + }).compileComponents(); fixture = TestBed.createComponent(IncidentComponent); component = fixture.componentInstance; diff --git a/client/stillbox/src/app/incidents/incident/incident.component.ts b/client/stillbox/src/app/incidents/incident/incident.component.ts index 9d142ea..27d0508 100644 --- a/client/stillbox/src/app/incidents/incident/incident.component.ts +++ b/client/stillbox/src/app/incidents/incident/incident.component.ts @@ -4,8 +4,6 @@ import { Component } from '@angular/core'; selector: 'app-incident', imports: [], templateUrl: './incident.component.html', - styleUrl: './incident.component.scss' + styleUrl: './incident.component.scss', }) -export class IncidentComponent { - -} +export class IncidentComponent {} diff --git a/client/stillbox/src/app/incidents/incidents.component.scss b/client/stillbox/src/app/incidents/incidents.component.scss index 031b8d5..9c1fc7c 100644 --- a/client/stillbox/src/app/incidents/incidents.component.scss +++ b/client/stillbox/src/app/incidents/incidents.component.scss @@ -60,4 +60,4 @@ form { .filterBox { flex: 1 1 300px; -} \ No newline at end of file +} diff --git a/client/stillbox/src/app/incidents/incidents.component.ts b/client/stillbox/src/app/incidents/incidents.component.ts index 93ce64c..0b2485f 100644 --- a/client/stillbox/src/app/incidents/incidents.component.ts +++ b/client/stillbox/src/app/incidents/incidents.component.ts @@ -85,10 +85,11 @@ export class IncidentsComponent { incsResult = new BehaviorSubject(new Array(0)); @ViewChild('paginator') paginator!: MatPaginator; count = 0; + curLen = 0; page = 0; perPage = 25; pageSizeOptions = [25, 50, 75, 100, 200]; - columns = ['startTime', 'endTime', 'name', 'numCalls', 'edit']; + columns = ['select', 'startTime', 'endTime', 'name', 'numCalls', 'edit']; curPage = { pageIndex: 0, pageSize: 0 }; currentSet!: IncidentRecord[]; currentServerPage = 0; // page is never 0, forces load @@ -119,7 +120,7 @@ export class IncidentsComponent { isAllSelected() { const numSelected = this.selection.selected.length; - const numRows = this.curPage.pageSize; + const numRows = this.curLen; return numSelected === numRows; } @@ -238,6 +239,11 @@ export class IncidentsComponent { ); }), ); + this.subscriptions.add( + this.incsResult.subscribe((cr) => { + this.curLen = cr.length; + }), + ); } resetFilter() {