diff --git a/app/frontend/src/javascript/components/machines/machine-form.tsx b/app/frontend/src/javascript/components/machines/machine-form.tsx index 6197511f0..f6d7bd956 100644 --- a/app/frontend/src/javascript/components/machines/machine-form.tsx +++ b/app/frontend/src/javascript/components/machines/machine-form.tsx @@ -63,6 +63,26 @@ export const MachineForm: React.FC = ({ action, machine, onErr }); }; + /** + * Callack triggered when the user changes the 'reservable' status of the machine: + * A reservable machine cannot be disabled + */ + const onReservableToggled = (reservable: boolean) => { + if (reservable) { + setValue('disabled', false); + } + }; + + /** + * Callack triggered when the user changes the 'disabled' status of the machine: + * A disabled machine cannot be reservable + */ + const onDisabledToggled = (disabled: boolean) => { + if (disabled) { + setValue('reservable', false); + } + }; + /** * Convert all machine categories to the select format */ @@ -150,10 +170,12 @@ export const MachineForm: React.FC = ({ action, machine, onErr