Wizard: Add validation to Systemd services step

This adds validation to ChippingInputs on the Systemd services step.
This commit is contained in:
regexowl 2025-02-04 11:59:32 +01:00 committed by Klara Simickova
parent 1e0cf96457
commit 8bafe6cb80
4 changed files with 65 additions and 2 deletions

View file

@ -14,6 +14,7 @@ import {
selectServices,
} from '../../../../../store/wizardSlice';
import ChippingInput from '../../../ChippingInput';
import { useServicesValidation } from '../../../utilities/useValidation';
import { isServiceValid } from '../../../validators';
const ServicesInput = () => {
@ -21,6 +22,8 @@ const ServicesInput = () => {
const maskedServices = useAppSelector(selectServices).masked;
const enabledServices = useAppSelector(selectServices).enabled;
const stepValidation = useServicesValidation();
const release = useAppSelector(selectDistribution);
const complianceProfileID = useAppSelector(selectComplianceProfileID);
@ -64,6 +67,8 @@ const ServicesInput = () => {
item="Disabled service"
addAction={addDisabledService}
removeAction={removeDisabledService}
stepValidation={stepValidation}
fieldName="disabledSystemdServices"
/>
</FormGroup>
<FormGroup isRequired={false} label="Enabled services">
@ -78,6 +83,8 @@ const ServicesInput = () => {
item="Enabled service"
addAction={addEnabledService}
removeAction={removeEnabledService}
stepValidation={stepValidation}
fieldName="enabledSystemdServices"
/>
</FormGroup>
</>