@openeventkit/event-site 2.1.18 → 2.1.21

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 (86) hide show
  1. package/.github/workflows/jest.yml +1 -1
  2. package/babel.config.json +9 -9
  3. package/gatsby-node.js +67 -125
  4. package/jest.setup.js +2 -0
  5. package/netlify.toml +1 -1
  6. package/package.json +25 -16
  7. package/src/__mocks__/@mdx-js/mdx.js +32 -0
  8. package/src/__mocks__/@mdx-js/react.js +15 -0
  9. package/src/__mocks__/rehype-external-links.js +3 -0
  10. package/src/__mocks__/remark-gfm.js +3 -0
  11. package/src/actions/fetch-entities-actions.js +45 -87
  12. package/src/actions/update-data-actions.js +2 -2
  13. package/src/actions/user-actions.js +578 -430
  14. package/src/cms/config/collections/configurationsCollection/siteSettings/index.js +2 -0
  15. package/src/cms/config/collections/configurationsCollection/siteSettings/typeDefs.js +10 -0
  16. package/src/cms/preview-templates/ContentPagePreview.js +27 -29
  17. package/src/components/AvatarEditorModal/index.js +10 -0
  18. package/src/components/CertificatePDF.js +313 -0
  19. package/src/components/CertificateSection.js +139 -0
  20. package/src/components/FullSchedule.js +83 -66
  21. package/src/components/Mdx.js +39 -0
  22. package/src/components/__tests__/Mdx.test.jsx +70 -0
  23. package/src/content/site-settings/index.json +1 -1
  24. package/src/content/sponsors.json +1 -1
  25. package/src/i18n/locales/en.json +9 -1
  26. package/src/pages/a/[...].js +3 -0
  27. package/src/reducers/user-reducer.js +89 -27
  28. package/src/routes/authorization-callback-route.js +20 -2
  29. package/src/styles/rsvp-page.module.scss +63 -0
  30. package/src/templates/full-profile-page.js +61 -2
  31. package/src/templates/marketing-page-template/MainColumn.js +40 -42
  32. package/src/templates/rsvp-page.js +144 -0
  33. package/src/utils/alerts.js +1 -1
  34. package/src/utils/build-json/BaseAPIRequest.js +25 -0
  35. package/src/utils/build-json/EventsAPIRequest.js +171 -0
  36. package/src/utils/build-json/SpeakersAPIRequest.js +62 -0
  37. package/src/utils/build-json/SummitAPIRequest.js +115 -0
  38. package/src/utils/build-json/constants.js +5 -0
  39. package/src/utils/certificateSettings.js +45 -0
  40. package/src/utils/customErrorHandler.js +40 -1
  41. package/src/utils/rsvpConstants.js +7 -0
  42. package/src/utils/useMarketingSettings.js +48 -1
  43. package/src/utils/useSiteSettings.js +11 -0
  44. package/src/workers/feeds.worker.js +85 -90
  45. package/src/workers/sync_strategies/activity_synch_strategy.js +147 -102
  46. package/src/workers/sync_strategies/speaker_synch_strategy.js +3 -3
  47. package/src/workers/sync_strategies/track_synch_strategy.js +149 -48
  48. package/src/workers/synch.worker.js +123 -88
  49. package/static/fonts/fonts.css +120 -20
  50. package/static/fonts/nunito-sans/nunito-sans-v18-latin-200.woff2 +0 -0
  51. package/static/fonts/nunito-sans/nunito-sans-v18-latin-200italic.ttf +0 -0
  52. package/static/fonts/nunito-sans/nunito-sans-v18-latin-200italic.woff2 +0 -0
  53. package/static/fonts/nunito-sans/nunito-sans-v18-latin-300.woff2 +0 -0
  54. package/static/fonts/nunito-sans/nunito-sans-v18-latin-300italic.ttf +0 -0
  55. package/static/fonts/nunito-sans/nunito-sans-v18-latin-300italic.woff2 +0 -0
  56. package/static/fonts/nunito-sans/nunito-sans-v18-latin-400.ttf +0 -0
  57. package/static/fonts/nunito-sans/nunito-sans-v18-latin-400.woff2 +0 -0
  58. package/static/fonts/nunito-sans/nunito-sans-v18-latin-400italic.ttf +0 -0
  59. package/static/fonts/nunito-sans/nunito-sans-v18-latin-400italic.woff2 +0 -0
  60. package/static/fonts/nunito-sans/nunito-sans-v18-latin-500.ttf +0 -0
  61. package/static/fonts/nunito-sans/nunito-sans-v18-latin-500.woff2 +0 -0
  62. package/static/fonts/nunito-sans/nunito-sans-v18-latin-500italic.ttf +0 -0
  63. package/static/fonts/nunito-sans/nunito-sans-v18-latin-500italic.woff2 +0 -0
  64. package/static/fonts/nunito-sans/nunito-sans-v18-latin-600.woff2 +0 -0
  65. package/static/fonts/nunito-sans/nunito-sans-v18-latin-600italic.woff2 +0 -0
  66. package/static/fonts/nunito-sans/nunito-sans-v18-latin-700.ttf +0 -0
  67. package/static/fonts/nunito-sans/nunito-sans-v18-latin-700.woff2 +0 -0
  68. package/static/fonts/nunito-sans/nunito-sans-v18-latin-700italic.woff2 +0 -0
  69. package/static/fonts/nunito-sans/nunito-sans-v18-latin-800.ttf +0 -0
  70. package/static/fonts/nunito-sans/nunito-sans-v18-latin-800.woff2 +0 -0
  71. package/static/fonts/nunito-sans/nunito-sans-v18-latin-800italic.woff2 +0 -0
  72. package/static/fonts/nunito-sans/nunito-sans-v18-latin-900.ttf +0 -0
  73. package/static/fonts/nunito-sans/nunito-sans-v18-latin-900.woff2 +0 -0
  74. package/static/fonts/nunito-sans/nunito-sans-v18-latin-900italic.woff2 +0 -0
  75. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300.woff +0 -0
  76. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300.woff2 +0 -0
  77. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300italic.woff +0 -0
  78. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300italic.woff2 +0 -0
  79. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600.woff +0 -0
  80. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600.woff2 +0 -0
  81. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600italic.woff +0 -0
  82. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600italic.woff2 +0 -0
  83. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700.woff +0 -0
  84. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700.woff2 +0 -0
  85. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700italic.woff +0 -0
  86. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700italic.woff2 +0 -0
