@openeventkit/event-site 2.0.128-beta.5 → 2.0.129
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 +1 -1
- package/src/actions/clock-actions.js +17 -16
- package/src/actions/security-actions.js +32 -0
- package/src/styles/colors.scss +13 -7
- package/src/styles/fonts.scss +11 -16
- package/src/utils/envVariables.js +2 -0
package/env.template
CHANGED
package/package.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { createAction } from
|
|
1
|
+
import { createAction } from "openstack-uicore-foundation/lib/utils/actions";
|
|
2
|
+
import { PHASES, getSummitPhase, getEventPhase } from "@utils/phasesUtils";
|
|
3
|
+
import { updateVotingPeriodsPhase } from "../actions/presentation-actions";
|
|
4
|
+
import { sanitizeHash } from "../actions/security-actions";
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const EVENT_PHASE_DURING = 'EVENT_PHASE_DURING';
|
|
12
|
-
export const EVENT_PHASE_AFTER = 'EVENT_PHASE_AFTER';
|
|
13
|
-
export const EVENT_PHASE_ADD = 'EVENT_PHASE_ADD';
|
|
14
|
-
export const UPDATE_CLOCK = 'UPDATE_CLOCK';
|
|
6
|
+
export const SUMMIT_PHASE_AFTER = "SUMMIT_PHASE_AFTER";
|
|
7
|
+
export const SUMMIT_PHASE_DURING = "SUMMIT_PHASE_DURING";
|
|
8
|
+
export const SUMMIT_PHASE_BEFORE = "SUMMIT_PHASE_BEFORE";
|
|
9
|
+
export const EVENT_PHASE_BEFORE = "EVENT_PHASE_BEFORE";
|
|
10
|
+
export const EVENT_PHASE_DURING = "EVENT_PHASE_DURING";
|
|
11
|
+
export const EVENT_PHASE_AFTER = "EVENT_PHASE_AFTER";
|
|
12
|
+
export const EVENT_PHASE_ADD = "EVENT_PHASE_ADD";
|
|
13
|
+
export const UPDATE_CLOCK = "UPDATE_CLOCK";
|
|
15
14
|
|
|
16
15
|
export const updateClock = (timestamp) => (dispatch) => {
|
|
17
|
-
|
|
18
16
|
dispatch(createAction(UPDATE_CLOCK)({ timestamp }));
|
|
17
|
+
|
|
19
18
|
dispatch(updateSummitPhase());
|
|
20
19
|
dispatch(updateEventsPhase());
|
|
21
20
|
dispatch(updateVotingPeriodsPhase());
|
|
21
|
+
|
|
22
|
+
dispatch(sanitizeHash());
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const updateSummitPhase = () => (dispatch, getState) => {
|
|
@@ -89,5 +90,5 @@ export const updateEventsPhase = () => (dispatch, getState) => {
|
|
|
89
90
|
break;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
})
|
|
93
|
-
};
|
|
93
|
+
});
|
|
94
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getEnvVariable, HASH_SANITIZE_TOKENS } from "@utils/envVariables";
|
|
2
|
+
|
|
3
|
+
export const sanitizeHash = () => (dispatch, getState) => {
|
|
4
|
+
const { userState: { isAuthorized } } = getState();
|
|
5
|
+
|
|
6
|
+
if (!isAuthorized) {
|
|
7
|
+
const tokens = getEnvVariable(HASH_SANITIZE_TOKENS)?.split(",") ?? [];
|
|
8
|
+
|
|
9
|
+
if (tokens.length > 0) {
|
|
10
|
+
const url = new URL(window.location.href);
|
|
11
|
+
let fragment = url.hash;
|
|
12
|
+
let shouldUpdate = false;
|
|
13
|
+
|
|
14
|
+
tokens.forEach(token => {
|
|
15
|
+
if (fragment.includes(`${token}=`)) {
|
|
16
|
+
shouldUpdate = true;
|
|
17
|
+
fragment = fragment
|
|
18
|
+
.split("&")
|
|
19
|
+
.filter(fragmentToken => !fragmentToken.includes(`${token}=`))
|
|
20
|
+
.join("&")
|
|
21
|
+
.replace("#&", "#")
|
|
22
|
+
.replace("#?", "#")
|
|
23
|
+
.replace("#", "");
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (shouldUpdate) {
|
|
28
|
+
window.history.replaceState({}, "", `${url.pathname}${fragment ? `#${fragment}` : ""}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
package/src/styles/colors.scss
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Warning:
|
|
3
|
+
* Dont edit this file by hand, has been generated by colors scss util
|
|
4
|
+
* Uses default colors as base and then overriden by colors set via marketing
|
|
5
|
+
**/
|
|
6
|
+
|
|
7
|
+
$color_accent: #ff5e32;
|
|
2
8
|
$color_alerts: #ff0000;
|
|
3
9
|
$color_background_light: #ffffff;
|
|
4
10
|
$color_background_dark: #000000;
|
|
@@ -19,16 +25,16 @@ $color_input_text_color_light: #363636;
|
|
|
19
25
|
$color_input_text_color_dark: #ffffff;
|
|
20
26
|
$color_input_text_color_disabled_light: #ffffff;
|
|
21
27
|
$color_input_text_color_disabled_dark: #ffffff;
|
|
22
|
-
$color_primary: #
|
|
23
|
-
$color_primary_contrast: #
|
|
24
|
-
$color_secondary: #
|
|
25
|
-
$color_secondary_contrast: #
|
|
28
|
+
$color_primary: #6d6e71;
|
|
29
|
+
$color_primary_contrast: #f1f2f2;
|
|
30
|
+
$color_secondary: #00CEC4;
|
|
31
|
+
$color_secondary_contrast: #ff5e32;
|
|
26
32
|
$color_text_light: #ffffff;
|
|
27
33
|
$color_text_med: #828282;
|
|
28
|
-
$color_text_dark: #
|
|
34
|
+
$color_text_dark: #333333;
|
|
29
35
|
$color_text_input_hints_light: #7b7b7b;
|
|
30
36
|
$color_text_input_hints_dark: #7b7b7b;
|
|
31
|
-
$color_text_input_hints: #
|
|
37
|
+
$color_text_input_hints: #c4c4c4;
|
|
32
38
|
|
|
33
39
|
:root {
|
|
34
40
|
--color_primary: #{$color_primary};
|
package/src/styles/fonts.scss
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Warning:
|
|
3
|
+
* Dont edit this file by hand, has been generated by fonts scss util
|
|
4
|
+
* Generated with font values set via CMS
|
|
5
|
+
**/
|
|
6
|
+
|
|
7
|
+
$font-family: 'Nunito Sans', sans-serif;
|
|
2
8
|
|
|
3
9
|
:root {
|
|
4
|
-
--font_family:
|
|
10
|
+
--font_family: #{$font-family};
|
|
5
11
|
}
|
|
6
12
|
|
|
7
|
-
@font-face {
|
|
8
|
-
font-family: "BuilderExtended";
|
|
9
|
-
src: url("/fonts/buildersans-regular.woff") format("woff");
|
|
10
|
-
font-weight: normal;
|
|
11
|
-
}
|
|
12
|
-
@font-face {
|
|
13
|
-
font-family: "BuilderExtended";
|
|
14
|
-
src: url("/fonts/builderextended-semibold.woff") format("woff");
|
|
15
|
-
font-weight: bold;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
13
|
%font-regular {
|
|
19
|
-
font-family:
|
|
14
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
20
15
|
font-weight: 400;
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
%font-semi {
|
|
24
|
-
font-family:
|
|
19
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
25
20
|
font-weight: 600;
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
%font-bold {
|
|
29
|
-
font-family:
|
|
24
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
30
25
|
font-weight: 700;
|
|
31
26
|
}
|
|
@@ -26,6 +26,7 @@ export const REAL_TIME_UPDATES_STRATEGY = "REAL_TIME_UPDATES_STRATEGY";
|
|
|
26
26
|
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
|
+
export const HASH_SANITIZE_TOKENS = "HASH_SANITIZE_TOKENS";
|
|
29
30
|
|
|
30
31
|
const processEnv = {
|
|
31
32
|
/**
|
|
@@ -63,6 +64,7 @@ const processEnv = {
|
|
|
63
64
|
TIMEINTERVALSINCE1970_API_URL: process.env.GATSBY_TIMEINTERVALSINCE1970_API_URL,
|
|
64
65
|
ABLY_API_KEY: process.env.GATSBY_ABLY_API_KEY,
|
|
65
66
|
GOOGLE_TAGMANAGER_ID: process.env.GATSBY_GOOGLE_TAGMANAGER_ID,
|
|
67
|
+
HASH_SANITIZE_TOKENS: process.env.GATSBY_HASH_SANITIZE_TOKENS
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
export const getEnvVariable = (name) => {
|