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

Fixes for improved NOI structure text #1909

Merged
merged 10 commits into from
Oct 11, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>

<ng-container *ngIf="_noiSubmission.soilIsRemovingSoilForNewStructure">
<div class="full-width subheading2">The total floor area (m<sup>2</sup>) of the proposed structure(s)</div>
<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>
Expand All @@ -18,7 +18,7 @@
{{ i + 1 }}
</div>
<div class="grid-2">
{{ structure.type }}
{{ mapStructureTypeValueToLabel(structure.type) }}
<app-no-data *ngIf="!structure.type"></app-no-data>
</div>
<div class="grid-3">
Expand All @@ -39,31 +39,46 @@
</ng-container>

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

<ng-container *ngIf="isSoilAgriParcelActivityVisible">
<div class="subheading2 grid-1">Describe the current agricultural activity on the parcel(s)</div>
<div class="subheading2 grid-1">Describe the current or proposed agricultural activity on the parcel(s)</div>
<div class="grid-double">
{{ _noiSubmission.soilAgriParcelActivity }}
<app-no-data *ngIf="!_noiSubmission.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</div>
<div class="subheading2 grid-1">
Describe the intended use of the residential accessory structure(s) and why
<ng-container *ngIf="_noiSubmission.typeCode === 'POFO'">placing fill</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'ROSO'">removing soil</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'PFRS'">placing fill/removing soil</ng-container> is required
</div>
<div class="grid-double">
{{ _noiSubmission.soilStructureResidentialAccessoryUseReason }}
<app-no-data *ngIf="!_noiSubmission.soilStructureResidentialAccessoryUseReason"></app-no-data>
</div>
</ng-container>

<ng-container *ngIf="isSoilOtherStructureUseReasonVisible">
<div class="subheading2 grid-1">Describe the intended use of the 'Other' structure</div>
<div class="subheading2 grid-1">
Describe the intended use of the 'Other' structure(s) and why
<ng-container *ngIf="_noiSubmission.typeCode === 'POFO'">placing fill</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'ROSO'">removing soil</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'PFRS'">placing fill/removing soil</ng-container> is required
</div>
<div class="grid-double">
{{ _noiSubmission.soilStructureOtherUseReason }}
<app-no-data *ngIf="!_noiSubmission.soilStructureOtherUseReason"></app-no-data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import {
} from '../../../../../services/notice-of-intent/notice-of-intent.dto';
import { DOCUMENT_TYPE } from '../../../../../shared/document/document.dto';

const NOI_STRUCTURE_TYPE_LABEL_MAP: Record<STRUCTURE_TYPES, string> = {
[STRUCTURE_TYPES.FARM_STRUCTURE]: STRUCTURE_TYPES.FARM_STRUCTURE,
[STRUCTURE_TYPES.PRINCIPAL_RESIDENCE]: 'Principal Residence',
[STRUCTURE_TYPES.ADDITIONAL_RESIDENCE]: 'Additional Residence',
[STRUCTURE_TYPES.ACCESSORY_STRUCTURE]: 'Residential Accessory Structure',
[STRUCTURE_TYPES.OTHER]: STRUCTURE_TYPES.OTHER,
};

@Component({
selector: 'app-additional-information',
templateUrl: './additional-information.component.html',
Expand Down Expand Up @@ -82,4 +90,12 @@ export class AdditionalInformationComponent {
break;
}
}

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

return NOI_STRUCTURE_TYPE_LABEL_MAP[value];
}
}
2 changes: 1 addition & 1 deletion alcs-frontend/src/app/shared/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const FILE_NAME_TRUNCATE_LENGTH = 30;
export const FILE_NAME_TRUNCATE_LENGTH = 30;
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ <h2>Additional Proposal Information</h2>
[formControlName]="element.id + '-type'"
(valueChange)="onChangeStructureType(element.id, $event)"
>
<mat-option *ngFor="let type of STRUCTURE_TYPES" [value]="type">
{{ type }}
<mat-option *ngFor="let type of STRUCTURE_TYPE_OPTIONS" [value]="type.value">
{{ type.label }}
</mat-option>
</mat-select>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import { SoilRemovalConfirmationDialogComponent } from './soil-removal-confirmat

export enum STRUCTURE_TYPES {
FARM_STRUCTURE = 'Farm Structure',
PRINCIPAL_RESIDENCE = 'Principal Residence',
ADDITIONAL_RESIDENCE = 'Additional Residence',
ACCESSORY_STRUCTURE = 'Residential Accessory Structure',
PRINCIPAL_RESIDENCE = 'Residential - Principal Residence',
ADDITIONAL_RESIDENCE = 'Residential - Additional Residence',
ACCESSORY_STRUCTURE = 'Residential - Accessory Structure',
OTHER_STRUCTURE = 'Other Structure',
}

