@openeventkit/event-site 2.1.35 → 2.1.37
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 -0
- package/package.json +4 -4
- package/src/actions/base-actions.js +3 -1
- package/src/cms/config/collections/configurationsCollection/siteSettings/index.js +4 -2
- package/src/components/AuthComponent.js +2 -1
- package/src/components/RegistrationLiteComponent.js +2 -2
- package/src/routes/login-callback-route.js +2 -1
- package/src/templates/token-expire-page.js +2 -1
- package/src/utils/alerts.js +2 -1
- package/src/utils/envVariables.js +7 -1
- package/src/utils/real_time_updates/withRealTimeUpdates.js +6 -0
- package/src/workers/sync_strategies/activity_synch_strategy.js +12 -0
- package/src/workers/sync_strategies/synch_strategy_factory.js +3 -2
- package/src/workers/synch.worker.js +6 -1
package/env.template
CHANGED
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.37",
|
|
5
5
|
"author": "Tipit LLC",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/server": "^11.11.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"classnames": "^2.3.1",
|
|
46
46
|
"cross-env": "^7.0.3",
|
|
47
47
|
"crypto-js": "^4.1.1",
|
|
48
|
-
"decap-cms-app": "
|
|
48
|
+
"decap-cms-app": "3.6.4",
|
|
49
49
|
"decap-cms-lib-widgets": "^3.0.2",
|
|
50
50
|
"disqus-react": "1.0.10",
|
|
51
51
|
"dotenv": "^8.2.0",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"markdown-it": "^12.0.0",
|
|
88
88
|
"moment": "^2.27.0",
|
|
89
89
|
"moment-timezone": "^0.5.31",
|
|
90
|
-
"my-orders-tickets-widget": "1.0.
|
|
90
|
+
"my-orders-tickets-widget": "1.0.3",
|
|
91
91
|
"object.assign": "^4.1.5",
|
|
92
|
-
"openstack-uicore-foundation": "4.2.
|
|
92
|
+
"openstack-uicore-foundation": "4.2.16",
|
|
93
93
|
"path-browserify": "^1.0.1",
|
|
94
94
|
"prop-types": "^15.6.0",
|
|
95
95
|
"react": "^18.2.0",
|
|
@@ -10,6 +10,8 @@ import {RELOAD_SCHED_DATA, RELOAD_USER_PROFILE} from "./schedule-actions";
|
|
|
10
10
|
|
|
11
11
|
import {RESET_STATE, SYNC_DATA, GET_THIRD_PARTY_PROVIDERS, UPDATE_LAST_CHECK_FOR_NOVELTIES } from './base-actions-definitions';
|
|
12
12
|
|
|
13
|
+
import { getEnvVariableAsQueryParam, TENANT_ID } from "../utils/envVariables";
|
|
14
|
+
|
|
13
15
|
export const resetState = () => (dispatch) => {
|
|
14
16
|
dispatch(createAction(RESET_STATE)({}));
|
|
15
17
|
};
|
|
@@ -58,7 +60,7 @@ export const getThirdPartyProviders = () => (dispatch) => {
|
|
|
58
60
|
return getRequest(
|
|
59
61
|
null,
|
|
60
62
|
createAction(GET_THIRD_PARTY_PROVIDERS),
|
|
61
|
-
`${window.IDP_BASE_URL}/oauth2/.well-known/openid-configuration`,
|
|
63
|
+
`${window.IDP_BASE_URL}/oauth2/.well-known/openid-configuration${getEnvVariableAsQueryParam(TENANT_ID, "tenant")}`,
|
|
62
64
|
customErrorHandler
|
|
63
65
|
)({})(dispatch).then(payload => {
|
|
64
66
|
dispatch(stopLoading());
|
|
@@ -18,7 +18,9 @@ import {
|
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
20
|
getEnvVariable,
|
|
21
|
-
|
|
21
|
+
getEnvVariableAsQueryParam,
|
|
22
|
+
IDP_BASE_URL,
|
|
23
|
+
TENANT_ID
|
|
22
24
|
} from "@utils/envVariables";
|
|
23
25
|
|
|
24
26
|
import { mapObjectToSelectOptions } from "../../../utils";
|
|
@@ -221,7 +223,7 @@ const siteSettings = {
|
|
|
221
223
|
widget: "identityProviderParam",
|
|
222
224
|
label: "Provider Param",
|
|
223
225
|
name: "providerParam",
|
|
224
|
-
endpoint: `${getEnvVariable(IDP_BASE_URL)}/oauth2/.well-known/openid-configuration`,
|
|
226
|
+
endpoint: `${getEnvVariable(IDP_BASE_URL)}/oauth2/.well-known/openid-configuration${getEnvVariableAsQueryParam(TENANT_ID, "tenant")}`,
|
|
225
227
|
required: false
|
|
226
228
|
},
|
|
227
229
|
imageField({
|
|
@@ -20,6 +20,7 @@ import { getDefaultLocation, validateIdentityProviderButtons } from "@utils/logi
|
|
|
20
20
|
import { userHasAccessLevel, VIRTUAL_ACCESS_LEVEL } from "@utils/authorizedGroups";
|
|
21
21
|
import useSiteSettings from "@utils/useSiteSettings";
|
|
22
22
|
import { PHASES } from "@utils/phasesUtils";
|
|
23
|
+
import { getEnvVariable, TENANT_ID } from "@utils/envVariables";
|
|
23
24
|
|
|
24
25
|
import styles from "../styles/auth-component.module.scss";
|
|
25
26
|
|
|
@@ -81,7 +82,7 @@ const AuthComponent = ({
|
|
|
81
82
|
};
|
|
82
83
|
|
|
83
84
|
const onClickLogin = (provider) => {
|
|
84
|
-
doLogin(getBackURL(), provider, null, initialEmailValue || null);
|
|
85
|
+
doLogin(getBackURL(), provider, null, initialEmailValue || null, null, getEnvVariable(TENANT_ID));
|
|
85
86
|
};
|
|
86
87
|
|
|
87
88
|
const handleClosePopup = () => {
|
|
@@ -24,7 +24,7 @@ import "summit-registration-lite/dist/index.css";
|
|
|
24
24
|
import useSiteSettings from "@utils/useSiteSettings";
|
|
25
25
|
import usePaymentSettings from "@utils/usePaymentSettings";
|
|
26
26
|
import useMarketingSettings, { MARKETING_SETTINGS_KEYS } from "@utils/useMarketingSettings";
|
|
27
|
-
import { getEnvVariable, SUMMIT_API_BASE_URL, OAUTH2_CLIENT_ID, REGISTRATION_BASE_URL, SUPPORT_EMAIL } from "@utils/envVariables";
|
|
27
|
+
import { getEnvVariable, SUMMIT_API_BASE_URL, OAUTH2_CLIENT_ID, REGISTRATION_BASE_URL, SUPPORT_EMAIL, TENANT_ID } from "@utils/envVariables";
|
|
28
28
|
import { userHasAccessLevel, VIRTUAL_ACCESS_LEVEL } from "@utils/authorizedGroups";
|
|
29
29
|
import { validateIdentityProviderButtons } from "@utils/loginUtils";
|
|
30
30
|
import { triggerTagManagerTrackEvent } from "@utils/eventTriggers";
|
|
@@ -83,7 +83,7 @@ const RegistrationLiteComponent = ({
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const onClickLogin = (provider) => {
|
|
86
|
-
doLogin(getBackURL(), provider);
|
|
86
|
+
doLogin(getBackURL(), provider, null, null, null, getEnvVariable(TENANT_ID));
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
const handleCompanyError = () => {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import URI from "urijs"
|
|
14
14
|
import React from 'react'
|
|
15
15
|
import {connect} from "react-redux";
|
|
16
|
+
import { getEnvVariable, TENANT_ID } from "@utils/envVariables";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* class LogInCallbackRoute
|
|
@@ -47,7 +48,7 @@ class LogInCallbackRoute extends React.Component {
|
|
|
47
48
|
otpLoginHint = encodeURI(query["otp_login_hint"]);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
doLogin(backUrl, loginHint, otpLoginHint);
|
|
51
|
+
doLogin(backUrl, loginHint, otpLoginHint, null, null, getEnvVariable(TENANT_ID));
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
|
|
@@ -7,6 +7,7 @@ import { handleResetReducers } from "../actions/event-actions";
|
|
|
7
7
|
import Interstitial from "../components/Interstitial";
|
|
8
8
|
import { userHasAccessLevel, VIRTUAL_ACCESS_LEVEL } from "@utils/authorizedGroups";
|
|
9
9
|
import { getDefaultLocation } from "@utils/loginUtils";
|
|
10
|
+
import { getEnvVariable, TENANT_ID } from "@utils/envVariables";
|
|
10
11
|
|
|
11
12
|
export const TokenExpirePageTemplate = class extends React.Component {
|
|
12
13
|
|
|
@@ -27,7 +28,7 @@ export const TokenExpirePageTemplate = class extends React.Component {
|
|
|
27
28
|
|
|
28
29
|
setTimeout(() => {
|
|
29
30
|
handleResetReducers();
|
|
30
|
-
doLogin(backUrl);
|
|
31
|
+
doLogin(backUrl, null, null, null, null, getEnvVariable(TENANT_ID));
|
|
31
32
|
}, 1500);
|
|
32
33
|
}
|
|
33
34
|
}
|
package/src/utils/alerts.js
CHANGED
|
@@ -2,6 +2,7 @@ import Swal from "sweetalert2";
|
|
|
2
2
|
import { doLogin } from 'openstack-uicore-foundation/lib/security/methods'
|
|
3
3
|
import URI from "urijs"
|
|
4
4
|
import { savePendingAction } from "./schedule";
|
|
5
|
+
import { getEnvVariable, TENANT_ID } from "@utils/envVariables";
|
|
5
6
|
|
|
6
7
|
export const alertPopup = (title, html, confirmLabel, confirmAction, cancelLabel = 'Dismiss') => {
|
|
7
8
|
Swal.fire({
|
|
@@ -38,7 +39,7 @@ export const needsLogin = (action, msg = null) => {
|
|
|
38
39
|
let backUrl = window?.location?.href ?? '/a';
|
|
39
40
|
let encodedBackUrl = URI.encode(backUrl);
|
|
40
41
|
if (action) savePendingAction(action);
|
|
41
|
-
return doLogin(encodedBackUrl);
|
|
42
|
+
return doLogin(encodedBackUrl, null, null, null, null, getEnvVariable(TENANT_ID));
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
alertPopup('Login', msg || defaultMessage, 'Login', login, 'OK');
|
|
@@ -27,6 +27,7 @@ export const TIMEINTERVALSINCE1970_API_URL = "TIMEINTERVALSINCE1970_API_URL";
|
|
|
27
27
|
export const ABLY_API_KEY = "ABLY_API_KEY";
|
|
28
28
|
export const GOOGLE_TAGMANAGER_ID = "GOOGLE_TAGMANAGER_ID";
|
|
29
29
|
export const HASH_SANITIZE_TOKENS = "HASH_SANITIZE_TOKENS";
|
|
30
|
+
export const TENANT_ID = "TENANT_ID";
|
|
30
31
|
|
|
31
32
|
const processEnv = {
|
|
32
33
|
/**
|
|
@@ -64,7 +65,8 @@ const processEnv = {
|
|
|
64
65
|
TIMEINTERVALSINCE1970_API_URL: process.env.GATSBY_TIMEINTERVALSINCE1970_API_URL,
|
|
65
66
|
ABLY_API_KEY: process.env.GATSBY_ABLY_API_KEY,
|
|
66
67
|
GOOGLE_TAGMANAGER_ID: process.env.GATSBY_GOOGLE_TAGMANAGER_ID,
|
|
67
|
-
HASH_SANITIZE_TOKENS: process.env.GATSBY_HASH_SANITIZE_TOKENS
|
|
68
|
+
HASH_SANITIZE_TOKENS: process.env.GATSBY_HASH_SANITIZE_TOKENS,
|
|
69
|
+
TENANT_ID: process.env.GATSBY_TENANT_ID
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
export const getEnvVariable = (name) => {
|
|
@@ -75,6 +77,10 @@ export const getEnvVariable = (name) => {
|
|
|
75
77
|
return res;
|
|
76
78
|
}
|
|
77
79
|
|
|
80
|
+
export const getEnvVariableAsQueryParam = (env, param) => {
|
|
81
|
+
return `${getEnvVariable(env) ? `?${param}=${getEnvVariable(env)}` : ""}`;
|
|
82
|
+
}
|
|
83
|
+
|
|
78
84
|
if (typeof window === "object") {
|
|
79
85
|
window.SITE_URL = processEnv[SITE_URL];
|
|
80
86
|
window.OAUTH2_FLOW = processEnv[OAUTH2_FLOW];
|
|
@@ -62,6 +62,11 @@ const withRealTimeUpdates = WrappedComponent => {
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
getCurrentLocation() {
|
|
66
|
+
const { location } = this.props;
|
|
67
|
+
return location?.pathname || '';
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
/**
|
|
66
71
|
*
|
|
67
72
|
* @param updates
|
|
@@ -92,6 +97,7 @@ const withRealTimeUpdates = WrappedComponent => {
|
|
|
92
97
|
allIDXEvents: JSON.stringify(allIDXEvents),
|
|
93
98
|
allSpeakers: JSON.stringify(allSpeakers),
|
|
94
99
|
allIDXSpeakers: JSON.stringify(allIDXSpeakers),
|
|
100
|
+
currentLocation: this.getCurrentLocation()
|
|
95
101
|
});
|
|
96
102
|
|
|
97
103
|
this._worker.onmessage = ({
|
|
@@ -104,6 +104,13 @@ class ActivitySynchStrategy extends AbstractSynchStrategy{
|
|
|
104
104
|
if (entity?.moderator) this._upsertSpeaker(entity.moderator);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/** only fetch streaming info based on event detail page */
|
|
108
|
+
_shouldFetchStreamingInfo(currentLocation) {
|
|
109
|
+
if (!currentLocation) return false;
|
|
110
|
+
const streamingPages = ['/a/event/'];
|
|
111
|
+
return streamingPages.some(page => currentLocation.includes(page));
|
|
112
|
+
}
|
|
113
|
+
|
|
107
114
|
async _handleUpsert(entity, payload, eventsData) {
|
|
108
115
|
console.log("ActivitySynchStrategy::process upsert", { id: entity?.id });
|
|
109
116
|
|
|
@@ -155,6 +162,11 @@ class ActivitySynchStrategy extends AbstractSynchStrategy{
|
|
|
155
162
|
case 'INSERT':
|
|
156
163
|
case 'UPDATE':{
|
|
157
164
|
let entity = await fetchEventById(this.summit.id, entity_id, this.accessToken);
|
|
165
|
+
if(this.accessToken && this._shouldFetchStreamingInfo(this.currentLocation)) {
|
|
166
|
+
const streaming_info = await fetchStreamingInfoByEventId(this.summit.id, entity_id, this.accessToken);
|
|
167
|
+
if(streaming_info) entity = {...entity, ...streaming_info};
|
|
168
|
+
}
|
|
169
|
+
|
|
158
170
|
if(!entity){
|
|
159
171
|
// was deleted ( un - published)
|
|
160
172
|
return this._handleDeleteOrUnpublish(entity_id, payload, eventsData);
|
|
@@ -18,12 +18,13 @@ class SynchStrategyFactory {
|
|
|
18
18
|
* @param allIDXSpeakers
|
|
19
19
|
* @param accessToken
|
|
20
20
|
* @param payload
|
|
21
|
+
* @param currentLocation
|
|
21
22
|
* @returns {null|*}
|
|
22
23
|
*/
|
|
23
|
-
static build(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken, payload) {
|
|
24
|
+
static build(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken, payload, currentLocation) {
|
|
24
25
|
const {entity_type} = payload;
|
|
25
26
|
if (isSummitEventDataUpdate(entity_type)) {
|
|
26
|
-
return new ActivitySynchStrategy(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken);
|
|
27
|
+
return new ActivitySynchStrategy(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken, currentLocation);
|
|
27
28
|
}
|
|
28
29
|
if (isSummitEventTypeDataUpdate(entity_type)) {
|
|
29
30
|
return new ActivityTypeSynchStrategy(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken);
|
|
@@ -8,6 +8,7 @@ let localAllIDXEvents = null;
|
|
|
8
8
|
let localAllSpeakers = null;
|
|
9
9
|
let localAllIDXSpeakers = null;
|
|
10
10
|
let currentAccessToken = null;
|
|
11
|
+
let currentLocation = '';
|
|
11
12
|
|
|
12
13
|
// Dedup/backpressure pool: key -> { payload, seq }
|
|
13
14
|
const pool = new Map();
|
|
@@ -68,6 +69,7 @@ self.onmessage = (e) => {
|
|
|
68
69
|
allIDXEvents,
|
|
69
70
|
allSpeakers,
|
|
70
71
|
allIDXSpeakers,
|
|
72
|
+
currentLocation: location
|
|
71
73
|
} = e.data || {};
|
|
72
74
|
|
|
73
75
|
// Initialize persistent state once
|
|
@@ -77,6 +79,8 @@ self.onmessage = (e) => {
|
|
|
77
79
|
if (localAllSpeakers === null) localAllSpeakers = maybeParseJSON(allSpeakers);
|
|
78
80
|
if (localAllIDXSpeakers === null) localAllIDXSpeakers = maybeParseJSON(allIDXSpeakers);
|
|
79
81
|
|
|
82
|
+
currentLocation = location ?? currentLocation;
|
|
83
|
+
|
|
80
84
|
currentAccessToken = accessToken ?? currentAccessToken;
|
|
81
85
|
|
|
82
86
|
// Coalesce incoming payloads into the pool (backpressure)
|
|
@@ -150,7 +154,8 @@ async function runBatch(batch) {
|
|
|
150
154
|
localAllSpeakers,
|
|
151
155
|
localAllIDXSpeakers,
|
|
152
156
|
currentAccessToken,
|
|
153
|
-
payload
|
|
157
|
+
payload,
|
|
158
|
+
currentLocation
|
|
154
159
|
);
|
|
155
160
|
|
|
156
161
|
lastPayload = payload;
|