@openeventkit/event-site 2.1.50 → 2.1.51
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/gatsby-node.js +21 -4
- package/package.json +3 -3
- package/src/cms/config/collections/configurationsCollection/siteSettings/index.js +21 -0
- package/src/cms/config/collections/configurationsCollection/siteSettings/typeDefs.js +5 -0
- package/src/cms/config/collections/contentPagesCollection/index.js +11 -1
- package/src/cms/config/collections/contentPagesCollection/typeDefs.js +1 -0
- package/src/cms/config/collections/defaultPagesCollection/marketingPage/index.js +2 -6
- package/src/cms/config/collections/defaultPagesCollection/marketingPage/typeDefs.js +0 -1
- package/src/cms/preview-templates/ContentPagePreview.js +12 -1
- package/src/components/AuthComponent.js +2 -1
- package/src/components/MarketingHero/MainColumn.js +23 -11
- package/src/components/RegisterButton.js +59 -0
- package/src/components/RegistrationFormShortcode.js +82 -0
- package/src/components/RegistrationModalComponent.js +124 -0
- package/src/content/marketing-page/index.json +1 -2
- package/src/content/site-settings/index.json +1 -1
- package/src/content/sponsors.json +1 -1
- package/src/pages/index.js +0 -1
- package/src/styles/colors.scss +11 -11
- package/src/styles/register-page.module.scss +23 -0
- package/src/templates/content-page/shortcodes.js +3 -5
- package/src/templates/register-page.js +96 -0
- package/src/utils/registrationConstants.js +7 -0
- package/src/utils/useRegistrationWidgetProps.js +204 -0
- package/src/utils/useSiteSettings.js +4 -0
- package/src/components/RegistrationLiteComponent.js +0 -293
- package/src/templates/login-page.js +0 -49
package/gatsby-node.js
CHANGED
|
@@ -454,6 +454,7 @@ exports.createPages = async ({ actions, graphql }) => {
|
|
|
454
454
|
}
|
|
455
455
|
frontmatter {
|
|
456
456
|
templateKey
|
|
457
|
+
slug
|
|
457
458
|
}
|
|
458
459
|
internal {
|
|
459
460
|
contentFilePath
|
|
@@ -471,17 +472,33 @@ exports.createPages = async ({ actions, graphql }) => {
|
|
|
471
472
|
const nodes = result.data.allMdx.nodes;
|
|
472
473
|
|
|
473
474
|
nodes.forEach((node) => {
|
|
474
|
-
const { id, fields: { slug }, frontmatter: { templateKey }, internal: { contentFilePath } } = node;
|
|
475
|
+
const { id, fields: { slug }, frontmatter: { templateKey, slug: frontmatterSlug }, internal: { contentFilePath } } = node;
|
|
475
476
|
const template = require.resolve(`./src/templates/${String(templateKey)}`);
|
|
476
|
-
//
|
|
477
|
-
const
|
|
477
|
+
// use frontmatter slug if set, otherwise derive from filename
|
|
478
|
+
const pagePath = frontmatterSlug
|
|
479
|
+
? `/${frontmatterSlug.replace(/^\/+/, '')}/`
|
|
480
|
+
: slug.replace(`/${CONTENT_PAGES_PATH_NAME}`, "");
|
|
478
481
|
const page = {
|
|
479
|
-
path:
|
|
482
|
+
path: pagePath,
|
|
480
483
|
component: `${template}?__contentFilePath=${contentFilePath}`,
|
|
481
484
|
context: { id }
|
|
482
485
|
};
|
|
483
486
|
createPage(page);
|
|
484
487
|
});
|
|
488
|
+
|
|
489
|
+
// Conditionally create /register page based on registrationMode
|
|
490
|
+
if (fs.existsSync(SITE_SETTINGS_FILE_PATH)) {
|
|
491
|
+
const siteSettings = JSON.parse(fs.readFileSync(SITE_SETTINGS_FILE_PATH));
|
|
492
|
+
const { REGISTRATION_MODE } = require('./src/utils/registrationConstants');
|
|
493
|
+
const registrationMode = siteSettings.registration?.registrationMode;
|
|
494
|
+
if (registrationMode === REGISTRATION_MODE.standalone) {
|
|
495
|
+
createPage({
|
|
496
|
+
path: '/register/',
|
|
497
|
+
component: require.resolve('./src/templates/register-page.js'),
|
|
498
|
+
context: {}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
485
502
|
};
|
|
486
503
|
|
|
487
504
|
exports.onCreatePage = async ({ page, actions }) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openeventkit/event-site",
|
|
3
3
|
"description": "Event Site",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.51",
|
|
5
5
|
"author": "Tipit LLC",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/server": "^11.11.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"font-awesome": "^4.7.0",
|
|
56
56
|
"formik": "^2.4.6",
|
|
57
57
|
"fs-extra": "^11.3.0",
|
|
58
|
-
"full-schedule-widget": "3.1.
|
|
58
|
+
"full-schedule-widget": "3.1.3",
|
|
59
59
|
"gatsby": "^5.13.5",
|
|
60
60
|
"gatsby-alias-imports": "^1.0.6",
|
|
61
61
|
"gatsby-plugin-decap-cms": "^4.0.4",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"stream-browserify": "^3.0.0",
|
|
136
136
|
"stream-chat": "^2.7.2",
|
|
137
137
|
"stream-chat-react": "3.1.7",
|
|
138
|
-
"summit-registration-lite": "
|
|
138
|
+
"summit-registration-lite": "7.0.0",
|
|
139
139
|
"superagent": "8.0.9",
|
|
140
140
|
"sweetalert2": "^11.11.1",
|
|
141
141
|
"upcoming-events-widget": "3.0.7",
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
} from "@utils/envVariables";
|
|
25
25
|
|
|
26
26
|
import { mapObjectToSelectOptions } from "../../../utils";
|
|
27
|
+
import { REGISTRATION_MODE } from "@utils/registrationConstants";
|
|
27
28
|
|
|
28
29
|
const FONT_FORMATS = {
|
|
29
30
|
truetype: "ttf",
|
|
@@ -179,6 +180,26 @@ const siteSettings = {
|
|
|
179
180
|
})
|
|
180
181
|
]
|
|
181
182
|
}),
|
|
183
|
+
objectField({
|
|
184
|
+
label: "Registration",
|
|
185
|
+
name: "registration",
|
|
186
|
+
fields: [
|
|
187
|
+
selectField({
|
|
188
|
+
label: "Registration Mode",
|
|
189
|
+
name: "registrationMode",
|
|
190
|
+
default: REGISTRATION_MODE.modal,
|
|
191
|
+
required: false,
|
|
192
|
+
options: mapObjectToSelectOptions(REGISTRATION_MODE),
|
|
193
|
+
hint: "MODAL: opens the registration form as a popup overlay. STANDALONE: redirects to a dedicated registration page. LINK: redirects to the URL specified in Registration Link, which can be an internal content page with an embedded registration form or an external URL."
|
|
194
|
+
}),
|
|
195
|
+
stringField({
|
|
196
|
+
label: "Registration Link",
|
|
197
|
+
name: "registrationLink",
|
|
198
|
+
required: false,
|
|
199
|
+
hint: "Only used when Registration Mode is LINK. Use a relative path (e.g. /my-page) for an internal page, or a full URL (e.g. https://example.com) for an external site. To embed the registration form in a content page, add the <RegistrationForm /> shortcode in the page body."
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
}),
|
|
182
203
|
objectField({
|
|
183
204
|
label: "IDP Logo",
|
|
184
205
|
name: "idpLogo",
|
|
@@ -43,12 +43,17 @@ module.exports = `
|
|
|
43
43
|
providerLogo: File @fileByRelativePath
|
|
44
44
|
providerLogoSize: Float
|
|
45
45
|
}
|
|
46
|
+
type Registration {
|
|
47
|
+
registrationMode: String
|
|
48
|
+
registrationLink: String
|
|
49
|
+
}
|
|
46
50
|
type MaintenanceMode {
|
|
47
51
|
enabled: Boolean
|
|
48
52
|
title: String
|
|
49
53
|
subtitle: String
|
|
50
54
|
}
|
|
51
55
|
type SiteSettingsJson implements Node {
|
|
56
|
+
registration: Registration
|
|
52
57
|
siteMetadata: SiteMetadata
|
|
53
58
|
favicon: Favicon
|
|
54
59
|
siteFont: SiteFont
|
|
@@ -11,6 +11,9 @@ import { CONTENT_PAGES_DIR_PATH } from "@utils/filePath";
|
|
|
11
11
|
import { USER_REQUIREMENTS } from "@utils/pageAccessConstants";
|
|
12
12
|
|
|
13
13
|
import { mapObjectToSelectOptions } from "../../utils";
|
|
14
|
+
import shortcodes from "../../../../templates/content-page/shortcodes";
|
|
15
|
+
|
|
16
|
+
const shortcodesHint = `Available shortcodes: ${Object.keys(shortcodes).map(name => `<${name} />`).join(", ")}`;
|
|
14
17
|
|
|
15
18
|
const contentPagesCollection = {
|
|
16
19
|
...collectionDefaults({
|
|
@@ -33,6 +36,12 @@ const contentPagesCollection = {
|
|
|
33
36
|
label: "Title",
|
|
34
37
|
name: "title"
|
|
35
38
|
}),
|
|
39
|
+
stringField({
|
|
40
|
+
label: "Slug",
|
|
41
|
+
name: "slug",
|
|
42
|
+
required: false,
|
|
43
|
+
hint: "URL path for this page (e.g. registration). Leave empty to use the default path based on the title. Changing this will change the page URL."
|
|
44
|
+
}),
|
|
36
45
|
selectField({
|
|
37
46
|
label: "User Requirement",
|
|
38
47
|
name: "userRequirement",
|
|
@@ -42,7 +51,8 @@ const contentPagesCollection = {
|
|
|
42
51
|
}),
|
|
43
52
|
markdownField({
|
|
44
53
|
label: "Body",
|
|
45
|
-
name: "body"
|
|
54
|
+
name: "body",
|
|
55
|
+
hint: shortcodesHint
|
|
46
56
|
})
|
|
47
57
|
]
|
|
48
58
|
};
|
|
@@ -78,12 +78,8 @@ const marketingPage = {
|
|
|
78
78
|
booleanField({
|
|
79
79
|
label: "Display",
|
|
80
80
|
name: "display",
|
|
81
|
-
required: false
|
|
82
|
-
|
|
83
|
-
stringField({
|
|
84
|
-
label: "External Registration Link",
|
|
85
|
-
name: "externalRegistrationLink",
|
|
86
|
-
required: false
|
|
81
|
+
required: false,
|
|
82
|
+
hint: "Show or hide the register button on the hero. To change the register button behavior (open registration popup, navigate to standalone registration page, or redirect to an internal page or external URL), go to Site Settings > Registration."
|
|
87
83
|
}),
|
|
88
84
|
]
|
|
89
85
|
}),
|
|
@@ -6,6 +6,7 @@ import Mdx from "../../components/Mdx";
|
|
|
6
6
|
|
|
7
7
|
// function to transform content by replacing relative image URLs with absolute ones
|
|
8
8
|
const transformContent = (mdx, getAsset) => {
|
|
9
|
+
if (!mdx) return "";
|
|
9
10
|
// regex to identify Markdown image tags 
|
|
10
11
|
const imageRegex = /!\[([^\]]*)\]\(([^)]+)\)/g;
|
|
11
12
|
|
|
@@ -21,9 +22,19 @@ const transformContent = (mdx, getAsset) => {
|
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
// Override shortcodes that require Redux/Gatsby context with placeholders for CMS preview
|
|
26
|
+
const previewShortcodes = {
|
|
27
|
+
...shortcodes,
|
|
28
|
+
RegistrationForm: () => (
|
|
29
|
+
<div style={{ border: '2px dashed #ccc', padding: '2rem', textAlign: 'center', margin: '1rem 0' }}>
|
|
30
|
+
<p style={{ fontSize: '1.2rem', color: '#666' }}>Registration Form Widget (preview not available)</p>
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
};
|
|
34
|
+
|
|
24
35
|
// function to render transformed content with Mdx
|
|
25
36
|
const renderContent = (mdx, getAsset) => (
|
|
26
|
-
<Mdx shortcodes={
|
|
37
|
+
<Mdx shortcodes={previewShortcodes} content={transformContent(mdx, getAsset)}/>
|
|
27
38
|
);
|
|
28
39
|
|
|
29
40
|
const ContentPagePreview = ({ entry, getAsset }) => {
|
|
@@ -12,7 +12,8 @@ import { getThirdPartyProviders } from "../actions/base-actions";
|
|
|
12
12
|
// these two libraries are client-side only
|
|
13
13
|
import LoginComponent from "summit-registration-lite/dist/components/login";
|
|
14
14
|
import PasswordlessLoginComponent from "summit-registration-lite/dist/components/login-passwordless";
|
|
15
|
-
import "summit-registration-lite/dist/
|
|
15
|
+
import "summit-registration-lite/dist/components/login.css";
|
|
16
|
+
import "summit-registration-lite/dist/components/login-passwordless.css";
|
|
16
17
|
import IconButton from "./IconButton";
|
|
17
18
|
import Link from "./Link";
|
|
18
19
|
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { getSrc } from "gatsby-plugin-image";
|
|
3
3
|
import AuthComponent from "../AuthComponent";
|
|
4
|
-
import
|
|
4
|
+
import RegistrationModalComponent from "../RegistrationModalComponent";
|
|
5
|
+
import RegisterButton from "../RegisterButton";
|
|
6
|
+
import { REGISTRATION_MODE } from "@utils/registrationConstants";
|
|
7
|
+
import useSiteSettings from "@utils/useSiteSettings";
|
|
5
8
|
|
|
6
9
|
import styles from "./styles.module.scss";
|
|
7
10
|
|
|
8
|
-
const ButtonGroup = ({ location, registerButton, loginButton }) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
11
|
+
const ButtonGroup = ({ location, registerButton, loginButton }) => {
|
|
12
|
+
const siteSettings = useSiteSettings();
|
|
13
|
+
const mode = siteSettings?.registration?.registrationMode || REGISTRATION_MODE.modal;
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
{registerButton?.display && (mode === REGISTRATION_MODE.standalone || mode === REGISTRATION_MODE.link) && (
|
|
17
|
+
<span className={styles.link}>
|
|
18
|
+
<RegisterButton />
|
|
19
|
+
</span>
|
|
20
|
+
)}
|
|
21
|
+
{registerButton?.display && mode === REGISTRATION_MODE.modal && (
|
|
22
|
+
<span className={styles.link}>
|
|
23
|
+
<RegistrationModalComponent location={location} />
|
|
24
|
+
</span>
|
|
25
|
+
)}
|
|
26
|
+
{loginButton?.display && <AuthComponent location={location} />}
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
18
30
|
|
|
19
31
|
const MainColumn = ({ location, title, subTitle, date, time, buttons, backgroundSrc, fullWidth }) => {
|
|
20
32
|
const backgroundImageStyle = backgroundSrc
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { navigate } from "gatsby";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
|
|
6
|
+
import IconButton from "./IconButton";
|
|
7
|
+
import iconButtonStyles from "./IconButton/styles.module.scss";
|
|
8
|
+
import { REGISTRATION_MODE } from "@utils/registrationConstants";
|
|
9
|
+
import useSiteSettings from "@utils/useSiteSettings";
|
|
10
|
+
|
|
11
|
+
const RegisterButton = ({
|
|
12
|
+
marketingPageSettings,
|
|
13
|
+
children,
|
|
14
|
+
}) => {
|
|
15
|
+
const siteSettings = useSiteSettings();
|
|
16
|
+
const registration = siteSettings?.registration;
|
|
17
|
+
const mode = registration?.registrationMode || REGISTRATION_MODE.modal;
|
|
18
|
+
|
|
19
|
+
const handleClick = () => {
|
|
20
|
+
if (mode === REGISTRATION_MODE.link && registration?.registrationLink) {
|
|
21
|
+
const url = registration.registrationLink;
|
|
22
|
+
const isInternal = /^\/(?!\/)/.test(url);
|
|
23
|
+
if (isInternal) {
|
|
24
|
+
navigate(url);
|
|
25
|
+
} else {
|
|
26
|
+
window.location = url;
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
navigate("/register");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { registerButton } = marketingPageSettings.hero.buttons;
|
|
34
|
+
|
|
35
|
+
if (children) {
|
|
36
|
+
return React.cloneElement(children, { onClick: handleClick });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!registerButton.display) return null;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<IconButton
|
|
43
|
+
className={iconButtonStyles.register}
|
|
44
|
+
iconClass="fa fa-2x fa-edit"
|
|
45
|
+
buttonText={registerButton.text}
|
|
46
|
+
onClick={handleClick}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
RegisterButton.propTypes = {
|
|
52
|
+
children: PropTypes.node,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const mapStateToProps = ({ settingState }) => ({
|
|
56
|
+
marketingPageSettings: settingState.marketingPageSettings
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export default connect(mapStateToProps)(RegisterButton);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import { navigate } from "gatsby";
|
|
4
|
+
import * as Sentry from "@sentry/react";
|
|
5
|
+
import NoSsr from "@mui/material/NoSsr";
|
|
6
|
+
|
|
7
|
+
import { SentryFallbackFunction } from "./SentryErrorComponent";
|
|
8
|
+
import RegistrationForm from "summit-registration-lite/dist/components/registration-form";
|
|
9
|
+
import "summit-registration-lite/dist/components/registration-form.css";
|
|
10
|
+
|
|
11
|
+
import { setPasswordlessLogin, setUserOrder, checkOrderData, getUserProfile, checkRequireExtraQuestionsByAttendee } from "../actions/user-actions";
|
|
12
|
+
import { getThirdPartyProviders } from "../actions/base-actions";
|
|
13
|
+
import { getExtraQuestions } from "../actions/summit-actions";
|
|
14
|
+
|
|
15
|
+
import useRegistrationWidgetProps from "@utils/useRegistrationWidgetProps";
|
|
16
|
+
|
|
17
|
+
const RegistrationFormShortcode = ({
|
|
18
|
+
summit,
|
|
19
|
+
userProfile,
|
|
20
|
+
idpProfile,
|
|
21
|
+
colorSettings,
|
|
22
|
+
attendee,
|
|
23
|
+
availableThirdPartyProviders,
|
|
24
|
+
allowsNativeAuth,
|
|
25
|
+
allowsOtpAuth,
|
|
26
|
+
loadingProfile,
|
|
27
|
+
loadingIDP,
|
|
28
|
+
setPasswordlessLogin,
|
|
29
|
+
setUserOrder,
|
|
30
|
+
checkOrderData,
|
|
31
|
+
getUserProfile,
|
|
32
|
+
getThirdPartyProviders,
|
|
33
|
+
getExtraQuestions,
|
|
34
|
+
checkRequireExtraQuestionsByAttendee
|
|
35
|
+
}) => {
|
|
36
|
+
const backUrl = typeof window !== 'undefined' ? window.location.pathname : '/';
|
|
37
|
+
|
|
38
|
+
const widgetProps = useRegistrationWidgetProps({
|
|
39
|
+
summit, userProfile, idpProfile, attendee, colorSettings,
|
|
40
|
+
loadingProfile, loadingIDP, availableThirdPartyProviders,
|
|
41
|
+
allowsNativeAuth, allowsOtpAuth,
|
|
42
|
+
setPasswordlessLogin, setUserOrder, checkOrderData,
|
|
43
|
+
getThirdPartyProviders, getExtraQuestions, checkRequireExtraQuestionsByAttendee,
|
|
44
|
+
backUrl,
|
|
45
|
+
closeWidget: () => navigate("/"),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (!summit) return null;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<NoSsr>
|
|
52
|
+
<Sentry.ErrorBoundary fallback={SentryFallbackFunction({componentName: "Registration Form"})}>
|
|
53
|
+
<div className="summit-registration-lite">
|
|
54
|
+
<RegistrationForm {...widgetProps} />
|
|
55
|
+
</div>
|
|
56
|
+
</Sentry.ErrorBoundary>
|
|
57
|
+
</NoSsr>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const mapStateToProps = ({ userState, summitState, settingState }) => ({
|
|
62
|
+
loadingProfile: userState.loading,
|
|
63
|
+
loadingIDP: userState.loadingIDP,
|
|
64
|
+
userProfile: userState.userProfile,
|
|
65
|
+
idpProfile: userState.idpProfile,
|
|
66
|
+
attendee: userState.attendee,
|
|
67
|
+
availableThirdPartyProviders: summitState.third_party_providers,
|
|
68
|
+
allowsNativeAuth: summitState.allows_native_auth,
|
|
69
|
+
allowsOtpAuth: summitState.allows_otp_auth,
|
|
70
|
+
summit: summitState.summit,
|
|
71
|
+
colorSettings: settingState.colorSettings,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export default connect(mapStateToProps, {
|
|
75
|
+
setPasswordlessLogin,
|
|
76
|
+
setUserOrder,
|
|
77
|
+
checkOrderData,
|
|
78
|
+
getUserProfile,
|
|
79
|
+
getThirdPartyProviders,
|
|
80
|
+
getExtraQuestions,
|
|
81
|
+
checkRequireExtraQuestionsByAttendee
|
|
82
|
+
})(RegistrationFormShortcode);
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import * as Sentry from "@sentry/react";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
|
|
6
|
+
import FragmentParser from "openstack-uicore-foundation/lib/utils/fragment-parser";
|
|
7
|
+
|
|
8
|
+
import { getUserProfile, setPasswordlessLogin, setUserOrder, checkOrderData, checkRequireExtraQuestionsByAttendee } from "../actions/user-actions";
|
|
9
|
+
import { getThirdPartyProviders } from "../actions/base-actions";
|
|
10
|
+
import { getExtraQuestions } from "../actions/summit-actions";
|
|
11
|
+
|
|
12
|
+
import IconButton from "./IconButton";
|
|
13
|
+
import iconButtonStyles from "./IconButton/styles.module.scss";
|
|
14
|
+
import { SentryFallbackFunction } from "./SentryErrorComponent";
|
|
15
|
+
|
|
16
|
+
import RegistrationModal from "summit-registration-lite/dist/components/registration-modal";
|
|
17
|
+
import "summit-registration-lite/dist/components/registration-modal.css";
|
|
18
|
+
|
|
19
|
+
import useRegistrationWidgetProps from "@utils/useRegistrationWidgetProps";
|
|
20
|
+
|
|
21
|
+
const RegistrationModalComponent = ({
|
|
22
|
+
summit,
|
|
23
|
+
userProfile,
|
|
24
|
+
idpProfile,
|
|
25
|
+
colorSettings,
|
|
26
|
+
attendee,
|
|
27
|
+
availableThirdPartyProviders,
|
|
28
|
+
allowsNativeAuth,
|
|
29
|
+
allowsOtpAuth,
|
|
30
|
+
loadingProfile,
|
|
31
|
+
loadingIDP,
|
|
32
|
+
marketingPageSettings,
|
|
33
|
+
setPasswordlessLogin,
|
|
34
|
+
setUserOrder,
|
|
35
|
+
checkOrderData,
|
|
36
|
+
getUserProfile,
|
|
37
|
+
getThirdPartyProviders,
|
|
38
|
+
getExtraQuestions,
|
|
39
|
+
checkRequireExtraQuestionsByAttendee,
|
|
40
|
+
children,
|
|
41
|
+
ignoreAutoOpen
|
|
42
|
+
}) => {
|
|
43
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
const fragmentParser = new FragmentParser();
|
|
47
|
+
if (!ignoreAutoOpen && fragmentParser.getParam("registration")) {
|
|
48
|
+
setIsOpen(true);
|
|
49
|
+
}
|
|
50
|
+
}, [ignoreAutoOpen]);
|
|
51
|
+
|
|
52
|
+
const handleOpenPopup = () => {
|
|
53
|
+
setIsOpen(true);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleClosePopup = () => {
|
|
57
|
+
setIsOpen(false);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const widgetProps = useRegistrationWidgetProps({
|
|
61
|
+
summit, userProfile, idpProfile, attendee, colorSettings,
|
|
62
|
+
loadingProfile, loadingIDP, availableThirdPartyProviders,
|
|
63
|
+
allowsNativeAuth, allowsOtpAuth,
|
|
64
|
+
setPasswordlessLogin, setUserOrder, checkOrderData,
|
|
65
|
+
getUserProfile, getThirdPartyProviders, getExtraQuestions,
|
|
66
|
+
checkRequireExtraQuestionsByAttendee,
|
|
67
|
+
backUrl: '/#registration=1',
|
|
68
|
+
closeWidget: handleClosePopup,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const { registerButton } = marketingPageSettings.hero.buttons;
|
|
72
|
+
|
|
73
|
+
if (!summit) return null;
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<Sentry.ErrorBoundary fallback={SentryFallbackFunction({componentName: "Registration Modal"})}>
|
|
77
|
+
{children ?
|
|
78
|
+
React.cloneElement(children, { onClick: handleOpenPopup })
|
|
79
|
+
:
|
|
80
|
+
registerButton.display &&
|
|
81
|
+
<IconButton
|
|
82
|
+
className={iconButtonStyles.register}
|
|
83
|
+
iconClass="fa fa-2x fa-edit"
|
|
84
|
+
buttonText={registerButton.text}
|
|
85
|
+
onClick={handleOpenPopup}
|
|
86
|
+
disabled={isOpen}
|
|
87
|
+
/>
|
|
88
|
+
}
|
|
89
|
+
{isOpen && <RegistrationModal {...widgetProps} />}
|
|
90
|
+
</Sentry.ErrorBoundary>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
RegistrationModalComponent.defaultProps = {
|
|
95
|
+
ignoreAutoOpen: false,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
RegistrationModalComponent.propTypes = {
|
|
99
|
+
ignoreAutoOpen: PropTypes.bool,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const mapStateToProps = ({ userState, summitState, settingState }) => ({
|
|
103
|
+
loadingProfile: userState.loading,
|
|
104
|
+
loadingIDP: userState.loadingIDP,
|
|
105
|
+
userProfile: userState.userProfile,
|
|
106
|
+
idpProfile: userState.idpProfile,
|
|
107
|
+
attendee: userState.attendee,
|
|
108
|
+
availableThirdPartyProviders: summitState.third_party_providers,
|
|
109
|
+
allowsNativeAuth: summitState.allows_native_auth,
|
|
110
|
+
allowsOtpAuth: summitState.allows_otp_auth,
|
|
111
|
+
summit: summitState.summit,
|
|
112
|
+
colorSettings: settingState.colorSettings,
|
|
113
|
+
marketingPageSettings: settingState.marketingPageSettings
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export default connect(mapStateToProps, {
|
|
117
|
+
setPasswordlessLogin,
|
|
118
|
+
setUserOrder,
|
|
119
|
+
checkOrderData,
|
|
120
|
+
getUserProfile,
|
|
121
|
+
getThirdPartyProviders,
|
|
122
|
+
getExtraQuestions,
|
|
123
|
+
checkRequireExtraQuestionsByAttendee
|
|
124
|
+
})(RegistrationModalComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"favicon":{"asset":"icon.png"},"widgets":{"chat":{"enabled":true,"showQA":false,"showHelp":false,"defaultScope":"page"},"schedule":{"allowClick":true}},"identityProviderButtons":[{"buttonColor":"#082238","providerLabel":"Continue with FNid","providerLogo":"logo_fn.svg","providerLogoSize":27},{"buttonColor":"#0A66C2","providerLabel":"Sign in with LinkedIn","providerParam":"linkedin","providerLogo":"logo_linkedin.svg","providerLogoSize":18},{"buttonColor":"#000000","providerLabel":"Sign in with Apple","providerParam":"apple","providerLogoSize":17,"providerLogo":"logo_apple.svg"},{"buttonColor":"#1877F2","providerLabel":"Login with Facebook","providerParam":"facebook","providerLogo":"logo_facebook.svg","providerLogoSize":20}],"maintenanceMode":{"enabled":false,"title":"Site under maintenance","subtitle":"Please reload page shortly"},"staticJsonFilesBuildTime":[{"file":"src/data/summit.json","build_time":
|
|
1
|
+
{"favicon":{"asset":"icon.png"},"widgets":{"chat":{"enabled":true,"showQA":false,"showHelp":false,"defaultScope":"page"},"schedule":{"allowClick":true}},"identityProviderButtons":[{"buttonColor":"#082238","providerLabel":"Continue with FNid","providerLogo":"logo_fn.svg","providerLogoSize":27},{"buttonColor":"#0A66C2","providerLabel":"Sign in with LinkedIn","providerParam":"linkedin","providerLogo":"logo_linkedin.svg","providerLogoSize":18},{"buttonColor":"#000000","providerLabel":"Sign in with Apple","providerParam":"apple","providerLogoSize":17,"providerLogo":"logo_apple.svg"},{"buttonColor":"#1877F2","providerLabel":"Login with Facebook","providerParam":"facebook","providerLogo":"logo_facebook.svg","providerLogoSize":20}],"maintenanceMode":{"enabled":false,"title":"Site under maintenance","subtitle":"Please reload page shortly"},"staticJsonFilesBuildTime":[{"file":"src/data/summit.json","build_time":1777290117148},{"file":"src/data/events.json","build_time":1777290119814},{"file":"src/data/events.idx.json","build_time":1777290119815},{"file":"src/data/speakers.json","build_time":1777290120736},{"file":"src/data/speakers.idx.json","build_time":1777290120737},{"file":"src/content/sponsors.json","build_time":1777290130468},{"file":"src/data/voteable-presentations.json","build_time":1777290130851}],"lastBuild":1777290130851,"registration":{"registrationMode":"STANDALONE"}}
|