Skip to content

Commit

Permalink
Merge pull request #1392 from bcgov/develop
Browse files Browse the repository at this point in the history
Deployment PR - 927
  • Loading branch information
dhaselhan authored Feb 7, 2024
2 parents 5163efb + 754f8d2 commit 19e6bac
Show file tree
Hide file tree
Showing 29 changed files with 72 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
<div>
{{ _applicationSubmission.soilToPlaceArea }}
<span *ngIf="_applicationSubmission.soilToPlaceArea !== null">ha</span>
<span *ngIf="_applicationSubmission.soilToPlaceArea !== null">m<sup>2</sup></span>
</div>

<div><strong>Maximum Depth</strong></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
</div>
<div class="subheading2 grid-1">Area</div>
<div class="grid-double">
{{ _applicationSubmission.soilToRemoveArea }} <span *ngIf="_applicationSubmission.soilToRemoveArea">ha</span>
{{ _applicationSubmission.soilToRemoveArea }}
<span *ngIf="_applicationSubmission.soilToRemoveArea">m<sup>2</sup></span>
</div>
<div class="subheading2 grid-1">Maximum Depth</div>
<div class="grid-double">
Expand All @@ -58,7 +59,7 @@
<div class="subheading2 grid-1">Area</div>
<div class="grid-double">
{{ _applicationSubmission.soilAlreadyRemovedArea }}
<span *ngIf="_applicationSubmission.soilAlreadyRemovedArea">ha</span>
<span *ngIf="_applicationSubmission.soilAlreadyRemovedArea">m<sup>2</sup></span>
</div>
<div class="subheading2 grid-1">Maximum Depth</div>
<div class="grid-double">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h3>Primary Contact Information</h3>
</div>
</ng-container>
<div class="full-width center">
<button *ngIf="showEdit" [disabled]="disableEdit" (click)="onEdit(2)" mat-flat-button color="accent">
<button *ngIf="showEdit" [disabled]="disableEdit" (click)="onEdit(1)" mat-flat-button color="accent">
Edit Section
</button>
</div>
Expand Down Expand Up @@ -123,7 +123,7 @@ <h4>Land Use of Adjacent Parcels</h4>
</div>
</div>
<div class="full-width center">
<button *ngIf="showEdit" [disabled]="disableEdit" (click)="onEdit(4)" mat-flat-button color="accent">
<button *ngIf="showEdit" [disabled]="disableEdit" (click)="onEdit(3)" mat-flat-button color="accent">
Edit Section
</button>
</div>
Expand All @@ -148,7 +148,7 @@ <h3>Proposal</h3>
></app-pfrs-details>
<div class="review-table edit-section">
<div class="full-width center">
<button *ngIf="showEdit" [disabled]="disableEdit" (click)="onEdit(5)" mat-flat-button color="accent">
<button *ngIf="showEdit" [disabled]="disableEdit" (click)="onEdit(4)" mat-flat-button color="accent">
Edit Section
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
<div class="grid-1"><strong>Area</strong></div>
<div class="grid-2">
{{ _noiSubmission.soilToRemoveArea }} <span *ngIf="_noiSubmission.soilToRemoveArea">ha</span>
{{ _noiSubmission.soilToRemoveArea }} <span *ngIf="_noiSubmission.soilToRemoveArea">m<sup>2</sup></span>
</div>
<div class="grid-1"><strong>Maximum Depth</strong></div>
<div class="grid-2">
Expand Down Expand Up @@ -69,7 +69,7 @@
<div class="grid-1"><strong>Area</strong></div>
<div class="grid-2">
{{ _noiSubmission.soilAlreadyRemovedArea }}
<span *ngIf="_noiSubmission.soilAlreadyRemovedArea !== null">ha</span>
<span *ngIf="_noiSubmission.soilAlreadyRemovedArea !== null">m<sup>2</sup></span>
</div>
<div class="grid-1"><strong>Maximum Depth</strong></div>
<div class="grid-2">
Expand Down Expand Up @@ -107,7 +107,7 @@

<div class="subheading2 grid-1">Reclamation Plan</div>
<div class="grid-double multiple-documents">
<a *ngFor="let file of crossSections" (click)="openFile(file)">
<a *ngFor="let file of reclamationPlans" (click)="openFile(file)">
{{ file.fileName }}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion bin/migrate-oats-data/applications/migrate_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def process_application_etl(batch_size):
update_application_incomplete_date(batch_size)
process_application_parcels(batch_size)
process_application_owners(batch_size)
process_application_applicant_on_submissions(batch_size)
# process_application_applicant_on_submissions(batch_size)
process_app_staff_journal(batch_size)
process_application_decisions(batch_size)
set_application_visibility()
Expand Down
2 changes: 1 addition & 1 deletion bin/migrate-oats-data/noi/notice_of_intent_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def process_notice_of_intent(batch_size):

