@openstack_dev/gatsby-theme-marketing-oif-core 1.0.0

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.
Files changed (93) hide show
  1. package/.eslintrc.json +27 -0
  2. package/.github/workflows/eslint.yml +15 -0
  3. package/.husky/pre-commit +4 -0
  4. package/.nvmrc +1 -0
  5. package/LICENSE.md +201 -0
  6. package/README.md +10 -0
  7. package/babel.config.json +12 -0
  8. package/gatsby-browser.js +5 -0
  9. package/gatsby-config.js +217 -0
  10. package/gatsby-node.js +162 -0
  11. package/gatsby-ssr.js +50 -0
  12. package/package.json +154 -0
  13. package/src/cms/cms-utils.js +8 -0
  14. package/src/cms/cms.js +12 -0
  15. package/src/cms/config/collections/configurationsCollection/announcementBanner/index.js +59 -0
  16. package/src/cms/config/collections/configurationsCollection/announcementBanner/typeDefs.js +11 -0
  17. package/src/cms/config/collections/configurationsCollection/footer/index.js +158 -0
  18. package/src/cms/config/collections/configurationsCollection/footer/typeDefs.js +37 -0
  19. package/src/cms/config/collections/configurationsCollection/index.js +16 -0
  20. package/src/cms/config/collections/configurationsCollection/navbar/index.js +62 -0
  21. package/src/cms/config/collections/configurationsCollection/navbar/typeDefs.js +13 -0
  22. package/src/cms/config/collections/configurationsCollection/siteSettings/index.js +117 -0
  23. package/src/cms/config/collections/configurationsCollection/siteSettings/typeDefs.js +15 -0
  24. package/src/cms/config/collections/configurationsCollection/typeDefs.js +9 -0
  25. package/src/cms/config/collections/typeDefs.js +5 -0
  26. package/src/cms/config/fields.js +268 -0
  27. package/src/cms/config/index.js +35 -0
  28. package/src/cms/config/patterns.js +51 -0
  29. package/src/cms/preview-templates/.gitkeep +0 -0
  30. package/src/cms/widgets/.gitkeep +0 -0
  31. package/src/components/AnnouncementBanner/index.js +26 -0
  32. package/src/components/AnnouncementBanner/index.module.scss +131 -0
  33. package/src/components/AnnouncementBanner/template.js +40 -0
  34. package/src/components/Footer/index.js +40 -0
  35. package/src/components/Footer/index.module.scss +59 -0
  36. package/src/components/Footer/template.js +55 -0
  37. package/src/components/Header/index.js +8 -0
  38. package/src/components/Header/template.js +5 -0
  39. package/src/components/Layout.js +32 -0
  40. package/src/components/Link.js +41 -0
  41. package/src/components/Navbar/index.js +460 -0
  42. package/src/components/Navbar/index.module.scss +301 -0
  43. package/src/components/SponsoredProjectsNav/index.js +22 -0
  44. package/src/components/SponsoredProjectsNav/index.module.scss +7 -0
  45. package/src/components/SubscribeForm/index.js +47 -0
  46. package/src/components/SubscribeForm/index.module.scss +114 -0
  47. package/src/components/Tracking/custom-bing-tracker.js +5 -0
  48. package/src/components/Tracking/custom-google-tracker.js +51 -0
  49. package/src/components/head-components.js +20 -0
  50. package/src/components/svgs/RightArrow.jsx +9 -0
  51. package/src/content/announcement-banner/OpenInfrastructureFoundation-icon-RGB.svg +1 -0
  52. package/src/content/announcement-banner/index.json +8 -0
  53. package/src/content/footer/index.json +139 -0
  54. package/src/content/navbar/index.json +304 -0
  55. package/src/content/site-settings/index.json +1 -0
  56. package/src/images/icon.png +0 -0
  57. package/src/images/openstack-logo-full.svg +57 -0
  58. package/src/images/openstack-logo-vert.svg +57 -0
  59. package/src/images/right-arrow.svg +3 -0
  60. package/src/pages/404.js +49 -0
  61. package/src/pages/auth/[...].js +36 -0
  62. package/src/pages/index.js +14 -0
  63. package/src/reducers/.gitkeep +0 -0
  64. package/src/reducers/index.js +5 -0
  65. package/src/routes/.gitkeep +0 -0
  66. package/src/routes/authorization-callback-route.js +71 -0
  67. package/src/routes/login-callback-route.js +62 -0
  68. package/src/routes/logout-callback-route.js +72 -0
  69. package/src/state/.gitkeep +0 -0
  70. package/src/state/ReduxWrapper.js +29 -0
  71. package/src/state/storage.js +21 -0
  72. package/src/state/store.js +43 -0
  73. package/src/templates/.gitkeep +0 -0
  74. package/src/theme.js +36 -0
  75. package/src/utils/cacheUtils.js +48 -0
  76. package/src/utils/cssUtils.js +62 -0
  77. package/src/utils/envVariables.js +52 -0
  78. package/src/utils/expiredToken.js +15 -0
  79. package/src/utils/filePath.js +95 -0
  80. package/static/admin/admin.css +3 -0
  81. package/static/fonts/fonts.css +65 -0
  82. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300.woff +0 -0
  83. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300.woff2 +0 -0
  84. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300italic.woff +0 -0
  85. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300italic.woff2 +0 -0
  86. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600.woff +0 -0
  87. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600.woff2 +0 -0
  88. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600italic.woff +0 -0
  89. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600italic.woff2 +0 -0
  90. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700.woff +0 -0
  91. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700.woff2 +0 -0
  92. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700italic.woff +0 -0
  93. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700italic.woff2 +0 -0
