From 7ddce9ac2267eb32ca212d1fe636b370914aa873 Mon Sep 17 00:00:00 2001 From: Vivian Leung Date: Mon, 1 Sep 2025 14:24:56 +0200 Subject: [PATCH] Manager: Add Input Validation to Settings page Prevent fields from being empty, when it's known that Flamenco Manager will not start up if they are. The icons for the variable add/delete are enhanced with colors and icons +/- or with a trashcan SVG. Error/warning messages appear under inputs when values are invalid on blur. `FormInputDropdownSelect` is also created here, decoupling the validation from Dropdown Select. `DropdownSelect`'s props now have type definitions. CSS selectors are more specified, and renamed to be more fitting. ### What 'required' means for each input - For text, `required` means the field cannot be empty. - For numbers, `required` means the field cannot be empty, and having a `min` and/or `max` means the number must be equal to or above/below the min/max. - For dropdowns, `required` means the selection cannot be empty, and `strict` means that an option not included in the list passed to the `options` prop cannot be selected. - For the new variable input, empty strings, duplicate variable names, and variable names that contain `{` or `}` are invalid. ### Required Settings To keep the application running and remaining on the same page, these fields **must** be non-empty strings: - `database` and `shared_storage_path` (both which can be invalid so long as they are non-empty) - `listen` (which MUST be a valid value AND non-empty) When `shared_storage_path` is empty, the application will automatically jump to the Setup Assistant which after completing will create a new `flamenco-manager.yaml` and restart the application. If `database` is empty and `listen` is not a proper port, the application will fail to start, leading the user to a dead end and forcing them to manually configure `flamenco-manager.yaml` to get it running again. To prevent the backend from throwing a `Bad Request` error, numerical and time duration inputs **must not** be null or empty: - `database_check_period`, `task_timeout`, `worker_timeout`, `blocklist_threshold`, `task_fail_after_softfail_count` Pull Request: https://projects.blender.org/studio/flamenco/pulls/104409 --- .../components/settings/DropdownSelect.vue | 71 +++- .../settings/FormInputDropdownSelect.vue | 109 ++++++ .../components/settings/FormInputNumber.vue | 4 +- .../settings/FormInputSwitchCheckbox.vue | 4 +- .../src/components/settings/FormInputText.vue | 4 +- web/app/src/views/SettingsView.vue | 323 ++++++++++++------ 6 files changed, 403 insertions(+), 112 deletions(-) create mode 100644 web/app/src/components/settings/FormInputDropdownSelect.vue diff --git a/web/app/src/components/settings/DropdownSelect.vue b/web/app/src/components/settings/DropdownSelect.vue index 07461e28..3c1f8fc2 100644 --- a/web/app/src/components/settings/DropdownSelect.vue +++ b/web/app/src/components/settings/DropdownSelect.vue @@ -6,20 +6,73 @@ select {