Skip to content

Commit

Permalink
LCSD-6857 LCSD-7322 (#4300)
Browse files Browse the repository at this point in the history
LCSD-6857 & LCSD-7322

Licensing - LP/LPC/LP Location Change - Update Floor Plan Requirement Language (Occupant Load Stamp)

Licensing – CM Lean – Floor Plans – 1 of 2 – Occupant Load (Fillable field)
  • Loading branch information
simranjeetgit authored Nov 13, 2024
1 parent 08a2edb commit 532c577
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1826,20 +1826,29 @@ <h3 class="blue-header" *ngIf="this.isLP()">ESTABLISHMENT TYPE</h3>
[uploadHeader]="'TO UPLOAD FLOOR PLANS, DRAG FILES HERE OR'">
</app-file-uploader>
</section>
</div>
<br>
<section *ngIf="application.applicationType.serviceAreas" > <p>Enter the total occupant load as indicated by the occupant load stamp on the floor plan. This number can be either the total stamped on the floor plan or the sum of occupant loads across all service areas, as listed in the occupant load stamp. </p>
<app-field [valid]="!showValidationMessages || form.get('totalOccupantLoad').valid" errorMessage="Total occupant load is required."> <input class="form-control" formControlName="totalOccupantLoad" id="totalOccupantLoad"
style="width: 250px;" type="number" min="1" placeholder="Total occupant load" (input)="validateInput($event)" ></app-field></section>
</div>

</section>

<!-- Service Area -->
<h3 class="blue-header" *ngIf="application.applicationType.serviceAreas">SERVICE AREAS</h3>
<section *ngIf="application.applicationType.serviceAreas" class="padded-section content-bottom">

<div *ngIf="htmlContent?.serviceAreas" [innerHTML]="htmlContent.serviceAreas"></div>
<div *ngIf="htmlContent?.serviceAreas" [innerHTML]="htmlContent.serviceAreas" ></div>

<app-field [valid]="!showValidationMessages || form.get('serviceAreas').valid" errorMessage="All fields are required."
[showChevrons]="false" [isFullWidth]="true">
<app-capacity-table formControlName="serviceAreas" [areaCategory]="getAreaCategoryNumber('Service')"
[enabled]="!isOpenedByLGForApproval && !lGHasApproved()">
</app-capacity-table>
<div *ngIf="!isOccupantLoadCorrect()">
<br>
<p class="error-text">The sum of occupant loads across all service areas does not match the total occupant load entered in the total occupant load field.</p>
</div>
</app-field>

<mat-card class="mat-elevation-z0 mb-3" *ngIf="showHoldsOtherManufactureLicence()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@
padding-left: 15px;
margin-bottom: 20px;
}
.text-red {
color: #ff0800;
}

.error-text {
color: #d8292f;
font-weight: 400;
line-height: 1.5;
}
.warning-state {
color: #ffc107;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export class ApplicationComponent extends FormBase implements OnInit {
applyAsIndigenousNation: [false],
indigenousNationId: [{ value: null, disabled: true }, Validators.required],
federalProducerNames: ['', Validators.required],
totalOccupantLoad: ['', Validators.required],
applicantType: ['', Validators.required],
description1: [''],
description2: [''],
Expand Down Expand Up @@ -617,6 +618,8 @@ export class ApplicationComponent extends FormBase implements OnInit {

if (!this.application.applicationType.serviceAreas) {
this.form.get('serviceAreas').disable();
this.form.get('totalOccupantLoad').disable();

}
if (!this.application.applicationType.outsideAreas) {
this.form.get('outsideAreas').disable();
Expand Down Expand Up @@ -1114,12 +1117,19 @@ export class ApplicationComponent extends FormBase implements OnInit {
}
}

const serviceArea = ('areas' in this.form.get('serviceAreas').value) ? this.form.get('serviceAreas').value['areas'] : this.form.get('serviceAreas').value;

const serviceArea = ('areas' in this.form.get('serviceAreas').value) ? this.form.get('serviceAreas').value['areas'] : this.form.get('serviceAreas').value;

//if (this.showServiceArea() && serviceArea.length === 0 && (this.isLP() || ApplicationTypeNames.SpecialEventAreaEndorsement || ApplicationTypeNames.LoungeAreaEndorsment) ) {
if (this.showServiceArea() && serviceArea.length === 0) {
valid = false;
this.validationMessages.push('At least one service area is required.');
}else{
if(!this.isOccupantLoadCorrect()){
valid = false;
this.validationMessages.push('The sum of occupant loads across all service areas does not match the total occupant load entered in the total occupant load field.');
}

}

// optional for this application type
Expand Down Expand Up @@ -1489,6 +1499,7 @@ export class ApplicationComponent extends FormBase implements OnInit {
establishmentParcelId: 'Please enter the Parcel Identifier (format: 9 digits)',
establishmentopeningdate: 'Please enter the store opening date',
federalProducerNames: 'Please enter the name of federal producer',
totalOccupantLoad:'Please enter the total occupant load',
hasValidInterest: 'Please enter a value for valid interest',
indigenousNationId: 'Please select the Indigenous nation',
isAlr: 'Please indicate ALR status',
Expand Down Expand Up @@ -1771,4 +1782,16 @@ export class ApplicationComponent extends FormBase implements OnInit {
this.licenseToRemove = assignedLicence;
this.form.get("description1").patchValue(this.licenseToRemove.name);
}

validateInput(event:Event):void{
const input = event.target as HTMLInputElement;
input.value = input.value.replace(/-/g,'');
}

isOccupantLoadCorrect(): Boolean{
const serviceArea = ('areas' in this.form.get('serviceAreas').value) ? this.form.get('serviceAreas').value['areas'] : this.form.get('serviceAreas').value;
let totalCapacity = serviceArea.reduce((sum,item)=> Number(sum+(+item.capacity)),0);
let totalOccupantLoad = this.form.get('totalOccupantLoad').value | 0;
return totalOccupantLoad>=totalCapacity;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[areaCategory]="areaCategory" [onDelete]="removeRow.bind(this)" [index]="i" [onRowChange]="onRowChange.bind(this)" [enabled]="enabled">
</tr>
</ng-container>
<br>
<tr>
<td [colSpan]="isService() ? 2 : 1">
<button (click)="addRow()" class="btn btn-secondary" style="height: 100%;" *ngIf="enabled"><i class="fa fa-plus-circle" style="color: #1a5a96;"></i> Add Area</button>
Expand Down

0 comments on commit 532c577

Please sign in to comment.