summit-registration-lite 3.0.10 → 3.0.13

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/README.md CHANGED
@@ -24,6 +24,11 @@ React component for the summit registration lite widget
24
24
 
25
25
  **showMultipleTicketTexts**= boolean to show/hide the text for multiple tickets
26
26
 
27
+ **noAllowedTicketsMessage**= string with the message for the 'No Allowed Tickets' error
28
+
29
+ **ticketTaxesErrorMessage**= string with the message for the 'TicketAndTaxesError' component
30
+
31
+
27
32
  Example
28
33
 
29
34
  ```
package/dist/index.css CHANGED
@@ -22,5 +22,9 @@
22
22
 
23
23
  .passwordlessWrapper___BRQ_s{height:400px;display:flex;justify-content:center;align-items:center;flex-direction:column}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi{text-align:center;font-weight:bold;height:100%;width:300px;display:flex;flex-direction:column;justify-content:center}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .logo___qNVrv{width:175px;align-self:center}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .digits___Vu5iy{margin-top:15px;display:inline-block}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .codeInput___LnTZe{margin-top:20px;display:flex;justify-content:center}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .codeInput___LnTZe input{height:56px;width:56px;font-size:42px;background-color:var(--color_primary50);border:1px solid var(--color_primary);border-radius:5px;padding:5px;display:inline-flex;text-transform:uppercase;text-align:center;margin:0 5px}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .error___wZflZ{margin-top:10px;color:#e5424d;font-size:14px}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .verify___IBgMl{margin-top:20px}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .verify___IBgMl .button___nBhtQ{padding:10px 30px;font-weight:normal;justify-content:center;margin:5px 0;border-radius:5px;cursor:pointer;background-color:var(--color_secondary_contrast);color:#FFFFFF;width:100%;font-size:1em}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .verify___IBgMl .link___f6fDT{color:var(--color_primary);text-decoration:underline;cursor:pointer}.passwordlessWrapper___BRQ_s .resend___Nma1U{margin:auto 0 0 0;font-weight:normal;font-size:14px}.passwordlessWrapper___BRQ_s .resend___Nma1U span{color:var(--color_primary);text-decoration:underline;cursor:pointer}
24
24
 
25
- .ticketOwnedWrapper___nhkDY{margin:10px}.alert___c49oP{margin:0 !important}
25
+ .ticketOwnedWrapper___nhkDY{margin:10px}span{display:block}.alert___c49oP{margin:0 !important}
26
+
27
+ .noAllowedWrapper___k52of{margin:10px}.alert___McKm0{margin:0 !important}
28
+
29
+ .ticketTaxesErrorWrapper___ldztd{margin:10px;min-height:150px;display:flex;flex-direction:column}.ticketTaxesErrorWrapper___ldztd button{width:100px;align-self:center;margin:10px 5px 0 5px}.alert___AM17V{margin:0 !important;text-align:center;padding:30px}
26
30
 
package/dist/index.js CHANGED
@@ -404,6 +404,22 @@ const stopWidgetLoading = (0,actions_namespaceObject.createAction)(STOP_WIDGET_L
404
404
  const loadSession = settings => dispatch => {
405
405
  dispatch((0,actions_namespaceObject.createAction)(LOAD_INITIAL_VARS)(settings));
406
406
  };
407
+
408
+ const customErrorHandler = (err, res) => (dispatch, state) => {
409
+ if (err.timeout) {
410
+ return err;
411
+ }
412
+
413
+ if (res && res.statusCode === 404) {
414
+ return err;
415
+ }
416
+
417
+ if (res && res.statusCode === 500) {
418
+ return err;
419
+ }
420
+
421
+ return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
422
+ };
407
423
  /*********************************************************************************/
408
424
 
409
425
  /* TICKETS */
@@ -412,6 +428,13 @@ const loadSession = settings => dispatch => {
412
428
  // api/v1/summits/{id}/ticket-types/allowed
413
429
  // api/v1/summits/{id}/tax-types
414
430
 
431
+
432
+ const getTicketTypesAndTaxes = summitId => async dispatch => {
433
+ return Promise.all([dispatch(getTicketTypes(summitId)), dispatch(getTaxesTypes(summitId))]).catch(err => {
434
+ return Promise.reject(err);
435
+ });
436
+ };
437
+
415
438
  const getTicketTypes = summitId => async (dispatch, getState, {
416
439
  apiBaseUrl,
417
440
  getAccessToken
@@ -423,13 +446,18 @@ const getTicketTypes = summitId => async (dispatch, getState, {
423
446
  access_token: accessToken
424
447
  };
425
448
  dispatch(startWidgetLoading());
426
- return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types/allowed`, actions_namespaceObject.authErrorHandler)(params)(dispatch).then(() => {
449
+ return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types/allowed`, customErrorHandler)(params)(dispatch).then(() => {
450
+ dispatch(stopWidgetLoading());
451
+ }).catch(error => {
427
452
  dispatch(stopWidgetLoading());
453
+ return Promise.reject(error);
428
454
  });
429
455
  } catch (e) {
430
- return Promise.reject();
456
+ dispatch(stopWidgetLoading());
457
+ return Promise.reject(e);
431
458
  }
432
459
  };
460
+
433
461
  const getTaxesTypes = summitId => async (dispatch, getState, {
434
462
  apiBaseUrl,
435
463
  getAccessToken
@@ -440,13 +468,18 @@ const getTaxesTypes = summitId => async (dispatch, getState, {
440
468
  access_token: accessToken
441
469
  };
442
470
  dispatch(startWidgetLoading());
443
- return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TAX_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/tax-types`, actions_namespaceObject.authErrorHandler)(params)(dispatch).then(() => {
471
+ return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TAX_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/tax-types`, customErrorHandler)(params)(dispatch).then(() => {
472
+ dispatch(stopWidgetLoading());
473
+ }).catch(error => {
444
474
  dispatch(stopWidgetLoading());
475
+ return Promise.reject(error);
445
476
  });
446
477
  } catch (e) {
447
- return Promise.reject();
478
+ dispatch(stopWidgetLoading());
479
+ return Promise.reject(e);
448
480
  }
449
481
  };
482
+
450
483
  const reserveTicket = ({
451
484
  provider,
452
485
  personalInformation,
@@ -2547,8 +2580,80 @@ const getCurrentProvider = summit => {
2547
2580
  provider: ''
2548
2581
  };
2549
2582
  };
2583
+ ;// CONCATENATED MODULE: ./src/components/no-allowed-tickets/index.module.scss
2584
+ // extracted by mini-css-extract-plugin
2585
+ /* harmony default export */ const no_allowed_tickets_index_module = ({"noAllowedWrapper":"noAllowedWrapper___k52of","alert":"alert___McKm0"});
2586
+ ;// CONCATENATED MODULE: ./src/components/no-allowed-tickets/index.js
2587
+ /**
2588
+ * Copyright 2020 OpenStack Foundation
2589
+ * Licensed under the Apache License, Version 2.0 (the "License");
2590
+ * you may not use this file except in compliance with the License.
2591
+ * You may obtain a copy of the License at
2592
+ * http://www.apache.org/licenses/LICENSE-2.0
2593
+ * Unless required by applicable law or agreed to in writing, software
2594
+ * distributed under the License is distributed on an "AS IS" BASIS,
2595
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2596
+ * See the License for the specific language governing permissions and
2597
+ * limitations under the License.
2598
+ **/
2599
+
2600
+
2601
+
2602
+ const NoAllowedTickets = ({
2603
+ noAllowedTicketsMessage
2604
+ }) => {
2605
+ return /*#__PURE__*/external_react_default().createElement("div", {
2606
+ className: no_allowed_tickets_index_module.noAllowedWrapper
2607
+ }, /*#__PURE__*/external_react_default().createElement("div", {
2608
+ className: `${no_allowed_tickets_index_module.alert} alert alert-warning`,
2609
+ role: "alert",
2610
+ dangerouslySetInnerHTML: {
2611
+ __html: noAllowedTicketsMessage
2612
+ }
2613
+ }));
2614
+ };
2615
+
2616
+ /* harmony default export */ const no_allowed_tickets = (NoAllowedTickets);
2617
+ ;// CONCATENATED MODULE: ./src/components/ticket-taxes-error/index.module.scss
2618
+ // extracted by mini-css-extract-plugin
2619
+ /* harmony default export */ const ticket_taxes_error_index_module = ({"ticketTaxesErrorWrapper":"ticketTaxesErrorWrapper___ldztd","alert":"alert___AM17V"});
2620
+ ;// CONCATENATED MODULE: ./src/components/ticket-taxes-error/index.js
2621
+ /**
2622
+ * Copyright 2020 OpenStack Foundation
2623
+ * Licensed under the Apache License, Version 2.0 (the "License");
2624
+ * you may not use this file except in compliance with the License.
2625
+ * You may obtain a copy of the License at
2626
+ * http://www.apache.org/licenses/LICENSE-2.0
2627
+ * Unless required by applicable law or agreed to in writing, software
2628
+ * distributed under the License is distributed on an "AS IS" BASIS,
2629
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2630
+ * See the License for the specific language governing permissions and
2631
+ * limitations under the License.
2632
+ **/
2633
+
2634
+
2635
+
2636
+ const TicketTaxesError = ({
2637
+ ticketTaxesErrorMessage,
2638
+ retryTicketTaxes
2639
+ }) => {
2640
+ return /*#__PURE__*/external_react_default().createElement("div", {
2641
+ className: ticket_taxes_error_index_module.ticketTaxesErrorWrapper
2642
+ }, /*#__PURE__*/external_react_default().createElement("div", {
2643
+ className: `${ticket_taxes_error_index_module.alert} alert alert-warning`,
2644
+ role: "alert",
2645
+ dangerouslySetInnerHTML: {
2646
+ __html: ticketTaxesErrorMessage
2647
+ }
2648
+ }), /*#__PURE__*/external_react_default().createElement("button", {
2649
+ className: `${ticket_taxes_error_index_module.button} button`,
2650
+ onClick: () => retryTicketTaxes()
2651
+ }, "Retry"));
2652
+ };
2653
+
2654
+ /* harmony default export */ const ticket_taxes_error = (TicketTaxesError);
2550
2655
  ;// CONCATENATED MODULE: ./src/components/registration-lite.js
2551
- const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypes", "getTaxesTypes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToEvent", "goToRegistration", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions", "invitation", "loginInitialEmailInputValue", "getMyInvitation", "showMultipleTicketTexts"];
2656
+ const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypesAndTaxes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToEvent", "goToRegistration", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions", "invitation", "loginInitialEmailInputValue", "getMyInvitation", "showMultipleTicketTexts", "noAllowedTicketsMessage", "ticketTaxesErrorMessage"];
2552
2657
 
2553
2658
  function registration_lite_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2554
2659
 
@@ -2590,6 +2695,8 @@ function registration_lite_objectWithoutPropertiesLoose(source, excluded) { if (
2590
2695
 
2591
2696
 
2592
2697
 
2698
+
2699
+
2593
2700
 
2594
2701
  const RegistrationLite = _ref => {
2595
2702
  var _formValues$ticketTyp, _formValues$ticketTyp2;
@@ -2602,8 +2709,7 @@ const RegistrationLite = _ref => {
2602
2709
  reserveTicket,
2603
2710
  payTicketWithProvider,
2604
2711
  onPurchaseComplete,
2605
- getTicketTypes,
2606
- getTaxesTypes,
2712
+ getTicketTypesAndTaxes,
2607
2713
  getLoginCode,
2608
2714
  passwordlessLogin,
2609
2715
  goToLogin,
@@ -2638,7 +2744,9 @@ const RegistrationLite = _ref => {
2638
2744
  invitation,
2639
2745
  loginInitialEmailInputValue,
2640
2746
  getMyInvitation,
2641
- showMultipleTicketTexts
2747
+ showMultipleTicketTexts,
2748
+ noAllowedTicketsMessage,
2749
+ ticketTaxesErrorMessage
2642
2750
  } = _ref,
2643
2751
  rest = registration_lite_objectWithoutProperties(_ref, registration_lite_excluded);
2644
2752
 
@@ -2651,6 +2759,7 @@ const RegistrationLite = _ref => {
2651
2759
  },
2652
2760
  errors: []
2653
2761
  });
2762
+ const [ticketTaxesError, setTicketTaxesError] = (0,external_react_namespaceObject.useState)(false);
2654
2763
  const {
2655
2764
  values: formValues,
2656
2765
  errors: formErrors
@@ -2680,14 +2789,14 @@ const RegistrationLite = _ref => {
2680
2789
  }, [profileData]);
2681
2790
  (0,external_react_namespaceObject.useEffect)(() => {
2682
2791
  if (summitData && profileData) {
2683
- getTicketTypes(summitData.id).then(() => getTaxesTypes(summitData.id));
2792
+ handleGetTicketTypesAndTaxes(summitData.id);
2684
2793
  }
2685
- }, [summitData, profileData]);
2794
+ }, []);
2686
2795
  (0,external_react_namespaceObject.useEffect)(() => {
2687
2796
  if (summitData && profileData) {
2688
2797
  getMyInvitation(summitData.id).catch(e => console.log(e));
2689
2798
  }
2690
- }, [summitData, profileData]);
2799
+ }, []);
2691
2800
  (0,external_react_namespaceObject.useEffect)(() => {
2692
2801
  if (step === 1 && formValues !== null && formValues !== void 0 && formValues.ticketType && formValues !== null && formValues !== void 0 && formValues.personalInformation) {
2693
2802
  reserveTicket({
@@ -2727,6 +2836,13 @@ const RegistrationLite = _ref => {
2727
2836
  rest.closeWidget();
2728
2837
  };
2729
2838
 
2839
+ const handleGetTicketTypesAndTaxes = summitId => {
2840
+ setTicketTaxesError(false);
2841
+ getTicketTypesAndTaxes(summitId).then().catch(error => {
2842
+ setTicketTaxesError(true);
2843
+ });
2844
+ };
2845
+
2730
2846
  return /*#__PURE__*/external_react_default().createElement("div", {
2731
2847
  id: `${general_module.modal}`,
2732
2848
  className: "modal is-active"
@@ -2749,7 +2865,12 @@ const RegistrationLite = _ref => {
2749
2865
  className: "fa fa-close",
2750
2866
  "aria-label": "close",
2751
2867
  onClick: handleCloseClick
2752
- })), /*#__PURE__*/external_react_default().createElement("div", {
2868
+ })), ticketTaxesError && profileData && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
2869
+ ticketTaxesErrorMessage: ticketTaxesErrorMessage,
2870
+ retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData === null || summitData === void 0 ? void 0 : summitData.id)
2871
+ }), !ticketTaxesError && profileData && ticketTypes.length === 0 && !loading && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
2872
+ noAllowedTicketsMessage: noAllowedTicketsMessage
2873
+ }), !ticketTaxesError && /*#__PURE__*/external_react_default().createElement("div", {
2753
2874
  className: general_module.stepsWrapper
2754
2875
  }, !profileData && !passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(login, {
2755
2876
  options: loginOptions,
@@ -2812,7 +2933,7 @@ const RegistrationLite = _ref => {
2812
2933
  supportEmail: supportEmail,
2813
2934
  goToEvent: goToEvent,
2814
2935
  goToExtraQuestions: goToExtraQuestions
2815
- })), profileData && step !== 3 && /*#__PURE__*/external_react_default().createElement(button_bar, {
2936
+ })), !ticketTaxesError && profileData && step !== 3 && ticketTypes.length > 0 && /*#__PURE__*/external_react_default().createElement(button_bar, {
2816
2937
  step: step,
2817
2938
  inPersonDisclaimer: inPersonDisclaimer,
2818
2939
  formValues: formValues,
@@ -2840,7 +2961,9 @@ const registration_lite_mapStateToProps = ({
2840
2961
 
2841
2962
  RegistrationLite.defaultProps = {
2842
2963
  loginInitialEmailInputValue: '',
2843
- showMultipleTicketTexts: true
2964
+ showMultipleTicketTexts: true,
2965
+ 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>',
2966
+ ticketTaxesErrorMessage: '<span>There was an error getting the information for the tickets. Please try it again.</span>'
2844
2967
  };
2845
2968
  RegistrationLite.propTypes = {
2846
2969
  loginInitialEmailInputValue: (external_prop_types_default()).string,
@@ -2852,8 +2975,7 @@ RegistrationLite.propTypes = {
2852
2975
  reserveTicket: reserveTicket,
2853
2976
  removeReservedTicket: removeReservedTicket,
2854
2977
  payTicketWithProvider: payTicketWithProvider,
2855
- getTicketTypes: getTicketTypes,
2856
- getTaxesTypes: getTaxesTypes,
2978
+ getTicketTypesAndTaxes: getTicketTypesAndTaxes,
2857
2979
  getLoginCode: getLoginCode,
2858
2980
  passwordlessLogin: passwordlessLogin,
2859
2981
  goToLogin: goToLogin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "summit-registration-lite",
3
- "version": "3.0.10",
3
+ "version": "3.0.13",
4
4
  "description": "Summit Registration Lite",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -60,7 +60,7 @@
60
60
  "moment": "^2.22.2",
61
61
  "moment-timezone": "^0.5.21",
62
62
  "node-sass": "^7.0.1",
63
- "openstack-uicore-foundation": "^4.0.35",
63
+ "openstack-uicore-foundation": "^4.0.43",
64
64
  "optimize-css-assets-webpack-plugin": "^6.0.1",
65
65
  "path": "^0.12.7",
66
66
  "react": "^16.8.4",
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 14.19.1