File without changes
@@ -0,0 +1,5 @@
1
+ import { loggedUserReducer } from "openstack-uicore-foundation/lib/security/reducers";
2
+
3
+ export {
4
+ loggedUserReducer,
5
+ };
File without changes
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Copyright 2017 OpenStack Foundation
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ * */
13
+
14
+ import React from "react";
15
+ import { navigate } from "gatsby";
16
+ import { Redirect } from "@gatsbyjs/reach-router";
17
+ import {
18
+ getEnvVariable,
19
+ IDP_BASE_URL,
20
+ OAUTH2_CLIENT_ID,
21
+ } from "@utils/envVariables";
22
+ import AbstractAuthorizationCallbackRoute from "openstack-uicore-foundation/lib/security/abstract-auth-callback-route";
23
+ import { connect } from "react-redux";
24
+
25
+ class AuthorizationCallbackRoute extends AbstractAuthorizationCallbackRoute {
26
+ constructor(props) {
27
+ super(
28
+ getEnvVariable(IDP_BASE_URL),
29
+ getEnvVariable(OAUTH2_CLIENT_ID),
30
+ props,
31
+ );
32
+ }
33
+
34
+ _callback(backUrl) {
35
+ let localBackUrl = backUrl;
36
+ if (!localBackUrl) localBackUrl = "/";
37
+ this.props.getUserInfo("groups").then(() => {
38
+ navigate(localBackUrl);
39
+ });
40
+ }
41
+
42
+ _redirect2Error(error) {
43
+ console.log(`AuthorizationCallbackRoute error ${error}`);
44
+ if (error.includes("access_denied") || error.includes("consent_required")) return <Redirect to="/" noThrow />;
45
+ return <Redirect to={`/error?error=${error}`} noThrow />;
46
+ }
47
+
48
+ render() {
49
+ // reimplements same render as defined in abstract class
50
+ // but modifies the return (if no errors) to improve UX
51
+ // re: https://github.com/OpenStackweb/openstack-uicore-foundation/blob/cf8337911dcbb9d71bef3624c45256039e6447a0/src/components/security/abstract-auth-callback-route.js#L139
52
+ const { id_token_is_valid, error } = this.state;
53
+
54
+ if (error != null) {
55
+ console.log(
56
+ `AbstractAuthorizationCallbackRoute::render _redirect2Error error ${error}`,
57
+ );
58
+ return this._redirect2Error(error);
59
+ }
60
+
61
+ if (!id_token_is_valid) {
62
+ return this._redirect2Error("token_validation_error");
63
+ }
64
+
65
+ return <p>Checking Credentials...</p>;
66
+ }
67
+ }
68
+
69
+ const mapStateToProps = () => ({});
70
+
71
+ export default connect(mapStateToProps, {})(AuthorizationCallbackRoute);
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright 2023 OpenStack Foundation
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ **/
13
+ import URI from "urijs"
14
+ import React from 'react'
15
+ import {connect} from "react-redux";
16
+
17
+ /**
18
+ * class LogInCallbackRoute
19
+ */
20
+ class LogInCallbackRoute extends React.Component {
21
+
22
+
23
+ constructor(props) {
24
+ super(props);
25
+
26
+ this.state = {
27
+ error: null
28
+ };
29
+ }
30
+
31
+ componentWillMount() {
32
+ const {doLogin, location} = this.props;
33
+ const query = URI.parseQuery(location.search);
34
+ let loginHint = null;
35
+ let otpLoginHint = null;
36
+ let backUrl = '/';
37
+
38
+ if (query["login_hint"]) {
39
+ loginHint = encodeURI(query["login_hint"]);
40
+ }
41
+
42
+ if (query["backUrl"]) {
43
+ backUrl = encodeURI(query["backUrl"]);
44
+ }
45
+
46
+ if (query["otp_login_hint"]) {
47
+ otpLoginHint = encodeURI(query["otp_login_hint"]);
48
+ }
49
+
50
+ doLogin(backUrl, loginHint, otpLoginHint);
51
+ }
52
+
53
+
54
+ render() {
55
+ if (this.state.error != null) {
56
+ return (<p>{this.state.error}</p>)
57
+ }
58
+ return null;
59
+ }
60
+ }
61
+
62
+ export default connect(null)(LogInCallbackRoute);
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Copyright 2020
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ **/
13
+ import React from 'react';
14
+ import { connect } from 'react-redux';
15
+ import { navigate } from "gatsby"
16
+ import { Redirect } from "@gatsbyjs/reach-router";
17
+ import URI from "urijs"
18
+ import { initLogOut } from 'openstack-uicore-foundation/lib/security/methods'
19
+ import { doLogout } from 'openstack-uicore-foundation/lib/security/actions'
20
+ import { getFromLocalStorage } from 'openstack-uicore-foundation/lib/utils/methods'
21
+
22
+ export class LogOutCallbackRoute extends React.Component {
23
+
24
+ constructor(props) {
25
+ super(props);
26
+
27
+ // initial state
28
+ this.state = {
29
+ error: null,
30
+ error_description: null,
31
+ };
32
+ }
33
+
34
+ componentDidMount() {
35
+ let {location} = this.props;
36
+
37
+ let postLogoutState = getFromLocalStorage('post_logout_state', true);
38
+ if (postLogoutState) {
39
+ // if we have the nonce we alredy start a logout process
40
+ let query = URI.parseQuery(location.search);
41
+ // compare the state and perform the final logout
42
+ if (query.hasOwnProperty("state") && query["state"] === postLogoutState) {
43
+ this.props.doLogout();
44
+ let backUrl = getFromLocalStorage('post_logout_redirect_path', true);
45
+ navigate(backUrl ? backUrl : '/');
46
+ return;
47
+ }
48
+ // error
49
+ this.setState({...this.state, error: 'Invalid Nonce', error_description:'There was an error on logout process. Please try again.'})
50
+ return;
51
+ }
52
+ // starts logout process
53
+ let backUrl = location.state?.backUrl ? location.state.backUrl : '/';
54
+ window.localStorage.setItem('post_logout_redirect_path', backUrl);
55
+ initLogOut();
56
+ }
57
+
58
+ render() {
59
+ let { error, error_description } = this.state;
60
+ if(error){
61
+ return <Redirect to={`/error?error=${error}&error_description=${error_description}`} noThrow/>;
62
+ }
63
+ return null;
64
+ }
65
+ }
66
+
67
+ export default connect(
68
+ null,
69
+ {
70
+ doLogout
71
+ }
72
+ )(LogOutCallbackRoute)
File without changes
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { Provider } from "react-redux";
3
+ import { PersistGate } from "redux-persist/integration/react";
4
+ import { store, persistor } from "./store";
5
+ import { ThemeProvider } from "@mui/material/styles";
6
+ import CssBaseline from "@mui/material/CssBaseline";
7
+ import theme from "../theme";
8
+
9
+ const onBeforeLift = () => {
10
+ const params = new URLSearchParams(window.location.search);
11
+ const flush = params.has("flushState");
12
+
13
+ if (flush) {
14
+ //store.dispatch({ type: RESET_STATE, payload: null });
15
+ }
16
+ };
17
+
18
+ const ReduxWrapper = ({ element }) => (
19
+ <Provider store={store}>
20
+ <PersistGate onBeforeLift={onBeforeLift} persistor={persistor}>
21
+ <ThemeProvider theme={theme}>
22
+ <CssBaseline />
23
+ {element}
24
+ </ThemeProvider>
25
+ </PersistGate>
26
+ </Provider>
27
+ );
28
+
29
+ export default ReduxWrapper;
@@ -0,0 +1,21 @@
1
+ import createWebStorage from "redux-persist/lib/storage/createWebStorage";
2
+ // create a mock storage for SSR
3
+ const createNoopStorage = () => {
4
+ return {
5
+ getItem(_key) {
6
+ return Promise.resolve(null);
7
+ },
8
+ setItem(_key, value) {
9
+ return Promise.resolve(value);
10
+ },
11
+ removeItem(_key) {
12
+ return Promise.resolve();
13
+ },
14
+ };
15
+ };
16
+
17
+ // and set the proper storege depending if we are in browser side or SSR side
18
+ // because you cannot create the local storage in Node.js
19
+ const storage = typeof window !== "undefined" ? createWebStorage("local") : createNoopStorage();
20
+
21
+ export default storage;
@@ -0,0 +1,43 @@
1
+ import { applyMiddleware, compose, createStore } from "redux";
2
+ import { persistCombineReducers, persistStore } from "redux-persist";
3
+ import storage from "./storage";
4
+ import thunk from "redux-thunk";
5
+
6
+ import * as reducers from "../reducers";
7
+
8
+ // Get from process.env because window is not set yet
9
+ const clientId = process.env.GATSBY_OAUTH2_CLIENT_ID;
10
+
11
+ const config = {
12
+ key: `root_${clientId}`,
13
+ storage,
14
+ blacklist: [
15
+ // this will be not saved to persistent storage see
16
+ // https://github.com/rt2zz/redux-persist#blacklist--whitelist
17
+ ],
18
+ };
19
+
20
+ const states = {
21
+ loggedUserState: reducers.loggedUserReducer,
22
+ };
23
+
24
+ const appendLoggedUser = ({ getState }) => (next) => (action) => {
25
+ return next(action);
26
+ };
27
+
28
+ const composeEnhancers = typeof window === "object" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
29
+ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
30
+ : compose;
31
+
32
+ const enhancer = composeEnhancers(applyMiddleware(appendLoggedUser, thunk));
33
+
34
+ // Create store with persistor
35
+ export const { store, persistor } = (() => {
36
+ const persistedReducers = persistCombineReducers(config, states);
37
+
38
+ const store = createStore(persistedReducers, enhancer);
39
+ const onRehydrateComplete = () => {};
40
+ const persistor = persistStore(store, null, onRehydrateComplete);
41
+
42
+ return { store, persistor };
43
+ })();
File without changes
package/src/theme.js ADDED
@@ -0,0 +1,36 @@
1
+ import { createTheme } from "@mui/material/styles";
2
+ import darkScrollbar from "@mui/material/darkScrollbar";
3
+
4
+ // create breakpoints in intermediate theme
5
+ let theme = createTheme({
6
+ breakpoints: {
7
+ values: {
8
+ xs: 0,
9
+ sm: 320,
10
+ md: 768,
11
+ lg: 1024,
12
+ xl: 1280,
13
+ }
14
+ }
15
+ });
16
+
17
+ // use breakpoints on theme creation
18
+ theme = createTheme(theme, {
19
+ components: {
20
+ MuiCssBaseline: {
21
+ styleOverrides: {
22
+ body: {
23
+ ...darkScrollbar(),
24
+ margin: 0,
25
+ padding: 0,
26
+ border: 0,
27
+ fontSize: "100%",
28
+ verticalAlign: "baseline",
29
+ fontFamily: "\"Open Sans\", Helvetica, Arial, sans-serif",
30
+ }
31
+ }
32
+ }
33
+ }
34
+ });
35
+
36
+ export default theme;
@@ -0,0 +1,48 @@
1
+ /**
2
+ *
3
+ * @param bucket
4
+ * @param key
5
+ * @param value
6
+ * @param isJson
7
+ * @param options
8
+ * @returns {Promise<void>}
9
+ */
10
+ export const putOnCache = async (bucket, key, value, isJson = false, options = {}) => {
11
+ if(typeof caches !== 'undefined') {
12
+ const cache = await caches.open(bucket);
13
+ const response = new Response(isJson ? JSON.stringify(value) : value, options);
14
+ await cache.put(`/${key}.json`, response);
15
+ }
16
+ }
17
+
18
+ /**
19
+ * @param bucket
20
+ * @param key
21
+ * @param isJson
22
+ * @returns {Promise<any|string>}
23
+ */
24
+ export const getFromCache = async (bucket, key, isJson = false) => {
25
+ if(typeof caches !== 'undefined') {
26
+ const cache = await caches.open(bucket);
27
+ const item = await cache.match(`/${key}.json`);
28
+ if (!item) return null;
29
+ const data = isJson ? await item.json() : await item.text();
30
+ return data;
31
+ }
32
+ return null;
33
+ }
34
+
35
+ /**
36
+ * @param bucket
37
+ * @param key
38
+ * @returns {Promise<null|boolean>}
39
+ */
40
+ export const deleteFromCache = async (bucket, key) => {
41
+ if(typeof caches !== 'undefined') {
42
+ caches.open(bucket).then((cache) => {
43
+ cache.delete(`/${key}.json`).then((response) => {
44
+ return true;
45
+ });
46
+ });
47
+ }
48
+ }
@@ -0,0 +1,62 @@
1
+ const getFontFormat = (format) => {
2
+ const formatMap = {
3
+ "ttf": "format(\"truetype\")",
4
+ "otf": "format(\"opentype\")",
5
+ "woff": "format(\"woff\")",
6
+ "woff2": "format(\"woff2\")",
7
+ };
8
+ return formatMap[format] || "";
9
+ };
10
+
11
+ const getFontSrc = (fontPath) => fontPath.replace(/^\/static/, "");
12
+
13
+ const generateFontFace = (fontFamily, fontData, fontWeight) => {
14
+ if (!fontFamily || !fontData || !fontData.fontFile || !fontData.fontFormat) return "";
15
+
16
+ const { fontFile, fontFormat } = fontData;
17
+ return `@font-face {
18
+ font-family: "${fontFamily}";
19
+ src: url("${getFontSrc(fontFile)}") ${getFontFormat(fontFormat)};
20
+ font-weight: ${fontWeight};
21
+ }`;
22
+ };
23
+
24
+ const generateFontFile = (fontsData) => {
25
+ if (!fontsData || !fontsData.fontFamily || !fontsData.regularFont || !fontsData.boldFont) return null;
26
+
27
+ const { fontFamily, regularFont, boldFont } = fontsData;
28
+
29
+ if (!regularFont.fontFile || !regularFont.fontFormat) return null;
30
+ if (!boldFont.fontFile || !boldFont.fontFormat) return null;
31
+
32
+ const regularFontFace = generateFontFace(fontFamily, regularFont, "normal");
33
+ const boldFontFace = generateFontFace(fontFamily, boldFont, "bold");
34
+
35
+ return `$font-family: "${fontFamily}";
36
+
37
+ :root {
38
+ --font_family: "${fontFamily}" !important;
39
+ }
40
+
41
+ ${regularFontFace}
42
+ ${boldFontFace}
43
+
44
+ %font-regular {
45
+ font-family: var(--font_family);
46
+ font-weight: 400;
47
+ }
48
+
49
+ %font-semi {
50
+ font-family: var(--font_family);
51
+ font-weight: 600;
52
+ }
53
+
54
+ %font-bold {
55
+ font-family: var(--font_family);
56
+ font-weight: 700;
57
+ }`;
58
+ };
59
+
60
+ module.exports = {
61
+ generateFontFile
62
+ };
@@ -0,0 +1,52 @@
1
+ export const SITE_URL = "SITE_URL";
2
+ export const IDP_BASE_URL = "IDP_BASE_URL";
3
+ export const OAUTH2_CODE = "OAUTH2_CODE";
4
+ export const OAUTH2_CLIENT_ID = "OAUTH2_CLIENT_ID";
5
+ export const SCOPES = "SCOPES";
6
+ export const SUPPORT_EMAIL = "SUPPORT_EMAIL";
7
+ export const SEARCH_WIDGET_BASE_URL = "SEARCH_WIDGET_BASE_URL";
8
+ export const OAUTH2_FLOW = "OAUTH2_FLOW";
9
+ export const API_BASE_URL = "API_BASE_URL";
10
+ export const SUMMIT_API_BASE_URL = "SUMMIT_API_BASE_URL";
11
+
12
+ const processEnv = {
13
+ /**
14
+ * Retrieve the site URL from environment variable set by the deploy provider.
15
+ * See documentation for more details:
16
+ * - Netlify: {@link https://docs.netlify.com/configure-builds/environment-variables/#deploy-urls-and-metadata}
17
+ * - Cloudflare Pages: {@link https://developers.cloudflare.com/pages/platform/build-configuration#environment-variables}
18
+ *
19
+ * If not available, fallback to user-defined GATSBY_SITE_URL env var.
20
+ */
21
+ SITE_URL:
22
+ process.env.GATSBY_URL
23
+ || process.env.GATSBY_CF_PAGES_URL
24
+ || process.env.GATSBY_SITE_URL,
25
+ IDP_BASE_URL: process.env.GATSBY_IDP_BASE_URL,
26
+ OAUTH2_FLOW: process.env.GATSBY_OAUTH2_FLOW,
27
+ OAUTH2_CLIENT_ID: process.env.GATSBY_OAUTH2_CLIENT_ID,
28
+ SCOPES: process.env.GATSBY_SCOPES,
29
+ SUPPORT_EMAIL: process.env.GATSBY_SUPPORT_EMAIL,
30
+ SEARCH_WIDGET_BASE_URL: process.env.GATSBY_SEARCH_WIDGET_BASE_URL,
31
+ SUMMIT_API_BASE_URL: process.env.GATSBY_SUMMIT_API_BASE_URL,
32
+ API_BASE_URL: process.env.GATSBY_SUMMIT_API_BASE_URL,
33
+ };
34
+
35
+ export const getEnvVariable = (name) => {
36
+ let res = typeof window === "object" ? window[name] : null;
37
+ if (!res) {
38
+ res = processEnv[name];
39
+ }
40
+ return res;
41
+ };
42
+
43
+ if (typeof window === "object") {
44
+ window.SITE_URL = processEnv[SITE_URL];
45
+ window.OAUTH2_FLOW = processEnv[OAUTH2_FLOW];
46
+ window.OAUTH2_CLIENT_ID = processEnv[OAUTH2_CLIENT_ID];
47
+ window.SCOPES = processEnv[SCOPES];
48
+ window.IDP_BASE_URL = processEnv[IDP_BASE_URL];
49
+ window.SUPPORT_EMAIL = processEnv[SUPPORT_EMAIL];
50
+ window.SUMMIT_API_BASE_URL = processEnv[SUMMIT_API_BASE_URL];
51
+ window.API_BASE_URL = processEnv[API_BASE_URL];
52
+ }
@@ -0,0 +1,15 @@
1
+ import { navigate } from "gatsby";
2
+
3
+ const expiredToken = function (err) {
4
+
5
+ if(typeof window !== 'undefined') {
6
+ let currentLocation = window.location.href;
7
+ return navigate('/auth/expired', {
8
+ state: {
9
+ backUrl: currentLocation,
10
+ },
11
+ });
12
+ }
13
+ }
14
+
15
+ export default expiredToken
@@ -0,0 +1,95 @@
1
+ const DATA_DIR_PATH = "src/data";
2
+ const STATIC_CONTENT_DIR_PATH = "src/content";
3
+ const DEFAULTS_DIR_PATH = "src/defaults";
4
+ const CONTENT_PAGES_DIR_PATH = "src/pages/content-pages";
5
+ const STYLES_DIR_PATH = "src/styles";
6
+ const DEFAULT_COLORS_FILE_PATH = `${DEFAULTS_DIR_PATH}/colors.json`;
7
+ const COLORS_FILE_PATH = `${DATA_DIR_PATH}/colors.json`;
8
+ const SPONSORED_PROJECTS_FILE_PATH = `${DATA_DIR_PATH}/sponsored-projects.json`;
9
+ const COLORS_SASS_FILE_PATH = `${STYLES_DIR_PATH}/colors.scss`
10
+ const FONTS_SCSS_FILE_PATH = `${STYLES_DIR_PATH}/fonts.scss`;
11
+ const SITE_SETTINGS_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/site-settings`;
12
+ const SITE_SETTINGS_FILE_PATH = `${SITE_SETTINGS_DIR_PATH}/index.json`;
13
+ const MARKETING_PAGE_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/marketing-page`;
14
+ const MARKETING_PAGE_FILE_PATH = `${MARKETING_PAGE_DIR_PATH}/index.json`;
15
+ const LOBBY_PAGE_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/lobby-page`;
16
+ const LOBBY_PAGE_FILE_PATH = `${LOBBY_PAGE_DIR_PATH}/index.json`;
17
+ const ADS_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/ads/index.json`;
18
+ const NAVBAR_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/navbar`;
19
+ const NAVBAR_FILE_PATH = `${NAVBAR_DIR_PATH}/index.json`;
20
+ const FOOTER_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/footer`;
21
+ const FOOTER_FILE_PATH = `${FOOTER_DIR_PATH}/index.json`;
22
+ const ANNOUNCEMENT_BANNER_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/announcement-banner/index.json`;
23
+ const POSTER_PAGES_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/posters-pages.json`;
24
+ const SUMMIT_FILE_NAME = `summit.json`
25
+ const SUMMIT_FILE_PATH = `${DATA_DIR_PATH}/${SUMMIT_FILE_NAME}`;
26
+ const EVENTS_FILE_NAME = "events.json";
27
+ const EVENTS_FILE_PATH = `${DATA_DIR_PATH}/${EVENTS_FILE_NAME}`;
28
+ const EVENTS_IDX_FILE_NAME = "events.idx.json";
29
+ const EVENTS_IDX_FILE_PATH = `${DATA_DIR_PATH}/${EVENTS_IDX_FILE_NAME}`;
30
+ const SPEAKERS_FILE_NAME = "speakers.json";
31
+ const SPEAKERS_FILE_PATH = `${DATA_DIR_PATH}/${SPEAKERS_FILE_NAME}`;
32
+ const SPEAKERS_IDX_FILE_NAME = "speakers.idx.json";
33
+ const SPEAKERS_IDX_FILE_PATH = `${DATA_DIR_PATH}/${SPEAKERS_IDX_FILE_NAME}`;
34
+ const VOTEABLE_PRESENTATIONS_FILE_NAME = "voteable-presentations.json";
35
+ const VOTEABLE_PRESENTATIONS_FILE_PATH = `${DATA_DIR_PATH}/${VOTEABLE_PRESENTATIONS_FILE_NAME}`;
36
+ const POSTERS_PAGES_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/posters-pages.json`;
37
+ const MARKETING_SETTINGS_FILE_PATH = `${DATA_DIR_PATH}/marketing-settings.json`;
38
+ const MAINTENANCE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/maintenance.json`;
39
+ const EXPO_HALL_PAGE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/expo-hall-page/index.json`;
40
+ const INVITATIONS_REJECT_PAGE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/invitations-reject-page/index.json`;
41
+ const SPONSORS_FILE_NAME = "sponsors.json";
42
+ const SPONSORS_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/${SPONSORS_FILE_NAME}`;
43
+ const CMS_FONT_FILE_PATH = "/static/fonts/"
44
+ const PAYMENTS_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/payments.json`;
45
+ const APPLE_PAY_DOMAIN_FILE_PATH = `/static/.well-known/`
46
+ const APPLE_PAY_DOMAIN_FILE_NAME = `apple-developer-merchantid-domain-association`;
47
+
48
+ exports.REQUIRED_DIR_PATHS = [
49
+ DATA_DIR_PATH,
50
+ STATIC_CONTENT_DIR_PATH,
51
+ CONTENT_PAGES_DIR_PATH,
52
+ STYLES_DIR_PATH,
53
+ SITE_SETTINGS_DIR_PATH,
54
+ NAVBAR_DIR_PATH,
55
+ FOOTER_DIR_PATH
56
+ ];
57
+
58
+ exports.STATIC_CONTENT_DIR_PATH = STATIC_CONTENT_DIR_PATH;
59
+ exports.DEFAULT_COLORS_FILE_PATH = DEFAULT_COLORS_FILE_PATH;
60
+ exports.COLORS_FILE_PATH = COLORS_FILE_PATH;
61
+ exports.COLORS_SASS_FILE_PATH = COLORS_SASS_FILE_PATH;
62
+ exports.FONTS_SCSS_FILE_PATH = FONTS_SCSS_FILE_PATH;
63
+ exports.SITE_SETTINGS_DIR_PATH = SITE_SETTINGS_DIR_PATH;
64
+ exports.SITE_SETTINGS_FILE_PATH = SITE_SETTINGS_FILE_PATH;
65
+ exports.CONTENT_PAGES_DIR_PATH = CONTENT_PAGES_DIR_PATH;
66
+ exports.MARKETING_PAGE_FILE_PATH = MARKETING_PAGE_FILE_PATH;
67
+ exports.LOBBY_PAGE_FILE_PATH = LOBBY_PAGE_FILE_PATH;
68
+ exports.ADS_FILE_PATH = ADS_FILE_PATH;
69
+ exports.NAVBAR_FILE_PATH = NAVBAR_FILE_PATH;
70
+ exports.FOOTER_FILE_PATH = FOOTER_FILE_PATH;
71
+ exports.ANNOUNCEMENT_BANNER_FILE_PATH = ANNOUNCEMENT_BANNER_FILE_PATH;
72
+ exports.POSTER_PAGES_FILE_PATH = POSTER_PAGES_FILE_PATH;
73
+ exports.SUMMIT_FILE_NAME = SUMMIT_FILE_NAME;
74
+ exports.SUMMIT_FILE_PATH = SUMMIT_FILE_PATH;
75
+ exports.EVENTS_FILE_NAME = EVENTS_FILE_NAME;
76
+ exports.EVENTS_FILE_PATH = EVENTS_FILE_PATH;
77
+ exports.EVENTS_IDX_FILE_NAME = EVENTS_IDX_FILE_NAME;
78
+ exports.EVENTS_IDX_FILE_PATH = EVENTS_IDX_FILE_PATH;
79
+ exports.SPEAKERS_FILE_NAME = SPEAKERS_FILE_NAME;
80
+ exports.SPEAKERS_FILE_PATH = SPEAKERS_FILE_PATH;
81
+ exports.SPEAKERS_IDX_FILE_NAME = SPEAKERS_IDX_FILE_NAME;
82
+ exports.SPEAKERS_IDX_FILE_PATH = SPEAKERS_IDX_FILE_PATH;
83
+ exports.VOTEABLE_PRESENTATIONS_FILE_NAME = VOTEABLE_PRESENTATIONS_FILE_NAME;
84
+ exports.VOTEABLE_PRESENTATIONS_FILE_PATH = VOTEABLE_PRESENTATIONS_FILE_PATH;
85
+ exports.POSTERS_PAGES_FILE_PATH = POSTERS_PAGES_FILE_PATH;
86
+ exports.MARKETING_SETTINGS_FILE_PATH = MARKETING_SETTINGS_FILE_PATH;
87
+ exports.MAINTENANCE_FILE_PATH = MAINTENANCE_FILE_PATH;
88
+ exports.EXPO_HALL_PAGE_FILE_PATH = EXPO_HALL_PAGE_FILE_PATH;
89
+ exports.INVITATIONS_REJECT_PAGE_FILE_PATH = INVITATIONS_REJECT_PAGE_FILE_PATH;
90
+ exports.SPONSORS_FILE_PATH = SPONSORS_FILE_PATH;
91
+ exports.CMS_FONT_FILE_PATH = CMS_FONT_FILE_PATH;
92
+ exports.PAYMENTS_FILE_PATH = PAYMENTS_FILE_PATH;
93
+ exports.APPLE_PAY_DOMAIN_FILE_PATH = APPLE_PAY_DOMAIN_FILE_PATH;
94
+ exports.APPLE_PAY_DOMAIN_FILE_NAME = APPLE_PAY_DOMAIN_FILE_NAME;
95
+ exports.SPONSORED_PROJECTS_FILE_PATH = SPONSORED_PROJECTS_FILE_PATH;
@@ -0,0 +1,3 @@
1
+ [data-slate-editor] {
2
+ -webkit-user-modify: read-write !important;
3
+ }