Skip to content

Commit a07bd1c

Browse files
DSS-809: No spinning wheel on Platform history page.
DSS-807: When filter is changed, results don't return to page 1
1 parent 8d95e6a commit a07bd1c

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

frontend/src/app/common/listing-upload-history-table/listing-upload-history-table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ <h2>Platform Upload History</h2>
120120
</ng-template>
121121
<ng-template pTemplate="emptymessage">
122122
<tr>
123-
<td colspan="8">No records found</td>
123+
<td colspan="9">No records found</td>
124124
</tr>
125125
</ng-template>
126126
</p-table>

frontend/src/app/common/listing-upload-history-table/listing-upload-history-table.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export class ListingUploadHistoryTableComponent implements OnInit {
5353
) { }
5454

5555
ngOnInit(): void {
56-
this.loaderService.loadingStart();
5756
const getCurrentUser = this.userDataService.getCurrentUser()
5857
const getPlatforms = this.delistingService.getPlatforms();
5958

@@ -66,7 +65,6 @@ export class ListingUploadHistoryTableComponent implements OnInit {
6665
}
6766
},
6867
complete: () => {
69-
this.loaderService.loadingEnd();
7068
this.cd.detectChanges();
7169
}
7270
});

frontend/src/app/features/components/listings-table/listings-table.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h2 class="title">Listings</h2>
5050
</div>
5151
</ng-template>
5252

53-
<p-table #table [ariaLabel]="'table-of-listings'" id="listings-table" [value]="listings" [scrollable]="true"
53+
<p-table [ariaLabel]="'table-of-listings'" id="listings-table" [value]="listings" [scrollable]="true"
5454
scrollHeight="{{isCEU?'550px':'500px'}}" [(selection)]="selectedListings" styleClass="p-datatable-sm"
5555
[tableStyle]="{ 'min-width': '50rem' }" [selectionPageOnly]="true">
5656
<ng-template pTemplate="header">
@@ -223,7 +223,7 @@ <h2 class="title">Listings</h2>
223223
</tr>
224224
</ng-template>
225225
</p-table>
226-
<p-paginator class="listings-paginator" *ngIf="currentPage" (onPageChange)="onPageChange($event)"
226+
<p-paginator #pagingRef class="listings-paginator" *ngIf="currentPage" (onPageChange)="onPageChange($event)"
227227
[rows]="currentPage.pageSize || 25" [totalRecords]="currentPage.totalCount || 0" [showPageLinks]="false"
228228
[showCurrentPageReport]="true" [showFirstLastIcon]="true" [rowsPerPageOptions]="[10, 25, 50, 100]"
229229
[currentPageReportTemplate]="'Rows per page: {rows} &nbsp; {first}-{last} of {totalRecords}'"></p-paginator>

frontend/src/app/features/components/listings-table/listings-table.component.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Table, TableModule } from 'primeng/table';
77
import { ButtonModule } from 'primeng/button';
88
import { DropdownModule } from 'primeng/dropdown';
99
import { CheckboxModule } from 'primeng/checkbox';
10-
import { PaginatorModule } from 'primeng/paginator';
10+
import { Paginator, PaginatorModule } from 'primeng/paginator';
1111
import { DialogModule } from 'primeng/dialog';
1212
import { InputTextModule } from 'primeng/inputtext';
1313
import { PanelModule } from 'primeng/panel';
@@ -54,7 +54,7 @@ import { FilterPersistenceService } from '../../../common/services/filter-persis
5454
styleUrl: './listings-table.component.scss'
5555
})
5656
export class ListingsTableComponent implements OnInit {
57-
@ViewChild('listingsTableMain') listingsTableMain!: Table;
57+
@ViewChild('pagingRef') pagingRef!: Paginator;
5858

5959
selectedListings = []
6060
listings = new Array<ListingTableRow>();
@@ -87,6 +87,10 @@ export class ListingsTableComponent implements OnInit {
8787
) { }
8888

8989
ngOnInit(): void {
90+
setInterval(() => {
91+
this.cd.detectChanges();
92+
}, 250);
93+
9094
this.getOrganizations();
9195
this.initFilters();
9296
let page = 1;
@@ -225,6 +229,7 @@ export class ListingsTableComponent implements OnInit {
225229
this.filterPersistenceService.listingFilter = { byLocation: { isBusinessLicenceRequired: '', isPrincipalResidenceRequired: '' }, community: 0, byStatus: {} };
226230
this.initFilters();
227231
this.isFilterOpened = false;
232+
this.currentPage.pageNumber = 1;
228233
this.onSearch();
229234
}
230235

@@ -312,6 +317,7 @@ export class ListingsTableComponent implements OnInit {
312317
next: (res: PagingResponse<ListingTableRow>) => {
313318
this.currentPage = res.pageInfo;
314319
this.listings = res.sourceList;
320+
this.pagingRef.updateFirst();
315321
},
316322
complete: () => {
317323
this.loaderService.loadingEnd();

0 commit comments

Comments
 (0)