@@ -1,4 +1,7 @@
1
1
  import URI from "urijs";
2
+ import SummitAPIRequest from "../utils/build-json/SummitAPIRequest";
3
+ import EventAPIRequest from "../utils/build-json/EventsAPIRequest";
4
+ import SpeakersAPIRequest from "../utils/build-json/SpeakersAPIRequest";
2
5
 
3
6
  /**
4
7
  * @param summitId
@@ -9,45 +12,16 @@ import URI from "urijs";
9
12
  export const fetchEventById = async (summitId, eventId, accessToken = null) => {
10
13
 
11
14
  let apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/public/v1/summits/${summitId}/events/${eventId}/published`);
12
- if(accessToken){
15
+ if (accessToken) {
13
16
  apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/v1/summits/${summitId}/events/${eventId}/published`);
14
17
  apiUrl.addQuery('access_token', accessToken);
15
18
  }
16
19
 
17
- const speakers_fields = ['id', 'first_name', 'last_name', 'title', 'bio','member_id','pic', 'big_pic', 'company'];
18
- const current_attendance_fields = ['member_first_name', 'member_last_name', 'member_pic'];
19
- const first_level_fields = [
20
- "id",
21
- "created",
22
- "last_edited",
23
- "title",
24
- "description",
25
- "social_description",
26
- "start_date",
27
- "end_date",
28
- "location_id",
29
- "class_name",
30
- "allow_feedback",
31
- "avg_feedback_rate",
32
- "published_date",
33
- "head_count",
34
- "attendance_count",
35
- "current_attendance_count",
36
- "image",
37
- "level" ,
38
- "show_sponsors",
39
- "duration",
40
- "moderator_speaker_id",
41
- "problem_addressed",
42
- "attendees_expected_learnt",
43
- "to_record",
44
- "attending_media",
45
- ];
46
- apiUrl.addQuery('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');
47
- apiUrl.addQuery('relations', "speakers.badge_features,speakers.affiliations,speakers.languages,speakers.other_presentation_links,speakers.areas_of_expertise,speakers.travel_preferences,speakers.organizational_roles,speakers.all_presentations,speakers.all_moderated_presentations");
48
- apiUrl.addQuery('fields', `${first_level_fields.join(",")},speakers.${speakers_fields.join(",speakers.")},current_attendance.${current_attendance_fields.join(',current_attendance.')}`);
49
- return fetch(apiUrl.toString(), {
50
- method: 'GET'
20
+ const apiUrlWithParams = EventAPIRequest.build(apiUrl);
21
+
22
+ return fetch(apiUrlWithParams, {
23
+ method: 'GET',
24
+ cache: "no-store",
51
25
  }).then(async (response) => {
52
26
  if (response.status === 200) {
53
27
  return await response.json();
@@ -66,7 +40,8 @@ export const fetchStreamingInfoByEventId = async (summitId, eventId, accessToken
66
40
  const apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/v1/summits/${summitId}/events/${eventId}/published/streaming-info`);
67
41
  apiUrl.addQuery('access_token', accessToken);
68
42
  return fetch(apiUrl.toString(), {
69
- method: 'GET'
43
+ method: 'GET',
44
+ cache: "no-store",
70
45
  }).then(async (response) => {
71
46
  if (response.status === 200) {
72
47
  return await response.json();
@@ -84,13 +59,14 @@ export const fetchStreamingInfoByEventId = async (summitId, eventId, accessToken
84
59
  export const fetchEventTypeById = async (summitId, eventTypeId, accessToken = null) => {
85
60
 
86
61
  let apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/public/v1/summits/${summitId}/event-types/${eventTypeId}`);
87
- if(accessToken){
62
+ if (accessToken) {
88
63
  apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/v1/summits/${summitId}/event-types/${eventTypeId}`);
89
64
  apiUrl.addQuery('access_token', accessToken);
90
65
  }
91
66
 
92
67
  return fetch(apiUrl.toString(), {
93
- method: 'GET'
68
+ method: 'GET',
69
+ cache: "no-store",
94
70
  }).then(async (response) => {
95
71
  if (response.status === 200) {
96
72
  return await response.json();
@@ -107,19 +83,20 @@ export const fetchEventTypeById = async (summitId, eventTypeId, accessToken = nu
107
83
  * @param accessToken
108
84
  * @returns {Promise<Response>}
109
85
  */
