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

Add structures to soil apps #1943

Merged
merged 46 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1578637
Move structure type options to module constant for use by other modules
trslater Oct 16, 2024
0a7812f
Rename NOI structure label map to make general for all soil
trslater Oct 16, 2024
cf945f2
Add new structures question to DB
trslater Oct 16, 2024
4ecbaa0
Git add new structure question to all services and DTO's
trslater Oct 16, 2024
6c50f45
Add new structure question to UI
trslater Oct 16, 2024
8e26b88
Show/hide old questions based on answer to new structure question
trslater Oct 16, 2024
981e73c
Add all new questions to DB
trslater Oct 16, 2024
52888ed
Add new conditional structure questions to all services and DTO's
trslater Oct 16, 2024
c5600ab
Add missed DTO field
trslater Oct 16, 2024
7c12b67
Add structures to all DTO's and services
trslater Oct 17, 2024
d46bfab
Expose structure form type for use by other modules
trslater Oct 17, 2024
736d832
Add structures table and conditional questions to UI
trslater Oct 17, 2024
fd655b8
Remove unused imports
trslater Oct 17, 2024
1b1334a
Add is new structure confirmation dialog
trslater Oct 17, 2024
d8f3c7f
Remove conditional app type text
trslater Oct 22, 2024
4e085f0
Fix NOI structure dialog return type issue
trslater Oct 23, 2024
3796ebf
Add wanting when changing structure type on mobile
trslater Oct 23, 2024
76f0b32
Implement mobile UI for soil apps
trslater Oct 23, 2024
bd4aec4
Update POFO/ROSO with changes from PFRS
trslater Oct 24, 2024
a2dfd3e
Add building plans
trslater Oct 24, 2024
3b1763c
Fix clearing file uploads
trslater Oct 24, 2024
9bdfad6
Update POFO/ROSO styles
trslater Oct 24, 2024
26365c0
Fix structure add button layout
trslater Oct 24, 2024
4b49360
Fix POFO/ROSO wording
trslater Oct 24, 2024
0a9dc55
Add updates to portal view
trslater Oct 25, 2024
1a1cb9d
Fix missing saved submission fields
trslater Oct 25, 2024
ce2c4dd
Fix submission validation
trslater Oct 25, 2024
5147bef
Fix structures type in DTO
trslater Oct 25, 2024
05ca07a
Add app soil updates to app info
trslater Oct 25, 2024
5480165
Merge branch 'develop' into feature/ALCS-1156
trslater Oct 28, 2024
0f9778e
Update public view with soil changes
trslater Oct 29, 2024
37b2710
Fix app info building plans
trslater Oct 29, 2024
0183164
Fix building plans being deleting for wrong action
trslater Oct 29, 2024
c21544e
Fix PFRS validation
trslater Oct 29, 2024
e960e98
Fix POFO reduce impact visibility
trslater Oct 29, 2024
7dc12b7
Fix ROSO sctructure table layout
trslater Oct 29, 2024
d1003dd
Display POFO reduce impact field
trslater Oct 29, 2024
70f10df
Pipe new structures data to PDF templates
trslater Oct 30, 2024
9a006d4
Add structure changes to PDF's
trslater Oct 30, 2024
9671bc4
Fix m2 -> m^2
trslater Oct 30, 2024
a1ab7f1
Fix API tests
trslater Oct 30, 2024
45e949b
Fix ALCS tests
trslater Oct 30, 2024
258fbd9
Fix portal tests
trslater Oct 30, 2024
7c457a1
Fix mobile/desktop area mirroring issue
trslater Oct 30, 2024
3829eb4
Move structure types to enum with label map
trslater Oct 31, 2024
caadcad
Fix API tests
trslater Oct 31, 2024
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 @@ -101,6 +101,13 @@ describe('ApplicationDetailsComponent', () => {
soilHasSubmittedNotice: null,
soilIsExtractionOrMining: null,
soilIsFollowUp: null,
soilIsNewStructure: null,
soilStructureFarmUseReason: null,
soilStructureResidentialUseReason: null,
soilAgriParcelActivity: null,
soilStructureResidentialAccessoryUseReason: null,
soilStructureOtherUseReason: null,
soilProposedStructures: [],
soilFollowUpIDs: null,
soilProjectDuration: null,
soilReduceNegativeImpacts: null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<div *ngIf="_applicationSubmission" class="review-table">
<div class="subheading2 grid-1">Are you removing soil and placing fill in order to build a structure?</div>
<div class="grid-double">
<span *ngIf="_applicationSubmission.soilIsNewStructure !== null">
{{ _applicationSubmission.soilIsNewStructure ? 'Yes' : 'No' }}
</span>
<app-no-data *ngIf="_applicationSubmission.soilIsNewStructure === null"></app-no-data>
</div>

<div class="subheading2 grid-1">
Has the ALC previously received an application or Notice of Intent for this proposal?
</div>
Expand Down Expand Up @@ -120,13 +128,6 @@
</div>
</div>

<div class="subheading2 grid-1">
What alternative measures have you considered or attempted before proposing to place fill?
</div>
<div class="grid-double">
<span>{{ _applicationSubmission.soilAlternativeMeasures }}</span>
</div>

<div class="subheading2 grid-1">Describe the type, origin and quality of fill proposed to be placed.</div>
<div class="grid-double">
<span>{{ _applicationSubmission.soilFillTypeToPlace }}</span>
Expand All @@ -136,52 +137,150 @@
<div class="grid-double">
<span>{{ _applicationSubmission.soilTypeRemoved }}</span>
</div>
<div class="subheading2 grid-1">What steps will be taken to reduce impacts to surrounding agricultural land?</div>
<div class="grid-double">
<span>{{ _applicationSubmission.soilReduceNegativeImpacts }}</span>
</div>

<ng-container *ngIf="_applicationSubmission.soilIsNewStructure === true">
<div class="full-width subheading2">The total floor area (m<sup>2</sup>) for each of the proposed structure(s)</div>
<div class="full-width structure-table">
<div class="grid-1 subheading2">#</div>
<div class="grid-2 subheading2">Type</div>
<div class="grid-3 subheading2">Area</div>
<ng-container *ngFor="let structure of _applicationSubmission.soilProposedStructures; let i = index">
<div class="grid-1">
{{ i + 1 }}
</div>
<div class="grid-2">
{{ mapStructureTypeValueToLabel(structure.type) }}
<app-no-data *ngIf="!structure.type"></app-no-data>
</div>
<div class="grid-3">
{{ structure.area }} <span *ngIf="structure.area">m<sup>2</sup></span>
<app-no-data *ngIf="!structure.area"></app-no-data>
</div>
</ng-container>
</div>
<div *ngIf="_applicationSubmission.soilProposedStructures.length === 0" class="full-width">
<app-no-data></app-no-data>
</div>

<ng-container *ngIf="isSoilStructureFarmUseReasonVisible">
<div class="subheading2 grid-1">Describe how the structure is necessary for farm use</div>
<div class="grid-double">
{{ _applicationSubmission.soilStructureFarmUseReason }}
<app-no-data *ngIf="!_applicationSubmission.soilStructureFarmUseReason"></app-no-data>
</div>
</ng-container>

<ng-container *ngIf="isSoilStructureResidentialUseReasonVisible">
<div class="subheading2 grid-1">
Describe why placing fill/removing soil is required for the residential structure(s)
</div>
<div class="grid-double">
{{ _applicationSubmission.soilStructureResidentialUseReason }}
<app-no-data *ngIf="!_applicationSubmission.soilStructureResidentialUseReason"></app-no-data>
</div>
</ng-container>

<ng-container *ngIf="isSoilAgriParcelActivityVisible">
<div class="subheading2 grid-1">Describe the current or proposed agricultural activity on the parcel(s)</div>
<div class="grid-double">
{{ _applicationSubmission.soilAgriParcelActivity }}
<app-no-data *ngIf="!_applicationSubmission.soilAgriParcelActivity"></app-no-data>
</div>
</ng-container>

<ng-container *ngIf="isSoilStructureResidentialAccessoryUseReasonVisible">
<div class="subheading2 grid-1">
Describe the intended use of the residential accessory structure(s) and why placing fill/removing soil is
required
</div>
<div class="grid-double">
{{ _applicationSubmission.soilStructureResidentialAccessoryUseReason }}
<app-no-data *ngIf="!_applicationSubmission.soilStructureResidentialAccessoryUseReason"></app-no-data>
</div>
</ng-container>

<ng-container *ngIf="isSoilOtherStructureVisible">
<div class="subheading2 grid-1">
Describe the intended use of the 'Other' structure(s) and why placing fill/removing soil is required
</div>
<div class="grid-double">
{{ _applicationSubmission.soilStructureOtherUseReason }}
<app-no-data *ngIf="!_applicationSubmission.soilStructureOtherUseReason"></app-no-data>
</div>
</ng-container>
</ng-container>

<ng-container *ngIf="_applicationSubmission.soilIsNewStructure === false">
<div class="subheading2 grid-1">
What alternative measures have you considered or attempted before proposing to place fill?
</div>
<div class="grid-double">
<span>{{ _applicationSubmission.soilAlternativeMeasures }}</span>
</div>

<div class="subheading2 grid-1">What steps will be taken to reduce impacts to surrounding agricultural land?</div>
<div class="grid-double">
<span>{{ _applicationSubmission.soilReduceNegativeImpacts }}</span>
</div>
</ng-container>

<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">Cross Sections</div>
<div class="grid-double multiple-documents">
<div>
<a *ngFor="let file of crossSections" (click)="openFile(file)">

<ng-container *ngIf="_applicationSubmission.soilIsNewStructure === false">
<div class="subheading2 grid-1">Cross Sections</div>
<div class="grid-double multiple-documents">
<div>
<a *ngFor="let file of crossSections" (click)="openFile(file)">
{{ file.fileName }}
</a>
</div>
</div>

<div class="subheading2 grid-1">Reclamation Plan</div>
<div class="grid-double multiple-documents">
<a *ngFor="let file of reclamationPlans" (click)="openFile(file)">
{{ file.fileName }}
</a>
</div>
</div>
<div class="subheading2 grid-1">Reclamation Plan</div>
<div class="grid-double multiple-documents">
<a *ngFor="let file of reclamationPlans" (click)="openFile(file)">
{{ file.fileName }}
</a>
</div>
</ng-container>

<div class="subheading2 grid-1">Is your proposal for aggregate extraction or placer mining?</div>
<div class="grid-double">
<span *ngIf="_applicationSubmission.soilIsExtractionOrMining !== null">
{{ _applicationSubmission.soilIsExtractionOrMining ? 'Yes' : 'No' }}
</span>
</div>
<ng-container *ngIf="_applicationSubmission.soilIsNewStructure === true">
<div class="subheading2 grid-1">Detailed Building Plan(s)</div>
<div class="grid-double multiple-documents">
<a *ngFor="let file of buildingPlans" (click)="openFile(file)">
{{ file.fileName }}
</a>
<app-no-data *ngIf="buildingPlans.length === 0"></app-no-data>
</div>
</ng-container>

<div *ngIf="_applicationSubmission.soilIsExtractionOrMining" class="subheading2 grid-1">
Have you submitted a Notice of Work to the Ministry of Energy, Mines and Low Carbon Innovation (EMLI)?
</div>
<div *ngIf="_applicationSubmission.soilIsExtractionOrMining" class="grid-double">
<span *ngIf="_applicationSubmission.soilHasSubmittedNotice !== null">
{{ _applicationSubmission.soilHasSubmittedNotice ? 'Yes' : 'No' }}
</span>
</div>
<ng-container *ngIf="_applicationSubmission.soilIsNewStructure === false">
<div class="subheading2 grid-1">Is your proposal for aggregate extraction or placer mining?</div>
<div class="grid-double">
<span *ngIf="_applicationSubmission.soilIsExtractionOrMining !== null">
{{ _applicationSubmission.soilIsExtractionOrMining ? 'Yes' : 'No' }}
</span>
</div>

<div *ngIf="_applicationSubmission.soilHasSubmittedNotice" class="subheading2 grid-1">Notice of Work</div>
<div *ngIf="_applicationSubmission.soilHasSubmittedNotice" class="grid-double multiple-documents">
<a *ngFor="let file of noticeOfWork" (click)="openFile(file)">
{{ file.fileName }}
</a>
</div>
<div *ngIf="_applicationSubmission.soilIsExtractionOrMining" class="subheading2 grid-1">
Have you submitted a Notice of Work to the Ministry of Energy, Mines and Low Carbon Innovation (EMLI)?
</div>
<div *ngIf="_applicationSubmission.soilIsExtractionOrMining" class="grid-double">
<span *ngIf="_applicationSubmission.soilHasSubmittedNotice !== null">
{{ _applicationSubmission.soilHasSubmittedNotice ? 'Yes' : 'No' }}
</span>
</div>

<div *ngIf="_applicationSubmission.soilHasSubmittedNotice" class="subheading2 grid-1">Notice of Work</div>
<div *ngIf="_applicationSubmission.soilHasSubmittedNotice" class="grid-double multiple-documents">
<a *ngFor="let file of noticeOfWork" (click)="openFile(file)">
{{ file.fileName }}
</a>
</div>
</ng-container>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@
height: 16px;
}
}