Expand All @@ -39,6 +39,14 @@ export const RESIDENTIAL_STRUCTURE_TYPES = [
STRUCTURE_TYPES.PRINCIPAL_RESIDENCE,
];

export const NOI_STRUCTURE_TYPE_LABEL_MAP: Record<STRUCTURE_TYPES, string> = {
[STRUCTURE_TYPES.FARM_STRUCTURE]: STRUCTURE_TYPES.FARM_STRUCTURE,
[STRUCTURE_TYPES.PRINCIPAL_RESIDENCE]: 'Principal Residence',
[STRUCTURE_TYPES.ADDITIONAL_RESIDENCE]: 'Additional Residence',
[STRUCTURE_TYPES.ACCESSORY_STRUCTURE]: 'Residential Accessory Structure',
[STRUCTURE_TYPES.OTHER_STRUCTURE]: STRUCTURE_TYPES.OTHER_STRUCTURE,
};

@Component({
selector: 'app-additional-information',
templateUrl: './additional-information.component.html',
Expand All @@ -48,12 +56,27 @@ export class AdditionalInformationComponent extends FilesStepComponent implement
currentStep = EditNoiSteps.ExtraInfo;

DOCUMENT = DOCUMENT_TYPE;
STRUCTURE_TYPES = [
STRUCTURE_TYPES.FARM_STRUCTURE,
STRUCTURE_TYPES.PRINCIPAL_RESIDENCE,
STRUCTURE_TYPES.ADDITIONAL_RESIDENCE,
STRUCTURE_TYPES.ACCESSORY_STRUCTURE,
STRUCTURE_TYPES.OTHER_STRUCTURE,
STRUCTURE_TYPE_OPTIONS = [
{
label: STRUCTURE_TYPES.FARM_STRUCTURE,
value: STRUCTURE_TYPES.FARM_STRUCTURE,
},
{
label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.PRINCIPAL_RESIDENCE],
value: STRUCTURE_TYPES.PRINCIPAL_RESIDENCE,
},
{
label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ADDITIONAL_RESIDENCE],
value: STRUCTURE_TYPES.ADDITIONAL_RESIDENCE,
},
{
label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ACCESSORY_STRUCTURE],
value: STRUCTURE_TYPES.ACCESSORY_STRUCTURE,
},
{
label: STRUCTURE_TYPES.OTHER_STRUCTURE,
value: STRUCTURE_TYPES.OTHER_STRUCTURE,
},
];

private submissionUuid = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>

<ng-container *ngIf="_noiSubmission.soilIsRemovingSoilForNewStructure">
<div class="full-width subheading2">The total floor area (m<sup>2</sup>) of the proposed structure(s)</div>
<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>
Expand All @@ -23,7 +23,7 @@
{{ i + 1 }}
</div>
<div class="grid-2">
{{ structure.type }}
{{ mapStructureTypeValueToLabel(structure.type) }}
<app-no-data [showRequired]="showErrors" *ngIf="!structure.type"></app-no-data>
</div>
<div class="grid-3">
Expand All @@ -45,7 +45,12 @@
</ng-container>

<ng-container *ngIf="isSoilStructureResidentialUseReasonVisible">
<div class="subheading2 grid-1">Describe how the structure is necessary for residential use</div>
<div class="subheading2 grid-1">
Describe why <ng-container *ngIf="_noiSubmission.typeCode === 'POFO'">placing fill</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'ROSO'">removing soil</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'PFRS'">placing fill/removing soil</ng-container> is required
for the residential structure(s)
</div>
<div class="grid-double">
{{ _noiSubmission.soilStructureResidentialUseReason }}
<app-no-data
Expand All @@ -56,15 +61,20 @@
</ng-container>

<ng-container *ngIf="isSoilAgriParcelActivityVisible">
<div class="subheading2 grid-1">Describe the current agricultural activity on the parcel(s)</div>
<div class="subheading2 grid-1">Describe the current or proposed agricultural activity on the parcel(s)</div>
<div class="grid-double">
{{ _noiSubmission.soilAgriParcelActivity }}
<app-no-data [showRequired]="showErrors" *ngIf="!_noiSubmission.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</div>
<div class="subheading2 grid-1">
Describe the intended use of the residential accessory structure(s) and why
<ng-container *ngIf="_noiSubmission.typeCode === 'POFO'">placing fill</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'ROSO'">removing soil</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'PFRS'">placing fill/removing soil</ng-container> is required
</div>
<div class="grid-double">
{{ _noiSubmission.soilStructureResidentialAccessoryUseReason }}
<app-no-data
Expand All @@ -75,7 +85,12 @@
</ng-container>