110
- export const fetchLocationById = async(summitId, locationId, expand, accessToken = null) => {
86
+ export const fetchLocationById = async (summitId, locationId, expand, accessToken = null) => {
111
87
 
112
88
  let apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/public/v1/summits/${summitId}/locations/${locationId}`);
113
- if(accessToken){
89
+ if (accessToken) {
114
90
  apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/v1/summits/${summitId}/locations/${locationId}`);
115
91
  apiUrl.addQuery('access_token', accessToken);
116
92
  }
117
93
 
118
- if(expand)
94
+ if (expand)
119
95
  apiUrl.addQuery('expand', expand);
120
96
 
121
97
  return fetch(apiUrl.toString(), {
122
- method: 'GET'
98
+ method: 'GET',
99
+ cache: "no-store",
123
100
  }).then(async (response) => {
124
101
  if (response.status === 200) {
125
102
  return await response.json();
@@ -135,34 +112,18 @@ export const fetchLocationById = async(summitId, locationId, expand, accessToken
135
112
  * @param accessToken
136
113
  * @returns {Promise<Response>}
137
114
  */
138
- export const fetchSpeakerById = async(summitId, speakerId, accessToken = null) => {
115
+ export const fetchSpeakerById = async (summitId, speakerId, accessToken = null) => {
139
116
 
140
117
  let apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/public/v1/summits/${summitId}/speakers/${speakerId}`);
141
118
 
142
- if(accessToken){
119
+ if (accessToken) {
143
120
  apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/v1/summits/${summitId}/speakers/${speakerId}`);
144
121
  apiUrl.addQuery('access_token', accessToken);
145
122
  }
146
123
 
147
- const speakers_relations = [
148
- 'badge_features',
149
- 'affiliations',
150
- 'languages',
151
- 'other_presentation_links',
152
- 'areas_of_expertise',
153
- 'travel_preferences',
154
- 'organizational_roles',
155
- 'all_presentations',
156
- 'all_moderated_presentations',
157
- ];
158
-
159
- const speakers_fields =
160
- ['id', 'first_name', 'last_name', 'title', 'bio','member_id','pic', 'big_pic', 'company'];
124
+ const apiUrlWithParams = SpeakersAPIRequest.build(apiUrl);
161
125
 
162
- apiUrl.addQuery('relations', speakers_relations.join(','));
163
- apiUrl.addQuery('fields', speakers_fields.join(','));
164
-
165
- return fetch(apiUrl.toString(), {
126
+ return fetch(apiUrlWithParams, {
166
127
  method: 'GET',
167
128
  cache: "no-store",
168
129
  }).then(async (response) => {
@@ -179,29 +140,19 @@ export const fetchSpeakerById = async(summitId, speakerId, accessToken = null) =
179
140
  * @param accessToken
180
141
  * @returns {Promise<Response>}
181
142
  */
182
- export const fetchSummitById = async(summitId, accessToken = null) => {
143
+ export const fetchSummitById = async (summitId, accessToken = null) => {
183
144
  let apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/public/v1/summits/${summitId}`);
184
- const expand = [
185
- 'event_types',
186
- 'tracks',
187
- 'tracks.subtracks',
188
- 'track_groups',
189
- 'presentation_levels',
190
- 'locations',
191
- 'locations.rooms',
192
- 'locations.floors',
193
- 'order_extra_questions.values',
194
- 'schedule_settings',
195
- 'schedule_settings.filters',
196
- 'schedule_settings.pre_filters',
197
- "ticket_types",
198
- "badge_features_types",
199
- ]
200
145
 
201
- apiUrl.addQuery('expand', expand.join(','));
146
+ if (accessToken) {
147
+ apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/v1/summits/${summitId}`);
148
+ apiUrl.addQuery('access_token', accessToken);
149
+ }
202
150
 
203
- return fetch(apiUrl.toString(), {
204
- method: 'GET'
151
+ const apiUrlWithParams = SummitAPIRequest.build(apiUrl);
152
+
153
+ return fetch(apiUrlWithParams, {
154
+ method: 'GET',
155
+ cache: "no-store",
205
156
  }).then(async (response) => {
206
157
  if (response.status === 200) {
207
158
  return await response.json();
@@ -216,17 +167,24 @@ export const fetchSummitById = async(summitId, accessToken = null) => {
216
167
  * @param accessToken
217
168
  * @returns {Promise<* | null>}
218
169
  */
219
- export const fetchTrackById = async(summitId, trackId, accessToken = null) => {
170
+ export const fetchTrackById = async (summitId, trackId, accessToken = null) => {
220
171
  let apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/public/v1/summits/${summitId}/tracks/${trackId}`);
221
172
 
222
- const expand = [
223
- 'subtracks',
224
- ]
173
+ const fields = [
174
+ "id", "name", "code", "order", "parent_id", "color","text_color",
175
+ "subtracks.id", "subtracks.name", "subtracks.code", "subtracks.order",
176
+ "subtracks.parent_id", "subtracks.color", "subtracks.text_color",
177
+ ];
178
+ const relations = ['subtracks','subtracks.none'];
179
+ const expand = ['subtracks']
225
180
 
181
+ apiUrl.addQuery('fields', fields.join(','));
182
+ apiUrl.addQuery('relations', relations.join(','));
226
183
  apiUrl.addQuery('expand', expand.join(','));
227
184
 
228
185
  return fetch(apiUrl.toString(), {
229
- method: 'GET'
186
+ method: 'GET',
187
+ cache: "no-store",
230
188
  }).then(async (response) => {
231
189
  if (response.status === 200) {
232
190
  return await response.json();
@@ -243,10 +243,10 @@ export const synchEntityData = (
243
243
  if (entity && entity_type === 'PresentationSpeaker' && entity_operator === 'UPDATE' && event &&
244
244
  (
245
245
  // current loaded event is a presentation on where speakers is a presenter
246
- (entity.all_presentations && entity.all_presentations.find(id => id == event?.id))
246
+ (entity?.presentations && entity.presentations.find(id => id == event?.id))
247
247
  ||
248
248
  // current loaded event is a presentation on where speakers is a moderator
249
- (entity.all_moderated_presentations && entity.all_moderated_presentations.find(id => id == event?.id))
249
+ (entity?.moderated_presentations && entity.moderated_presentations.find(id => id == event?.id))
250
250
  )
251
251
  )
252
252
  {