Skip to content

Commit 120c2fb

Browse files
author
Richand101
authored
Merge pull request #521 from bcgov/oleks
DSS-658 FE: Filter Listings by Location - Group communities - Extra requirements
2 parents 126d190 + 606805b commit 120c2fb

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

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

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

53-
<p-table #table [value]="listings" [scrollable]="true" scrollHeight="{{isCEU?'550px':'500px'}}"
54-
[(selection)]="selectedListings" styleClass="p-datatable-sm" [tableStyle]="{ 'min-width': '50rem' }"
55-
[selectionPageOnly]="true">
53+
<p-table #table [ariaLabel]="'table-of-listings'" [value]="listings" [scrollable]="true"
54+
scrollHeight="{{isCEU?'550px':'500px'}}" [(selection)]="selectedListings" styleClass="p-datatable-sm"
55+
[tableStyle]="{ 'min-width': '50rem' }" [selectionPageOnly]="true">
5656
<ng-template pTemplate="header">
5757
<tr>
58-
<th style="width: 4rem">
58+
<th [ariaLabel]="'select-listing'" style="width: 4rem">
5959
<p-tableHeaderCheckbox></p-tableHeaderCheckbox>
6060
</th>
6161
<th class="sortable-header" id="status_header"
@@ -152,7 +152,7 @@ <h2 class="title">Listings</h2>
152152
<ng-template pTemplate="body" let-row>
153153
<tr>
154154
<td>
155-
<p-tableCheckbox [value]="row"></p-tableCheckbox>
155+
<p-tableCheckbox [ariaLabel]="'select-listing-row'" [value]="row"></p-tableCheckbox>
156156
</td>
157157
<td>
158158
<div [ngSwitch]="row.listingStatusType" class="align-center status-col">
@@ -175,11 +175,12 @@ <h2 class="title">Listings</h2>
175175
</td>
176176
<td>{{ row.offeringOrganizationNm }}</td>
177177
<td>
178-
<a target="_blank" class="listing-id-link" [href]="row.platformListingUrl">{{
178+
<a [ariaLabel]="'platform-listing-url'" target="_blank" class="listing-id-link"
179+
[href]="row.platformListingUrl">{{
179180
row.platformListingNo }}</a>
180181
</td>
181182
<td class="align-center">
182-
<a pButton class="details-button-with-icon" target="_blank"
183+
<a [ariaLabel]="'open-listing-details'" pButton class="details-button-with-icon" target="_blank"
183184
[routerLink]="'/listing/'+row.rentalListingId"><i class="pi pi-list"></i></a>
184185
</td>
185186
<td

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ export class ListingsTableComponent implements OnInit {
321321
private getOrganizations(): void {
322322
this.requestAccessService.getOrganizations('LG').subscribe({
323323
next: (orgs) => {
324-
this.communities = orgs.map((org: DropdownOptionOrganization) => ({ label: org.label, value: org.value, localGovernmentType: org.localGovernmentType || 'Uncategorized' }));
324+
console.log(orgs.filter((x: any) => (x.organizationCd as string).includes('LGXFN-Homalco')))
325+
this.communities = orgs.map((org: DropdownOptionOrganization) => ({ label: org.label, value: org.value, localGovernmentType: org.localGovernmentType || 'Other' }));
325326

326327
const groupedData: Array<any> = this.communities.reduce((acc: any, curr: any) => {
327328
const existingGroup = acc.find((group: any) => group.value === curr.localGovernmentType);
@@ -346,6 +347,9 @@ export class ListingsTableComponent implements OnInit {
346347
}
347348

348349
private sortOrg(a: string, b: string): number {
350+
if (b === 'Other') {
351+
return -1;
352+
}
349353
if (a > b) {
350354
return 1;
351355
}

0 commit comments

Comments
 (0)