From b62e9efd1219747a6b4e7b15438caf1ea0ade71a Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 31 Jul 2023 14:35:31 +0200 Subject: [PATCH 1/3] (i18n) update tranlations --- config/locales/fr.yml | 2 +- config/locales/mails.fr.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index d94ecc30f..b6b6355c2 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" From 23faa559e357265cdb1b706de822c0058fa244f1 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 31 Jul 2023 15:10:16 +0200 Subject: [PATCH 2/3] (feat) reanme event family to event reserved for members --- config/locales/app.admin.en.yml | 4 ++-- config/locales/app.admin.fr.yml | 4 ++-- config/locales/app.logged.en.yml | 2 +- config/locales/app.logged.fr.yml | 2 +- config/locales/app.public.en.yml | 2 +- config/locales/app.public.fr.yml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 953a4b2b8..269ba65c1 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" @@ -604,7 +604,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 f30bc18db..60028aaeb 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" @@ -604,7 +604,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 852d74908..80e8e7ade 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 dfa1e53dc..4a596576c 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 :" From 65a6a80670fb92625900e9f5d52edde482d2be47 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 31 Jul 2023 15:10:46 +0200 Subject: [PATCH 3/3] (feat) add submiting to save event form --- .../src/javascript/components/events/event-form.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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')}