summit-registration-lite 6.0.5 → 6.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1549,7 +1549,9 @@ const reserveTicket = ({
|
|
|
1549
1549
|
|
|
1550
1550
|
let params = {
|
|
1551
1551
|
access_token,
|
|
1552
|
-
|
|
1552
|
+
fields: "owner_first_name,owner_last_name,owner_email,owner_company,summit_id,id,currency,amount_in_cents,amount,raw_amount_in_cents,discount_amount,discount_amount_in_cents,hash,payment_gateway_client_token,status,payment_method,promo_code,taxes_amount,applied_taxes.id,applied_taxes.name,applied_taxes.amount,tickets.id,tickets.ticket_type_id",
|
|
1553
|
+
relations: "tickets,tickets.none,applied_taxes",
|
|
1554
|
+
expand: 'tickets,applied_taxes'
|
|
1553
1555
|
};
|
|
1554
1556
|
const normalizedEntity = normalizeReservation({
|
|
1555
1557
|
owner_email: email,
|
|
@@ -4190,8 +4192,8 @@ const RegistrationLite = _ref => {
|
|
|
4190
4192
|
},
|
|
4191
4193
|
errors: []
|
|
4192
4194
|
});
|
|
4193
|
-
const [
|
|
4194
|
-
const [
|
|
4195
|
+
const [ticketDataError, setTicketDataError] = (0,external_react_.useState)(false);
|
|
4196
|
+
const [ticketDataLoaded, setTicketDataLoaded] = (0,external_react_.useState)(false);
|
|
4195
4197
|
const {
|
|
4196
4198
|
values: formValues,
|
|
4197
4199
|
errors: formErrors
|
|
@@ -4209,9 +4211,9 @@ const RegistrationLite = _ref => {
|
|
|
4209
4211
|
publicKey,
|
|
4210
4212
|
provider
|
|
4211
4213
|
} = (0,utils/* getCurrentProvider */.U5)(summitData);
|
|
4212
|
-
const allowedTicketTypes =
|
|
4213
|
-
const noAvailableTickets = (0,external_react_.useMemo)(() => profileData &&
|
|
4214
|
-
const alreadyOwnedTickets = (0,external_react_.useMemo)(() => profileData &&
|
|
4214
|
+
const allowedTicketTypes = ticketDataLoaded ? ticketTypes.filter(tt => tt.sub_type === constants.TICKET_TYPE_SUBTYPE_PREPAID || tt.sales_start_date === null && tt.sales_end_date === null || nowUtc >= tt.sales_start_date && nowUtc <= tt.sales_end_date) : [];
|
|
4215
|
+
const noAvailableTickets = (0,external_react_.useMemo)(() => profileData && ticketDataLoaded && !ticketDataError && allowedTicketTypes.length === 0 && step !== constants.STEP_COMPLETE, [allowedTicketTypes]);
|
|
4216
|
+
const alreadyOwnedTickets = (0,external_react_.useMemo)(() => profileData && ticketDataLoaded && !ticketDataError && allowedTicketTypes.length > 0 && ownedTickets.length > 0, [ownedTickets, allowedTicketTypes]);
|
|
4215
4217
|
(0,external_react_.useEffect)(() => {
|
|
4216
4218
|
if (profileData) loadProfileData(profileData);
|
|
4217
4219
|
}, [profileData]); // just initial load ( once )
|
|
@@ -4279,8 +4281,8 @@ const RegistrationLite = _ref => {
|
|
|
4279
4281
|
};
|
|
4280
4282
|
|
|
4281
4283
|
const handleGetTicketTypesAndTaxes = summitId => {
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
+
setTicketDataError(false);
|
|
4285
|
+
setTicketDataLoaded(false);
|
|
4284
4286
|
getTicketTypesAndTaxes(summitId).then().catch(error => {
|
|
4285
4287
|
let {
|
|
4286
4288
|
message
|
|
@@ -4292,9 +4294,9 @@ const RegistrationLite = _ref => {
|
|
|
4292
4294
|
return authErrorCallback(error);
|
|
4293
4295
|
}
|
|
4294
4296
|
|
|
4295
|
-
|
|
4297
|
+
setTicketDataError(true);
|
|
4296
4298
|
}).finally(() => {
|
|
4297
|
-
|
|
4299
|
+
setTicketDataLoaded(true);
|
|
4298
4300
|
});
|
|
4299
4301
|
};
|
|
4300
4302
|
|
|
@@ -4326,11 +4328,12 @@ const RegistrationLite = _ref => {
|
|
|
4326
4328
|
trackEvent(constants.PURCHASE_COMPLETE, {
|
|
4327
4329
|
order
|
|
4328
4330
|
});
|
|
4329
|
-
}; //
|
|
4330
|
-
//
|
|
4331
|
+
}; // If user is logged in but ticket data hasn't loaded yet (and no error occurred),
|
|
4332
|
+
// don't render to avoid flash. Uses local state instead of Redux to prevent
|
|
4333
|
+
// race conditions with redux-persist rehydration.
|
|
4331
4334
|
|
|
4332
4335
|
|
|
4333
|
-
if (
|
|
4336
|
+
if (profileData && !ticketDataLoaded && !ticketDataError) return null;
|
|
4334
4337
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4335
4338
|
id: `${general_module.modal}`,
|
|
4336
4339
|
className: "modal is-active"
|
|
@@ -4356,12 +4359,12 @@ const RegistrationLite = _ref => {
|
|
|
4356
4359
|
className: "fa fa-close",
|
|
4357
4360
|
"aria-label": "close",
|
|
4358
4361
|
onClick: handleCloseClick
|
|
4359
|
-
})), profileData &&
|
|
4362
|
+
})), profileData && ticketDataError && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
|
|
4360
4363
|
ticketTaxesErrorMessage: ticketTaxesErrorMessage,
|
|
4361
4364
|
retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData?.id)
|
|
4362
4365
|
}), noAvailableTickets && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
|
|
4363
4366
|
noAllowedTicketsMessage: noAllowedTicketsMessage
|
|
4364
|
-
}), !
|
|
4367
|
+
}), !ticketDataError && /*#__PURE__*/external_react_default().createElement("div", {
|
|
4365
4368
|
className: general_module.stepsWrapper
|
|
4366
4369
|
}, !profileData && !passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(login["default"], {
|
|
4367
4370
|
summitData: summitData,
|
|
@@ -4484,7 +4487,7 @@ const RegistrationLite = _ref => {
|
|
|
4484
4487
|
orderComplete1stParagraph: rest.orderComplete1stParagraph,
|
|
4485
4488
|
orderComplete2ndParagraph: rest.orderComplete2ndParagraph,
|
|
4486
4489
|
orderCompleteButton: rest.orderCompleteButton
|
|
4487
|
-
})), !
|
|
4490
|
+
})), !ticketDataError && profileData && step !== constants.STEP_COMPLETE && /*#__PURE__*/external_react_default().createElement(button_bar, {
|
|
4488
4491
|
step: step,
|
|
4489
4492
|
inPersonDisclaimer: inPersonDisclaimer,
|
|
4490
4493
|
formValues: formValues,
|