@openeventkit/event-site 2.0.79 → 2.0.81
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/env.template +1 -2
- package/gatsby-ssr.js +2 -2
- package/package.json +2 -2
- package/src/components/Seo.js +14 -19
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupEditDetailsForm/TicketPopupEditDetailsForm.js +13 -13
- package/src/routes/WithAuthRoute.js +23 -13
- package/src/state/ReduxWrapper.js +12 -12
- package/src/state/reduxPersistStorage.js +26 -0
- package/src/state/store.js +48 -47
- package/src/templates/extra-questions-page.js +7 -7
- package/src/templates/ticket-error-page.js +44 -39
- package/src/utils/envVariables.js +0 -11
- package/src/utils/urlFormating.js +1 -1
- package/src/reducers/index.js +0 -23
- package/src/state/ReduxSSRWrapper.js +0 -9
package/env.template
CHANGED
package/gatsby-ssr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import ReduxWrapper from "./src/state/ReduxWrapper";
|
|
3
3
|
import {
|
|
4
4
|
HtmlAttributes,
|
|
5
5
|
HeadComponents,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { JSDOM } from "jsdom";
|
|
10
10
|
import { XMLHttpRequest } from "xmlhttprequest";
|
|
11
11
|
|
|
12
|
-
export const wrapRootElement =
|
|
12
|
+
export const wrapRootElement = ReduxWrapper;
|
|
13
13
|
|
|
14
14
|
export const onRenderBody = ({
|
|
15
15
|
setHtmlAttributes,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openeventkit/event-site",
|
|
3
3
|
"description": "Event Site",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.81",
|
|
5
5
|
"author": "Tipit LLC",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mui/base": "^5.0.0-alpha.114",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"netlify-cms-app": "^2.15.72",
|
|
79
79
|
"netlify-cms-lib-widgets": "^1.8.0",
|
|
80
80
|
"node-sass-utils": "^1.1.3",
|
|
81
|
-
"openstack-uicore-foundation": "4.1.
|
|
81
|
+
"openstack-uicore-foundation": "4.1.59",
|
|
82
82
|
"path-browserify": "^1.0.1",
|
|
83
83
|
"prop-types": "^15.6.0",
|
|
84
84
|
"react": "^18.2.0",
|
package/src/components/Seo.js
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import useSiteMetadata from "@utils/useSiteMetadata";
|
|
4
3
|
import useSiteSettings from "@utils/useSiteSettings";
|
|
4
|
+
import { Helmet } from "react-helmet";
|
|
5
5
|
import { getSrc } from "gatsby-plugin-image";
|
|
6
|
-
import {
|
|
7
|
-
import { getEnvVariable, SITE_URL } from "@utils/envVariables";
|
|
6
|
+
import { getUrl } from "@utils/urlFormating";
|
|
8
7
|
|
|
9
8
|
const Seo = ({ title, description, location, children }) => {
|
|
10
9
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const siteUrlInfo = siteUrl ? new URL(siteUrl) : null;
|
|
20
|
-
const scheme = siteUrlInfo ? siteUrlInfo.protocol.replace(":", "") : "https";
|
|
21
|
-
const host = siteUrlInfo ? siteUrlInfo.host : null;
|
|
10
|
+
siteMetadata: {
|
|
11
|
+
title: siteTitle,
|
|
12
|
+
description: defaultDescription,
|
|
13
|
+
image
|
|
14
|
+
}
|
|
15
|
+
} = useSiteSettings();
|
|
16
|
+
const host = typeof window !== "undefined" ? window.location.host : null;
|
|
17
|
+
const scheme = typeof window !== "undefined" ? window.location.protocol.replace(":", "") : "https";
|
|
22
18
|
const { pathname } = location;
|
|
23
|
-
|
|
24
19
|
const seo = {
|
|
25
20
|
title: title ? `${siteTitle} - ${title}` : siteTitle,
|
|
26
21
|
description: description || defaultDescription,
|
|
27
|
-
url:
|
|
28
|
-
image: host && image ?
|
|
22
|
+
url: getUrl(scheme, host, pathname),
|
|
23
|
+
image: host && image ? getUrl(scheme, host, getSrc(image)) : null,
|
|
29
24
|
};
|
|
30
25
|
return (
|
|
31
|
-
|
|
26
|
+
<Helmet>
|
|
32
27
|
{seo.title && <title>{seo.title}</title>}
|
|
33
28
|
{seo.description && <meta name="description" content={seo.description} />}
|
|
34
29
|
{seo.url && <meta property="og:url" content={seo.url} />}
|
|
@@ -43,7 +38,7 @@ const Seo = ({ title, description, location, children }) => {
|
|
|
43
38
|
{seo.description && <meta name="twitter:description" content={seo.description} />}
|
|
44
39
|
{seo.image && <meta name="twitter:image" content={seo.image} />}
|
|
45
40
|
{children}
|
|
46
|
-
|
|
41
|
+
</Helmet>
|
|
47
42
|
);
|
|
48
43
|
};
|
|
49
44
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { useDispatch, useSelector } from "react-redux";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { CSSTransition } from "react-transition-group";
|
|
@@ -30,7 +30,7 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
30
30
|
order,
|
|
31
31
|
canEditTicketData,
|
|
32
32
|
goToReassignPanel,
|
|
33
|
-
context
|
|
33
|
+
context
|
|
34
34
|
}) => {
|
|
35
35
|
const formRef = useRef(null);
|
|
36
36
|
const { t } = useTranslation();
|
|
@@ -126,7 +126,7 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
const handleConfirmAccept = async () => {
|
|
129
|
-
setShowConfirm(false);
|
|
129
|
+
setShowConfirm(false);
|
|
130
130
|
dispatch(removeAttendee({ticket, context})).then((updatedTicket) => {
|
|
131
131
|
onTicketAssignChange(updatedTicket);
|
|
132
132
|
toggleUnassignMessage()
|
|
@@ -149,7 +149,7 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
149
149
|
|
|
150
150
|
const scrollToError = (error) => document.querySelector(`label[for="${error}"]`).scrollIntoView(ScrollBehaviour);
|
|
151
151
|
|
|
152
|
-
const validateForm = (
|
|
152
|
+
const validateForm = (errorId = null) => {
|
|
153
153
|
// Validate the formik form
|
|
154
154
|
formik.validateForm().then((errors) => {
|
|
155
155
|
const errorKeys = Object.keys(errors);
|
|
@@ -159,8 +159,8 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
// extra question
|
|
162
|
-
if (
|
|
163
|
-
|
|
162
|
+
if (errorId) {
|
|
163
|
+
formRef.current.scroll2QuestionById(errorId);
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
// disclaimer
|
|
@@ -184,8 +184,8 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
184
184
|
validateForm();
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
-
const handleExtraQuestionError = (
|
|
188
|
-
validateForm(
|
|
187
|
+
const handleExtraQuestionError = (errors, ref, errorId) => {
|
|
188
|
+
validateForm(errorId);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
const onExtraQuestionsAnswersSet = (answersForm) => {
|
|
@@ -207,10 +207,10 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
207
207
|
};
|
|
208
208
|
|
|
209
209
|
const canSubmitChanges = () => {
|
|
210
|
-
const qs = new QuestionsSet(extraQuestions, initialValues[TicketKeys.extraQuestions]);
|
|
210
|
+
const qs = new QuestionsSet(extraQuestions, initialValues[TicketKeys.extraQuestions]);
|
|
211
211
|
const unansweredExtraQuestions = !qs.completed();
|
|
212
212
|
return canEditTicketData || isReassignable || unansweredExtraQuestions;
|
|
213
|
-
}
|
|
213
|
+
}
|
|
214
214
|
|
|
215
215
|
return (
|
|
216
216
|
<div className="ticket-popup-edit-details-form">
|
|
@@ -252,7 +252,7 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
252
252
|
value={initialValues[TicketKeys.email]}
|
|
253
253
|
disabled={true}
|
|
254
254
|
/>
|
|
255
|
-
{isUserTicketOwner && isReassignable &&
|
|
255
|
+
{isUserTicketOwner && isReassignable &&
|
|
256
256
|
<div className="mt-1">
|
|
257
257
|
<span onClick={() => goToReassignPanel()}>
|
|
258
258
|
<u>Reassign</u>
|
|
@@ -332,7 +332,7 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
332
332
|
</div>
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
{hasExtraQuestions &&
|
|
335
|
+
{hasExtraQuestions &&
|
|
336
336
|
<div className="column is-full pt-5">
|
|
337
337
|
<h4 className="pb-2">{t("ticket_popup.edit_preferences")}</h4>
|
|
338
338
|
<ExtraQuestionsForm
|
|
@@ -398,4 +398,4 @@ export const TicketPopupEditDetailsForm = ({
|
|
|
398
398
|
/>
|
|
399
399
|
</div>
|
|
400
400
|
);
|
|
401
|
-
};
|
|
401
|
+
};
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {connect} from "react-redux";
|
|
3
|
+
import {navigate} from "gatsby";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
6
|
+
*
|
|
7
|
+
* @param isLoggedIn
|
|
8
|
+
* @param location
|
|
9
|
+
* @param children
|
|
10
|
+
* @returns {null|*}
|
|
11
|
+
* @constructor
|
|
9
12
|
*/
|
|
10
|
-
const WithAuthRoute = ({
|
|
11
|
-
|
|
13
|
+
const WithAuthRoute = ({
|
|
14
|
+
|
|
15
|
+
isLoggedIn,
|
|
16
|
+
location,
|
|
17
|
+
children
|
|
18
|
+
}) => {
|
|
19
|
+
|
|
12
20
|
if (!isLoggedIn) {
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
// reject it and redirect with current location to login
|
|
22
|
+
navigate("/#login=1", {state: {backUrl: `${location.pathname}`,},});
|
|
23
|
+
return null;
|
|
15
24
|
}
|
|
16
|
-
}, [isLoggedIn, location.pathname]);
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
return children;
|
|
19
27
|
};
|
|
20
28
|
|
|
21
|
-
|
|
29
|
+
const mapStateToProps = ({}) => ({});
|
|
30
|
+
|
|
31
|
+
export default connect(mapStateToProps, {})(WithAuthRoute);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Provider } from "react-redux";
|
|
3
3
|
import { PersistGate } from "redux-persist/integration/react";
|
|
4
|
-
import
|
|
4
|
+
import store, { persistor } from "./store";
|
|
5
5
|
|
|
6
6
|
import { RESET_STATE } from "../actions/base-actions-definitions";
|
|
7
7
|
|
|
8
8
|
const onBeforeLift = () => {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const params = new URLSearchParams(window.location.search);
|
|
10
|
+
const flush = params.has("flushState");
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
if (flush) {
|
|
13
|
+
store.dispatch({ type: RESET_STATE, payload: null });
|
|
14
|
+
}
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export default ({ element }) => (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
<Provider store={store}>
|
|
19
|
+
<PersistGate onBeforeLift={onBeforeLift} persistor={persistor}>
|
|
20
|
+
{element}
|
|
21
|
+
</PersistGate>
|
|
22
|
+
</Provider>
|
|
23
23
|
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create dummy storage on the server-side and wrapper for localStorage on the client-side.
|
|
3
|
+
* @see https://github.com/rt2zz/redux-persist/issues/1208#issuecomment-658695446
|
|
4
|
+
* @see https://stackoverflow.com/questions/57781527/how-to-solve-console-error-redux-persist-failed-to-create-sync-storage-falli
|
|
5
|
+
* @see https://github.com/vercel/next.js/discussions/15687#discussioncomment-45319
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import createWebStorage from 'redux-persist/lib/storage/createWebStorage';
|
|
9
|
+
|
|
10
|
+
const createNoopStorage = () => {
|
|
11
|
+
return {
|
|
12
|
+
getItem(_key) {
|
|
13
|
+
return Promise.resolve(null);
|
|
14
|
+
},
|
|
15
|
+
setItem(_key, value) {
|
|
16
|
+
return Promise.resolve(value);
|
|
17
|
+
},
|
|
18
|
+
removeItem(_key) {
|
|
19
|
+
return Promise.resolve();
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const storage = typeof window !== 'undefined' ? createWebStorage('local') : createNoopStorage();
|
|
25
|
+
|
|
26
|
+
export default storage;
|
package/src/state/store.js
CHANGED
|
@@ -1,67 +1,68 @@
|
|
|
1
|
-
import { applyMiddleware, compose, createStore
|
|
1
|
+
import { applyMiddleware, compose, createStore } from "redux";
|
|
2
2
|
import { persistCombineReducers, persistStore } from "redux-persist";
|
|
3
|
-
import storage from "redux-persist/lib/storage";
|
|
4
3
|
import thunk from "redux-thunk";
|
|
4
|
+
import storage from "./reduxPersistStorage";
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { loggedUserReducer } from "openstack-uicore-foundation/lib/security/reducers";
|
|
7
|
+
import settingReducer from "../reducers/setting-reducer";
|
|
8
|
+
import userReducer from "../reducers/user-reducer";
|
|
9
|
+
import clockReducer from "../reducers/clock-reducer";
|
|
10
|
+
import summitReducer from "../reducers/summit-reducer";
|
|
11
|
+
import allSchedulesReducer from "../reducers/all-schedules-reducer";
|
|
12
|
+
import presentationsReducer from "../reducers/presentations-reducer";
|
|
13
|
+
import eventReducer from "../reducers/event-reducer";
|
|
14
|
+
import speakerReducer from "../reducers/speaker-reducer";
|
|
15
|
+
import sponsorReducer from "../reducers/sponsor-reducer";
|
|
16
|
+
import extraQuestionReducer from "../reducers/extra-questions-reducer";
|
|
7
17
|
|
|
8
|
-
//
|
|
18
|
+
// get from process.env bc window is not set yet
|
|
9
19
|
const clientId = process.env.GATSBY_OAUTH2_CLIENT_ID;
|
|
10
20
|
const summitID = process.env.GATSBY_SUMMIT_ID;
|
|
11
21
|
|
|
12
22
|
const config = {
|
|
13
23
|
key: `root_${clientId}_${summitID}`,
|
|
14
|
-
storage,
|
|
24
|
+
storage: storage,
|
|
15
25
|
blacklist: [
|
|
16
26
|
// this will be not saved to persistent storage see
|
|
17
27
|
// https://github.com/rt2zz/redux-persist#blacklist--whitelist
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]
|
|
28
|
+
'summitState',
|
|
29
|
+
'allSchedulesState',
|
|
30
|
+
'presentationsState',
|
|
31
|
+
'eventState',
|
|
32
|
+
'speakerState',
|
|
33
|
+
'sponsorState',
|
|
34
|
+
]
|
|
25
35
|
};
|
|
26
36
|
|
|
27
|
-
const
|
|
28
|
-
loggedUserState:
|
|
29
|
-
settingState:
|
|
30
|
-
userState:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
presentationsState:
|
|
35
|
-
|
|
36
|
-
speakerState:
|
|
37
|
-
sponsorState:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const appendLoggedUser = ({ getState }) => (next) => (action) => {
|
|
41
|
-
const { userState: { userProfile } } = getState();
|
|
42
|
-
action.userProfile = userProfile;
|
|
43
|
-
return next(action);
|
|
44
|
-
};
|
|
37
|
+
const persistedReducers = persistCombineReducers(config, {
|
|
38
|
+
loggedUserState: loggedUserReducer,
|
|
39
|
+
settingState: settingReducer,
|
|
40
|
+
userState: userReducer,
|
|
41
|
+
allSchedulesState: allSchedulesReducer,
|
|
42
|
+
clockState: clockReducer,
|
|
43
|
+
eventState: eventReducer,
|
|
44
|
+
presentationsState: presentationsReducer,
|
|
45
|
+
summitState: summitReducer,
|
|
46
|
+
speakerState: speakerReducer,
|
|
47
|
+
sponsorState: sponsorReducer,
|
|
48
|
+
extraQuestionState: extraQuestionReducer
|
|
49
|
+
});
|
|
45
50
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
:
|
|
51
|
+
function appendLoggedUser({ getState }) {
|
|
52
|
+
return next => action => {
|
|
53
|
+
const { userState: { userProfile } } = getState();
|
|
54
|
+
// Call the next dispatch method in the middleware chain.
|
|
55
|
+
action.userProfile = userProfile;
|
|
56
|
+
return next(action);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
49
59
|
|
|
50
|
-
const
|
|
60
|
+
const composeEnhancers = typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : compose;
|
|
51
61
|
|
|
52
|
-
|
|
53
|
-
export const storeWithoutPersistor = createStore(
|
|
54
|
-
combineReducers(states),
|
|
55
|
-
enhancer
|
|
56
|
-
);
|
|
62
|
+
const store = createStore(persistedReducers, composeEnhancers(applyMiddleware(appendLoggedUser, thunk)));
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
export const { store, persistor } = (() => {
|
|
60
|
-
const persistedReducers = persistCombineReducers(config, states);
|
|
64
|
+
const onRehydrateComplete = () => {};
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
const onRehydrateComplete = () => {};
|
|
64
|
-
const persistor = persistStore(store, null, onRehydrateComplete);
|
|
66
|
+
export const persistor = persistStore(store, null, onRehydrateComplete);
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
})();
|
|
68
|
+
export default store;
|
|
@@ -88,7 +88,7 @@ export const ExtraQuestionsPageTemplate = ({ user, summit, extraQuestions, atten
|
|
|
88
88
|
|
|
89
89
|
const scrollToError = (error) => document.querySelector(`label[for="${error}"]`).scrollIntoView(ScrollBehaviour);
|
|
90
90
|
|
|
91
|
-
const validateForm = (
|
|
91
|
+
const validateForm = (errorId = null) => {
|
|
92
92
|
// Validate the formik form
|
|
93
93
|
formik.validateForm().then((errors) => {
|
|
94
94
|
const errorKeys = Object.keys(errors);
|
|
@@ -98,8 +98,8 @@ export const ExtraQuestionsPageTemplate = ({ user, summit, extraQuestions, atten
|
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
// extra question
|
|
101
|
-
if (
|
|
102
|
-
|
|
101
|
+
if (errorId) {
|
|
102
|
+
formRef.current.scroll2QuestionById(errorId);
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
// disclaimer
|
|
@@ -123,8 +123,8 @@ export const ExtraQuestionsPageTemplate = ({ user, summit, extraQuestions, atten
|
|
|
123
123
|
validateForm();
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
const handleExtraQuestionError = (
|
|
127
|
-
validateForm(
|
|
126
|
+
const handleExtraQuestionError = (errors, ref, errorId) => {
|
|
127
|
+
validateForm(errorId);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
const onExtraQuestionsAnswersSet = (answersForm) => {
|
|
@@ -159,7 +159,7 @@ export const ExtraQuestionsPageTemplate = ({ user, summit, extraQuestions, atten
|
|
|
159
159
|
<div className={styles.extraQuestionsAttendeeWarning}>
|
|
160
160
|
{`Attention: The info below is for ${getAttendeeFullname(attendee)}. No additional action is required if you
|
|
161
161
|
prefer ${attendee.first_name || attendee.email} to complete this info; they have received an email with instructions.
|
|
162
|
-
You can manage this ticket on the "My Orders / Tickets" page.`}
|
|
162
|
+
You can manage this ticket on the "My Orders / Tickets" page.`}
|
|
163
163
|
</div>
|
|
164
164
|
}
|
|
165
165
|
<div className={`content columns ${styles.extraQuestionsContainer}`}>
|
|
@@ -242,7 +242,7 @@ export const ExtraQuestionsPageTemplate = ({ user, summit, extraQuestions, atten
|
|
|
242
242
|
questionContainerClassName={`columns is-multiline ${styles.extraQuestion} pt-3`}
|
|
243
243
|
questionLabelContainerClassName={'column is-full pb-0'}
|
|
244
244
|
questionControlContainerClassName={`column is-full pt-0`}
|
|
245
|
-
shouldScroll2FirstError={
|
|
245
|
+
shouldScroll2FirstError={true}
|
|
246
246
|
onError={handleExtraQuestionError}
|
|
247
247
|
/>
|
|
248
248
|
</>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import HeroComponent from
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {connect} from "react-redux";
|
|
3
|
+
import PropTypes from 'prop-types'
|
|
4
|
+
import {navigate} from 'gatsby'
|
|
5
|
+
import {getEnvVariable, REGISTRATION_BASE_URL} from '../utils/envVariables'
|
|
6
|
+
import HeroComponent from '../components/HeroComponent'
|
|
7
7
|
|
|
8
8
|
export const TicketErrorPageTemplate = class extends React.Component {
|
|
9
9
|
|
|
10
10
|
constructor(props) {
|
|
11
11
|
super(props);
|
|
12
12
|
|
|
13
|
-
const {
|
|
13
|
+
const {location} = this.props;
|
|
14
14
|
|
|
15
15
|
this.state = {
|
|
16
16
|
error: location.state?.error
|
|
@@ -18,21 +18,21 @@ export const TicketErrorPageTemplate = class extends React.Component {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
redirect() {
|
|
21
|
-
const {
|
|
21
|
+
const {error} = this.state;
|
|
22
22
|
|
|
23
23
|
if (getEnvVariable(REGISTRATION_BASE_URL)) {
|
|
24
24
|
|
|
25
25
|
let targetUrl = null;
|
|
26
26
|
|
|
27
27
|
switch (error) {
|
|
28
|
-
case
|
|
29
|
-
targetUrl =
|
|
28
|
+
case 'no-virtual-access':
|
|
29
|
+
targetUrl = `/`;
|
|
30
30
|
break
|
|
31
|
-
case
|
|
32
|
-
targetUrl =
|
|
31
|
+
case 'no-ticket':
|
|
32
|
+
targetUrl = `/#registration=1`;
|
|
33
33
|
break;
|
|
34
|
-
case
|
|
35
|
-
targetUrl =
|
|
34
|
+
case 'incomplete':
|
|
35
|
+
targetUrl = `/a/extra-questions`;
|
|
36
36
|
break;
|
|
37
37
|
default:
|
|
38
38
|
break;
|
|
@@ -46,23 +46,25 @@ export const TicketErrorPageTemplate = class extends React.Component {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
setTimeout(() =>
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
navigate('/')
|
|
51
|
+
}, 5000);
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
getErrorMessage() {
|
|
53
|
-
const {
|
|
55
|
+
const {error} = this.state;
|
|
54
56
|
|
|
55
|
-
let message =
|
|
57
|
+
let message = '';
|
|
56
58
|
|
|
57
59
|
switch (error) {
|
|
58
|
-
case
|
|
59
|
-
message =
|
|
60
|
+
case 'no-virtual-access':
|
|
61
|
+
message = 'I’m sorry your badge does not allow access to this section.';
|
|
60
62
|
break;
|
|
61
|
-
case
|
|
62
|
-
message =
|
|
63
|
+
case 'no-ticket':
|
|
64
|
+
message = 'I’m sorry you are not registered for this event.';
|
|
63
65
|
break;
|
|
64
|
-
case
|
|
65
|
-
message =
|
|
66
|
+
case 'incomplete':
|
|
67
|
+
message = 'You have not answered questions required to join the event.';
|
|
66
68
|
break;
|
|
67
69
|
default:
|
|
68
70
|
break;
|
|
@@ -72,13 +74,11 @@ export const TicketErrorPageTemplate = class extends React.Component {
|
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
getRedirectMessage() {
|
|
75
|
-
const {
|
|
76
|
-
|
|
77
|
-
let message = "";
|
|
78
|
-
|
|
77
|
+
const {error} = this.state;
|
|
78
|
+
let message = '';
|
|
79
79
|
switch (error) {
|
|
80
|
-
case
|
|
81
|
-
message = getEnvVariable(REGISTRATION_BASE_URL) ?
|
|
80
|
+
case 'no-ticket':
|
|
81
|
+
message = getEnvVariable(REGISTRATION_BASE_URL) ? 'You will be redirected to registration.' : '';
|
|
82
82
|
break;
|
|
83
83
|
default:
|
|
84
84
|
break;
|
|
@@ -88,7 +88,7 @@ export const TicketErrorPageTemplate = class extends React.Component {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
render() {
|
|
91
|
-
const {
|
|
91
|
+
const {error} = this.state;
|
|
92
92
|
|
|
93
93
|
if (error) {
|
|
94
94
|
this.redirect();
|
|
@@ -100,7 +100,8 @@ export const TicketErrorPageTemplate = class extends React.Component {
|
|
|
100
100
|
)
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
navigate('/');
|
|
104
|
+
return null
|
|
104
105
|
}
|
|
105
106
|
};
|
|
106
107
|
|
|
@@ -108,19 +109,23 @@ TicketErrorPageTemplate.propTypes = {
|
|
|
108
109
|
location: PropTypes.object,
|
|
109
110
|
};
|
|
110
111
|
|
|
111
|
-
const TicketErrorPage = ({
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
const TicketErrorPage = ({location, summit}) => {
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<TicketErrorPageTemplate
|
|
116
|
+
location={location}
|
|
117
|
+
summit={summit}
|
|
118
|
+
/>
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
};
|
|
117
122
|
|
|
118
123
|
TicketErrorPage.propTypes = {
|
|
119
124
|
location: PropTypes.object,
|
|
120
125
|
};
|
|
121
126
|
|
|
122
|
-
const mapStateToProps = ({
|
|
127
|
+
const mapStateToProps = ({summitState}) => ({
|
|
123
128
|
summit: summitState.summit,
|
|
124
129
|
});
|
|
125
130
|
|
|
126
|
-
export default connect(mapStateToProps,
|
|
131
|
+
export default connect(mapStateToProps, {})(TicketErrorPage);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const SITE_URL = 'SITE_URL';
|
|
2
1
|
export const IDP_BASE_URL = 'IDP_BASE_URL';
|
|
3
2
|
export const SUMMIT_API_BASE_URL = 'SUMMIT_API_BASE_URL';
|
|
4
3
|
export const SUMMIT_ID = 'SUMMIT_ID';
|
|
@@ -27,15 +26,6 @@ export const TIMEINTERVALSINCE1970_API_URL = 'TIMEINTERVALSINCE1970_API_URL';
|
|
|
27
26
|
export const ABLY_API_KEY = 'ABLY_API_KEY';
|
|
28
27
|
|
|
29
28
|
const processEnv = {
|
|
30
|
-
/**
|
|
31
|
-
* Retrieve the site URL from environment variable set by the deploy provider.
|
|
32
|
-
* See documentation for more details:
|
|
33
|
-
* - Netlify: {@link https://docs.netlify.com/configure-builds/environment-variables/#deploy-urls-and-metadata}
|
|
34
|
-
* - Cloudflare Pages: {@link https://developers.cloudflare.com/pages/platform/build-configuration#environment-variables}
|
|
35
|
-
*
|
|
36
|
-
* If not available, fallback to user-defined GATSBY_SITE_URL env var.
|
|
37
|
-
*/
|
|
38
|
-
SITE_URL: process.env.GATSBY_URL || process.env.GATSBY_CF_PAGES_URL || process.env.GATSBY_SITE_URL,
|
|
39
29
|
IDP_BASE_URL: process.env.GATSBY_IDP_BASE_URL,
|
|
40
30
|
SUMMIT_API_BASE_URL: process.env.GATSBY_SUMMIT_API_BASE_URL,
|
|
41
31
|
API_BASE_URL: process.env.GATSBY_SUMMIT_API_BASE_URL,
|
|
@@ -72,7 +62,6 @@ export const getEnvVariable = (name) => {
|
|
|
72
62
|
}
|
|
73
63
|
|
|
74
64
|
if (typeof window === 'object') {
|
|
75
|
-
window.SITE_URL = processEnv[SITE_URL];
|
|
76
65
|
window.OAUTH2_FLOW = processEnv[OAUTH2_FLOW];
|
|
77
66
|
window.OAUTH2_CLIENT_ID = processEnv[OAUTH2_CLIENT_ID];
|
|
78
67
|
window.SCOPES = processEnv[SCOPES];
|
package/src/reducers/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { loggedUserReducer } from "openstack-uicore-foundation/lib/security/reducers";
|
|
2
|
-
import settingReducer from "./setting-reducer";
|
|
3
|
-
import userReducer from "./user-reducer";
|
|
4
|
-
import clockReducer from "./clock-reducer";
|
|
5
|
-
import summitReducer from "./summit-reducer";
|
|
6
|
-
import allSchedulesReducer from "./all-schedules-reducer";
|
|
7
|
-
import presentationsReducer from "./presentations-reducer";
|
|
8
|
-
import eventReducer from "./event-reducer";
|
|
9
|
-
import speakerReducer from "./speaker-reducer";
|
|
10
|
-
import sponsorReducer from "./sponsor-reducer";
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
loggedUserReducer,
|
|
14
|
-
settingReducer,
|
|
15
|
-
userReducer,
|
|
16
|
-
clockReducer,
|
|
17
|
-
summitReducer,
|
|
18
|
-
allSchedulesReducer,
|
|
19
|
-
presentationsReducer,
|
|
20
|
-
eventReducer,
|
|
21
|
-
speakerReducer,
|
|
22
|
-
sponsorReducer,
|
|
23
|
-
};
|