Skip to content

Commit

Permalink
Merge pull request #651 from bcgov/oleks
Browse files Browse the repository at this point in the history
BugFixes
  • Loading branch information
ychung-mot committed Sep 16, 2024
2 parents a428851 + a44898b commit 2c92056
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<h2 class="title">Aggregated Listings</h2>
<div class="search-container">
<span class="vertical-spacer" *ngIf="isFilterSet"></span>
<p-dropdown [options]="searchColumns" id="search-by-drd" [(ngModel)]="searchColumn"
class="search-by-select"></p-dropdown>
<p-dropdown [options]="searchColumns" [showClear]="searchColumn !== 'all'" (onClear)="clearSearchBy($event)"
id="search-by-drd" [(ngModel)]="searchColumn" class="search-by-select"></p-dropdown>
<span class="p-input-icon-right search-input-container">
<button pButton class="search-submit-btn" id="search-submit-btn" (click)="onSearch()"> <i
class="pi pi-search"></i></button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ export class AggregatedListingsTableComponent implements OnInit {
}

onSearch(): void {
this.getListings(this.currentPage.pageNumber);
this.paginator.changePage(0);
}

clearSearchBy(_event: any): void {
this.searchColumn = 'all';
this.cd.detectChanges();
}

get isFilterSet(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<h2 class="title">Listings</h2>
<div class="search-container">
<span class="vertical-spacer" *ngIf="isFilterSet"></span>
<p-dropdown [options]="searchColumns" id="search-by-drd" [(ngModel)]="searchColumn"
class="search-by-select"></p-dropdown>
<p-dropdown [options]="searchColumns" [showClear]="searchColumn !== 'all'" (onClear)="clearSearchBy($event)"
id="search-by-drd" [(ngModel)]="searchColumn" class="search-by-select"></p-dropdown>
<span class="p-input-icon-right search-input-container">
<button pButton class="search-submit-btn" id="search-submit-btn" (click)="onSearch()"> <i
class="pi pi-search"></i></button>
Expand Down Expand Up @@ -213,7 +213,7 @@ <h2 class="title">Listings</h2>
{{ row.lastActionNm || '-'}}
</td>
<td>
{{ row.lastActionDtm || '-' |date }}
{{ row.lastActionDtm? '-': row.lastActionDtm |date }}
</td>
</tr>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ListingDataService } from '../../../common/services/listing-data.servic
import { PagingResponse, PagingResponsePageInfo } from '../../../common/models/paging-response';
import { ListingTableRow } from '../../../common/models/listing-table-row';
import { CommonModule } from '@angular/common';
import { Table, TableModule } from 'primeng/table';
import { TableModule } from 'primeng/table';
import { ButtonModule } from 'primeng/button';
import { DropdownModule } from 'primeng/dropdown';
import { CheckboxModule } from 'primeng/checkbox';
Expand Down Expand Up @@ -87,10 +87,6 @@ export class ListingsTableComponent implements OnInit {
) { }

ngOnInit(): void {
setInterval(() => {
this.cd.detectChanges();
}, 250);

this.getOrganizations();
this.initFilters();
let page = 1;
Expand Down Expand Up @@ -158,6 +154,11 @@ export class ListingsTableComponent implements OnInit {
this.paginator.changePage(0);
}

clearSearchBy(_event: any): void {
this.searchColumn = 'all';
this.cd.detectChanges();
}

unselectAll(): void {
this.selectedListings = [];
}
Expand Down Expand Up @@ -188,7 +189,7 @@ export class ListingsTableComponent implements OnInit {
}

onSearch(): void {
this.getListings(this.currentPage.pageNumber);
this.paginator.changePage(0);
}

get isFilterSet(): boolean {
Expand Down

0 comments on commit 2c92056

Please sign in to comment.