<ng-container *ngIf="isSoilOtherStructureVisible">
<div class="subheading2 grid-1">Describe the intended use of the 'Other' structure</div>
<div class="subheading2 grid-1">
Describe the intended use of the 'Other' structure(s) and why
<ng-container *ngIf="_noiSubmission.typeCode === 'POFO'">placing fill</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'ROSO'">removing soil</ng-container>
<ng-container *ngIf="_noiSubmission.typeCode === 'PFRS'">placing fill/removing soil</ng-container> is required
</div>
<div class="grid-double">
{{ _noiSubmission.soilStructureOtherUseReason }}
<app-no-data [showRequired]="showErrors" *ngIf="!_noiSubmission.soilStructureOtherUseReason"></app-no-data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto';
import {
RESIDENTIAL_STRUCTURE_TYPES,
STRUCTURE_TYPES,
NOI_STRUCTURE_TYPE_LABEL_MAP,
} from '../../edit-submission/additional-information/additional-information.component';
import { openFileInline } from '../../../../shared/utils/file';

Expand Down Expand Up @@ -106,4 +107,12 @@ export class AdditionalInformationComponent {
openFileInline(res.url, file.fileName);
}
}

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

return NOI_STRUCTURE_TYPE_LABEL_MAP[value];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>

<ng-container *ngIf="noiSubmission.soilIsRemovingSoilForNewStructure">
<div class="full-width subheading2">The total floor area (m<sup>2</sup>) of the proposed structure(s)</div>
<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>
Expand All @@ -20,7 +20,7 @@
{{ i + 1 }}
</div>
<div class="grid-2">
{{ structure.type }}
{{ mapStructureTypeValueToLabel(structure.type) }}
<app-no-data *ngIf="!structure.type"></app-no-data>
</div>
<div class="grid-3">
Expand All @@ -42,31 +42,46 @@
</ng-container>

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

<ng-container *ngIf="isSoilAgriParcelActivityVisible">
<div class="subheading2 grid-1">Describe the current agricultural activity on the parcel(s)</div>
<div class="subheading2 grid-1">Describe the current or proposed agricultural activity on the parcel(s)</div>
<div class="grid-double">
{{ noiSubmission.soilAgriParcelActivity }}
<app-no-data *ngIf="!noiSubmission.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</div>
<div class="subheading2 grid-1">
Describe the intended use of the residential accessory structure(s) and why
<ng-container *ngIf="noiSubmission.typeCode === 'POFO'">placing fill</ng-container>
<ng-container *ngIf="noiSubmission.typeCode === 'ROSO'">removing soil</ng-container>
<ng-container *ngIf="noiSubmission.typeCode === 'PFRS'">placing fill/removing soil</ng-container> is required
</div>
<div class="grid-double">
{{ noiSubmission.soilStructureResidentialAccessoryUseReason }}
<app-no-data *ngIf="!noiSubmission.soilStructureResidentialAccessoryUseReason"></app-no-data>
</div>
</ng-container>

<ng-container *ngIf="isSoilOtherStructureVisible">
<div class="subheading2 grid-1">Describe the intended use of the 'Other' structure</div>
<div class="subheading2 grid-1">
Describe the intended use of the 'Other' structure(s) and why
<ng-container *ngIf="noiSubmission.typeCode === 'POFO'">placing fill</ng-container>
<ng-container *ngIf="noiSubmission.typeCode === 'ROSO'">removing soil</ng-container>
<ng-container *ngIf="noiSubmission.typeCode === 'PFRS'">placing fill/removing soil</ng-container> is required
</div>
<div class="grid-double">
{{ noiSubmission.soilStructureOtherUseReason }}
<app-no-data *ngIf="!noiSubmission.soilStructureOtherUseReason"></app-no-data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { openFileInline } from '../../../../../shared/utils/file';
import {
RESIDENTIAL_STRUCTURE_TYPES,
STRUCTURE_TYPES,
NOI_STRUCTURE_TYPE_LABEL_MAP,
} from '../../../../notice-of-intents/edit-submission/additional-information/additional-information.component';

@Component({
Expand Down Expand Up @@ -88,4 +89,12 @@ export class AdditionalInformationComponent implements OnInit {
openFileInline(res.url, file.fileName);
}
}

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

return NOI_STRUCTURE_TYPE_LABEL_MAP[value];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,17 @@ export class GenerateNoiSubmissionDocumentService {
soilProposedStructures: submission.soilProposedStructures.map(
(structure, index) => ({
area: structure.area ?? NO_DATA,
type: structure.type ?? NO_DATA,
type:
{
'Fram Structure': 'Fram Structure',
'Residential - Principal Residence': 'Principal Residence',
'Residential - Additional Residence': 'Additional Residence',
'Residential - Accessory Structure':
'Residential Accessory Structure',
'Other Structure': 'Other Structure',
}[structure.type ?? ''] ??
structure.type ??
NO_DATA,
index: index + 1,
}),
),
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.