diff --git a/package.json b/package.json
index a5f4a76..2abdf1e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "3d-inventory-angular-ui",
- "version": "0.37.36",
+ "version": "0.37.37",
"private": true,
"browser": {
"fs": false,
diff --git a/src/app/components/devices/edit-device/edit-device.component.html b/src/app/components/devices/edit-device/edit-device.component.html
index 3dac82a..c81fbce 100644
--- a/src/app/components/devices/edit-device/edit-device.component.html
+++ b/src/app/components/devices/edit-device/edit-device.component.html
@@ -99,7 +99,7 @@
Edit Device
placeholder="h"
required
[ngClass]="{
- 'is-invalid': this.x?.status !== 'VALID',
+ 'is-invalid': editDeviceForm.get('position')?.get('h')?.status !== 'VALID',
'is-valid': editDeviceForm.get('position')?.get('h')?.status === 'VALID',
}" />
diff --git a/src/app/components/devices/edit-device/edit-device.component.ts b/src/app/components/devices/edit-device/edit-device.component.ts
index fc39749..cd7df8a 100644
--- a/src/app/components/devices/edit-device/edit-device.component.ts
+++ b/src/app/components/devices/edit-device/edit-device.component.ts
@@ -27,7 +27,7 @@ export class DeviceEditComponent implements OnInit {
// Arrow function for number validation
numberValidator: ValidatorFn = (control: AbstractControl): ValidationErrors | null => {
const value: number = control.value as number
- if (Number.isNaN(value) || Number(value) < 0) {
+ if (Number.isNaN(value) || Number(value) > 100 || Number(value) < -100) {
return { invalidNumber: true }
}
return null
@@ -40,8 +40,8 @@ export class DeviceEditComponent implements OnInit {
modelId: ['', Validators.required],
position: this.formBulider.group({
x: [0, [Validators.required, this.numberValidator]],
- y: [0, [Validators.required]],
- h: [0, [Validators.required]],
+ y: [0, [Validators.required, this.numberValidator]],
+ h: [0, [Validators.required, this.numberValidator]],
}),
})
}