1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00

(ui) show required fields not filled in trainings settings

This commit is contained in:
Sylvain 2023-02-02 16:58:56 +01:00 committed by Sylvain
parent 116475780f
commit 4a8e69a06e

View File

@ -65,7 +65,7 @@ export const TrainingsSettings: React.FC<TrainingsSettingsProps> = ({ onError, o
<div className="trainings-settings"> <div className="trainings-settings">
<header> <header>
<h2>{t('app.admin.trainings_settings.title')}</h2> <h2>{t('app.admin.trainings_settings.title')}</h2>
<FabButton onClick={handleSubmit(onSubmit)} className='save-btn is-main'>{t('app.admin.trainings_settings.save')}</FabButton> <FabButton onClick={() => handleSubmit(onSubmit)()} className='save-btn is-main'>{t('app.admin.trainings_settings.save')}</FabButton>
</header> </header>
<form className="trainings-settings-content"> <form className="trainings-settings-content">
<div className="settings-section"> <div className="settings-section">
@ -124,6 +124,7 @@ export const TrainingsSettings: React.FC<TrainingsSettingsProps> = ({ onError, o
type="number" type="number"
register={register} register={register}
rules={{ required: isActiveAuthorizationValidity, min: 1 }} rules={{ required: isActiveAuthorizationValidity, min: 1 }}
nullable
step={1} step={1}
formState={formState} formState={formState}
label={t('app.admin.trainings_settings.authorization_validity_period')} /> label={t('app.admin.trainings_settings.authorization_validity_period')} />
@ -146,6 +147,7 @@ export const TrainingsSettings: React.FC<TrainingsSettingsProps> = ({ onError, o
type="number" type="number"
register={register} register={register}
rules={{ required: isActiveInvalidationRule, min: 1 }} rules={{ required: isActiveInvalidationRule, min: 1 }}
nullable
step={1} step={1}
formState={formState} formState={formState}
label={t('app.admin.trainings_settings.validation_rule_period')} /> label={t('app.admin.trainings_settings.validation_rule_period')} />