Skip to content

Commit

Permalink
Merge pull request #1639 from bcgov/develop
Browse files Browse the repository at this point in the history
Deployment PR - 1149
  • Loading branch information
dhaselhan authored May 28, 2024
2 parents 5d4c936 + a8c827e commit c086885
Show file tree
Hide file tree
Showing 339 changed files with 8,908 additions and 4,678 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To report bugs/issues/features requests, please file an [issue](https://github.c
- [Pipelines](./docs/pipelines.md)
- [SchemaSpy - ALCS](https://bcgov.github.io/alcs/schemaspy/alcs/index.html)
- [SchemaSpy - OATS](https://bcgov.github.io/alcs/schemaspy/oats/index.html)
- [One time Jobs](./docs/jobs.md)
- [Maintenance Jobs](./docs/jobs.md)

## Development Environment Setup

Expand Down
13 changes: 11 additions & 2 deletions alcs-frontend/src/app/features/admin/admin.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DragDropModule } from '@angular/cdk/drag-drop';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatChipsModule } from '@angular/material/chips';
import { MatPaginatorModule } from '@angular/material/paginator';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../shared/shared.module';
Expand All @@ -12,6 +13,7 @@ import { CardStatusComponent } from './card-status/card-status.component';
import { CeoCriterionDialogComponent } from './ceo-criterion/ceo-criterion-dialog/ceo-criterion-dialog.component';
import { CeoCriterionComponent } from './ceo-criterion/ceo-criterion.component';
import { ConfigurationComponent } from './configuration/configuration.component';
import { MaintenanceBannerConfirmationDialogComponent } from './configuration/maintenance-banner-confirmation-dialog/maintenance-banner-confirmation-dialog.component';
import { DecisionConditionTypesDialogComponent } from './decision-condition-types/decision-condition-types-dialog/decision-condition-types-dialog.component';
import { DecisionConditionTypesComponent } from './decision-condition-types/decision-condition-types.component';
import { DecisionMakerDialogComponent } from './decision-maker/decision-maker-dialog/decision-maker-dialog.component';
Expand All @@ -23,7 +25,6 @@ import { LocalGovernmentComponent } from './local-government/local-government.co
import { NoiSubtypeDialogComponent } from './noi-subtype/noi-subtype-dialog/noi-subtype-dialog.component';
import { NoiSubtypeComponent } from './noi-subtype/noi-subtype.component';
import { UnarchiveComponent } from './unarchive/unarchive.component';
import { MaintenanceBannerConfirmationDialogComponent } from './configuration/maintenance-banner-confirmation-dialog/maintenance-banner-confirmation-dialog.component';

const routes: Routes = [
{
Expand All @@ -32,6 +33,7 @@ const routes: Routes = [
children: childRoutes,
},
];

@NgModule({
declarations: [
AdminComponent,
Expand All @@ -55,6 +57,13 @@ const routes: Routes = [
ConfigurationComponent,
MaintenanceBannerConfirmationDialogComponent,
],
imports: [CommonModule, SharedModule.forRoot(), RouterModule.forChild(routes), MatPaginatorModule, DragDropModule],
imports: [
CommonModule,
SharedModule.forRoot(),
RouterModule.forChild(routes),
MatPaginatorModule,
DragDropModule,
MatChipsModule,
],
})
export class AdminModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,27 @@ <h4>{{ title }} Government</h4>
</div>

<div>
<mat-form-field appearance="outline">
<mat-label>Contact Emails (comma separated)</mat-label>
<mat-form-field style="width: 100%" appearance="outline">
<mat-chip-grid #chipGrid aria-label="Enter emails">
<mat-chip-row
*ngFor="let email of model.emails"
(removed)="onRemoveEmail(email)"
[editable]="true"
(edited)="editEmail(email, $event)"
[aria-description]="'press enter to edit ' + email"
>
{{ email }}
<button matChipRemove [attr.aria-label]="'remove ' + email">
<mat-icon>cancel</mat-icon>
</button>
</mat-chip-row>
</mat-chip-grid>
<input
matInput
id="emails"
placeholder="[email protected], [email protected]"
[(ngModel)]="model.emails"
name="emails"
placeholder="Type and hit ‘space’ to add emails"
[matChipInputFor]="chipGrid"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
[matChipInputAddOnBlur]="true"
(matChipInputTokenEnd)="addEmail($event)"
/>
</mat-form-field>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
width: 100%;
}
}

:host::ng-deep {
.mat-mdc-form-field-infix {
display: flex;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { MatChipEditedEvent, MatChipInputEvent } from '@angular/material/chips';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Subject, takeUntil } from 'rxjs';
import { LocalGovernmentDto } from '../../../../services/admin-local-government/admin-local-government.dto';
Expand All @@ -12,6 +14,8 @@ import { ApplicationService } from '../../../../services/application/application
styleUrls: ['./local-government-dialog.component.scss'],
})
export class LocalGovernmentDialogComponent implements OnInit, OnDestroy {
readonly separatorKeysCodes = [ENTER, COMMA, SPACE] as const;

$destroy = new Subject<void>();
title: string = 'Create';
model: {
Expand All @@ -21,7 +25,7 @@ export class LocalGovernmentDialogComponent implements OnInit, OnDestroy {
name: string;
bceidBusinessGuid: string | null;
uuid?: string;
emails: string;
emails: string[];
};
regions: ApplicationRegionDto[] = [];

Expand All @@ -31,10 +35,10 @@ export class LocalGovernmentDialogComponent implements OnInit, OnDestroy {
@Inject(MAT_DIALOG_DATA) public data: LocalGovernmentDto,
private dialogRef: MatDialogRef<LocalGovernmentDialogComponent>,
private localGovernmentService: AdminLocalGovernmentService,
private applicationService: ApplicationService
private applicationService: ApplicationService,
) {
this.model = {
emails: '',
emails: [],
isActive: '',
name: '',
isFirstNation: 'false',
Expand All @@ -49,7 +53,7 @@ export class LocalGovernmentDialogComponent implements OnInit, OnDestroy {
...this.data,
isFirstNation: this.data.isFirstNation ? 'true' : 'false',
isActive: this.data.isActive ? 'true' : 'false',
emails: this.data.emails ? this.data.emails.join(', ') : '',
emails: this.data.emails,
};
this.title = this.model.uuid ? 'Edit' : 'Create';
}
Expand All @@ -74,7 +78,7 @@ export class LocalGovernmentDialogComponent implements OnInit, OnDestroy {
isFirstNation: this.model.isFirstNation === 'true',
isActive: this.model.isActive === 'true',
preferredRegionCode: this.model.preferredRegionCode,
emails: this.model.emails.split(', '),
emails: this.model.emails,
};

if (this.model.uuid) {
Expand All @@ -86,4 +90,32 @@ export class LocalGovernmentDialogComponent implements OnInit, OnDestroy {
this.dialogRef.close(true);
}
}

onRemoveEmail(email: string) {
const index = this.model.emails.indexOf(email);

if (index >= 0) {
this.model.emails.splice(index, 1);
}
}

addEmail(event: MatChipInputEvent): void {
const value = (event.value || '').trim();
if (value) {
this.model.emails.push(value);
}
event.chipInput!.clear();
}

editEmail(email: string, event: MatChipEditedEvent) {
const value = event.value.trim();
if (!value) {
this.onRemoveEmail(email);
return;
}
const index = this.model.emails.indexOf(email);
if (index >= 0) {
this.model.emails[index] = value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3>Other Owned Parcels</h3>
<div class="subheading2 grid-1">
Do any of the land owners added previously own or lease other parcels that might inform this application process?
</div>
<div class="grid-double">
<div class="grid-double" data-testid="has-other-parcels">
<span *ngIf="submission.hasOtherParcelsInCommunity !== null">{{
submission.hasOtherParcelsInCommunity ? 'Yes' : 'No'
}}</span>
Expand All @@ -24,7 +24,7 @@ <h3>Other Owned Parcels</h3>
<div class="subheading2 grid-1">
Describe the other parcels including their location, who owns or leases them, and their use.
</div>
<div class="grid-double">
<div class="grid-double" data-testid="other-parcels-description">
{{ submission.otherParcelsDescription }}
<app-no-data *ngIf="!submission.otherParcelsDescription"></app-no-data>
</div>
Expand All @@ -42,17 +42,17 @@ <h3>Other Owned Parcels</h3>
<h3>Primary Contact Information</h3>
<div *ngIf="submission" class="review-table">
<div class="subheading2 grid-1">Type</div>
<div class="grid-double">
<div class="grid-double" data-testid="primary-contact-type">
{{ submission.primaryContact?.type?.label }}
<app-no-data *ngIf="!submission.primaryContact?.type?.label"></app-no-data>
</div>
<div class="subheading2 grid-1">First Name</div>
<div class="grid-double">
<div class="grid-double" data-testid="primary-contact-first-name">
{{ submission.primaryContact?.firstName }}
<app-no-data *ngIf="!submission.primaryContact?.firstName"></app-no-data>
</div>
<div class="subheading2 grid-1">Last Name</div>
<div class="grid-double">
<div class="grid-double" data-testid="primary-contact-last-name">
{{ submission.primaryContact?.lastName }}
<app-no-data *ngIf="!submission.primaryContact?.lastName"></app-no-data>
</div>
Expand All @@ -63,25 +63,25 @@ <h3>Primary Contact Information</h3>
<span *ngIf="submission.primaryContact?.type?.code === 'CRWN'">Ministry/Department Responsible</span>
<span *ngIf="submission.primaryContact?.type?.code === 'GOVR'">Department</span>
</div>
<div class="grid-double">
<div class="grid-double" data-testid="primary-contact-organization">
{{ submission.primaryContact?.organizationName }}
<app-no-data *ngIf="!submission.primaryContact?.organizationName"></app-no-data>
</div>
<div class="subheading2 grid-1">Phone</div>
<div class="grid-double">
<div class="grid-double" data-testid="primary-contact-phone-number">
{{ submission.primaryContact?.phoneNumber }}
<app-no-data *ngIf="!submission.primaryContact?.phoneNumber"></app-no-data>
</div>
<div class="subheading2 grid-1">Email</div>
<div class="grid-double">
<div class="grid-double" data-testid="primary-contact-email">
{{ submission.primaryContact?.email }}
<app-no-data *ngIf="!submission.primaryContact?.email"></app-no-data>
</div>
<ng-container *ngIf="authorizationLetters.length > 0">
<div class="subheading2 grid-1">Authorization Letter(s)</div>
<div class="grid-double">
<div *ngFor="let file of authorizationLetters">
<a (click)="openFile(file)">{{ file.fileName }}</a>
<a (click)="openFile(file)" data-testid="authorization-letter">{{ file.fileName }}</a>
</div>
</div>
</ng-container>
Expand All @@ -99,15 +99,15 @@ <h3>Land Use</h3>
<h4>Land Use of Parcel(s) under Application</h4>
</div>
<div class="subheading2 grid-1">Describe all agriculture that currently takes place on the parcel(s).</div>
<div class="grid-double">
<div class="grid-double" data-testid="parcels-agriculture-description">
{{ submission.parcelsAgricultureDescription }}
</div>
<div class="subheading2 grid-1">Describe all agricultural improvements made to the parcel(s).</div>
<div class="grid-double">
<div class="grid-double" data-testid="parcels-agriculture-improvement-description">
{{ submission.parcelsAgricultureImprovementDescription }}
</div>
<div class="subheading2 grid-1">Describe all other uses that currently take place on the parcel(s).</div>
<div class="grid-double">
<div class="grid-double" data-testid="parcels-non-agriculture-description">
{{ submission.parcelsNonAgricultureUseDescription }}
</div>
<div class="full-width">
Expand All @@ -118,31 +118,31 @@ <h4>Land Use of Adjacent Parcels</h4>
<div class="grid-2 subheading2">Main Land Use Type</div>
<div class="grid-3 subheading2">Specific Activity</div>
<div class="grid-1 subheading2">North</div>
<div class="grid-2">
<div class="grid-2" data-testid="north-land-use-type">
{{ submission.northLandUseType }}
</div>
<div class="grid-3">
<div class="grid-3" data-testid="north-land-use-description">
{{ submission.northLandUseTypeDescription }}
</div>
<div class="grid-1 subheading2">East</div>
<div class="grid-2">
<div class="grid-2" data-testid="east-land-use-type">
{{ submission.eastLandUseType }}
</div>
<div class="grid-3">
<div class="grid-3" data-testid="east-land-use-description">
{{ submission.eastLandUseTypeDescription }}
</div>
<div class="grid-1 subheading2">South</div>
<div class="grid-2">
<div class="grid-2" data-testid="south-land-use-type">
{{ submission.southLandUseType }}
</div>
<div class="grid-3">
<div class="grid-3" data-testid="south-land-use-description">
{{ submission.southLandUseTypeDescription }}
</div>
<div class="grid-1 subheading2">West</div>
<div class="grid-2">
<div class="grid-2" data-testid="west-land-use-type">
{{ submission.westLandUseType }}
</div>
<div class="grid-3">
<div class="grid-3" data-testid="west-land-use-description">
{{ submission.westLandUseTypeDescription }}
</div>
</div>
Expand Down Expand Up @@ -225,13 +225,13 @@ <h3>Optional Documents</h3>
<div class="grid-3 subheading2">Description</div>

<ng-container *ngFor="let file of otherFiles">
<div class="grid-1">
<div class="grid-1" data-testid="optional-document-file-name">
<a (click)="openFile(file)">{{ file.fileName }}</a>
</div>
<div class="grid-2">
<div class="grid-2" data-testid="optional-document-type">
{{ file.type?.label }}
</div>
<div class="grid-3">
<div class="grid-3" data-testid="optional-document-description">
{{ file.description }}
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
}

.no-data-text {
text-align: center;
color: colors.$grey;
padding-top: 12px;

.error {
justify-content: center;
Expand Down
Loading

0 comments on commit c086885

Please sign in to comment.