@openeventkit/event-site 1.0.42 → 1.0.44

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 CHANGED
@@ -43,22 +43,6 @@ const getAccessToken = async (config, scope) => {
43
43
  }
44
44
  };
45
45
 
46
- const SSR_getMarketingSettings = async (baseUrl, summitId) => {
47
-
48
- const params = {
49
- per_page: 100,
50
- };
51
-
52
- return await axios.get(
53
- `${baseUrl}/api/public/v1/config-values/all/shows/${summitId}`,
54
- { params }
55
- )
56
- .then(response => {
57
- return response.data.data
58
- })
59
- .catch(e => console.log("ERROR: ", e));
60
- };
61
-
62
46
  const SSR_GetRemainingPages = async (endpoint, params, lastPage) => {
63
47
  // create an array with remaining pages to perform Promise.All
64
48
  const pages = [];
@@ -78,6 +62,26 @@ const SSR_GetRemainingPages = async (endpoint, params, lastPage) => {
78
62
  return remainingPages.sort((a, b,) => a.current_page - b.current_page ).map(p => p.data).flat();
79
63
  }
80
64
 
65
+ const SSR_getMarketingSettings = async (baseUrl, summitId) => {
66
+
67
+ const endpoint = `${baseUrl}/api/public/v1/config-values/all/shows/${summitId}`;
68
+
69
+ const params = {
70
+ per_page: 100,
71
+ page: 1
72
+ };
73
+
74
+ return await axios.get(endpoint, { params }).then(async ({data}) => {
75
+
76
+ console.log(`SSR_getMarketingSettings then data.current_page ${data.current_page} data.last_page ${data.last_page} total ${data.total}`)
77
+
78
+ let remainingPages = await SSR_GetRemainingPages(endpoint, params, data.last_page);
79
+
80
+ return [...data.data, ...remainingPages];
81
+
82
+ }).catch(e => console.log("ERROR: ", e));
83
+ };
84
+
81
85
  const SSR_getEvents = async (baseUrl, summitId, accessToken) => {
82
86
 
83
87
  const endpoint = `${baseUrl}/api/v1/summits/${summitId}/events/published`;
@@ -86,7 +90,7 @@ const SSR_getEvents = async (baseUrl, summitId, accessToken) => {
86
90
  access_token: accessToken,
87
91
  per_page: 50,
88
92
  page: 1,
89
- expand: "slides, links, videos, media_uploads, type, track, track.allowed_access_levels, location, location.venue, location.floor, speakers, moderator, sponsors, current_attendance, groups, rsvp_template, tags",
93
+ expand: "slides, links, videos, media_uploads, type, track, track.subtracks, track.allowed_access_levels, location, location.venue, location.floor, speakers, moderator, sponsors, current_attendance, groups, rsvp_template, tags",
90
94
  }
91
95
 
92
96
  return await axios.get(endpoint, { params }).then(async ({data}) => {
@@ -178,7 +182,7 @@ const SSR_getSpeakers = async (baseUrl, summitId, accessToken, filter = null) =>
178
182
  const SSR_getSummit = async (baseUrl, summitId) => {
179
183
 
180
184
  const params = {
181
- expand: "event_types,tracks,track_groups,presentation_levels,locations.rooms,locations.floors,order_extra_questions.values,schedule_settings,schedule_settings.filters,schedule_settings.pre_filters",
185
+ expand: "event_types,tracks, tracks.subtracks,track_groups,presentation_levels,locations.rooms,locations.floors,order_extra_questions.values,schedule_settings,schedule_settings.filters,schedule_settings.pre_filters",
182
186
  t: Date.now()
183
187
  };
184
188
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openeventkit/event-site",
3
3
  "description": "Event Site",
4
- "version": "1.0.42",
4
+ "version": "1.0.44",
5
5
  "author": "Tipit LLC",
6
6
  "dependencies": {
7
7
  "@mui/base": "^5.0.0-alpha.114",
@@ -107,7 +107,7 @@
107
107
  "redux-thunk": "^2.4.1",
108
108
  "sanitize-html": "^2.7.0",
109
109
  "sass": "^1.49.9",
110
- "schedule-filter-widget": "^2.0.3",
110
+ "schedule-filter-widget": "^2.0.6",
111
111
  "simple-chat-widget": "^1.0.31",
112
112
  "simple-oauth2": "^4.1.0",
113
113
  "slick-carousel": "^1.8.1",
@@ -103,7 +103,7 @@ export const updateFiltersFromHash =
103
103
  : "";
104
104
  } else {
105
105
  const newValues = normalizedFilters[key]
106
- ? normalizedFilters[key].split(",")
106
+ ? decodeURIComponent(normalizedFilters[key]).split(",")
107
107
  : [];
108
108
  newFilters[key].values = newValues.map((val) => {
109
109
  if (isNaN(val)) return decodeURIComponent(val);
@@ -125,7 +125,7 @@ export const updateFiltersFromHash =
125
125
  };
126
126
 
127
127
  export const getShareLink = (filters, view) => {
128
- const hashVars = [];
128
+ const hashVars = {};
129
129
 
130
130
  if (filters) {
131
131
  Object.entries(filters).forEach(([key, value]) => {
@@ -137,17 +137,20 @@ export const getShareLink = (filters, view) => {
137
137
  } else {
138
138
  hashValue = encodeURIComponent(value.values);
139
139
  }
140
- hashVars.push(`${key}=${hashValue}`);
140
+ hashVars[key] = hashValue;
141
141
  }
142
142
  });
143
143
  }
144
144
 
145
145
  if (view) {
146
- hashVars.push(`view=${view}`);
146
+ hashVars['view'] = view;
147
147
  }
148
148
 
149
149
  if (typeof window !== "undefined") {
150
- return `${window.location}#${hashVars.join("&")}`;
150
+ const currentURL = window.location.href.split("#")[0];
151
+ Object.entries(hashVars).map(([key, value]) => fragmentParser.setParam(key, value));
152
+ let fragment = fragmentParser.serialize();
153
+ return `${currentURL}#${fragment}`;
151
154
  }
152
155
 
153
156
  return "";
@@ -17,6 +17,10 @@ const checkVimeoVideo = (url) => {
17
17
  return url.match(/https:\/\/(www\.)?(player\.)?vimeo.com\/(.*)/);
18
18
  };
19
19
 
20
+ function checkYouTubeVideo(url) {
21
+ return url.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);
22
+ }
23
+
20
24
  const VideoComponent = ({ url, title, namespace, firstHalf, autoPlay, start }) => {
21
25
  console.log({ url, title, namespace, firstHalf, autoPlay, start });
22
26
  if (url) {
@@ -54,6 +58,23 @@ const VideoComponent = ({ url, title, namespace, firstHalf, autoPlay, start }) =
54
58
  <VideoJSPlayer title={title} namespace={namespace} firstHalf={firstHalf} {...videoJsOptions} />
55
59
  );
56
60
  };
61
+
62
+ const customOptions = checkYouTubeVideo(url) ? {
63
+ techOrder: ["youtube"],
64
+ sources: [{
65
+ type: "video/youtube",
66
+ src: url
67
+ }],
68
+ youtube: {
69
+ ytControls: 0,
70
+ iv_load_policy: 1
71
+ },
72
+ }: {
73
+ sources: [{
74
+ src: url
75
+ }],
76
+ };
77
+
57
78
  const videoJsOptions = {
58
79
  autoplay: autoPlay,
59
80
  /*
@@ -64,17 +85,10 @@ const VideoComponent = ({ url, title, namespace, firstHalf, autoPlay, start }) =
64
85
  muted: !!autoPlay,
65
86
  controls: true,
66
87
  fluid: true,
67
- techOrder: ["youtube"],
68
- sources: [{
69
- type: "video/youtube",
70
- src: url
71
- }],
72
- youtube: {
73
- ytControls: 0,
74
- iv_load_policy: 1
75
- },
76
88
  playsInline: true,
89
+ ...customOptions
77
90
  };
91
+
78
92
  return (
79
93
  <VideoJSPlayer title={title} namespace={namespace} {...videoJsOptions} />
80
94
  );
@@ -225,7 +225,7 @@ const PostersPage = ({
225
225
  };
226
226
 
227
227
  const mapStateToProps = ({ settingState, presentationsState, userState, summitState }) => ({
228
- pagesSettings: [...settingState.posterPagesSettings.posterPages],
228
+ pagesSettings: [...settingState.posterPagesSettings.postersPages],
229
229
  posters: presentationsState.voteablePresentations.filteredPresentations,
230
230
  allBuildTimePosters: presentationsState.voteablePresentations.ssrPresentations,
231
231
  allPosters: presentationsState.voteablePresentations.allPresentations,