summit-registration-lite 6.0.5-beta.1 → 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 CHANGED
@@ -1549,7 +1549,9 @@ const reserveTicket = ({
1549
1549
 
1550
1550
  let params = {
1551
1551
  access_token,
1552
- expand: 'tickets,tickets.owner,tickets.ticket_type,tickets.ticket_type.taxes'
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,
@@ -2868,6 +2870,9 @@ const PaymentComponent = ({
2868
2870
  };
2869
2871
 
2870
2872
  /* harmony default export */ const payment = (PaymentComponent);
2873
+ ;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/inputs/company-input-v2"
2874
+ const company_input_v2_namespaceObject = require("openstack-uicore-foundation/lib/components/inputs/company-input-v2");
2875
+ var company_input_v2_default = /*#__PURE__*/__webpack_require__.n(company_input_v2_namespaceObject);
2871
2876
  // EXTERNAL MODULE: ./src/helpers/index.js + 1 modules
2872
2877
  var helpers = __webpack_require__(499);
2873
2878
  ;// CONCATENATED MODULE: ./src/components/personal-information/index.module.scss
@@ -2904,6 +2909,7 @@ function personal_information_defineProperty(obj, key, value) { if (key in obj)
2904
2909
 
2905
2910
 
2906
2911
 
2912
+
2907
2913
  const PersonalInfoComponent = ({
2908
2914
  isActive,
2909
2915
  changeForm,
@@ -3049,21 +3055,34 @@ const PersonalInfoComponent = ({
3049
3055
  }
3050
3056
  });
3051
3057
  const customStyles = {
3052
- control: provided => personal_information_objectSpread(personal_information_objectSpread({}, provided), {}, {
3053
- minHeight: '36px',
3054
- height: '36px'
3055
- }),
3056
- menuList: provided => personal_information_objectSpread(personal_information_objectSpread({}, provided), {}, {
3057
- maxHeight: '120px'
3058
- }),
3059
- placeholder: provided => personal_information_objectSpread(personal_information_objectSpread({}, provided), {}, {
3060
- fontSize: '12px',
3061
- textOverflow: 'ellipsis',
3062
- whiteSpace: 'nowrap',
3063
- overflow: 'hidden',
3064
- width: '95%',
3065
- paddingRight: '10px'
3066
- })
3058
+ height: 36,
3059
+ "& .MuiFormControl-root": {
3060
+ marginTop: 0,
3061
+ marginBottom: 0
3062
+ },
3063
+ "& .MuiOutlinedInput-root": {
3064
+ height: 36,
3065
+ boxSizing: "border-box"
3066
+ },
3067
+ "& .MuiOutlinedInput-input": {
3068
+ height: "100%",
3069
+ lineHeight: 36,
3070
+ boxSizing: "border-box",
3071
+ fontSize: 16
3072
+ },
3073
+ "& .MuiOutlinedInput-input::placeholder": {
3074
+ fontSize: 14
3075
+ },
3076
+ "& .MuiAutocomplete-option": {
3077
+ fontSize: 16
3078
+ },
3079
+ "& .MuiAutocomplete-listbox": {
3080
+ maxHeight: 120
3081
+ },
3082
+ "& .MuiInputLabel-root:not(.MuiInputLabel-shrink)": {
3083
+ transform: "translate(12px, 10px)",
3084
+ fontSize: 14
3085
+ }
3067
3086
  };
3068
3087
  return /*#__PURE__*/external_react_default().createElement("div", {
3069
3088
  className: `${personal_information_index_module.outerWrapper} step-wrapper`
@@ -3145,21 +3164,26 @@ const PersonalInfoComponent = ({
3145
3164
  "data-testid": "email-error-invalid"
3146
3165
  }, "The email is invalid.")), showCompanyInput && /*#__PURE__*/external_react_default().createElement("div", {
3147
3166
  className: personal_information_index_module.fieldWrapper
3148
- }, /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement(components_namespaceObject.RegistrationCompanyInput, {
3167
+ }, /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement((company_input_v2_default()), {
3149
3168
  id: "reg-comp-input",
3150
3169
  name: "reg-comp-input",
3151
3170
  "data-testid": "company",
3152
- styles: customStyles,
3171
+ sx: customStyles,
3153
3172
  summitId: summitId,
3154
3173
  onChange: onCompanyChange,
3155
3174
  onError: handleCompanyError,
3156
3175
  value: personalInfo.company,
3157
3176
  placeholder: companyDDLPlaceholder,
3158
- isClearable: true,
3159
- defaultOptions: showCompanyInputDefaultOptions,
3160
- openMenuOnFocus: showCompanyInputDefaultOptions,
3161
- openMenuOnClick: showCompanyInputDefaultOptions,
3162
- options2Show: companyDDLOptions2Show
3177
+ options2Show: companyDDLOptions2Show,
3178
+ disableShrink: true,
3179
+ label: null,
3180
+ ListboxProps: {
3181
+ sx: {
3182
+ '& li.MuiAutocomplete-option': {
3183
+ fontSize: '16px'
3184
+ }
3185
+ }
3186
+ }
3163
3187
  }), companyError && /*#__PURE__*/external_react_default().createElement("div", {
3164
3188
  className: personal_information_index_module.fieldError,
3165
3189
  "data-testid": "company-error"
@@ -4168,8 +4192,8 @@ const RegistrationLite = _ref => {
4168
4192
  },
4169
4193
  errors: []
4170
4194
  });
4171
- const [ticketTaxesError, setTicketTaxesError] = (0,external_react_.useState)(false);
4172
- const [ticketTaxesLoaded, setTicketTaxesLoaded] = (0,external_react_.useState)(false);
4195
+ const [ticketDataError, setTicketDataError] = (0,external_react_.useState)(false);
4196
+ const [ticketDataLoaded, setTicketDataLoaded] = (0,external_react_.useState)(false);
4173
4197
  const {
4174
4198
  values: formValues,
4175
4199
  errors: formErrors
@@ -4187,9 +4211,9 @@ const RegistrationLite = _ref => {
4187
4211
  publicKey,
4188
4212
  provider
4189
4213
  } = (0,utils/* getCurrentProvider */.U5)(summitData);
4190
- const allowedTicketTypes = ticketTaxesLoaded ? 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) : [];
4191
- const noAvailableTickets = (0,external_react_.useMemo)(() => profileData && ticketTaxesLoaded && !ticketTaxesError && allowedTicketTypes.length === 0 && step !== constants.STEP_COMPLETE, [allowedTicketTypes]);
4192
- const alreadyOwnedTickets = (0,external_react_.useMemo)(() => profileData && ticketTaxesLoaded && !ticketTaxesError && allowedTicketTypes.length > 0 && ownedTickets.length > 0, [ownedTickets, allowedTicketTypes]);
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]);
4193
4217
  (0,external_react_.useEffect)(() => {
4194
4218
  if (profileData) loadProfileData(profileData);
4195
4219
  }, [profileData]); // just initial load ( once )
@@ -4206,7 +4230,10 @@ const RegistrationLite = _ref => {
4206
4230
  }, []);
4207
4231
  (0,external_react_.useEffect)(() => {
4208
4232
  if (summitData && profileData) {
4209
- getMyInvitation(summitData.id).catch(e => console.log(e)).finally(() => handleGetTicketTypesAndTaxes(summitData.id));
4233
+ const ensureInvitation = () => summitData.invite_only_registration ? getMyInvitation(summitData.id) : Promise.resolve(); // no-op when not invite-only
4234
+
4235
+
4236
+ ensureInvitation().catch(e => console.log(e)).finally(() => handleGetTicketTypesAndTaxes(summitData.id));
4210
4237
  }
4211
4238
  }, [summitData, profileData]);
4212
4239
  (0,external_react_.useEffect)(() => {
@@ -4254,8 +4281,8 @@ const RegistrationLite = _ref => {
4254
4281
  };
4255
4282
 
4256
4283
  const handleGetTicketTypesAndTaxes = summitId => {
4257
- setTicketTaxesError(false);
4258
- setTicketTaxesLoaded(false);
4284
+ setTicketDataError(false);
4285
+ setTicketDataLoaded(false);
4259
4286
  getTicketTypesAndTaxes(summitId).then().catch(error => {
4260
4287
  let {
4261
4288
  message
@@ -4267,9 +4294,9 @@ const RegistrationLite = _ref => {
4267
4294
  return authErrorCallback(error);
4268
4295
  }
4269
4296
 
4270
- setTicketTaxesError(true);
4297
+ setTicketDataError(true);
4271
4298
  }).finally(() => {
4272
- setTicketTaxesLoaded(true);
4299
+ setTicketDataLoaded(true);
4273
4300
  });
4274
4301
  };
4275
4302
 
@@ -4301,11 +4328,12 @@ const RegistrationLite = _ref => {
4301
4328
  trackEvent(constants.PURCHASE_COMPLETE, {
4302
4329
  order
4303
4330
  });
4304
- }; // if we dont have yet ticket types and we didnt requested so far for them but we are already logged in
4305
- // just dont render
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.
4306
4334
 
4307
4335
 
4308
- if (ticketTypes.length === 0 && !requestedTicketTypes && profileData) return null;
4336
+ if (profileData && !ticketDataLoaded && !ticketDataError) return null;
4309
4337
  return /*#__PURE__*/external_react_default().createElement("div", {
4310
4338
  id: `${general_module.modal}`,
4311
4339
  className: "modal is-active"
@@ -4331,12 +4359,12 @@ const RegistrationLite = _ref => {
4331
4359
  className: "fa fa-close",
4332
4360
  "aria-label": "close",
4333
4361
  onClick: handleCloseClick
4334
- })), profileData && ticketTaxesError && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
4362
+ })), profileData && ticketDataError && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
4335
4363
  ticketTaxesErrorMessage: ticketTaxesErrorMessage,
4336
4364
  retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData?.id)
4337
4365
  }), noAvailableTickets && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
4338
4366
  noAllowedTicketsMessage: noAllowedTicketsMessage
4339
- }), !ticketTaxesError && /*#__PURE__*/external_react_default().createElement("div", {
4367
+ }), !ticketDataError && /*#__PURE__*/external_react_default().createElement("div", {
4340
4368
  className: general_module.stepsWrapper
4341
4369
  }, !profileData && !passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(login["default"], {
4342
4370
  summitData: summitData,
@@ -4459,7 +4487,7 @@ const RegistrationLite = _ref => {
4459
4487
  orderComplete1stParagraph: rest.orderComplete1stParagraph,
4460
4488
  orderComplete2ndParagraph: rest.orderComplete2ndParagraph,
4461
4489
  orderCompleteButton: rest.orderCompleteButton
4462
- })), !ticketTaxesError && profileData && step !== constants.STEP_COMPLETE && /*#__PURE__*/external_react_default().createElement(button_bar, {
4490
+ })), !ticketDataError && profileData && step !== constants.STEP_COMPLETE && /*#__PURE__*/external_react_default().createElement(button_bar, {
4463
4491
  step: step,
4464
4492
  inPersonDisclaimer: inPersonDisclaimer,
4465
4493
  formValues: formValues,
@@ -4500,7 +4528,7 @@ RegistrationLite.defaultProps = {
4500
4528
  noAllowedTicketsMessage: '<span>You already have purchased all available tickets for this event and/or there are no tickets available for you to purchase.</span><br/><span><a href="/a/my-tickets">Visit the my orders / my tickets page</a> to review your existing tickets.</span>',
4501
4529
  ticketTaxesErrorMessage: '<span>There was an error getting the information for the tickets. Please try it again.</span>',
4502
4530
  allowPromoCodes: true,
4503
- companyDDLPlaceholder: 'Type to select company',
4531
+ companyDDLPlaceholder: 'Company',
4504
4532
  authErrorCallback: error => {
4505
4533
  console.log(error);
4506
4534
  },