.structure-table {
display: grid;
grid-template-columns: max-content 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
Expand Up @@ -4,17 +4,44 @@ import { ApplicationDocumentDto } from '../../../../../services/application/appl
import { ApplicationDocumentService } from '../../../../../services/application/application-document/application-document.service';
import { ApplicationSubmissionDto } from '../../../../../services/application/application.dto';
import { DOCUMENT_TYPE } from '../../../../../shared/document/document.dto';
import { STRUCTURE_TYPES } from '../../../../../services/notice-of-intent/notice-of-intent.dto';
import { STRUCTURE_TYPE_LABEL_MAP } from '../../../../notice-of-intent/applicant-info/notice-of-intent-details/additional-information/additional-information.component';

@Component({
selector: 'app-pfrs-details[applicationSubmission]',
templateUrl: './pfrs-details.component.html',
styleUrls: ['./pfrs-details.component.scss'],
})
export class PfrsDetailsComponent {
isSoilStructureFarmUseReasonVisible = false;
isSoilStructureResidentialUseReasonVisible = false;
isSoilAgriParcelActivityVisible = false;
isSoilStructureResidentialAccessoryUseReasonVisible = false;
isSoilOtherStructureVisible = false;

_applicationSubmission: ApplicationSubmissionDto | undefined;
@Input() set applicationSubmission(application: ApplicationSubmissionDto | undefined) {
if (application) {
this._applicationSubmission = application;

this.isSoilStructureFarmUseReasonVisible = application.soilProposedStructures.some(
(structure) => structure.type === STRUCTURE_TYPES.FARM_STRUCTURE,
);
this.isSoilStructureResidentialUseReasonVisible = application.soilProposedStructures.some(
(structure) =>
structure.type === STRUCTURE_TYPES.PRINCIPAL_RESIDENCE ||
structure.type === STRUCTURE_TYPES.ADDITIONAL_RESIDENCE ||
structure.type === STRUCTURE_TYPES.ACCESSORY_STRUCTURE,
);
this.isSoilAgriParcelActivityVisible = application.soilProposedStructures.some(
(structure) => structure.type === STRUCTURE_TYPES.FARM_STRUCTURE,
);
this.isSoilStructureResidentialAccessoryUseReasonVisible = application.soilProposedStructures.some(
(structure) => structure.type === STRUCTURE_TYPES.ACCESSORY_STRUCTURE,
);
this.isSoilOtherStructureVisible = application.soilProposedStructures.some(
(structure) => structure.type === STRUCTURE_TYPES.OTHER,
);
}
}

Expand All @@ -23,18 +50,28 @@ export class PfrsDetailsComponent {
this.crossSections = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.CROSS_SECTIONS);
this.proposalMap = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.PROPOSAL_MAP);
this.reclamationPlans = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.RECLAMATION_PLAN);
this.buildingPlans = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.BUILDING_PLAN);
this.noticeOfWork = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.NOTICE_OF_WORK);
}
}

crossSections: ApplicationDocumentDto[] = [];
proposalMap: ApplicationDocumentDto[] = [];
reclamationPlans: ApplicationDocumentDto[] = [];
buildingPlans: ApplicationDocumentDto[] = [];
noticeOfWork: ApplicationDocumentDto[] = [];

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

async openFile(file: ApplicationDocumentDto) {
await this.applicationDocumentService.download(file.uuid, file.fileName);
}

mapStructureTypeValueToLabel(value: STRUCTURE_TYPES | null): string | null {
if (value === null) {
return null;
}

return STRUCTURE_TYPE_LABEL_MAP[value];
}
}
Loading