Commit graph

31 commits

Author SHA1 Message Date
regexowl
2bea0bd50b Wizard: Update kernel argument validation regex
There are special characters missing from the validation regex.
2025-08-05 12:52:39 +00:00
Katarina Sieklova
2f034dffd8 Wizard: organize steps components into the "components" folders 2025-06-24 14:09:36 +00:00
Katarina Sieklova
310f7a05cf Wizard: edit validation of port format in the Firewall step
Fixes #3269
2025-06-05 16:18:25 +02:00
Ondřej Budai
11d36f4d6c Wizard: show a specific error message when description validation fails
Prior to this commit, the wizard showed "Invalid description" when
the description was too long. This was rather unhelpful for users.

The actual size check happens in validators.ts, but the functions there
just return a boolean value, even if they check for multiple criteria.

I'm not entirely sure, why the validation functions live in a separate
file, so I decided to move this specific condition to useValidation.tsx
so the condition, and the relevant user-facing error message can be
defined next to each other.
2025-04-02 09:50:44 +02:00
regexowl
7a225e4146 Wizard: Add group input to User step
This adds a group input to the User step. The input is implemented as a `LabelInput`, when Administrator checkbox is checked, `wheel` group gets added and it's removal automatically unchecks the Administrator checkbox again.
2025-03-31 19:46:52 -05:00
regexowl
019faf0ff9 Wizard: Remove if (!value) check from validators
This removes check for whether the value is defined from validators and moves it to the place the validator is called where needed.
2025-03-31 12:53:42 -05:00
Michal Gold
6afaf49452 Wizard: Refactor Description input using new component
This commit refactors the Description field by replacing HookValidatedInput with the new ValidatedInputAndTextArea component.
It fixes a bug where the validation icon remained visible after the user cleared the Description field.
2025-03-17 15:48:29 +01:00
regexowl
5eef2b3f9a Wizard: Fix kernel validation
Kernel validation worked only for one invalid field on the step. Now it is able to validate both.
2025-03-14 15:09:58 +01:00
Michal Gold
49fa0ee735 Wizard: Refactor HookValidatedInput component
This commit splits the HookValidatedInput component into three separate functions to improve modularity and readability:

- `getValidationState`: Calculates the validation state ('default', 'success', 'error') based on whether the input is pristine and if there is an error message.
- `ValidatedInputAndTextArea`: Renders the TextInput or TextArea component, utilizing the `getValidationState` output.
- `ErrorMessage`: Displays validation error messages.

This refactoring enhances code maintainability and testability, and the updated structure is now implemented for the username field.
2025-03-05 16:07:36 -06:00
regexowl
c2cdb84e77 validators: Remove unneeded condition for service validator
After the regex was fixed this condition should be removed.
2025-02-05 16:48:02 +01:00
Sanne Raymaekers
b574a7cabc CreateImageWizard: fix systemd validator
The naming of systemd services don't follow the RFC in the comments. See
`man systemd.unit` for the specification.
2025-02-05 13:11:14 +01:00
regexowl
8bafe6cb80 Wizard: Add validation to Systemd services step
This adds validation to ChippingInputs on the Systemd services step.
2025-02-04 15:15:49 +01:00
regexowl
f11ab64262 Wizard: Add validation to ChippingInput
This adds step validation to ChippingInput, allowing to validate imported values.
2025-02-04 11:37:16 +01:00
regexowl
4145157858 Wizard: Add firewall services
This adds firewall services, using the `<ChippingInput>` components. New tests were also added.
2025-01-29 14:48:15 +01:00
regexowl
1b21852518 Wizard: Add kernel append input
This adds the kernel append input. New arguments can be added by pressing the "Add" button or hitting Enter after the argument.

The kernel arguments linked to a selected OpenSCAP profile are rendered in a category marked as "Required by OpenSCAP" and are read only.
2025-01-27 13:21:48 +01:00
Michal Gold
7d34d30b08 wizrad: add validation to ssh key field (HMS-5349)
this commit add validation to ssh key field

JIRA: HMS-5349
2025-01-23 14:08:24 +01:00
regexowl
30d77faeb5 this commit add validation to name field in Users step 2025-01-21 11:36:33 +01:00
regexowl
bfef28999d Wizard: Add validation for kernel step
This adds validation for the Kernel step.
2025-01-21 08:33:52 +01:00
regexowl
86add0ee38 validators: Remove kernel name validator
We currently don't use this validator.
2025-01-21 08:33:52 +01:00
regexowl
c121e5caba Wizard: Add Kernel name input
This adds a kernel name input.
2025-01-21 08:33:52 +01:00
regexowl
6918313d6f validators: Remove undefined where only string value expected
This removes checks for an `undefined` value in validators that take only `string`.
2025-01-20 13:23:34 +01:00
regexowl
4802d08214 Wizard: Firewall ports input
This adds chipping input for ports on the Firewall step.
2025-01-16 11:23:56 -06:00
regexowl
9b6934438a validators: Allow only lowercase characters for hostname
Validation error mentions only lowercase characters, this updates the regex accordingly.
2024-12-12 14:53:22 +02:00
regexowl
3bd4dc89c4 test: Add test to check hostname length
This adds a test to check the length of the hostname.
2024-12-12 14:53:22 +02:00
Lucas Garfield
b4932d6a44 Wizard: Hostname validation
Hostname validation rules can be found in the hostname man pages (`man 5
hostname`). This commit tweaks the hostname validator function so it is
in line with these guidelines by limiting the length to 64 characters
and also updates the error message for invalid hostnames to provide
users with some additional guidance/context when an invalid hostname is
provided.
2024-12-11 12:59:41 -06:00
regexowl
5a514d1d04 Wizard: Add Hostname functionality
This adds a validated hostname input and new tests.
2024-12-11 12:59:41 -06:00
regexowl
9324a33a74 Wizard: Add validation for NTP servers
This adds a validation pattern and a validation for NTP servers field.
2024-12-09 13:44:10 -06:00
regexowl
ba9282b61c src: Resolve circular dependency FileSystemTable <-> FileSystemConfiguration
Nothing got added, nothing got removed. Stuff just got moved around and imports are updated.
2024-10-11 14:55:03 +02:00
regexowl
076fb3fc9d src: Resolve type-only imports 2024-10-11 14:55:03 +02:00
Ondrej Ezr
2cf95bea02 Wizard: Validate snapshot date with useValidation 2024-08-30 10:17:25 +02:00
regexowl
4fb37c187e src: Rename "V2" folders to just Wizard
This replaces all occurences of "CreateImageWizardV2" with just "CreateImageWizard" as it is the only version now.
2024-07-17 11:17:06 +02:00
Renamed from src/Components/CreateImageWizardV2/validators.ts (Browse further)