Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "ALCS-2175 Advanced search revamp" #1982

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@
</td>
</ng-container>

<ng-container matColumnDef="status">
<ng-container matColumnDef="portalStatus">
<th class="type-cell" mat-header-cell *matHeaderCellDef mat-sort-header>Portal Status</th>
<td mat-cell class="type-cell" *matCellDef="let element">
<app-application-submission-status-type-pill
*ngIf="element.status"
[type]="element.status"
></app-application-submission-status-type-pill>
<app-spinner-status *ngIf="!element.status" />
</td>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface SearchResult {
referenceId: string;
board?: string;
class: string;
status?: ApplicationSubmissionStatusPill | null;
status?: ApplicationSubmissionStatusPill;
}

@Component({
Expand All @@ -42,7 +42,7 @@ export class ApplicationSearchTableComponent {

@Output() tableChange = new EventEmitter<TableChange>();

displayedColumns = ['fileId', 'dateSubmitted', 'ownerName', 'type', 'government', 'status'];
displayedColumns = ['fileId', 'dateSubmitted', 'ownerName', 'type', 'government', 'portalStatus'];
dataSource: SearchResult[] = [];
itemsPerPage = 20;
total = 0;
Expand Down Expand Up @@ -88,22 +88,24 @@ export class ApplicationSearchTableComponent {
private mapApplications(applications: ApplicationSearchResultDto[]): SearchResult[] {
return applications.map((e) => {
const status = this.statuses.find((st) => st.code === e.status);

return {
fileNumber: e.fileNumber,
dateSubmitted: e.dateSubmitted,
ownerName: e.ownerName,
type: e.type,
localGovernmentName: e.localGovernmentName,
portalStatus: e.portalStatus,
referenceId: e.referenceId,
board: e.boardCode,
class: e.class,
status: status ? {
backgroundColor: status.portalBackgroundColor ?? defaultStatusBackgroundColour,
textColor: status.portalColor ?? defaultStatusColour,
borderColor: status.portalBackgroundColor,
label: status.label,
shortLabel: status.label,
} : null,
status: {
backgroundColor: status?.portalBackgroundColor ?? defaultStatusBackgroundColour,
textColor: status?.portalColor ?? defaultStatusColour,
borderColor: status?.portalBackgroundColor,
label: status?.label,
shortLabel: status?.label,
},
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@
</td>
</ng-container>

<ng-container matColumnDef="status">
<ng-container matColumnDef="portalStatus">
<th class="type-cell" mat-header-cell *matHeaderCellDef mat-sort-header>Portal Status</th>
<td mat-cell class="type-cell" *matCellDef="let element">
<app-application-submission-status-type-pill
*ngIf="element.status"
[type]="element.status"
></app-application-submission-status-type-pill>
<app-spinner-status *ngIf="!element.status" />
</td>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface SearchResult {
referenceId: string;
board?: string;
class: string;
status?: ApplicationSubmissionStatusPill | null;
status?: ApplicationSubmissionStatusPill;
}

@Component({
Expand All @@ -41,7 +41,7 @@ export class NoticeOfIntentSearchTableComponent {

@Output() tableChange = new EventEmitter<TableChange>();

displayedColumns = ['fileId', 'dateSubmitted', 'ownerName', 'type', 'government', 'status'];
displayedColumns = ['fileId', 'dateSubmitted', 'ownerName', 'type', 'government', 'portalStatus'];
dataSource: SearchResult[] = [];

itemsPerPage = 20;
Expand Down Expand Up @@ -98,13 +98,13 @@ export class NoticeOfIntentSearchTableComponent {
referenceId: e.referenceId,
board: e.boardCode,
class: e.class,
status: status ? {
status: {
backgroundColor: status!.alcsBackgroundColor,
textColor: status!.alcsColor,
borderColor: status!.alcsBackgroundColor,
label: status!.label,
shortLabel: status!.label,
} : null,
},
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@
</td>
</ng-container>

<ng-container matColumnDef="status">
<ng-container matColumnDef="portalStatus">
<th class="type-cell" mat-header-cell *matHeaderCellDef mat-sort-header>Portal Status</th>
<td mat-cell class="type-cell" *matCellDef="let element">
<app-application-submission-status-type-pill
*ngIf="element.status"
[type]="element.status"
></app-application-submission-status-type-pill>
<app-spinner-status *ngIf="!element.status" />
</td>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface SearchResult {
referenceId: string;
board?: string;
class: string;
status?: ApplicationSubmissionStatusPill | null;
status?: ApplicationSubmissionStatusPill;
}

@Component({
Expand All @@ -41,7 +41,7 @@ export class NotificationSearchTableComponent {

@Output() tableChange = new EventEmitter<TableChange>();

displayedColumns = ['fileId', 'dateSubmitted', 'ownerName', 'type', 'government', 'status'];
displayedColumns = ['fileId', 'dateSubmitted', 'ownerName', 'type', 'government', 'portalStatus'];
dataSource: SearchResult[] = [];
itemsPerPage = 20;
total = 0;
Expand Down Expand Up @@ -97,13 +97,13 @@ export class NotificationSearchTableComponent {
referenceId: e.referenceId,
board: e.boardCode,
class: e.class,
status: status ? {
status: {
backgroundColor: status ? status!.alcsBackgroundColor : '',
textColor: status ? status!.alcsColor : '',
borderColor: status ? status!.alcsBackgroundColor : '',
label: status ? status!.label : '',
shortLabel: status ? status!.label : '',
} : null,
},
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ <h4>Date Range</h4>

<div class="search-fields-wrapper search-result-wrapper" *ngIf="!searchResultsHidden">
<h2 class="search-title">Search Results:</h2>
<mat-tab-group id="results" mat-align-tabs="start" [mat-stretch-tabs]="isCommissioner" (selectedTabChange)="onTabChanged($event.index);" #searchResultTabs>
<mat-tab-group id="results" mat-align-tabs="start" [mat-stretch-tabs]="isCommissioner" #searchResultTabs>
<mat-tab>
<ng-template mat-tab-label> Applications: {{ applicationTotal }}</ng-template>
<app-application-search-table
Expand Down
73 changes: 0 additions & 73 deletions alcs-frontend/src/app/features/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes';
export const defaultStatusBackgroundColour = '#ffffff';
export const defaultStatusColour = '#313132';

enum searchTabs {
Applications = 0,
Nois = 1,
Plannings = 2,
Notifications = 3,
Inquiries = 4,
}

@Component({
selector: 'app-search',
templateUrl: './search.component.html',
Expand Down Expand Up @@ -354,7 +346,6 @@ export class SearchComponent implements OnInit, OnDestroy {

this.applications = result?.data ?? [];
this.applicationTotal = result?.total ?? 0;
this.updateApplicationStatuses();
}

async onNoticeOfIntentSearch() {
Expand All @@ -363,7 +354,6 @@ export class SearchComponent implements OnInit, OnDestroy {

this.noticeOfIntents = result?.data ?? [];
this.noticeOfIntentTotal = result?.total ?? 0;
this.updateNoiStatuses();
}

async onPlanningReviewSearch() {
Expand All @@ -380,7 +370,6 @@ export class SearchComponent implements OnInit, OnDestroy {

this.notifications = result?.data ?? [];
this.notificationTotal = result?.total ?? 0;
this.updateNotificationStatuses();
}

async onInquirySearch() {
Expand Down Expand Up @@ -418,22 +407,6 @@ export class SearchComponent implements OnInit, OnDestroy {
}
}

async onTabChanged(index: number) {
switch (index) {
case searchTabs.Applications:
await this.updateApplicationStatuses();
break;
case searchTabs.Nois:
await this.updateNoiStatuses();
break;
case searchTabs.Notifications:
await this.updateNotificationStatuses();
break;
default:
break;
}
}

onFileTypeChange(fileTypes: string[]) {
this.componentTypeControl.setValue(fileTypes);
}
Expand Down Expand Up @@ -556,7 +529,6 @@ export class SearchComponent implements OnInit, OnDestroy {
];

this.tabGroup.selectedIndex = searchCounts.indexOf(Math.max(...searchCounts));
this.onTabChanged(this.tabGroup.selectedIndex);
}

private formatStringSearchParam(value: string | undefined | null) {
Expand Down Expand Up @@ -591,49 +563,4 @@ export class SearchComponent implements OnInit, OnDestroy {
this.allStatuses = result;
this.allStatuses.sort((a, b) => (a.label > b.label ? 1 : -1));
}

private async updateApplicationStatuses() {
const needsUpdate = this.applications.filter((a) => a.status === null).length > 0;
if (!needsUpdate) return;
const statusUpdates = await this.searchService.advancedSearchApplicationStatusFetch(
this.applications.map((a) => a.fileNumber)
);
this.applications = this.applications.map((a) => {
const updatedStatus = statusUpdates ? statusUpdates.find((s) => s.fileNumber === a.fileNumber) : null;
return {
...a,
status: updatedStatus ? updatedStatus.status : '',
}
});
}

private async updateNoiStatuses() {
const needsUpdate = this.noticeOfIntents.filter((a) => a.status === null).length > 0;
if (!needsUpdate) return;
const statusUpdates = await this.searchService.advancedSearchNoiStatusFetch(
this.noticeOfIntents.map((a) => a.fileNumber)
);
this.noticeOfIntents = this.noticeOfIntents.map((a) => {
const updatedStatus = statusUpdates ? statusUpdates.find((s) => s.fileNumber === a.fileNumber) : null;
return {
...a,
status: updatedStatus ? updatedStatus.status : '',
}
});
}

private async updateNotificationStatuses() {
const needsUpdate = this.notifications.filter((a) => a.status === null).length > 0;
if (!needsUpdate) return;
const statusUpdates = await this.searchService.advancedSearchNotificationStatusFetch(
this.notifications.map((a) => a.fileNumber)
);
this.notifications = this.notifications.map((a) => {
const updatedStatus = statusUpdates ? statusUpdates.find((s) => s.fileNumber === a.fileNumber) : null;
return {
...a,
status: updatedStatus ? updatedStatus.status : '',
}
});
}
}
2 changes: 0 additions & 2 deletions alcs-frontend/src/app/features/search/search.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { NotificationSearchTableComponent } from './notification-search-table/no
import { SearchComponent } from './search.component';
import { InquirySearchTableComponent } from './inquiry-search-table/inquiry-search-table.component';
import { MatChipsModule } from '@angular/material/chips';
import { SpinnerStatusComponent } from './spinner-status/spinner-status.component';

const routes: Routes = [
{
Expand All @@ -31,7 +30,6 @@ const routes: Routes = [
NotificationSearchTableComponent,
FileTypeFilterDropDownComponent,
InquirySearchTableComponent,
SpinnerStatusComponent,
],
imports: [
CommonModule,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 1 addition & 6 deletions alcs-frontend/src/app/services/search/search.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface ApplicationSearchResultDto {
dateSubmitted: number;
portalStatus?: string;
class: string;
status?: string | null;
status: string;
}

export interface NoticeOfIntentSearchResultDto extends ApplicationSearchResultDto {}
Expand Down Expand Up @@ -93,8 +93,3 @@ export interface SearchResultDto {
boardCode?: string;
label?: ApplicationTypeDto;
}

export interface StatusUpdateSearchResultDto {
fileNumber: string;
status: string;
}
Loading