mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-22 11:52:21 +01:00
Merge branch 'pre_inscription' into staging
This commit is contained in:
commit
e2765d5629
@ -56,6 +56,7 @@ export const EventForm: React.FC<EventFormProps> = ({ action, event, onError, on
|
||||
const [isActiveAccounting, setIsActiveAccounting] = useState<boolean>(false);
|
||||
const [isActiveFamilyAccount, setIsActiveFamilyAccount] = useState<boolean>(false);
|
||||
const [isAcitvePreRegistration, setIsActivePreRegistration] = useState<boolean>(event?.pre_registration);
|
||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
EventCategoryAPI.index()
|
||||
@ -100,6 +101,8 @@ export const EventForm: React.FC<EventFormProps> = ({ action, event, onError, on
|
||||
* Callback triggered when the user validates the machine form: handle create or update
|
||||
*/
|
||||
const onSubmit: SubmitHandler<Event> = (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<EventFormProps> = ({ 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<EventFormProps> = ({ action, event, onError, on
|
||||
<div className="event-form">
|
||||
<header>
|
||||
<h2>{t('app.admin.event_form.ACTION_title', { ACTION: action })}</h2>
|
||||
<FabButton onClick={handleSubmit(onSubmit)} className="fab-button save-btn is-main">
|
||||
<FabButton onClick={handleSubmit(onSubmit)} disabled={submitting} className="fab-button save-btn is-main">
|
||||
{t('app.admin.event_form.save')}
|
||||
</FabButton>
|
||||
</header>
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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}}"
|
||||
|
@ -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}}"
|
||||
|
@ -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:"
|
||||
|
@ -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 :"
|
||||
|
@ -323,7 +323,7 @@ fr:
|
||||
notify_member_create_reservation:
|
||||
your_reservation_RESERVABLE_was_successfully_saved_html: "Votre réservation <strong><em>%{RESERVABLE}</em></strong> a bien été enregistrée."
|
||||
notify_member_pre_booked_reservation:
|
||||
your_reservation_RESERVABLE_was_successfully_saved_html: "Votre pré-inscription <strong><em>%{RESERVABLE}</em></strong> a bien été pris en compte."
|
||||
your_reservation_RESERVABLE_was_successfully_saved_html: "Votre pré-inscription <strong><em>%{RESERVABLE}</em></strong> 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 <strong>%{RESERVABLE}</strong> qui aura lieu le <em>%{DATE}</em>"
|
||||
notify_member_slot_is_canceled:
|
||||
|
@ -79,9 +79,9 @@ fr:
|
||||
reservation_saved_html: "Votre réservation <strong><em>%{RESERVATION}</em></strong> 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 <strong><em>%{RESERVATION}</em></strong> a bien été pris en compte."
|
||||
reservation_saved_html: "Votre réservation <strong><em>%{RESERVATION}</em></strong> 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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user