@openeventkit/event-site 1.0.18 → 1.0.20
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openeventkit/event-site",
|
|
3
3
|
"description": "Event Site",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.20",
|
|
5
5
|
"author": "Tipit LLC",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mui/base": "^5.0.0-alpha.114",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"stream-browserify": "^3.0.0",
|
|
117
117
|
"stream-chat": "^2.7.2",
|
|
118
118
|
"stream-chat-react": "3.1.7",
|
|
119
|
-
"summit-registration-lite": "4.0.
|
|
119
|
+
"summit-registration-lite": "^4.0.11",
|
|
120
120
|
"superagent": "8.0.9",
|
|
121
121
|
"sweetalert2": "^9.17.0",
|
|
122
122
|
"upcoming-events-widget": "2.0.8",
|
|
@@ -26,195 +26,209 @@ import { SentryFallbackFunction } from "./SentryErrorComponent";
|
|
|
26
26
|
import styles from "../styles/marketing-hero.module.scss"
|
|
27
27
|
|
|
28
28
|
const RegistrationLiteComponent = ({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const handleOpenPopup = () => {
|
|
70
|
-
setIsActive(true);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const onClickLogin = (provider) => {
|
|
74
|
-
doLogin(getBackURL(), provider);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const handleCompanyError = () => {
|
|
78
|
-
console.log("company error...")
|
|
79
|
-
Swal.fire("ERROR", "Hold on. Your session expired!.", "error").then(() => {
|
|
80
|
-
// save current location and summit slug, for further redirect logic
|
|
81
|
-
window.localStorage.setItem("post_logout_redirect_path", new URI(window.location.href).pathname());
|
|
82
|
-
doLogout();
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const getPasswordlessCode = (email) => {
|
|
87
|
-
const params = {
|
|
88
|
-
connection: "email",
|
|
89
|
-
send: "code",
|
|
90
|
-
redirect_uri: `${window.location.origin}/auth/callback`,
|
|
91
|
-
email,
|
|
29
|
+
registrationProfile,
|
|
30
|
+
userProfile,
|
|
31
|
+
attendee,
|
|
32
|
+
getThirdPartyProviders,
|
|
33
|
+
thirdPartyProviders,
|
|
34
|
+
getUserProfile,
|
|
35
|
+
setPasswordlessLogin,
|
|
36
|
+
setUserOrder,
|
|
37
|
+
checkOrderData,
|
|
38
|
+
loadingProfile,
|
|
39
|
+
loadingIDP,
|
|
40
|
+
summit,
|
|
41
|
+
colorSettings,
|
|
42
|
+
marketingPageSettings,
|
|
43
|
+
allowsNativeAuth,
|
|
44
|
+
allowsOtpAuth,
|
|
45
|
+
checkRequireExtraQuestionsByAttendee,
|
|
46
|
+
getExtraQuestions,
|
|
47
|
+
children,
|
|
48
|
+
}) => {
|
|
49
|
+
const [isActive, setIsActive] = useState(false);
|
|
50
|
+
const [initialEmailValue, setInitialEmailValue] = useState("");
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const fragmentParser = new FragmentParser();
|
|
54
|
+
setIsActive(fragmentParser.getParam("registration"));
|
|
55
|
+
const paramInitialEmailValue = fragmentParser.getParam("email");
|
|
56
|
+
if (paramInitialEmailValue)
|
|
57
|
+
setInitialEmailValue(paramInitialEmailValue);
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!thirdPartyProviders.length) getThirdPartyProviders();
|
|
62
|
+
}, [thirdPartyProviders]);
|
|
63
|
+
|
|
64
|
+
const getBackURL = () => {
|
|
65
|
+
let backUrl = "/#registration=1";
|
|
66
|
+
return URI.encode(backUrl);
|
|
92
67
|
};
|
|
93
68
|
|
|
94
|
-
|
|
95
|
-
|
|
69
|
+
const handleOpenPopup = () => {
|
|
70
|
+
setIsActive(true);
|
|
71
|
+
}
|
|
96
72
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
connection: "email",
|
|
100
|
-
otp: code,
|
|
101
|
-
email
|
|
73
|
+
const onClickLogin = (provider) => {
|
|
74
|
+
doLogin(getBackURL(), provider);
|
|
102
75
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
76
|
+
|
|
77
|
+
const handleCompanyError = () => {
|
|
78
|
+
console.log("company error...")
|
|
79
|
+
Swal.fire("ERROR", "Hold on. Your session expired!.", "error").then(() => {
|
|
80
|
+
// save current location and summit slug, for further redirect logic
|
|
81
|
+
window.localStorage.setItem("post_logout_redirect_path", new URI(window.location.href).pathname());
|
|
82
|
+
doLogout();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const getPasswordlessCode = (email) => {
|
|
87
|
+
const params = {
|
|
88
|
+
connection: "email",
|
|
89
|
+
send: "code",
|
|
90
|
+
redirect_uri: `${window.location.origin}/auth/callback`,
|
|
91
|
+
email,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return passwordlessStart(params)
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const loginPasswordless = (code, email) => {
|
|
98
|
+
const params = {
|
|
99
|
+
connection: "email",
|
|
100
|
+
otp: code,
|
|
101
|
+
email
|
|
102
|
+
};
|
|
103
|
+
return setPasswordlessLogin(params);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const { getSettingByKey } = useMarketingSettings();
|
|
107
|
+
|
|
108
|
+
const inPersonDisclaimer = getSettingByKey(MARKETING_SETTINGS_KEYS.registrationInPersonDisclaimer);
|
|
109
|
+
const allowPromoCodes = !!Number(getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteAllowPromoCodes));
|
|
110
|
+
const companyInputPlaceholder = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteCompanyInputPlaceholder);
|
|
111
|
+
const companyDDLPlaceholder = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteCompanyDDLPlaceholder);
|
|
112
|
+
const initialOrderComplete1stParagraph = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteInitialOrderComplete1stParagraph)
|
|
113
|
+
const initialOrderComplete2ndParagraph = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteInitialOrderComplete2ndParagraph)
|
|
114
|
+
const initialOrderCompleteButton = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteInitialOrderCompleteButton)
|
|
115
|
+
const orderComplete1stParagraph = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteOrderComplete1stParagraph)
|
|
116
|
+
const orderComplete2ndParagraph = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteOrderComplete2ndParagraph)
|
|
117
|
+
const orderCompleteButton = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteOrderCompleteButton)
|
|
118
|
+
const noAllowedTicketsMessage = getSettingByKey(MARKETING_SETTINGS_KEYS.regLiteNoAllowedTicketsMessage);
|
|
119
|
+
|
|
120
|
+
const widgetProps = {
|
|
121
|
+
apiBaseUrl: getEnvVariable(SUMMIT_API_BASE_URL),
|
|
122
|
+
clientId: getEnvVariable(OAUTH2_CLIENT_ID),
|
|
123
|
+
summitData: summit,
|
|
124
|
+
profileData: registrationProfile,
|
|
125
|
+
marketingData: colorSettings,
|
|
126
|
+
loginOptions: formatThirdPartyProviders(thirdPartyProviders),
|
|
127
|
+
loading: loadingProfile || loadingIDP,
|
|
128
|
+
// only show info if its not a recent purchase
|
|
129
|
+
ticketOwned: userProfile?.summit_tickets?.length > 0,
|
|
130
|
+
hasVirtualAccessLevel: userHasAccessLevel(userProfile?.summit_tickets, VirtualAccessLevel),
|
|
131
|
+
ownedTickets: attendee?.ticket_types || [],
|
|
132
|
+
authUser: (provider) => onClickLogin(provider),
|
|
133
|
+
getPasswordlessCode: getPasswordlessCode,
|
|
134
|
+
loginWithCode: (code, email) => loginPasswordless(code, email).then( () => navigate("/#registration=1")),
|
|
135
|
+
getAccessToken: getAccessToken,
|
|
136
|
+
closeWidget: () => {
|
|
137
|
+
// reload user profile
|
|
138
|
+
getUserProfile().catch((e) => console.log("getUserProfile error. Not logged in?"));
|
|
139
|
+
setIsActive(false);
|
|
140
|
+
},
|
|
141
|
+
goToExtraQuestions: () => {
|
|
142
|
+
navigate("/a/extra-questions");
|
|
143
|
+
},
|
|
144
|
+
goToEvent: () => navigate("/a/"),
|
|
145
|
+
goToRegistration: () => navigate(`${getEnvVariable(REGISTRATION_BASE_URL)}/a/${summit.slug}`),
|
|
146
|
+
goToMyOrders: () => navigate("/a/my-tickets"),
|
|
147
|
+
completedExtraQuestions: async (order) => {
|
|
148
|
+
const currentUserTicket = order?.tickets.find(t => t?.owner?.email == userProfile?.email);
|
|
149
|
+
const currentAttendee = attendee ? attendee : (currentUserTicket ? currentUserTicket?.owner : null);
|
|
150
|
+
if(!currentAttendee) return true;
|
|
151
|
+
await getExtraQuestions();
|
|
152
|
+
return checkRequireExtraQuestionsByAttendee(currentAttendee);
|
|
153
|
+
},
|
|
154
|
+
onPurchaseComplete: (order) => {
|
|
155
|
+
// check if it"s necessary to update profile
|
|
156
|
+
setUserOrder(order).then(()=> checkOrderData(order));
|
|
157
|
+
},
|
|
158
|
+
inPersonDisclaimer: inPersonDisclaimer,
|
|
159
|
+
handleCompanyError: () => handleCompanyError,
|
|
160
|
+
allowsNativeAuth: allowsNativeAuth,
|
|
161
|
+
allowsOtpAuth: allowsOtpAuth,
|
|
162
|
+
stripeOptions: {
|
|
163
|
+
fonts: [{ cssSrc: withPrefix("/fonts/fonts.css") }],
|
|
164
|
+
style: { base: { fontFamily: `"Nunito Sans", sans-serif`, fontWeight: 300 } }
|
|
165
|
+
},
|
|
166
|
+
loginInitialEmailInputValue: initialEmailValue,
|
|
167
|
+
authErrorCallback: (error) => {
|
|
168
|
+
// we have an auth Error, perform logout
|
|
169
|
+
const fragment = window?.location?.hash;
|
|
170
|
+
return navigate("/auth/logout", {
|
|
171
|
+
state: {
|
|
172
|
+
backUrl: "/" + fragment
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
allowPromoCodes: allowPromoCodes,
|
|
177
|
+
companyInputPlaceholder: companyInputPlaceholder,
|
|
178
|
+
companyDDLPlaceholder: companyDDLPlaceholder,
|
|
179
|
+
supportEmail: getEnvVariable(SUPPORT_EMAIL),
|
|
180
|
+
initialOrderComplete1stParagraph: initialOrderComplete1stParagraph,
|
|
181
|
+
initialOrderComplete2ndParagraph: initialOrderComplete2ndParagraph,
|
|
182
|
+
initialOrderCompleteButton: initialOrderCompleteButton,
|
|
183
|
+
orderComplete1stParagraph: orderComplete1stParagraph,
|
|
184
|
+
orderComplete2ndParagraph: orderComplete2ndParagraph,
|
|
185
|
+
orderCompleteButton: orderCompleteButton,
|
|
186
|
+
noAllowedTicketsMessage: noAllowedTicketsMessage
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const { registerButton } = marketingPageSettings.hero.buttons;
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<>
|
|
193
|
+
{children ?
|
|
194
|
+
React.cloneElement(children, { onClick: handleOpenPopup })
|
|
195
|
+
:
|
|
196
|
+
registerButton.display &&
|
|
197
|
+
<button className={`${styles.button} button is-large`} disabled={isActive}
|
|
198
|
+
onClick={handleOpenPopup}>
|
|
199
|
+
<i className={`fa fa-2x fa-edit icon is-large`}/>
|
|
200
|
+
<b>{registerButton.text}</b>
|
|
201
|
+
</button>
|
|
202
|
+
}
|
|
203
|
+
<Sentry.ErrorBoundary fallback={SentryFallbackFunction({componentName: "Registration Lite"})}>
|
|
204
|
+
{isActive && <RegistrationLiteWidget {...widgetProps} />}
|
|
205
|
+
</Sentry.ErrorBoundary>
|
|
206
|
+
</>
|
|
207
|
+
)
|
|
194
208
|
};
|
|
195
209
|
|
|
196
210
|
const mapStateToProps = ({userState, summitState, settingState}) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
return ({
|
|
212
|
+
registrationProfile: userState.idpProfile,
|
|
213
|
+
userProfile: userState.userProfile,
|
|
214
|
+
attendee: userState.attendee,
|
|
215
|
+
loadingProfile: userState.loading,
|
|
216
|
+
loadingIDP: userState.loadingIDP,
|
|
217
|
+
thirdPartyProviders: summitState.third_party_providers,
|
|
218
|
+
allowsNativeAuth: summitState.allows_native_auth,
|
|
219
|
+
allowsOtpAuth: summitState.allows_otp_auth,
|
|
220
|
+
summit: summitState.summit,
|
|
221
|
+
colorSettings: settingState.colorSettings,
|
|
222
|
+
marketingPageSettings: settingState.marketingPageSettings
|
|
223
|
+
})
|
|
210
224
|
};
|
|
211
225
|
|
|
212
226
|
export default connect(mapStateToProps, {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
})(RegistrationLiteComponent);
|
|
227
|
+
getThirdPartyProviders,
|
|
228
|
+
getUserProfile,
|
|
229
|
+
setPasswordlessLogin,
|
|
230
|
+
setUserOrder,
|
|
231
|
+
checkOrderData,
|
|
232
|
+
checkRequireExtraQuestionsByAttendee,
|
|
233
|
+
getExtraQuestions,
|
|
234
|
+
})(RegistrationLiteComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"widgets": {
|
|
3
|
+
"chat": {
|
|
4
|
+
"showQA": false,
|
|
5
|
+
"showHelp": false,
|
|
6
|
+
"defaultScope": "page"
|
|
7
|
+
},
|
|
8
|
+
"schedule": {
|
|
9
|
+
"allowClick": true
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"favicons": {
|
|
13
|
+
"favicon180": "/img/favicon.png",
|
|
14
|
+
"favicon32": "/img/favicon.png",
|
|
15
|
+
"favicon16": "/img/favicon.png"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -11,7 +11,14 @@ export const MARKETING_SETTINGS_KEYS = {
|
|
|
11
11
|
activityCtaText: "ACTIVITY_CTA_TEXT",
|
|
12
12
|
regLiteAllowPromoCodes: "REG_LITE_ALLOW_PROMO_CODES",
|
|
13
13
|
regLiteCompanyInputPlaceholder: "REG_LITE_COMPANY_INPUT_PLACEHOLDER",
|
|
14
|
-
regLiteCompanyDDLPlaceholder: "REG_LITE_COMPANY_DDL_PLACEHOLDER"
|
|
14
|
+
regLiteCompanyDDLPlaceholder: "REG_LITE_COMPANY_DDL_PLACEHOLDER",
|
|
15
|
+
regLiteInitialOrderComplete1stParagraph: "REG_LITE_INITIAL_ORDER_COMPLETE_STEP_1ST_PARAGRAPH",
|
|
16
|
+
regLiteInitialOrderComplete2ndParagraph: "REG_LITE_INITIAL_ORDER_COMPLETE_STEP_2ND_PARAGRAPH",
|
|
17
|
+
regLiteInitialOrderCompleteButton: "REG_LITE_INITIAL_ORDER_COMPLETE_BTN_LABEL",
|
|
18
|
+
regLiteOrderComplete1stParagraph: "REG_LITE_ORDER_COMPLETE_STEP_1ST_PARAGRAPH",
|
|
19
|
+
regLiteOrderComplete2ndParagraph: "REG_LITE_ORDER_COMPLETE_STEP_2ND_PARAGRAPH",
|
|
20
|
+
regLiteOrderCompleteButton: "REG_LITE_ORDER_COMPLETE_BTN_LABEL",
|
|
21
|
+
regLiteNoAllowedTicketsMessage: "REG_LITE_NO_ALLOWED_TICKETS_MESSAGE",
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
const marketingSettingsQuery = graphql`
|