Skip to content

Commit

Permalink
Merge pull request #1350 from bcgov/develop
Browse files Browse the repository at this point in the history
Deployment PR - 888
  • Loading branch information
dhaselhan authored Jan 29, 2024
2 parents 9eae8cc + aa302ae commit bb8bfc4
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ <h6>Documents needed for this step:</h6>
(onFormGroupChange)="onParcelFormChange($event)"
(onOwnersUpdated)="onOwnersUpdated()"
(onOwnersDeleted)="reloadApplication()"
(onSaveProgress)="onSave()"
></app-parcel-entry>

<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ export class ParcelEntryComponent implements OnInit {
}

onAddNewOwner() {
this.onSaveProgress.emit();
const dialog = this.dialog.open(OwnerDialogComponent, {
data: {
fileId: this.fileId,
Expand All @@ -369,6 +370,7 @@ export class ParcelEntryComponent implements OnInit {
}

onAddNewGovernmentContact() {
this.onSaveProgress.emit();
const dialog = this.dialog.open(CrownOwnerDialogComponent, {
data: {
fileId: this.fileId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ <h2 class="heading">Application ID: {{ fileId }} Submitted!</h2>
<span *ngIf="governmentFee">
The {{ localGovernmentName }} portion of the fee is <strong>${{ governmentFee }}</strong
><br /><br />
Please contact the {{ localGovernmentName }} to determine the preferred form of payment.<br /><br />
</span>
<span *ngIf="localGovernmentName && !governmentFee">
There is no application fee to for an {{ appLabel }} application.<br /><br />
There is no application fee for an {{ appLabel }} application.<br /><br />
</span>
Please contact the {{ localGovernmentName }} to determine the preferred form of payment.<br /><br />
Until the {{ localGovernmentName }} resolves to forward your application to the ALC, the ALC cannot view your
submission. Any updates to your submission must be provided to the {{ localGovernmentName }}.
</ng-container>
Expand All @@ -22,7 +22,6 @@ <h2 class="heading">Application ID: {{ fileId }} Submitted!</h2>
You have submitted a <strong>{{ appLabel }}</strong> application to the
<strong>Agricultural Land Commission</strong> for their review and decision. </span
><br /><br /><br />

<ng-container *ngIf="alcFee">
Application Fee is <strong>${{ alcFee }}</strong
><br /><br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ <h2 *ngIf="isEdit">Edit Government Contact</h2>
<div class="full-row">
<mat-label for="type">Crown Type</mat-label>
<mat-button-toggle-group formControlName="crownLandOwnerType" class="input" id="crownLandOwnerType">
<mat-button-toggle value="provincial"
[ngClass]="{ 'error-outline': crownLandOwnerType.touched && crownLandOwnerType.errors?.['required'] }">
<mat-button-toggle
value="provincial"
[ngClass]="{ 'error-outline': crownLandOwnerType.touched && crownLandOwnerType.errors?.['required'] }"
>
Provincial Crown
</mat-button-toggle>
<mat-button-toggle value="federal"
[ngClass]="{ 'error-outline': crownLandOwnerType.touched && crownLandOwnerType.errors?.['required'] }">
<mat-button-toggle
value="federal"
[ngClass]="{ 'error-outline': crownLandOwnerType.touched && crownLandOwnerType.errors?.['required'] }"
>
Federal Crown
</mat-button-toggle>
</mat-button-toggle-group>
Expand All @@ -96,10 +100,19 @@ <h2 *ngIf="isEdit">Edit Government Contact</h2>
</div>

<div mat-dialog-actions class="actions">
<button *ngIf="isEdit" mat-stroked-button color="warn" style="margin-right: auto;" class="delete-btn" (click)="onDelete()">Delete Contact</button>
<button
*ngIf="isEdit"
mat-stroked-button
color="warn"
style="margin-right: auto"
class="delete-btn"
(click)="onDelete()"
>
Delete Contact
</button>
<div class="btn-group">
<button mat-stroked-button (click)="onClose()" style="margin-left: auto;">Cancel</button>
<button mat-flat-button color="primary" *ngIf="!isEdit" (click)="onCreate()">Add</button>
<button mat-flat-button color="primary" *ngIf="isEdit" (click)="onSave()">Save</button>
<button mat-stroked-button (click)="onClose()" style="margin-left: auto">Cancel</button>
<button mat-flat-button color="primary" *ngIf="!isEdit" [disabled]="isLoading" (click)="onCreate()">Add</button>
<button mat-flat-button color="primary" *ngIf="isEdit" [disabled]="isLoading" (click)="onSave()">Save</button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class CrownOwnerDialogComponent {
crownLandOwnerType = new FormControl<string | null>('', [Validators.required]);

isEdit = false;
isLoading = false;
existingUuid: string | undefined;

form = new FormGroup({
Expand Down Expand Up @@ -68,6 +69,7 @@ export class CrownOwnerDialogComponent {
async onCreate() {
this.form.markAllAsTouched();
if (this.form.valid) {
this.isLoading = true;
const createDto: ApplicationOwnerCreateDto & NoticeOfIntentOwnerCreateDto = {
organizationName: this.ministryName.getRawValue() || undefined,
firstName: this.firstName.getRawValue() || undefined,
Expand All @@ -81,6 +83,7 @@ export class CrownOwnerDialogComponent {
};

const res = await this.data.ownerService.create(createDto);
this.isLoading = false;
this.dialogRef.close({ ...res });
}
}
Expand All @@ -105,6 +108,7 @@ export class CrownOwnerDialogComponent {
async onSave() {
this.form.markAllAsTouched();
if (this.form.valid) {
this.isLoading = true;
const updateDto: ApplicationOwnerUpdateDto & NoticeOfIntentOwnerUpdateDto = {
organizationName: this.ministryName.getRawValue(),
firstName: this.firstName.getRawValue(),
Expand All @@ -118,6 +122,7 @@ export class CrownOwnerDialogComponent {
const res = await this.data.ownerService.update(this.existingUuid, updateDto);
this.dialogRef.close({ ...res, type: 'update' });
}
this.isLoading = false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,19 @@ <h4 class="full-row" *ngIf="type.getRawValue() === OWNER_TYPE.ORGANIZATION">Orga
</form>
</div>
<div mat-dialog-actions class="actions">
<button *ngIf="isEdit" mat-stroked-button color="warn" style="margin-right: auto;" class="delete-btn" (click)="onDelete()">Delete Owner</button>
<button
*ngIf="isEdit"
mat-stroked-button
color="warn"
style="margin-right: auto"
class="delete-btn"
(click)="onDelete()"
>
Delete Owner
</button>
<div class="btn-group">
<button mat-stroked-button (click)="onClose()" style="margin-left: auto;">Cancel</button>
<button mat-flat-button color="primary" *ngIf="!isEdit" (click)="onCreate()">Add</button>
<button mat-flat-button color="primary" *ngIf="isEdit" (click)="onSave()">Save</button>
<button mat-stroked-button (click)="onClose()" style="margin-left: auto">Cancel</button>
<button mat-flat-button color="primary" *ngIf="!isEdit" [disabled]="isLoading" (click)="onCreate()">Add</button>
<button mat-flat-button color="primary" *ngIf="isEdit" [disabled]="isLoading" (click)="onSave()">Save</button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Component, Inject, Input } from '@angular/core';
import { Component, Inject } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { MatButtonToggleChange } from '@angular/material/button-toggle';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
import { RemoveFileConfirmationDialogComponent } from '../../../features/applications/alcs-edit-submission/remove-file-confirmation-dialog/remove-file-confirmation-dialog.component';
import { ApplicationDocumentDto } from '../../../services/application-document/application-document.dto';
import { ApplicationDocumentService } from '../../../services/application-document/application-document.service';
import {
Expand All @@ -12,13 +13,12 @@ import {
import { ApplicationOwnerService } from '../../../services/application-owner/application-owner.service';
import { CodeService } from '../../../services/code/code.service';
import { NoticeOfIntentDocumentService } from '../../../services/notice-of-intent-document/notice-of-intent-document.service';
import { ConfirmationDialogService } from '../../confirmation-dialog/confirmation-dialog.service';
import { NoticeOfIntentOwnerCreateDto } from '../../../services/notice-of-intent-owner/notice-of-intent-owner.dto';
import { NoticeOfIntentOwnerService } from '../../../services/notice-of-intent-owner/notice-of-intent-owner.service';
import { ConfirmationDialogService } from '../../confirmation-dialog/confirmation-dialog.service';
import { DOCUMENT_SOURCE, DOCUMENT_TYPE, DocumentTypeDto } from '../../dto/document.dto';
import { OWNER_TYPE } from '../../dto/owner.dto';
import { FileHandle } from '../../file-drag-drop/drag-drop.directive';
import { RemoveFileConfirmationDialogComponent } from '../../../features/applications/alcs-edit-submission/remove-file-confirmation-dialog/remove-file-confirmation-dialog.component';

@Component({
selector: 'app-owner-dialog',
Expand All @@ -40,6 +40,7 @@ export class OwnerDialogComponent {
existingUuid: string | undefined;
files: ApplicationDocumentDto[] = [];
showFileErrors = false;
isLoading = false;

form = new FormGroup({
type: this.type,
Expand Down Expand Up @@ -108,6 +109,7 @@ export class OwnerDialogComponent {
return;
}

this.isLoading = true;
let documentUuid;
if (this.pendingFile) {
documentUuid = await this.uploadPendingFile(this.pendingFile);
Expand All @@ -128,6 +130,7 @@ export class OwnerDialogComponent {
};

const res = await this.data.ownerService.create(createDto);
this.isLoading = false;
this.dialogRef.close({
...res,
action: 'create',
Expand Down Expand Up @@ -159,6 +162,7 @@ export class OwnerDialogComponent {

async onSave() {
if (this.form.valid) {
this.isLoading = true;
const document = await this.uploadPendingFile(this.pendingFile);
const updateDto: ApplicationOwnerUpdateDto = {
organizationName: this.organizationName.getRawValue(),
Expand All @@ -176,6 +180,7 @@ export class OwnerDialogComponent {
action: 'edit',
});
}
this.isLoading = false;
} else {
this.form.markAllAsTouched();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,41 @@ export class RemoveDupeGovs1706056918403 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
//City of Port Alberni
await queryRunner.query(`
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."application" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."covenant" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
`);

//District of Barriere
await queryRunner.query(`
UPDATE "alcs"."application" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
UPDATE "alcs"."covenant" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
`);

//District of Fort St. James
await queryRunner.query(`
UPDATE "alcs"."application" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
UPDATE "alcs"."covenant" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
`);

//District of Hudson’s Hope
await queryRunner.query(`
UPDATE "alcs"."application" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
UPDATE "alcs"."covenant" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
DELETE FROM "alcs"."local_government" WHERE "uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
`);

Expand Down

0 comments on commit bb8bfc4

Please sign in to comment.