link_notice_of_intent_primary_contacts(batch_size)

process_notice_of_intent_applicant_on_submissions(batch_size)
# process_notice_of_intent_applicant_on_submissions(batch_size)

process_noi_staff_journal(batch_size)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@

<div class="subheading2 grid-1">Reclamation Plan</div>
<div class="grid-double multiple-documents">
<a *ngFor="let file of crossSections" (click)="openFile(file.uuid)">
<a *ngFor="let file of reclamationPlans" (click)="openFile(file.uuid)">
{{ file.fileName }}
</a>
<app-no-data [showRequired]="showErrors" *ngIf="crossSections.length === 0"></app-no-data>
<app-no-data [showRequired]="showErrors" *ngIf="reclamationPlans.length === 0"></app-no-data>
</div>

<div class="subheading2 grid-1">Is your proposal for aggregate extraction or placer mining?</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@

<div class="subheading2 grid-1">Reclamation Plan</div>
<div class="grid-double multiple-documents">
<a *ngFor="let file of crossSections" (click)="openFile(file.uuid)">
<a *ngFor="let file of reclamationPlans" (click)="openFile(file.uuid)">
{{ file.fileName }}
</a>
<app-no-data [showRequired]="showErrors" *ngIf="crossSections.length === 0"></app-no-data>
<app-no-data [showRequired]="showErrors" *ngIf="reclamationPlans.length === 0"></app-no-data>
</div>

<div *ngIf="showEdit" class="edit-button">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@

<div class="subheading2 grid-1">Reclamation Plan</div>
<div class="grid-double multiple-documents">
<a *ngFor="let file of crossSections" (click)="openFile(file.uuid)">
<a *ngFor="let file of reclamationPlans" (click)="openFile(file.uuid)">
{{ file.fileName }}
</a>
<app-no-data [showRequired]="showErrors" *ngIf="crossSections.length === 0"></app-no-data>
<app-no-data [showRequired]="showErrors" *ngIf="reclamationPlans.length === 0"></app-no-data>
</div>

<div *ngIf="showEdit" class="edit-button">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ApplicationSubmissionDto } from '../../../../services/application-submi
import { CodeService } from '../../../../services/code/code.service';
import { PdfGenerationService } from '../../../../services/pdf-generation/pdf-generation.service';
import { CustomStepperComponent } from '../../../../shared/custom-stepper/custom-stepper.component';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { DOCUMENT_SOURCE, DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { MOBILE_BREAKPOINT } from '../../../../shared/utils/breakpoints';
import { ReviewApplicationFngSteps } from '../review-submission.component';
import { ToastService } from '../../../../services/toast/toast.service';
Expand Down Expand Up @@ -71,7 +71,9 @@ export class ReviewSubmitFngComponent implements OnInit, OnDestroy {
this.resolutionDocument = documents.filter(
(document) => document.type?.code === DOCUMENT_TYPE.RESOLUTION_DOCUMENT
);
this.otherAttachments = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.OTHER);
this.otherAttachments = documents.filter(
(document) => document.type?.code === DOCUMENT_TYPE.OTHER && document.source === DOCUMENT_SOURCE.LFNG
);
});

this.$application.pipe(takeUntil(this.$destroy)).subscribe((application) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ApplicationSubmissionDto } from '../../../../services/application-submi
import { PdfGenerationService } from '../../../../services/pdf-generation/pdf-generation.service';
import { ToastService } from '../../../../services/toast/toast.service';
import { CustomStepperComponent } from '../../../../shared/custom-stepper/custom-stepper.component';
import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { DOCUMENT_SOURCE, DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import { MOBILE_BREAKPOINT } from '../../../../shared/utils/breakpoints';
import { ReviewApplicationSteps } from '../review-submission.component';
import { SubmitConfirmationDialogComponent } from '../submit-confirmation-dialog/submit-confirmation-dialog.component';
Expand Down Expand Up @@ -81,7 +81,9 @@ export class ReviewSubmitComponent implements OnInit, OnDestroy {
(document) => document.type?.code === DOCUMENT_TYPE.RESOLUTION_DOCUMENT
);
this.staffReport = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.STAFF_REPORT);
this.otherAttachments = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.OTHER);
this.otherAttachments = documents.filter(
(document) => document.type?.code === DOCUMENT_TYPE.OTHER && document.source === DOCUMENT_SOURCE.LFNG
);
});

