Skip to content

Commit 10e1cba

Browse files
committed
fixed issue with UI config incorrectly reporting as invalid
1 parent 5d23903 commit 10e1cba

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file.
1010
- updates to the `es.json` language file (#2376) (@kyrokode)
1111
- updates to the `id.json` language file (#2377) (@dwaan)
1212
- updates to the `ru.json` language file (#2384) (@SeregaTarasov)
13+
- fixed issue with UI config incorrectly reporting as invalid
1314

1415
### Other Changes
1516

config.schema.json

-4
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@
452452
"type": "string",
453453
"default": "",
454454
"description": "The method used to read the Homebridge log file.",
455-
"required": true,
456455
"oneOf": [
457456
{
458457
"title": "Default",
@@ -485,7 +484,6 @@
485484
"type": "string",
486485
"description": "Enter the full file path to your log file.",
487486
"placeholder": "/var/log/homebridge.log",
488-
"required": true,
489487
"condition": {
490488
"functionBody": "return (model.log && model.log.method==='file')"
491489
}
@@ -495,7 +493,6 @@
495493
"type": "string",
496494
"description": "Enter the systemd service name. Defaults to 'homebridge'.",
497495
"placeholder": "homebridge",
498-
"required": true,
499496
"condition": {
500497
"functionBody": "return (model.log && model.log.method==='systemd')"
501498
}
@@ -505,7 +502,6 @@
505502
"description": "This command should stream the logs to stdout.",
506503
"type": "string",
507504
"placeholder": "journalctl -f -n 100 -u homebridge",
508-
"required": true,
509505
"condition": {
510506
"functionBody": "return (model.log && model.log.method==='custom')"
511507
}

ui/src/app/core/components/schema-form/schema-form.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
(onChanges)="onChanges($event)"
1212
(isValid)="validChange($event)"
1313
[language]="language"
14+
(validationErrors)="validationErrors($event)"
1415
class="ng-bs5-validate"
1516
>
1617
</json-schema-form>

ui/src/app/core/components/schema-form/schema-form.component.ts

+6
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,10 @@ export class SchemaFormComponent implements OnInit {
5353
validChange(data: any) {
5454
this.isValid.emit(data)
5555
}
56+
57+
validationErrors(errors: any[] | null) {
58+
if (errors) {
59+
errors.forEach(error => console.error(error.instancePath, error.message))
60+
}
61+
}
5662
}

0 commit comments

Comments
 (0)