diff --git a/app/frontend/src/javascript/components/events/event-form.tsx b/app/frontend/src/javascript/components/events/event-form.tsx index 1013bb0b2..8102db622 100644 --- a/app/frontend/src/javascript/components/events/event-form.tsx +++ b/app/frontend/src/javascript/components/events/event-form.tsx @@ -56,6 +56,7 @@ export const EventForm: React.FC = ({ action, event, onError, on const [isActiveAccounting, setIsActiveAccounting] = useState(false); const [isActiveFamilyAccount, setIsActiveFamilyAccount] = useState(false); const [isAcitvePreRegistration, setIsActivePreRegistration] = useState(event?.pre_registration); + const [submitting, setSubmitting] = useState(false); useEffect(() => { EventCategoryAPI.index() @@ -100,6 +101,8 @@ export const EventForm: React.FC = ({ action, event, onError, on * Callback triggered when the user validates the machine form: handle create or update */ const onSubmit: SubmitHandler = (data: Event) => { + setSubmitting(true); + if (submitting) return; if (data.pre_registration_end_date?.toString() === 'Invalid Date') { data.pre_registration_end_date = null; } @@ -114,7 +117,7 @@ export const EventForm: React.FC = ({ action, event, onError, on EventAPI.create(data).then(res => { onSuccess(t(`app.admin.event_form.${action}_success`)); window.location.href = `/#!/events/${res.id}`; - }).catch(onError); + }).catch(onError).finally(() => setSubmitting(false)); } }; @@ -192,7 +195,7 @@ export const EventForm: React.FC = ({ action, event, onError, on

{t('app.admin.event_form.ACTION_title', { ACTION: action })}

- + {t('app.admin.event_form.save')}
diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 2b610570b..7260b74a9 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -155,7 +155,7 @@ en: event_types: standard: "Event standard" nominative: "Event nominative" - family: "Event family" + family: "Event reserved for members" pre_registration: "Pre-registration" pre_registration_help: "If this option is checked, administrators and managers must validate registrations before they become final." pre_registration_end_date: "Deadline for pre-registration" @@ -606,7 +606,7 @@ en: types: "Types" event_type: standard: "Standard" - family: "Family" + family: "Reserved for members" nominative: "Nominative" pre_registration: "Pre-registration" NUMBER_pre_registered: " {NUMBER} pre-registered" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index 04fe4f644..4312c953b 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -155,7 +155,7 @@ fr: event_types: standard: "Evénement standard" nominative: "Evénement nominatif" - family: "Evénement famille" + family: "Evénement réservé aux membres" pre_registration: "Pré-inscription" pre_registration_help: "Si cette option est cochée, les administrateurs et les gestionnaires devent valider les inscriptions avant qu'elles ne soient définitives." pre_registration_end_date: "Date limite de pré-inscription" @@ -606,7 +606,7 @@ fr: types: 'Types' event_type: standard: 'Standard' - family: "Famille" + family: "Réservé aux membres" nominative: "Nominatif" pre_registration: "Pré-inscription" NUMBER_pre_registered: " {NUMBER} pré-inscrit" diff --git a/config/locales/app.logged.en.yml b/config/locales/app.logged.en.yml index 125ca1b45..202b90b56 100644 --- a/config/locales/app.logged.en.yml +++ b/config/locales/app.logged.en.yml @@ -39,7 +39,7 @@ en: sync_profile: "Sync my profile" event_reservation_item: event: "Event" - family: "Family" + family: "Reserved for members" nominative: "Nominative" pre_registration: "Pre-registration" NUMBER_normal_places_reserved: "{NUMBER} {NUMBER, plural, =0{} =1{normal place reserved} other{normal places reserved}}" diff --git a/config/locales/app.logged.fr.yml b/config/locales/app.logged.fr.yml index 226196459..8a861f2fe 100644 --- a/config/locales/app.logged.fr.yml +++ b/config/locales/app.logged.fr.yml @@ -39,7 +39,7 @@ fr: sync_profile: "Synchroniser mon profil" event_reservation_item: event: 'Événement' - family: 'Famille' + family: 'Réservé aux membres' nominative: 'Nominatif' pre_registration: 'Pré-inscription' NUMBER_normal_places_reserved: "{NUMBER} {NUMBER, plural, =0{} =1{place normale réservée} other{places normales réservées}}" diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml index e4a41bbb9..f14ace6e9 100644 --- a/config/locales/app.public.en.yml +++ b/config/locales/app.public.en.yml @@ -319,7 +319,7 @@ en: downloadable_documents: "Downloadable documents" information_and_booking: "Information and booking" event_type: - family: "Family event" + family: "Event reserved for members" nominative: "Nominative event" dates: "Dates" beginning: "Beginning:" diff --git a/config/locales/app.public.fr.yml b/config/locales/app.public.fr.yml index 18116ee23..83355a75a 100644 --- a/config/locales/app.public.fr.yml +++ b/config/locales/app.public.fr.yml @@ -319,7 +319,7 @@ fr: downloadable_documents: "Documents à télécharger" information_and_booking: "Informations et réservation" event_type: - family: "Evénement famille" + family: "Evénement réservé aux membres" nominative: "Evénement nominatif" dates: "Dates" beginning: "Début :" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 398e00cca..278fc2ec7 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -323,7 +323,7 @@ fr: notify_member_create_reservation: your_reservation_RESERVABLE_was_successfully_saved_html: "Votre réservation %{RESERVABLE} a bien été enregistrée." notify_member_pre_booked_reservation: - your_reservation_RESERVABLE_was_successfully_saved_html: "Votre pré-inscription %{RESERVABLE} a bien été pris en compte." + your_reservation_RESERVABLE_was_successfully_saved_html: "Votre pré-inscription %{RESERVABLE} a bien été prise en compte." notify_member_reservation_reminder: reminder_you_have_a_reservation_RESERVABLE_to_be_held_on_DATE_html: "Rappel : Vous avez une réservation %{RESERVABLE} qui aura lieu le %{DATE}" notify_member_slot_is_canceled: diff --git a/config/locales/mails.fr.yml b/config/locales/mails.fr.yml index a6cda1010..95e541738 100644 --- a/config/locales/mails.fr.yml +++ b/config/locales/mails.fr.yml @@ -79,9 +79,9 @@ fr: reservation_saved_html: "Votre réservation %{RESERVATION} a bien été enregistrée." your_reserved_slots: "Les créneaux que vous avez réservés sont :" notify_member_pre_booked_reservation: - subject: "Votre pré-inscription a bien été pris en compte" + subject: "Votre pré-inscription a bien été prise en compte" body: - reservation_saved_html: "Votre réservation %{RESERVATION} a bien été pris en compte." + reservation_saved_html: "Votre réservation %{RESERVATION} a bien été prise en compte." your_reserved_slots: "Les créneaux que vous avez pré-inscrit sont :" notify_member_subscribed_plan_is_changed: subject: "Votre abonnement a été mis à jour"