Skip to content

Commit 2c68fe7

Browse files
authored
fix: resolved lat long zero bug (#2644)
* fix: resolved lat long zero bug * chore: added test for coverage * chore: addressed minor code issues * fix: resolved digits over 6 decimal places being cut off to 5 automatically
1 parent c1ccc17 commit 2c68fe7

File tree

3 files changed

+788
-28
lines changed

3 files changed

+788
-28
lines changed

alcs-frontend/src/app/features/compliance-and-enforcement/property/property.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ <h3>Property</h3>
6565
<div class="coordinate-field">
6666
<mat-form-field appearance="outline">
6767
<mat-label>Latitude</mat-label>
68-
<input type="number" matInput formControlName="latitude" step="0.00001" placeholder="e.g. 49.55555" />
68+
<input type="text" matInput formControlName="latitude" placeholder="e.g. 49.55555" (blur)="onLatitudeBlur()" />
6969
</mat-form-field>
7070
<div *ngIf="form.get('latitude')?.hasError('required') && form.get('latitude')?.touched" class="validation-error">
7171
<mat-icon class="error-icon">warning</mat-icon>
7272
<span>This field is required</span>
7373
</div>
74-
<div class="coordinate-help">Valid Range is 48 to 61. Example: 49.55555</div>
74+
<div class="coordinate-help">Valid Range is 48 to 61. Must have exactly 5 decimal places (e.g. 49.55555). Integers like 49 will be formatted to 49.00000.</div>
7575
<div *ngIf="form.get('latitude')?.hasError('min') && form.get('latitude')?.touched" class="validation-error">
7676
<mat-icon class="error-icon">warning</mat-icon>
7777
<span>Latitude must be at least 48</span>
@@ -89,13 +89,13 @@ <h3>Property</h3>
8989
<div class="coordinate-field">
9090
<mat-form-field appearance="outline">
9191
<mat-label>Longitude</mat-label>
92-
<input type="number" matInput formControlName="longitude" step="0.00001" placeholder="e.g. -130.55555" />
92+
<input type="text" matInput formControlName="longitude" placeholder="e.g. -130.55555" (blur)="onLongitudeBlur()" />
9393
</mat-form-field>
9494
<div *ngIf="form.get('longitude')?.hasError('required') && form.get('longitude')?.touched" class="validation-error">
9595
<mat-icon class="error-icon">warning</mat-icon>
9696
<span>This field is required</span>
9797
</div>
98-
<div class="coordinate-help">Valid Range is -140 to -113. Example: -130.55555</div>
98+
<div class="coordinate-help">Valid Range is -140 to -113. Must have exactly 5 decimal places (e.g. -130.55555). Integers like -130 will be formatted to -130.00000.</div>
9999
<div *ngIf="form.get('longitude')?.hasError('min') && form.get('longitude')?.touched" class="validation-error">
100100
<mat-icon class="error-icon">warning</mat-icon>
101101
<span>Longitude must be at least -140</span>

0 commit comments

Comments
 (0)