Skip to content

Commit

Permalink
Merge pull request #695 from bcgov/develop
Browse files Browse the repository at this point in the history
Deployment PR - 273
  • Loading branch information
dhaselhan authored Jun 21, 2023
2 parents 1dd982a + 8e2f4ec commit 26a9c77
Show file tree
Hide file tree
Showing 184 changed files with 5,469 additions and 793 deletions.
6 changes: 6 additions & 0 deletions alcs-frontend/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ProvisionComponent } from './features/provision/provision.component';
import { AuthGuard } from './services/authentication/auth.guard';
import { ALL_ROLES, ROLES } from './services/authentication/authentication.service';
import { HasRolesGuard } from './services/authentication/hasRoles.guard';
import { SearchComponent } from './shared/header/search/search.component';

export const ROLES_ALLOWED_APPLICATIONS = [ROLES.ADMIN, ROLES.LUP, ROLES.APP_SPECIALIST, ROLES.GIS];
export const ROLES_ALLOWED_BOARDS = ROLES_ALLOWED_APPLICATIONS;
Expand Down Expand Up @@ -82,6 +83,11 @@ const routes: Routes = [
component: ProvisionComponent,
canActivate: [AuthGuard],
},
{
path: 'search',
component: SearchComponent,
canActivate: [AuthGuard],
},
{ path: '', redirectTo: '/login', pathMatch: 'full' },
{ path: '**', component: NotFoundComponent },
];
Expand Down
2 changes: 2 additions & 0 deletions alcs-frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ConfirmationDialogComponent } from './shared/confirmation-dialog/confir
import { HeaderComponent } from './shared/header/header.component';
import { NotificationsComponent } from './shared/header/notifications/notifications.component';
import { SearchBarComponent } from './shared/header/search-bar/search-bar.component';
import { SearchComponent } from './shared/header/search/search.component';
import { SharedModule } from './shared/shared.module';

