summit-registration-lite 3.0.15 → 3.0.16
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 +10 -9
- package/dist/index.js +204 -115
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@ React component for the summit registration lite widget
|
|
|
5
5
|
## Registration Lite config
|
|
6
6
|
|
|
7
7
|
**apiBaseUrl** = base url for API
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
**summitData** = object with the data from the summit
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
**profileData** = object with the profile data from the user
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
**marketingData** = object with the settings from the marketing API
|
|
14
14
|
|
|
15
15
|
**supportEmail** = string with the email address for support
|
|
@@ -30,7 +30,7 @@ React component for the summit registration lite widget
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
Example
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
```
|
|
35
35
|
[
|
|
36
36
|
{ button_color: '#082238', provider_label: 'FNid', provider_param: 'fnid' },
|
|
@@ -39,15 +39,15 @@ React component for the summit registration lite widget
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
**authUser** = method passed that will be called on user login. param -> (provider) => console.log('login with', provider)
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
**getAccessToken** = method passed that will be called to request the access token
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
**closeWidget** = method passed that will be called if the user tries to close the widget
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
**goToExtraQuestions** = method passed that will be called by component to redirect to extra questions page
|
|
48
48
|
|
|
49
49
|
**goToEvent** = method passed that will be called to redirect the user to the current event
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
**getPasswordlessCode** = method passed that will be called when the user generates a code to login without password
|
|
52
52
|
|
|
53
53
|
**loginWithCode** = method passed that will be called when the user tries to login with a code
|
|
@@ -55,7 +55,8 @@ React component for the summit registration lite widget
|
|
|
55
55
|
**onPurchaseComplete** = method passed that will be called after the purchase of a ticket it's completed
|
|
56
56
|
|
|
57
57
|
**handleCompanyError** = method passed that will be called if the company dropdown can't be fetched
|
|
58
|
-
|
|
58
|
+
|
|
59
|
+
**authErrorCallback** = method passed that will handle on client any auth error
|
|
59
60
|
|
|
60
61
|
## PUBLISH TO NPM:
|
|
61
62
|
|
package/dist/index.js
CHANGED
|
@@ -383,6 +383,7 @@ const START_WIDGET_LOADING = 'START_WIDGET_LOADING';
|
|
|
383
383
|
const STOP_WIDGET_LOADING = 'STOP_WIDGET_LOADING';
|
|
384
384
|
const LOAD_INITIAL_VARS = 'LOAD_INITIAL_VARS';
|
|
385
385
|
const CHANGE_STEP = 'CHANGE_STEP';
|
|
386
|
+
const REQUESTED_TICKET_TYPES = 'REQUESTED_TICKET_TYPES';
|
|
386
387
|
const GET_TICKET_TYPES = 'GET_TICKET_TYPES';
|
|
387
388
|
const GET_TAX_TYPES = 'GET_TAX_TYPES';
|
|
388
389
|
const CREATE_RESERVATION = 'CREATE_RESERVATION';
|
|
@@ -399,11 +400,15 @@ const SET_PASSWORDLESS_ERROR = 'SET_PASSWORDLESS_ERROR';
|
|
|
399
400
|
const GO_TO_LOGIN = 'GO_TO_LOGIN';
|
|
400
401
|
const GET_MY_INVITATION = 'GET_MY_INVITATION';
|
|
401
402
|
const CLEAR_MY_INVITATION = 'CLEAR_MY_INVITATION';
|
|
403
|
+
const CLEAR_WIDGET_STATE = 'CLEAR_WIDGET_STATE';
|
|
402
404
|
const startWidgetLoading = (0,actions_namespaceObject.createAction)(START_WIDGET_LOADING);
|
|
403
405
|
const stopWidgetLoading = (0,actions_namespaceObject.createAction)(STOP_WIDGET_LOADING);
|
|
404
406
|
const loadSession = settings => dispatch => {
|
|
405
407
|
dispatch((0,actions_namespaceObject.createAction)(LOAD_INITIAL_VARS)(settings));
|
|
406
408
|
};
|
|
409
|
+
const clearWidgetState = () => dispatch => {
|
|
410
|
+
dispatch((0,actions_namespaceObject.createAction)(CLEAR_WIDGET_STATE)({}));
|
|
411
|
+
};
|
|
407
412
|
|
|
408
413
|
const customErrorHandler = (err, res) => (dispatch, state) => {
|
|
409
414
|
if (err.timeout) {
|
|
@@ -446,7 +451,7 @@ const getTicketTypes = summitId => async (dispatch, getState, {
|
|
|
446
451
|
access_token: accessToken
|
|
447
452
|
};
|
|
448
453
|
dispatch(startWidgetLoading());
|
|
449
|
-
return (0,actions_namespaceObject.getRequest)(
|
|
454
|
+
return (0,actions_namespaceObject.getRequest)((0,actions_namespaceObject.createAction)(REQUESTED_TICKET_TYPES), (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types/allowed`, customErrorHandler)(params)(dispatch).then(() => {
|
|
450
455
|
dispatch(stopWidgetLoading());
|
|
451
456
|
}).catch(error => {
|
|
452
457
|
dispatch(stopWidgetLoading());
|
|
@@ -491,134 +496,152 @@ const reserveTicket = ({
|
|
|
491
496
|
apiBaseUrl,
|
|
492
497
|
getAccessToken
|
|
493
498
|
}) => {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
499
|
+
try {
|
|
500
|
+
const {
|
|
501
|
+
registrationLiteState: {
|
|
502
|
+
settings: {
|
|
503
|
+
summitId
|
|
504
|
+
}
|
|
498
505
|
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
});
|
|
506
|
+
} = getState();
|
|
507
|
+
let {
|
|
508
|
+
firstName,
|
|
509
|
+
lastName,
|
|
510
|
+
email,
|
|
511
|
+
company,
|
|
512
|
+
promoCode
|
|
513
|
+
} = personalInformation;
|
|
514
|
+
dispatch(startWidgetLoading());
|
|
515
|
+
const access_token = await getAccessToken();
|
|
516
|
+
const tickets = [...Array(ticketQuantity)].map(() => ({
|
|
517
|
+
type_id: ticket.id,
|
|
518
|
+
promo_code: promoCode || null
|
|
519
|
+
})); // Only set the attendee for the first ticket.
|
|
520
|
+
|
|
521
|
+
tickets[0].attendee_first_name = firstName;
|
|
522
|
+
tickets[0].attendee_last_name = lastName;
|
|
523
|
+
tickets[0].attendee_email = email;
|
|
524
|
+
let params = {
|
|
525
|
+
access_token,
|
|
526
|
+
expand: 'tickets,tickets.owner,tickets.ticket_type,tickets.ticket_type.taxes'
|
|
527
|
+
};
|
|
528
|
+
const normalizedEntity = normalizeReservation({
|
|
529
|
+
owner_email: email,
|
|
530
|
+
owner_first_name: firstName,
|
|
531
|
+
owner_last_name: lastName,
|
|
532
|
+
owner_company: company,
|
|
533
|
+
tickets
|
|
534
|
+
});
|
|
529
535
|
|
|
530
|
-
|
|
531
|
-
|
|
536
|
+
const errorHandler = (err, res) => (dispatch, state) => {
|
|
537
|
+
if (res && res.statusCode === 412 && onError) return onError(err, res);
|
|
532
538
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
539
|
+
if (res && res.statusCode === 404) {
|
|
540
|
+
const msg = res.body.message;
|
|
541
|
+
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
538
544
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
545
|
+
if (res && res.statusCode === 500) {
|
|
546
|
+
const msg = res.body.message;
|
|
547
|
+
external_sweetalert2_default().fire("Server Error", msg, "error");
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
544
550
|
|
|
545
|
-
|
|
546
|
-
|
|
551
|
+
return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
552
|
+
};
|
|
547
553
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
554
|
+
return (0,actions_namespaceObject.postRequest)((0,actions_namespaceObject.createAction)(CREATE_RESERVATION), (0,actions_namespaceObject.createAction)(CREATE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/reserve`, normalizedEntity, errorHandler // entity
|
|
555
|
+
)(params)(dispatch).then(payload => {
|
|
556
|
+
dispatch(stopWidgetLoading());
|
|
557
|
+
payload.response.promo_code = promoCode || null;
|
|
552
558
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
559
|
+
if (!payload.response.amount) {
|
|
560
|
+
dispatch(payTicketWithProvider(provider));
|
|
561
|
+
return payload;
|
|
562
|
+
}
|
|
557
563
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
564
|
+
dispatch(changeStep(2));
|
|
565
|
+
return payload;
|
|
566
|
+
}).catch(e => {
|
|
567
|
+
dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
|
|
568
|
+
dispatch(stopWidgetLoading());
|
|
569
|
+
return Promise.reject(e);
|
|
570
|
+
});
|
|
571
|
+
} catch (e) {
|
|
561
572
|
dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
|
|
562
573
|
dispatch(stopWidgetLoading());
|
|
563
|
-
return e;
|
|
564
|
-
}
|
|
574
|
+
return Promise.reject(e);
|
|
575
|
+
}
|
|
565
576
|
};
|
|
566
577
|
const removeReservedTicket = () => async (dispatch, getState, {
|
|
567
578
|
apiBaseUrl,
|
|
568
579
|
getAccessToken
|
|
569
580
|
}) => {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
581
|
+
try {
|
|
582
|
+
let {
|
|
583
|
+
registrationLiteState: {
|
|
584
|
+
settings: {
|
|
585
|
+
summitId
|
|
586
|
+
},
|
|
587
|
+
reservation: {
|
|
588
|
+
hash
|
|
589
|
+
}
|
|
577
590
|
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
591
|
+
} = getState();
|
|
592
|
+
const access_token = await getAccessToken();
|
|
593
|
+
let params = {
|
|
594
|
+
access_token,
|
|
595
|
+
expand: 'tickets,tickets.owner'
|
|
596
|
+
};
|
|
597
|
+
dispatch(startWidgetLoading());
|
|
598
|
+
return (0,actions_namespaceObject.deleteRequest)((0,actions_namespaceObject.createAction)(DELETE_RESERVATION), (0,actions_namespaceObject.createAction)(DELETE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/${hash}`, {}, actions_namespaceObject.authErrorHandler // entity
|
|
599
|
+
)(params)(dispatch).then(payload => {
|
|
600
|
+
dispatch(stopWidgetLoading());
|
|
601
|
+
dispatch(changeStep(1));
|
|
602
|
+
return payload;
|
|
603
|
+
}).catch(e => {
|
|
604
|
+
dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
|
|
605
|
+
dispatch(changeStep(1));
|
|
606
|
+
dispatch(stopWidgetLoading());
|
|
607
|
+
return Promise.reject(e);
|
|
608
|
+
});
|
|
609
|
+
} catch (e) {
|
|
592
610
|
dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
|
|
593
611
|
dispatch(changeStep(1));
|
|
594
612
|
dispatch(stopWidgetLoading());
|
|
595
|
-
return e;
|
|
596
|
-
}
|
|
613
|
+
return Promise.reject(e);
|
|
614
|
+
}
|
|
597
615
|
};
|
|
598
616
|
const payTicketWithProvider = (provider, params = {}) => async (dispatch, getState, {
|
|
599
617
|
apiBaseUrl,
|
|
600
618
|
getAccessToken
|
|
601
619
|
}) => {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
620
|
+
try {
|
|
621
|
+
let {
|
|
622
|
+
registrationLiteState: {
|
|
623
|
+
settings: {
|
|
624
|
+
summitId,
|
|
625
|
+
userProfile
|
|
626
|
+
},
|
|
627
|
+
reservation
|
|
628
|
+
}
|
|
629
|
+
} = getState();
|
|
630
|
+
const access_token = await getAccessToken();
|
|
631
|
+
dispatch(startWidgetLoading());
|
|
632
|
+
const currentProvider = PaymentProviderFactory.build(provider, {
|
|
633
|
+
reservation,
|
|
634
|
+
summitId,
|
|
635
|
+
userProfile,
|
|
636
|
+
access_token,
|
|
637
|
+
apiBaseUrl,
|
|
638
|
+
dispatch
|
|
639
|
+
});
|
|
640
|
+
return dispatch(currentProvider.payTicket(actions_objectSpread({}, params)));
|
|
641
|
+
} catch (e) {
|
|
642
|
+
dispatch(stopWidgetLoading());
|
|
643
|
+
return Promise.reject(e);
|
|
644
|
+
}
|
|
622
645
|
};
|
|
623
646
|
const changeStep = step => (dispatch, getState) => {
|
|
624
647
|
dispatch(startWidgetLoading());
|
|
@@ -724,9 +747,11 @@ const getMyInvitation = summitId => async (dispatch, getState, {
|
|
|
724
747
|
dispatch(stopWidgetLoading());
|
|
725
748
|
});
|
|
726
749
|
} catch (e) {
|
|
727
|
-
return Promise.reject();
|
|
750
|
+
return Promise.reject(e);
|
|
728
751
|
}
|
|
729
752
|
};
|
|
753
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/security/actions"
|
|
754
|
+
const security_actions_namespaceObject = require("openstack-uicore-foundation/lib/security/actions");
|
|
730
755
|
;// CONCATENATED MODULE: ./src/reducer.js
|
|
731
756
|
function reducer_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; }
|
|
732
757
|
|
|
@@ -747,6 +772,7 @@ function reducer_defineProperty(obj, key, value) { if (key in obj) { Object.defi
|
|
|
747
772
|
* limitations under the License.
|
|
748
773
|
**/
|
|
749
774
|
|
|
775
|
+
|
|
750
776
|
const DEFAULT_STATE = {
|
|
751
777
|
reservation: null,
|
|
752
778
|
checkout: null,
|
|
@@ -759,6 +785,9 @@ const DEFAULT_STATE = {
|
|
|
759
785
|
error: false
|
|
760
786
|
},
|
|
761
787
|
ticketTypes: [],
|
|
788
|
+
// added this flag to really know if we requested or not the ticket types collection
|
|
789
|
+
// ( empty bc initial value or empty bc api empty response)
|
|
790
|
+
requestedTicketTypes: false,
|
|
762
791
|
taxTypes: [],
|
|
763
792
|
invitation: null,
|
|
764
793
|
settings: {
|
|
@@ -776,6 +805,19 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
776
805
|
} = action;
|
|
777
806
|
|
|
778
807
|
switch (type) {
|
|
808
|
+
case CLEAR_WIDGET_STATE:
|
|
809
|
+
case security_actions_namespaceObject.LOGOUT_USER:
|
|
810
|
+
{
|
|
811
|
+
return DEFAULT_STATE;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
case REQUESTED_TICKET_TYPES:
|
|
815
|
+
{
|
|
816
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
817
|
+
requestedTicketTypes: false
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
|
|
779
821
|
case START_WIDGET_LOADING:
|
|
780
822
|
{
|
|
781
823
|
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
@@ -826,7 +868,8 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
826
868
|
case GET_TICKET_TYPES:
|
|
827
869
|
{
|
|
828
870
|
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
829
|
-
ticketTypes: payload.response.data
|
|
871
|
+
ticketTypes: payload.response.data,
|
|
872
|
+
requestedTicketTypes: true
|
|
830
873
|
});
|
|
831
874
|
}
|
|
832
875
|
|
|
@@ -987,6 +1030,22 @@ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_pr
|
|
|
987
1030
|
const external_react_spring_namespaceObject = require("react-spring");
|
|
988
1031
|
;// CONCATENATED MODULE: external "react-use"
|
|
989
1032
|
const external_react_use_namespaceObject = require("react-use");
|
|
1033
|
+
;// CONCATENATED MODULE: ./src/utils/constants.js
|
|
1034
|
+
/**
|
|
1035
|
+
* Copyright 2022 OpenStack Foundation
|
|
1036
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1037
|
+
* you may not use this file except in compliance with the License.
|
|
1038
|
+
* You may obtain a copy of the License at
|
|
1039
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1040
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1041
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1042
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1043
|
+
* See the License for the specific language governing permissions and
|
|
1044
|
+
* limitations under the License.
|
|
1045
|
+
**/
|
|
1046
|
+
const AUTH_ERROR_MESSAGE = 'Missing Auth info';
|
|
1047
|
+
const AUTH_ERROR_MISSING_REFRESH_TOKEN = "missing Refresh Token";
|
|
1048
|
+
const AUTH_ERROR_REQUEST_FAILED = 'Request failed';
|
|
990
1049
|
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/ajaxloader"
|
|
991
1050
|
const ajaxloader_namespaceObject = require("openstack-uicore-foundation/lib/components/ajaxloader");
|
|
992
1051
|
var ajaxloader_default = /*#__PURE__*/__webpack_require__.n(ajaxloader_namespaceObject);
|
|
@@ -2653,7 +2712,7 @@ const TicketTaxesError = ({
|
|
|
2653
2712
|
|
|
2654
2713
|
/* harmony default export */ const ticket_taxes_error = (TicketTaxesError);
|
|
2655
2714
|
;// CONCATENATED MODULE: ./src/components/registration-lite.js
|
|
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"];
|
|
2715
|
+
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", "authErrorCallback", "clearWidgetState", "requestedTicketTypes"];
|
|
2657
2716
|
|
|
2658
2717
|
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; }
|
|
2659
2718
|
|
|
@@ -2696,6 +2755,7 @@ function registration_lite_objectWithoutPropertiesLoose(source, excluded) { if (
|
|
|
2696
2755
|
|
|
2697
2756
|
|
|
2698
2757
|
|
|
2758
|
+
|
|
2699
2759
|
|
|
2700
2760
|
|
|
2701
2761
|
const RegistrationLite = _ref => {
|
|
@@ -2746,7 +2806,10 @@ const RegistrationLite = _ref => {
|
|
|
2746
2806
|
getMyInvitation,
|
|
2747
2807
|
showMultipleTicketTexts,
|
|
2748
2808
|
noAllowedTicketsMessage,
|
|
2749
|
-
ticketTaxesErrorMessage
|
|
2809
|
+
ticketTaxesErrorMessage,
|
|
2810
|
+
authErrorCallback,
|
|
2811
|
+
clearWidgetState,
|
|
2812
|
+
requestedTicketTypes
|
|
2750
2813
|
} = _ref,
|
|
2751
2814
|
rest = registration_lite_objectWithoutProperties(_ref, registration_lite_excluded);
|
|
2752
2815
|
|
|
@@ -2791,12 +2854,12 @@ const RegistrationLite = _ref => {
|
|
|
2791
2854
|
if (summitData && profileData) {
|
|
2792
2855
|
handleGetTicketTypesAndTaxes(summitData.id);
|
|
2793
2856
|
}
|
|
2794
|
-
}, []);
|
|
2857
|
+
}, [summitData, profileData]);
|
|
2795
2858
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2796
2859
|
if (summitData && profileData) {
|
|
2797
2860
|
getMyInvitation(summitData.id).catch(e => console.log(e));
|
|
2798
2861
|
}
|
|
2799
|
-
}, []);
|
|
2862
|
+
}, [summitData, profileData]);
|
|
2800
2863
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2801
2864
|
if (step === 1 && formValues !== null && formValues !== void 0 && formValues.ticketType && formValues !== null && formValues !== void 0 && formValues.personalInformation) {
|
|
2802
2865
|
reserveTicket({
|
|
@@ -2806,6 +2869,16 @@ const RegistrationLite = _ref => {
|
|
|
2806
2869
|
ticketQuantity: formValues === null || formValues === void 0 ? void 0 : formValues.ticketQuantity
|
|
2807
2870
|
}, {
|
|
2808
2871
|
onError: (err, res) => setFormErrors(res.body.errors)
|
|
2872
|
+
}).catch(error => {
|
|
2873
|
+
let {
|
|
2874
|
+
message
|
|
2875
|
+
} = error;
|
|
2876
|
+
|
|
2877
|
+
if (message.includes(AUTH_ERROR_MESSAGE) || message.includes(AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(AUTH_ERROR_REQUEST_FAILED)) {
|
|
2878
|
+
// we dont have an access token, init log out process
|
|
2879
|
+
clearWidgetState();
|
|
2880
|
+
return authErrorCallback(error);
|
|
2881
|
+
}
|
|
2809
2882
|
});
|
|
2810
2883
|
}
|
|
2811
2884
|
|
|
@@ -2839,6 +2912,16 @@ const RegistrationLite = _ref => {
|
|
|
2839
2912
|
const handleGetTicketTypesAndTaxes = summitId => {
|
|
2840
2913
|
setTicketTaxesError(false);
|
|
2841
2914
|
getTicketTypesAndTaxes(summitId).then().catch(error => {
|
|
2915
|
+
let {
|
|
2916
|
+
message
|
|
2917
|
+
} = error;
|
|
2918
|
+
|
|
2919
|
+
if (message.includes(AUTH_ERROR_MESSAGE) || message.includes(AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(AUTH_ERROR_REQUEST_FAILED)) {
|
|
2920
|
+
// we dont have an access token, init log out process
|
|
2921
|
+
clearWidgetState();
|
|
2922
|
+
return authErrorCallback(error);
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2842
2925
|
setTicketTaxesError(true);
|
|
2843
2926
|
});
|
|
2844
2927
|
};
|
|
@@ -2868,7 +2951,7 @@ const RegistrationLite = _ref => {
|
|
|
2868
2951
|
})), ticketTaxesError && profileData && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
|
|
2869
2952
|
ticketTaxesErrorMessage: ticketTaxesErrorMessage,
|
|
2870
2953
|
retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData === null || summitData === void 0 ? void 0 : summitData.id)
|
|
2871
|
-
}), !ticketTaxesError && profileData && ticketTypes.length === 0 &&
|
|
2954
|
+
}), !ticketTaxesError && profileData && ticketTypes.length === 0 && requestedTicketTypes && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
|
|
2872
2955
|
noAllowedTicketsMessage: noAllowedTicketsMessage
|
|
2873
2956
|
}), !ticketTaxesError && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2874
2957
|
className: general_module.stepsWrapper
|
|
@@ -2951,6 +3034,7 @@ const registration_lite_mapStateToProps = ({
|
|
|
2951
3034
|
userProfile: registrationLiteState.settings.userProfile,
|
|
2952
3035
|
checkout: registrationLiteState.checkout,
|
|
2953
3036
|
ticketTypes: registrationLiteState.ticketTypes,
|
|
3037
|
+
requestedTicketTypes: registrationLiteState.requestedTicketTypes,
|
|
2954
3038
|
taxTypes: registrationLiteState.taxTypes,
|
|
2955
3039
|
step: registrationLiteState.step,
|
|
2956
3040
|
passwordlessEmail: registrationLiteState.passwordless.email,
|
|
@@ -2963,11 +3047,15 @@ RegistrationLite.defaultProps = {
|
|
|
2963
3047
|
loginInitialEmailInputValue: '',
|
|
2964
3048
|
showMultipleTicketTexts: true,
|
|
2965
3049
|
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>'
|
|
3050
|
+
ticketTaxesErrorMessage: '<span>There was an error getting the information for the tickets. Please try it again.</span>',
|
|
3051
|
+
authErrorCallback: error => {
|
|
3052
|
+
console.log(error);
|
|
3053
|
+
}
|
|
2967
3054
|
};
|
|
2968
3055
|
RegistrationLite.propTypes = {
|
|
2969
3056
|
loginInitialEmailInputValue: (external_prop_types_default()).string,
|
|
2970
|
-
showMultipleTicketTexts: (external_prop_types_default()).bool
|
|
3057
|
+
showMultipleTicketTexts: (external_prop_types_default()).bool,
|
|
3058
|
+
authErrorCallback: (external_prop_types_default()).func
|
|
2971
3059
|
};
|
|
2972
3060
|
/* harmony default export */ const registration_lite = ((0,external_react_redux_namespaceObject.connect)(registration_lite_mapStateToProps, {
|
|
2973
3061
|
loadSession: loadSession,
|
|
@@ -2979,7 +3067,8 @@ RegistrationLite.propTypes = {
|
|
|
2979
3067
|
getLoginCode: getLoginCode,
|
|
2980
3068
|
passwordlessLogin: passwordlessLogin,
|
|
2981
3069
|
goToLogin: goToLogin,
|
|
2982
|
-
getMyInvitation: getMyInvitation
|
|
3070
|
+
getMyInvitation: getMyInvitation,
|
|
3071
|
+
clearWidgetState: clearWidgetState
|
|
2983
3072
|
})(RegistrationLite));
|
|
2984
3073
|
;// CONCATENATED MODULE: ./src/summit-registration-lite.js
|
|
2985
3074
|
/**
|