Skip to content

Commit

Permalink
Merge pull request #1860 from bcgov/hotfix/ALCS-2251
Browse files Browse the repository at this point in the history
Fix Commissioners Being Able to Search All Portal Status Codes on Advanced Search
  • Loading branch information
Abradat authored Sep 16, 2024
2 parents 07048e4 + 4b0521b commit c1ab369
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion alcs-frontend/src/app/features/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,20 @@ export class SearchComponent implements OnInit, OnDestroy {
getSearchParams(): SearchRequestDto {
const resolutionNumberString = this.formatStringSearchParam(this.searchForm.controls.resolutionNumber.value);
let fileTypes: string[];
let portalStatusCodes;

if (this.searchForm.controls.componentType.value === null) {
fileTypes = this.isCommissioner ? this.fileTypeService.getCommissionerListData() : [];
} else {
fileTypes = this.searchForm.controls.componentType.value!;
}

if (this.searchForm.controls.portalStatus.value?.length === 0) {
portalStatusCodes = this.isCommissioner ? this.portalStatusDataService.getCommissionerListData() : [];
} else {
portalStatusCodes = this.searchForm.controls.portalStatus.value!;
}

return {
// pagination
pageSize: this.itemsPerPage,
Expand All @@ -273,7 +280,7 @@ export class SearchComponent implements OnInit, OnDestroy {
pid: this.formatStringSearchParam(this.searchForm.controls.pid.value),
resolutionNumber: resolutionNumberString ? parseInt(resolutionNumberString) : undefined,
resolutionYear: this.searchForm.controls.resolutionYear.value ?? undefined,
portalStatusCodes: this.portalStatusControl.value !== null ? this.portalStatusControl.value : undefined,
portalStatusCodes: portalStatusCodes,
governmentName: this.formatStringSearchParam(this.searchForm.controls.government.value),
regionCode: this.searchForm.controls.region.value ?? undefined,
dateSubmittedFrom: this.searchForm.controls.dateSubmittedFrom.value
Expand Down

0 comments on commit c1ab369

Please sign in to comment.