summit-registration-lite 2.0.0 → 2.0.1
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 +6 -0
- package/dist/index.css +2 -2
- package/dist/index.js +132 -51
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,6 +14,10 @@ React component for the summit registration lite widget
|
|
|
14
14
|
|
|
15
15
|
**supportEmail** = string with the email address for support
|
|
16
16
|
|
|
17
|
+
**allowsNativeAuth** = boolean to show/hide native auth
|
|
18
|
+
|
|
19
|
+
**allowsOtpAuth** = boolean to show/hide OTP auth
|
|
20
|
+
|
|
17
21
|
**loginOptions** = array with the options to show on the login screen
|
|
18
22
|
|
|
19
23
|
**loading** = boolean to show/hide a loader on the widget
|
|
@@ -42,6 +46,8 @@ React component for the summit registration lite widget
|
|
|
42
46
|
**loginWithCode** = method passed that will be called when the user tries to login with a code
|
|
43
47
|
|
|
44
48
|
**onPurchaseComplete** = method passed that will be called after the purchase of a ticket it's completed
|
|
49
|
+
|
|
50
|
+
**handleCompanyError** = method passed that will be called if the company dropdown can't be fetched
|
|
45
51
|
|
|
46
52
|
|
|
47
53
|
## PUBLISH TO NPM:
|
package/dist/index.css
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
:root{--color_primary: lightgray;--color_primary50: lightgray;--color_primary_contrast: #fff;--color_primary_contrast50: #ffffff50;--color_secondary: lightgray;--color_secondary_contrast: lightgray;--color_text_dark: #212121;--color_text_light: #ffffff;--color_text_input_hints: #212121}.step-wrapper{padding:10px;margin:10px;border:1px solid lightgray;border-radius:5px}.summit-registration-lite{color:var(--color_text_dark);font-size:15px}input{outline:none}
|
|
4
4
|
|
|
5
|
-
.loginWrapper___sxUEn{display:flex;justify-content:center;font-weight:bold;text-align:center;padding:20px 0 30px}.innerWrapper___GQRkq{display:flex;flex-direction:column;justify-content:center;width:300px}.innerWrapper___GQRkq span{margin:10px 0}.button___QMZPu{padding:10px 30px;background-color:red;color:white;font-weight:normal;display:inline-flex;justify-content:center;margin:5px 0;border-radius:5px;cursor:pointer;background-position:28px center;background-repeat:no-repeat;background-size:16px;line-height:1.4}.loginCode___dDBup{margin-bottom:10px;font-size:16px}.loginCode___dDBup>div{margin-top:10px}.loginCode___dDBup span{display:inline-block;font-weight:normal;font-size:14px;color:#e5424d}.input___QR9sA{display:flex;height:40px;margin-top:5px}.input___QR9sA input{border:1px solid var(--color_primary);border-radius:5px;padding:5px;width:100%}.input___QR9sA input::placeholder{color:var(--color_text_input_hints)}.input___QR9sA button{margin-left:5px;background-color:var(--color_secondary_contrast);padding:0px 15px;border:1px solid var(--color_secondary_contrast);color:#fff;box-shadow:none;text-align:center;white-space:nowrap;font-weight:bold;border-radius:5px;cursor:pointer;display:flex;align-items:center;justify-content:center}
|
|
5
|
+
.loginWrapper___sxUEn{display:flex;justify-content:center;font-weight:bold;text-align:center;padding:20px 0 30px}.innerWrapper___GQRkq{display:flex;flex-direction:column;justify-content:center;width:300px}.innerWrapper___GQRkq span{margin:10px 0}.button___QMZPu{padding:10px 30px;background-color:red;color:white;font-weight:normal;display:inline-flex;justify-content:center;margin:5px 0;border-radius:5px;cursor:pointer;background-position:28px center;background-repeat:no-repeat;background-size:16px;line-height:1.4;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)}.button___QMZPu:hover{box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}.loginCode___dDBup{margin-bottom:10px;font-size:16px}.loginCode___dDBup>div{margin-top:10px}.loginCode___dDBup span{display:inline-block;font-weight:normal;font-size:14px;color:#e5424d}.input___QR9sA{display:flex;height:40px;margin-top:5px}.input___QR9sA input{border:1px solid var(--color_primary);border-radius:5px;padding:5px;width:100%}.input___QR9sA input::placeholder{color:var(--color_text_input_hints)}.input___QR9sA button{margin-left:5px;background-color:var(--color_secondary_contrast);padding:0px 15px;border:1px solid var(--color_secondary_contrast);color:#fff;box-shadow:none;text-align:center;white-space:nowrap;font-weight:bold;border-radius:5px;cursor:pointer;display:flex;align-items:center;justify-content:center}
|
|
6
6
|
|
|
7
7
|
.title___LksVm{font-weight:bold;cursor:pointer}.form___v5GIx{display:flex;flex-wrap:wrap;justify-content:space-between;margin:10px 0}.form___v5GIx div.fieldWrapper___Eoe61{width:48%;border-radius:5px;background-color:#e6f3ff;border:1px solid #3fa2f7;height:36px;padding:5px;display:flex;justify-content:space-between;align-items:center;margin-bottom:5px}.form___v5GIx div.fieldWrapper___Eoe61:first-of-type{width:100%}.form___v5GIx div.fieldWrapper___Eoe61 input{width:100%;background-color:transparent;border:none}.form___v5GIx div.fieldWrapper___Eoe61 input:focus-visible{outline:none}.form___v5GIx div.fieldWrapper___Eoe61 i{position:relative;padding-right:5px}.form___v5GIx div.fieldWrapper___Eoe61>div{width:100%;padding-left:5px}.form___v5GIx div.fieldWrapper___Eoe61>div:first-of-type{width:95%}.form___v5GIx input{width:48%;border-radius:5px;border:1px solid #3fa2f7;color:#3486cd;font-size:16px;background-color:#e6f3ff;height:36px;padding:5px;display:flex;justify-content:space-between;align-items:center;margin-bottom:5px;font-weight:bold}.form___v5GIx input::placeholder{color:#3486cd}
|
|
8
8
|
|
|
9
9
|
.form___DoT3x{display:flex;flex-wrap:wrap;justify-content:space-between;margin:10px 0}.form___DoT3x div.fieldWrapper___wa1Ks{display:flex;width:48%;border-radius:5px;border:1px solid var(--color_primary);height:36px;padding:5px;display:flex;justify-content:space-between;align-items:center;margin-bottom:5px}.form___DoT3x div.fieldWrapper___wa1Ks:first-of-type{width:100%}.form___DoT3x div.fieldWrapper___wa1Ks:last-of-type{flex-direction:column}.form___DoT3x div.fieldWrapper___wa1Ks input{width:100%;background-color:transparent;border:none}.form___DoT3x div.fieldWrapper___wa1Ks input:focus-visible{outline:none}.form___DoT3x div.fieldWrapper___wa1Ks i{position:relative;padding-right:5px}.form___DoT3x div.fieldWrapper___wa1Ks>div{width:100%;padding-left:5px}.form___DoT3x div.fieldWrapper___wa1Ks>div:first-of-type{width:95%}.form___DoT3x div.fieldWrapper___wa1Ks span{display:inline-block;color:#e5424d;font-size:14px;align-self:flex-start}.form___DoT3x input{width:48%;border-radius:5px;color:#3486cd;font-size:16px;height:36px;padding:5px;display:flex;justify-content:space-between;align-items:center;margin-bottom:5px}.form___DoT3x input::placeholder{color:var(--color_text_input_hints);font-size:16px}
|
|
10
10
|
|
|
11
|
-
.title___ECoNz{font-weight:bold;cursor:pointer;display:flex;justify-content:space-between}.title___ECoNz div{font-weight:normal}.form___lDFka{display:flex;flex-wrap:wrap;justify-content:space-between;margin:10px 0}.form___lDFka
|
|
11
|
+
.title___ECoNz{font-weight:bold;cursor:pointer;display:flex;justify-content:space-between}.title___ECoNz div{font-weight:normal}.form___lDFka{display:flex;flex-wrap:wrap;justify-content:space-between;margin:10px 0}.form___lDFka>div{width:48%}.form___lDFka>div input{width:100%;border-radius:5px;border:1px solid var(--color_primary);height:36px;padding:5px;display:flex;justify-content:space-between;align-items:center;font-size:15px}.form___lDFka>div input::placeholder{color:var(--color_text_input_hints)}.form___lDFka>div .readOnly___WRazF{opacity:0.6;cursor:default}.form___lDFka>div span{display:inline-block;color:#e5424d}.form___lDFka>div>:last-child{margin-bottom:5px}.form___lDFka .companies___kmGFB{width:48%}.form___lDFka .companies___kmGFB>div{position:relative;width:100%;border-radius:5px;display:flex;justify-content:space-between;align-items:center;font-size:15px}.form___lDFka .companies___kmGFB>div::placeholder{color:var(--color_text_input_hints)}.form___lDFka .companies___kmGFB>div>div{height:100%;width:100%}.form___lDFka .companies___kmGFB>div>div>div{height:36px;padding:0px;border:1px solid var(--color_primary)}.form___lDFka .companies___kmGFB>div>div>div>div{height:36px}.form___lDFka .companies___kmGFB>div input{padding:5px;border:1px solid var(--color_primary);padding-right:0px !important;background-color:transparent}.form___lDFka .companies___kmGFB>div i{right:10px !important}
|
|
12
12
|
|
|
13
13
|
.title___DNZyl{font-weight:bold;cursor:pointer;display:flex;justify-content:space-between}.summary___quWdZ{text-align:right}.crossOut___QZ7dy{text-decoration:line-through}.discount___sEK_Q{color:green}.promo___F8lPO{font-weight:bold;display:flex;justify-content:flex-end}.dropdown____HWg0{margin-top:5px}.inPersonDisclaimer___PXGTz{margin-top:15px}
|
|
14
14
|
|
package/dist/index.js
CHANGED
|
@@ -87,6 +87,12 @@ const methods_namespaceObject = require("openstack-uicore-foundation/lib/utils/m
|
|
|
87
87
|
const external_sweetalert2_namespaceObject = require("sweetalert2");
|
|
88
88
|
var external_sweetalert2_default = /*#__PURE__*/__webpack_require__.n(external_sweetalert2_namespaceObject);
|
|
89
89
|
;// CONCATENATED MODULE: ./src/actions.js
|
|
90
|
+
function 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; }
|
|
91
|
+
|
|
92
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
93
|
+
|
|
94
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
95
|
+
|
|
90
96
|
/**
|
|
91
97
|
* Copyright 2020 OpenStack Foundation
|
|
92
98
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -192,7 +198,7 @@ const reserveTicket = (personalInformation, ticket) => async (dispatch, getState
|
|
|
192
198
|
access_token,
|
|
193
199
|
expand: 'tickets,tickets.owner,tickets.ticket_type,tickets.ticket_type.taxes'
|
|
194
200
|
};
|
|
195
|
-
let normalizedEntity = {
|
|
201
|
+
let normalizedEntity = normalizeReservation({
|
|
196
202
|
owner_email: email,
|
|
197
203
|
owner_first_name: firstName,
|
|
198
204
|
owner_last_name: lastName,
|
|
@@ -204,7 +210,7 @@ const reserveTicket = (personalInformation, ticket) => async (dispatch, getState
|
|
|
204
210
|
attendee_last_name: lastName,
|
|
205
211
|
attendee_email: email
|
|
206
212
|
}]
|
|
207
|
-
};
|
|
213
|
+
});
|
|
208
214
|
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, methods_namespaceObject.authErrorHandler // entity
|
|
209
215
|
)(params)(dispatch).then(payload => {
|
|
210
216
|
dispatch(stopWidgetLoading());
|
|
@@ -384,12 +390,25 @@ const isInPersonTicketType = ticketType => {
|
|
|
384
390
|
|
|
385
391
|
return false;
|
|
386
392
|
};
|
|
393
|
+
|
|
394
|
+
const normalizeReservation = entity => {
|
|
395
|
+
const normalizedEntity = _objectSpread({}, entity);
|
|
396
|
+
|
|
397
|
+
if (!entity.owner_company.id) {
|
|
398
|
+
normalizedEntity['owner_company'] = entity.owner_company.name;
|
|
399
|
+
} else {
|
|
400
|
+
delete normalizedEntity['owner_company'];
|
|
401
|
+
normalizedEntity['owner_company_id'] = entity.owner_company.id;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return normalizedEntity;
|
|
405
|
+
};
|
|
387
406
|
;// CONCATENATED MODULE: ./src/reducer.js
|
|
388
|
-
function
|
|
407
|
+
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; }
|
|
389
408
|
|
|
390
|
-
function
|
|
409
|
+
function reducer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? reducer_ownKeys(Object(source), !0).forEach(function (key) { reducer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : reducer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
391
410
|
|
|
392
|
-
function
|
|
411
|
+
function reducer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
393
412
|
|
|
394
413
|
/**
|
|
395
414
|
* Copyright 2020 OpenStack Foundation
|
|
@@ -434,14 +453,14 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
434
453
|
switch (type) {
|
|
435
454
|
case START_WIDGET_LOADING:
|
|
436
455
|
{
|
|
437
|
-
return
|
|
456
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
438
457
|
widgetLoading: true
|
|
439
458
|
});
|
|
440
459
|
}
|
|
441
460
|
|
|
442
461
|
case STOP_WIDGET_LOADING:
|
|
443
462
|
{
|
|
444
|
-
return
|
|
463
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
445
464
|
widgetLoading: false
|
|
446
465
|
});
|
|
447
466
|
}
|
|
@@ -459,11 +478,11 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
459
478
|
document.documentElement.style.setProperty(`--${setting}50`, `${marketingData[setting]}50`);
|
|
460
479
|
}
|
|
461
480
|
});
|
|
462
|
-
return
|
|
481
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
463
482
|
reservation: null,
|
|
464
483
|
checkout: null,
|
|
465
|
-
passwordless:
|
|
466
|
-
settings:
|
|
484
|
+
passwordless: reducer_objectSpread({}, DEFAULT_STATE.passwordless),
|
|
485
|
+
settings: reducer_objectSpread(reducer_objectSpread({}, DEFAULT_STATE.settings), {}, {
|
|
467
486
|
marketingData: marketingData,
|
|
468
487
|
summitId: summitData.id,
|
|
469
488
|
userProfile: profileData,
|
|
@@ -473,29 +492,29 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
473
492
|
|
|
474
493
|
case CHANGE_STEP:
|
|
475
494
|
{
|
|
476
|
-
return
|
|
495
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
477
496
|
step: payload
|
|
478
497
|
});
|
|
479
498
|
}
|
|
480
499
|
|
|
481
500
|
case GET_TICKET_TYPES:
|
|
482
501
|
{
|
|
483
|
-
return
|
|
502
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
484
503
|
ticketTypes: payload.response.data
|
|
485
504
|
});
|
|
486
505
|
}
|
|
487
506
|
|
|
488
507
|
case GET_TAX_TYPES:
|
|
489
508
|
{
|
|
490
|
-
return
|
|
509
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
491
510
|
taxTypes: payload.response.data
|
|
492
511
|
});
|
|
493
512
|
}
|
|
494
513
|
|
|
495
514
|
case GO_TO_LOGIN:
|
|
496
515
|
{
|
|
497
|
-
return
|
|
498
|
-
passwordless:
|
|
516
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
517
|
+
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
499
518
|
code_sent: false,
|
|
500
519
|
error: false
|
|
501
520
|
})
|
|
@@ -504,8 +523,8 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
504
523
|
|
|
505
524
|
case SET_PASSWORDLESS_LOGIN:
|
|
506
525
|
{
|
|
507
|
-
return
|
|
508
|
-
passwordless:
|
|
526
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
527
|
+
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
509
528
|
email: payload,
|
|
510
529
|
error: false
|
|
511
530
|
})
|
|
@@ -517,8 +536,8 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
517
536
|
const {
|
|
518
537
|
otp_length
|
|
519
538
|
} = payload;
|
|
520
|
-
return
|
|
521
|
-
passwordless:
|
|
539
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
540
|
+
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
522
541
|
otp_length,
|
|
523
542
|
code_sent: true,
|
|
524
543
|
error: false
|
|
@@ -528,8 +547,8 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
528
547
|
|
|
529
548
|
case SET_PASSWORDLESS_ERROR:
|
|
530
549
|
{
|
|
531
|
-
return
|
|
532
|
-
passwordless:
|
|
550
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
551
|
+
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
533
552
|
error: true
|
|
534
553
|
})
|
|
535
554
|
});
|
|
@@ -538,26 +557,26 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
538
557
|
case CREATE_RESERVATION_SUCCESS:
|
|
539
558
|
{
|
|
540
559
|
const reservation = payload.response;
|
|
541
|
-
return
|
|
560
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
542
561
|
reservation
|
|
543
562
|
});
|
|
544
563
|
}
|
|
545
564
|
|
|
546
565
|
case DELETE_RESERVATION_SUCCESS:
|
|
547
|
-
return
|
|
566
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
548
567
|
reservation: null
|
|
549
568
|
});
|
|
550
569
|
|
|
551
570
|
case CLEAR_RESERVATION:
|
|
552
571
|
{
|
|
553
|
-
return
|
|
572
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
554
573
|
reservation: null
|
|
555
574
|
});
|
|
556
575
|
}
|
|
557
576
|
|
|
558
577
|
case PAY_RESERVATION:
|
|
559
578
|
{
|
|
560
|
-
return
|
|
579
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
561
580
|
checkout: payload.response,
|
|
562
581
|
reservation: null,
|
|
563
582
|
userProfile: null
|
|
@@ -653,7 +672,8 @@ const stripe_js_namespaceObject = require("@stripe/stripe-js");
|
|
|
653
672
|
|
|
654
673
|
const LoginComponent = ({
|
|
655
674
|
options,
|
|
656
|
-
|
|
675
|
+
allowsNativeAuth,
|
|
676
|
+
allowsOtpAuthlogin,
|
|
657
677
|
getLoginCode,
|
|
658
678
|
getPasswordlessCode
|
|
659
679
|
}) => {
|
|
@@ -694,23 +714,52 @@ const LoginComponent = ({
|
|
|
694
714
|
}, ">"), /*#__PURE__*/external_react_default().createElement("br", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
695
715
|
"data-testid": "email-error"
|
|
696
716
|
}, "Please enter a valid email adress")), /*#__PURE__*/external_react_default().createElement("span", null, "Or you may signup or login with a social provider:"), options.map((o, index) => {
|
|
697
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
717
|
+
return o.provider_param ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
698
718
|
className: `${index_module.button}`,
|
|
699
|
-
key: `provider-${o.provider_param
|
|
719
|
+
key: `provider-${o.provider_param}`,
|
|
700
720
|
"data-testid": "login-button",
|
|
701
721
|
style: {
|
|
702
722
|
color: o.button_border_color ? o.button_border_color : '#ffffff',
|
|
703
723
|
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
704
724
|
backgroundColor: o.button_color,
|
|
725
|
+
color: o.font_color,
|
|
705
726
|
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
706
727
|
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
707
728
|
},
|
|
708
729
|
onClick: () => login(o.provider_param)
|
|
709
|
-
}, o.provider_label)
|
|
710
|
-
|
|
730
|
+
}, o.provider_label) : allowsNativeAuth ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
731
|
+
className: `${index_module.button}`,
|
|
732
|
+
key: `provider-fnid`,
|
|
733
|
+
"data-testid": "login-button",
|
|
734
|
+
style: {
|
|
735
|
+
color: o.button_border_color ? o.button_border_color : '#ffffff',
|
|
736
|
+
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
737
|
+
backgroundColor: o.button_color,
|
|
738
|
+
color: o.font_color,
|
|
739
|
+
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
740
|
+
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
741
|
+
},
|
|
742
|
+
onClick: () => login(o.provider_param)
|
|
743
|
+
}, o.provider_label) : null;
|
|
744
|
+
}), allowsOtpAuthlogin && /*#__PURE__*/external_react_default().createElement("div", {
|
|
745
|
+
className: index_module.loginCode
|
|
746
|
+
}, "or get a login code emailed to you", /*#__PURE__*/external_react_default().createElement("div", {
|
|
747
|
+
className: index_module.input
|
|
748
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
749
|
+
placeholder: "youremail@example.com",
|
|
750
|
+
value: email,
|
|
751
|
+
onChange: e => setEmail(e.target.value),
|
|
752
|
+
onKeyPress: ev => ev.key === 'Enter' ? loginCode() : null,
|
|
753
|
+
"data-testid": "email-input"
|
|
754
|
+
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
755
|
+
onClick: () => loginCode(),
|
|
756
|
+
"data-testid": "email-button"
|
|
757
|
+
}, ">"), /*#__PURE__*/external_react_default().createElement("br", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
758
|
+
"data-testid": "email-error"
|
|
759
|
+
}, "Please enter a valid email adress")))));
|
|
711
760
|
};
|
|
712
761
|
|
|
713
|
-
/* harmony default export */ const
|
|
762
|
+
/* harmony default export */ const components_login = (LoginComponent);
|
|
714
763
|
;// CONCATENATED MODULE: external "prop-types"
|
|
715
764
|
const external_prop_types_namespaceObject = require("prop-types");
|
|
716
765
|
;// CONCATENATED MODULE: external "@stripe/react-stripe-js"
|
|
@@ -924,11 +973,13 @@ const PaymentComponent = ({
|
|
|
924
973
|
};
|
|
925
974
|
|
|
926
975
|
/* harmony default export */ const payment = (PaymentComponent);
|
|
976
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components"
|
|
977
|
+
const components_namespaceObject = require("openstack-uicore-foundation/lib/components");
|
|
927
978
|
;// CONCATENATED MODULE: external "react-hook-form"
|
|
928
979
|
const external_react_hook_form_namespaceObject = require("react-hook-form");
|
|
929
980
|
;// CONCATENATED MODULE: ./src/components/personal-information/index.module.scss
|
|
930
981
|
// extracted by mini-css-extract-plugin
|
|
931
|
-
/* harmony default export */ const personal_information_index_module = ({"title":"title___ECoNz","form":"form___lDFka","readOnly":"readOnly___WRazF"});
|
|
982
|
+
/* harmony default export */ const personal_information_index_module = ({"title":"title___ECoNz","form":"form___lDFka","readOnly":"readOnly___WRazF","companies":"companies___kmGFB"});
|
|
932
983
|
;// CONCATENATED MODULE: ./src/components/personal-information/index.js
|
|
933
984
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
934
985
|
|
|
@@ -957,11 +1008,14 @@ function personal_information_defineProperty(obj, key, value) { if (key in obj)
|
|
|
957
1008
|
|
|
958
1009
|
|
|
959
1010
|
|
|
1011
|
+
|
|
960
1012
|
const PersonalInfoComponent = ({
|
|
961
1013
|
isActive,
|
|
962
1014
|
changeForm,
|
|
963
1015
|
reservation,
|
|
964
|
-
userProfile
|
|
1016
|
+
userProfile,
|
|
1017
|
+
summitId,
|
|
1018
|
+
handleCompanyError
|
|
965
1019
|
}) => {
|
|
966
1020
|
var _errors$email, _errors$email2;
|
|
967
1021
|
|
|
@@ -969,9 +1023,13 @@ const PersonalInfoComponent = ({
|
|
|
969
1023
|
firstName: userProfile.given_name || '',
|
|
970
1024
|
lastName: userProfile.family_name || '',
|
|
971
1025
|
email: userProfile.email || '',
|
|
972
|
-
company:
|
|
1026
|
+
company: {
|
|
1027
|
+
id: null,
|
|
1028
|
+
name: userProfile.company || ''
|
|
1029
|
+
},
|
|
973
1030
|
promoCode: ''
|
|
974
1031
|
});
|
|
1032
|
+
const [companyError, setCompanyError] = (0,external_react_namespaceObject.useState)(false);
|
|
975
1033
|
const {
|
|
976
1034
|
register,
|
|
977
1035
|
handleSubmit,
|
|
@@ -985,14 +1043,30 @@ const PersonalInfoComponent = ({
|
|
|
985
1043
|
firstName: reservation.owner_first_name ? reservation.owner_first_name : personalInfo.firstName,
|
|
986
1044
|
lastName: reservation.owner_last_name ? reservation.owner_last_name : personalInfo.lastName,
|
|
987
1045
|
email: reservation.owner_email ? reservation.owner_email : personalInfo.email,
|
|
988
|
-
company:
|
|
1046
|
+
company: {
|
|
1047
|
+
id: null,
|
|
1048
|
+
name: reservation.owner_company ? reservation.owner_company : personalInfo.company
|
|
1049
|
+
}
|
|
989
1050
|
});
|
|
990
1051
|
}
|
|
991
1052
|
}, []);
|
|
992
1053
|
|
|
1054
|
+
const onCompanyChange = ev => {
|
|
1055
|
+
const newCompany = ev.target.value;
|
|
1056
|
+
setCompanyError(false);
|
|
1057
|
+
setPersonalInfo(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), {}, {
|
|
1058
|
+
company: newCompany
|
|
1059
|
+
}));
|
|
1060
|
+
};
|
|
1061
|
+
|
|
993
1062
|
const onSubmit = data => {
|
|
994
|
-
|
|
995
|
-
|
|
1063
|
+
if (!personalInfo.company.name) {
|
|
1064
|
+
setCompanyError(true);
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
setPersonalInfo(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), data));
|
|
1069
|
+
changeForm(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), data));
|
|
996
1070
|
};
|
|
997
1071
|
|
|
998
1072
|
const [ref, {
|
|
@@ -1020,7 +1094,7 @@ const PersonalInfoComponent = ({
|
|
|
1020
1094
|
className: personal_information_index_module.title
|
|
1021
1095
|
}, /*#__PURE__*/external_react_default().createElement("span", null, "Personal Information"), !isActive && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1022
1096
|
"data-testid": "personal-info"
|
|
1023
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, `${personalInfo.firstName} ${personalInfo.lastName} ${personalInfo.company ? `- ${personalInfo.company}` : ''}`), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", null, personalInfo.email))), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
1097
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, `${personalInfo.firstName} ${personalInfo.lastName} ${personalInfo.company.name ? `- ${personalInfo.company.name}` : ''}`), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", null, personalInfo.email))), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
1024
1098
|
style: personal_information_objectSpread({
|
|
1025
1099
|
overflow: 'hidden'
|
|
1026
1100
|
}, toggleAnimation)
|
|
@@ -1068,15 +1142,15 @@ const PersonalInfoComponent = ({
|
|
|
1068
1142
|
"data-testid": "email-error-required"
|
|
1069
1143
|
}, "This field is required"), ((_errors$email2 = errors.email) === null || _errors$email2 === void 0 ? void 0 : _errors$email2.type) === 'pattern' && /*#__PURE__*/external_react_default().createElement("span", {
|
|
1070
1144
|
"data-testid": "email-error-invalid"
|
|
1071
|
-
}, "The email is invalid")), /*#__PURE__*/external_react_default().createElement("div",
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
})
|
|
1145
|
+
}, "The email is invalid")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1146
|
+
className: personal_information_index_module.companies
|
|
1147
|
+
}, /*#__PURE__*/external_react_default().createElement(components_namespaceObject.RegistrationCompanyInput, {
|
|
1148
|
+
id: "company",
|
|
1149
|
+
summitId: summitId,
|
|
1150
|
+
onChange: onCompanyChange,
|
|
1151
|
+
onError: handleCompanyError,
|
|
1152
|
+
value: personalInfo.company
|
|
1153
|
+
}), companyError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
1080
1154
|
"data-testid": "company-error"
|
|
1081
1155
|
}, "This field is required")), /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
1082
1156
|
type: "text",
|
|
@@ -1526,7 +1600,7 @@ const TicketOwnedComponent = ({
|
|
|
1526
1600
|
|
|
1527
1601
|
/* harmony default export */ const ticket_owned = (TicketOwnedComponent);
|
|
1528
1602
|
;// CONCATENATED MODULE: ./src/components/registration-lite.js
|
|
1529
|
-
const _excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicket", "onPurchaseComplete", "getTicketTypes", "getTaxesTypes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToEvent", "goToRegistration", "profileData", "summitData", "supportEmail", "ticketOwned", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile"];
|
|
1603
|
+
const _excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicket", "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", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError"];
|
|
1530
1604
|
|
|
1531
1605
|
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; }
|
|
1532
1606
|
|
|
@@ -1585,6 +1659,8 @@ const RegistrationLite = _ref => {
|
|
|
1585
1659
|
passwordlessLogin,
|
|
1586
1660
|
goToLogin,
|
|
1587
1661
|
loginOptions,
|
|
1662
|
+
allowsNativeAuth,
|
|
1663
|
+
allowsOtpAuth,
|
|
1588
1664
|
reservation,
|
|
1589
1665
|
checkout,
|
|
1590
1666
|
ticketTypes,
|
|
@@ -1606,7 +1682,8 @@ const RegistrationLite = _ref => {
|
|
|
1606
1682
|
widgetLoading,
|
|
1607
1683
|
loading,
|
|
1608
1684
|
inPersonDisclaimer,
|
|
1609
|
-
userProfile
|
|
1685
|
+
userProfile,
|
|
1686
|
+
handleCompanyError
|
|
1610
1687
|
} = _ref,
|
|
1611
1688
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
1612
1689
|
|
|
@@ -1694,8 +1771,10 @@ const RegistrationLite = _ref => {
|
|
|
1694
1771
|
goToRegistration: goToRegistration
|
|
1695
1772
|
})), !ticketOwned && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1696
1773
|
className: general_module.stepsWrapper
|
|
1697
|
-
}, !profileData && !passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(
|
|
1774
|
+
}, !profileData && !passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(components_login, {
|
|
1698
1775
|
options: loginOptions,
|
|
1776
|
+
allowsNativeAuth: allowsNativeAuth,
|
|
1777
|
+
allowsOtpAuth: allowsOtpAuth,
|
|
1699
1778
|
login: provider => rest.authUser(provider),
|
|
1700
1779
|
getLoginCode: getLoginCode,
|
|
1701
1780
|
getPasswordlessCode: getPasswordlessCode
|
|
@@ -1721,9 +1800,11 @@ const RegistrationLite = _ref => {
|
|
|
1721
1800
|
isActive: step === 1,
|
|
1722
1801
|
reservation: reservation,
|
|
1723
1802
|
userProfile: profileData,
|
|
1803
|
+
summitId: summitData.id,
|
|
1724
1804
|
changeForm: personalForm => setRegistrationForm(registration_lite_objectSpread(registration_lite_objectSpread({}, registrationForm), {}, {
|
|
1725
1805
|
personalInformation: personalForm
|
|
1726
|
-
}))
|
|
1806
|
+
})),
|
|
1807
|
+
handleCompanyError: handleCompanyError
|
|
1727
1808
|
}), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
1728
1809
|
style: registration_lite_objectSpread({}, toggleAnimation)
|
|
1729
1810
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "summit-registration-lite",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Summit Registration Lite",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"moment": "^2.22.2",
|
|
59
59
|
"moment-timezone": "^0.5.21",
|
|
60
60
|
"node-sass": "^7.0.1",
|
|
61
|
-
"openstack-uicore-foundation": "^4.0.
|
|
61
|
+
"openstack-uicore-foundation": "^4.0.14",
|
|
62
62
|
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
|
63
63
|
"path": "^0.12.7",
|
|
64
64
|
"react": "^16.8.4",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"lodash": "^4.17.14",
|
|
103
103
|
"moment": "^2.22.2",
|
|
104
104
|
"moment-timezone": "^0.5.21",
|
|
105
|
-
"openstack-uicore-foundation": "^4.0.
|
|
105
|
+
"openstack-uicore-foundation": "^4.0.14",
|
|
106
106
|
"react": "^16.8.4",
|
|
107
107
|
"react-bootstrap": "^0.31.5",
|
|
108
108
|
"react-datetime": "^2.16.2",
|