@NgModule({
Expand All @@ -31,6 +32,7 @@ import { SharedModule } from './shared/shared.module';
ConfirmationDialogComponent,
NotificationsComponent,
SearchBarComponent,
SearchComponent,
],
imports: [BrowserModule, BrowserAnimationsModule, SharedModule.forRoot(), AppRoutingModule, MomentDateModule],
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ <h3>Primary Contact Information</h3>
{{ submittedApplication.primaryContact.lastName }}
</div>
<div class="subheading2 grid-1">
<span *ngIf='submittedApplication.primaryContact.type.code !== "CRWN"'>Organization</span>
<span *ngIf='submittedApplication.primaryContact.type.code === "CRWN"'>Ministry/Department Responsible</span>
<span *ngIf="submittedApplication.primaryContact.type.code !== 'CRWN'">Organization</span>
<span *ngIf="submittedApplication.primaryContact.type.code === 'CRWN'">Ministry/Department Responsible</span>
</div>
<div class="grid-double">
{{ submittedApplication.primaryContact.organizationName }}
Expand Down Expand Up @@ -159,6 +159,11 @@ <h3>Proposal</h3>
[applicationSubmission]="submittedApplication"
[files]="files"
></app-pfrs-details>
<app-naru-details
*ngIf="submittedApplication && applicationType === 'NARU'"
[applicationSubmission]="submittedApplication"
[files]="files"
></app-naru-details>
<div class="review-table edit-section">
<div class="full-width center">
<button *ngIf="showEdit" (click)="onEdit(5)" mat-flat-button color="accent">Edit Section</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ describe('ApplicationDetailsComponent', () => {
fixture = TestBed.createComponent(ApplicationDetailsComponent);
component = fixture.componentInstance;
component.submittedApplication = {
naruExistingStructures: null,
naruFillOrigin: null,
naruFillType: null,
naruFloorArea: null,
naruInfrastructure: null,
naruLocationRationale: null,
naruProjectDurationAmount: null,
naruProjectDurationUnit: null,
naruPurpose: null,
naruResidenceNecessity: null,
naruSubtype: null,
naruToPlaceArea: null,
naruToPlaceAverageDepth: null,
naruToPlaceMaximumDepth: null,
naruToPlaceVolume: null,
naruWillImportFill: null,
nfuAgricultureSupport: null,
nfuFillOriginDescription: null,
nfuFillTypeDescription: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CommonModule, NgForOf, NgIf } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../../../../shared/shared.module';
import { ApplicationDetailsComponent } from './application-details.component';
import { NaruDetailsComponent } from './naru-details/naru-details.component';
import { NfuDetailsComponent } from './nfu-details/nfu-details.component';
import { ParcelComponent } from './parcel/parcel.component';
import { PfrsDetailsComponent } from './pfrs-details/pfrs-details.component';
Expand All @@ -20,6 +21,7 @@ import { TurDetailsComponent } from './tur-details/tur-details.component';
RosoDetailsComponent,
PofoDetailsComponent,
PfrsDetailsComponent,
NaruDetailsComponent,
],
imports: [CommonModule, SharedModule, NgForOf, NgIf, SharedModule],
exports: [ApplicationDetailsComponent],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<div *ngIf="_applicationSubmission" class="review-table">
<div class="subheading2 grid-1">Selected Subtype:</div>
<div class="grid-double">
{{ _applicationSubmission.naruSubtype?.label }}
</div>
<div class="subheading2 grid-1">What is the purpose of the proposal?</div>
<div class="grid-double">
{{ _applicationSubmission.naruPurpose }}
</div>
<ng-container *ngIf="_applicationSubmission.naruSubtype?.code === 'ARFU'">
<div class="subheading2 grid-1">
What is the total floor area (m<sup>2</sup>) of the proposed additional residence?
</div>
<div class="grid-double">
{{ _applicationSubmission.naruFloorArea }}
</div>
<div class="subheading2 grid-1">
Describe the necessity for an additional residence for farm use and how it will support agriculture in the short
or long term.
</div>
<div class="grid-double">
{{ _applicationSubmission.naruResidenceNecessity }}
</div>
<div class="subheading2 grid-1">Describe the rationale for the proposed location of the additional residence.</div>
<div class="grid-double">
{{ _applicationSubmission.naruLocationRationale }}
</div>
<div class="subheading2 grid-1">
Provide the total area (m<sup>2</sup>) and a description of infrastructure necessary to support the additional
residence.
</div>
<div class="grid-double">
{{ _applicationSubmission.naruInfrastructure }}
</div>
</ng-container>
<ng-container *ngIf="_applicationSubmission.naruSubtype?.code === 'PRIN'">
<div class="subheading2 grid-1">
What is the total floor area (m<sup>2</sup>) of the proposed principal residence?
</div>
<div class="grid-double">
{{ _applicationSubmission.naruFloorArea }}
</div>
<div class="subheading2 grid-1">
Describe how the proposal for a principal residence more than 500 m<sup>2</sup> will support agriculture in the
short or long term.
</div>
<div class="grid-double">
{{ _applicationSubmission.naruResidenceNecessity }}
</div>
<div class="subheading2 grid-1">Describe the rationale for the proposed location of the principal residence.</div>
<div class="grid-double">
{{ _applicationSubmission.naruLocationRationale }}
</div>
<div class="subheading2 grid-1">
Provide the total area (m<sup>2</sup>) and a description of infrastructure necessary to support the principal
residence.
</div>
<div class="grid-double">
{{ _applicationSubmission.naruInfrastructure }}
</div>
</ng-container>
<div class="subheading2 grid-1">
Describe the total floor area (m<sup>2</sup>), type, number, and occupancy of all residential structures currently
located on the property.
</div>
<div class="grid-double">
{{ _applicationSubmission.naruExistingStructures }}
</div>

<div class="subheading2 grid-1">Proposal Map / Site Plan</div>
<div class="grid-double">
<a *ngFor="let file of proposalMap" (click)="openFile(file)">
{{ file.fileName }}
</a>
</div>

<div class="subheading2 grid-1">
Do you need to import any fill to construct or conduct the proposed Non-farm use? Fill is any material brought onto
the property, including gravel for construction.
</div>
<div class="grid-double">
{{ _applicationSubmission.naruWillImportFill ? 'Yes' : 'No' }}
</div>
<ng-container *ngIf="_applicationSubmission.naruWillImportFill">
<div class="subheading1 full-width">Fill to be Placed</div>
<div class="full-width soil-table">
<div class="grid-1"><strong>Volume</strong></div>
<div class="grid-2">{{ _applicationSubmission.naruToPlaceVolume }} m<sup>3</sup></div>
<div class="grid-1"><strong>Area</strong></div>
<div class="grid-2">{{ _applicationSubmission.naruToPlaceArea }} ha</div>
<div class="grid-1"><strong>Maximum Depth</strong></div>
<div class="grid-2">{{ _applicationSubmission.naruToPlaceMaximumDepth }} m</div>
<div class="grid-1"><strong>Average Depth</strong></div>
<div class="grid-2">{{ _applicationSubmission.naruToPlaceAverageDepth }} m</div>
</div>

<div class="full-width">
<span class="subheading1">Project Duration</span>
</div>
<div class="subheading2 grid-1">Duration</div>
<div class="grid-double">
{{ _applicationSubmission.naruProjectDurationUnit }}
</div>
<div class="subheading2 grid-1">Length</div>
<div class="grid-double">
{{ _applicationSubmission.naruProjectDurationAmount }}
</div>
</ng-container>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.soil-table {
display: grid;
grid-template-columns: max-content max-content;
overflow-x: auto;
grid-column-gap: 36px;
grid-row-gap: 12px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DeepMocked } from '@golevelup/ts-jest';
import { ApplicationDocumentService } from '../../../../../services/application/application-document/application-document.service';

import { NaruDetailsComponent } from './naru-details.component';

describe('RosoDetailsComponent', () => {
let component: NaruDetailsComponent;
let fixture: ComponentFixture<NaruDetailsComponent>;
let mockAppDocumentService: DeepMocked<ApplicationDocumentService>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [NaruDetailsComponent],
providers: [
{
provide: ApplicationDocumentService,
useValue: mockAppDocumentService,
},
],
}).compileComponents();

fixture = TestBed.createComponent(NaruDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';
import { ApplicationDocumentDto } from '../../../../../services/application/application-document/application-document.dto';
import {
ApplicationDocumentService,
DOCUMENT_TYPE,
} from '../../../../../services/application/application-document/application-document.service';
import { ApplicationSubmissionDto } from '../../../../../services/application/application.dto';

@Component({
selector: 'app-naru-details[applicationSubmission]',
templateUrl: './naru-details.component.html',
styleUrls: ['./naru-details.component.scss'],
})
export class NaruDetailsComponent {
_applicationSubmission: ApplicationSubmissionDto | undefined;
@Input() set applicationSubmission(application: ApplicationSubmissionDto | undefined) {
if (application) {
this._applicationSubmission = application;
}
}

@Input() set files(documents: ApplicationDocumentDto[] | undefined) {
if (documents) {
this.proposalMap = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.PROPOSAL_MAP);
}
}

proposalMap: ApplicationDocumentDto[] = [];

constructor(private router: Router, private applicationDocumentService: ApplicationDocumentService) {}

async openFile(file: ApplicationDocumentDto) {
await this.applicationDocumentService.download(file.uuid, file.fileName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@

.nav {
background-color: colors.$bg-color;
min-width: 240px;
width: 240px;
height: 100%;
min-width: fit-content;
}

.nav-link {

div {
padding: 12px 24px;
border: 2px solid transparent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div mat-dialog-title>
<h2 class="card-title">{{ isEdit ? 'Edit' : 'New' }} Decision</h2>
<h2 class="card-title">{{ isEdit ? 'Edit' : 'Create' }} Decision</h2>
</div>
<form (ngSubmit)="onSubmit()" [formGroup]="form">
<mat-dialog-content style="height: 100%">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
<div class="subheading2">Non-Farm Use Type</div>
{{ component.nfuType }}
</div>
<div>
<div class="subheading2">Non-Farm Use Sub-Type</div>
{{ component.nfuSubType }}
</div>
<div>
<div class="subheading2">Use End Date</div>
{{ component.endDate | date }}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DecisionComponentDto } from '../../../../../../services/application/decision/application-decision-v2/application-decision-v2.dto';

import { NfupComponent } from './nfup.component';

describe('NfupComponent', () => {
let component: NfupComponent;
let fixture: ComponentFixture<NfupComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [NfupComponent],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();

fixture = TestBed.createComponent(NfupComponent);
component = fixture.componentInstance;
component.component = {} as DecisionComponentDto;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';
import { DecisionComponentDto } from '../../../../../../services/application/decision/application-decision-v2/application-decision-v2.dto';

@Component({
selector: 'app-nfup',
templateUrl: './nfup.component.html',
styleUrls: ['./nfup.component.scss'],
})
export class NfupComponent {
@Input() component!: DecisionComponentDto;
}
Loading

0 comments on commit 26a9c77

Please sign in to comment.