this.$application.pipe(takeUntil(this.$destroy)).subscribe((application) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<div class="table-wrapper">
<div class="table-container">
<table mat-table [dataSource]="dataSource">
<div *ngIf="isLoading" class="center">
<mat-spinner />
</div>
<table *ngIf="!isLoading" mat-table [dataSource]="dataSource">
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr
mat-row
Expand Down Expand Up @@ -57,9 +60,9 @@
</ng-container>
</table>
<mat-paginator
[length]="_totalCount"
[length]="totalCount"
[pageIndex]="pageIndex"
[pageSize]="10"
[pageSize]="itemsPerPage"
[pageSizeOptions]="[5, 10, 25, 100]"
(page)="onPageChange($event)"
aria-label="Select page"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Component, EventEmitter, Input, OnDestroy, Output, ViewChild } from '@angular/core';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { PageEvent } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { Router } from '@angular/router';
import { Subject, takeUntil } from 'rxjs';
import { TableChange } from '../../../public/search/search.interface';
import { InboxResultDto } from '../inbox.component';

Expand All @@ -12,42 +10,32 @@ import { InboxResultDto } from '../inbox.component';
templateUrl: './inbox-table.component.html',
styleUrls: ['./inbox-table.component.scss'],
})
export class InboxTableComponent implements OnDestroy {
$destroy = new Subject<void>();

@ViewChild(MatPaginator) paginator!: MatPaginator;
@ViewChild(MatSort) sort?: MatSort;

export class InboxTableComponent {
_items: InboxResultDto[] = [];
@Input() set items(applications: InboxResultDto[]) {
this._items = applications;
this.isLoading = false;
this.dataSource = new MatTableDataSource<InboxResultDto>(applications);
}

_totalCount = 0;
@Input() set totalCount(count: number) {
this._totalCount = count;

// this will ensure the reset of subscriber once the table is hidden because of empty
this.initSorting();
}

@Input() totalCount: number = 0;
@Input() type = 'Applications';
@Input() pageIndex: number = 0;

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

displayedColumns: string[] = ['fileNumber', 'dateCreated', 'applicant', 'applicationType', 'status', 'lastUpdated'];
dataSource = new MatTableDataSource<InboxResultDto>();
@Input() pageIndex: number = 0;
itemsPerPage = 10;
total = 0;
sortDirection = 'DESC';
sortField = 'lastUpdate';

private subscribedToSort = false;
isLoading = false;

constructor(private router: Router) {}

async onTableChange() {
onTableChange() {
this.isLoading = true;
this.tableChange.emit({
pageIndex: this.pageIndex,
itemsPerPage: this.itemsPerPage,
Expand All @@ -61,33 +49,7 @@ export class InboxTableComponent implements OnDestroy {
this.pageIndex = $event.pageIndex;
this.itemsPerPage = $event.pageSize;

await this.onTableChange();
}

ngOnDestroy(): void {
this.$destroy.next();
this.$destroy.complete();
}

private initSorting() {
if (this._totalCount <= 0) {
this.subscribedToSort = false;
}

// push subscription to next render cycle, after the table is rendered
setTimeout(() => {
if (this.sort && !this.subscribedToSort) {
this.subscribedToSort = true;
this.sort.sortChange.pipe(takeUntil(this.$destroy)).subscribe(async (sortObj) => {
this.paginator.pageIndex = 0;
this.pageIndex = 0;
this.sortDirection = sortObj.direction.toUpperCase();
this.sortField = sortObj.active;

await this.onTableChange();
});
}
});
this.onTableChange();
}

async onRowClick(link: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export class InboxComponent implements OnInit, OnDestroy {
async onClear() {
this.searchForm.reset();
this.pageIndex = 0;
this.itemsPerPage = 10;
await this.populateTable();
this.tabIndex = TAB_ORDER[this.currentTabName];
if (this.fileTypeFilterDropDownComponent) {
Expand Down Expand Up @@ -318,7 +319,6 @@ export class InboxComponent implements OnInit, OnDestroy {
this.pageIndex = event.pageIndex;
this.itemsPerPage = event.itemsPerPage;

this.isLoading = true;
switch (event.tableType) {
case 'APP':
await this.onApplicationSearch();
Expand All @@ -332,7 +332,6 @@ export class InboxComponent implements OnInit, OnDestroy {
default:
this.toastService.showErrorToast('Not implemented');
}
this.isLoading = false;
}

onFileTypeChange(fileTypes: string[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ export class ParcelEntryComponent implements OnInit {
this.searchBy.setValue(null);
this.pidPinPlaceholder = '';
this.isCrownLand = true;
this.pid.addValidators([Validators.required]);
this.pid.removeValidators([Validators.required]);
this.purchaseDate.disable();
} else {
this.searchBy.setValue('pid');
this.pidPinPlaceholder = 'Type 9 digit PID';
this.isCrownLand = false;
this.pid.removeValidators([Validators.required]);
this.pid.addValidators([Validators.required]);
this.crownLandOwnerType.setValue(null);
this.purchaseDate.enable();
}
Expand Down
Loading

0 comments on commit 19e6bac

Please sign in to comment.