@openeventkit/event-site 2.1.18 → 2.1.20
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/.github/workflows/jest.yml +1 -1
- package/babel.config.json +9 -9
- package/gatsby-node.js +67 -125
- package/jest.setup.js +2 -0
- package/netlify.toml +1 -1
- package/package.json +24 -16
- package/src/__mocks__/@mdx-js/mdx.js +32 -0
- package/src/__mocks__/@mdx-js/react.js +15 -0
- package/src/__mocks__/rehype-external-links.js +3 -0
- package/src/__mocks__/remark-gfm.js +3 -0
- package/src/actions/fetch-entities-actions.js +45 -87
- package/src/actions/update-data-actions.js +2 -2
- package/src/actions/user-actions.js +578 -430
- package/src/cms/preview-templates/ContentPagePreview.js +27 -29
- package/src/components/AvatarEditorModal/index.js +10 -0
- package/src/components/FullSchedule.js +83 -66
- package/src/components/Mdx.js +39 -0
- package/src/components/__tests__/Mdx.test.jsx +70 -0
- package/src/content/site-settings/index.json +1 -1
- package/src/content/sponsors.json +1 -1
- package/src/i18n/locales/en.json +9 -1
- package/src/pages/a/[...].js +3 -0
- package/src/reducers/user-reducer.js +89 -27
- package/src/routes/authorization-callback-route.js +20 -2
- package/src/styles/rsvp-page.module.scss +63 -0
- package/src/templates/marketing-page-template/MainColumn.js +40 -42
- package/src/templates/rsvp-page.js +144 -0
- package/src/utils/alerts.js +1 -1
- package/src/utils/build-json/BaseAPIRequest.js +25 -0
- package/src/utils/build-json/EventsAPIRequest.js +171 -0
- package/src/utils/build-json/SpeakersAPIRequest.js +62 -0
- package/src/utils/build-json/SummitAPIRequest.js +115 -0
- package/src/utils/build-json/constants.js +5 -0
- package/src/utils/customErrorHandler.js +40 -1
- package/src/utils/rsvpConstants.js +7 -0
- package/src/workers/sync_strategies/activity_synch_strategy.js +147 -102
- package/src/workers/sync_strategies/speaker_synch_strategy.js +3 -3
- package/src/workers/sync_strategies/track_synch_strategy.js +149 -48
- package/src/workers/synch.worker.js +123 -88
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
const BaseAPIRequest = require("./BaseAPIRequest");
|
|
2
|
+
|
|
3
|
+
const SPEAKER_MODERATOR_FIELDS = ['id', 'first_name', 'last_name', 'title', 'bio', 'member_id', 'pic', 'big_pic', 'company', 'featured'];
|
|
4
|
+
const DOCUMENTS_FIELDS = ['display_on_site', 'name', 'order', 'class_name', 'type', 'public_url', 'link'];
|
|
5
|
+
const CURRENT_ATTENDANCE_FIELDS = ['member_first_name', 'member_last_name', 'member_pic'];
|
|
6
|
+
|
|
7
|
+
class EventAPIRequest extends BaseAPIRequest {
|
|
8
|
+
static instance;
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
const primary_fields = [
|
|
12
|
+
"id",
|
|
13
|
+
"created",
|
|
14
|
+
"start_date",
|
|
15
|
+
"end_date",
|
|
16
|
+
"title",
|
|
17
|
+
"abstract",
|
|
18
|
+
"description",
|
|
19
|
+
"level",
|
|
20
|
+
"image",
|
|
21
|
+
"stream_thumbnail",
|
|
22
|
+
"location_id",
|
|
23
|
+
"class_name",
|
|
24
|
+
"allow_feedback",
|
|
25
|
+
"head_count",
|
|
26
|
+
"attendance_count",
|
|
27
|
+
"current_attendance_count",
|
|
28
|
+
"to_record",
|
|
29
|
+
"etherpad_link",
|
|
30
|
+
"streaming_url",
|
|
31
|
+
"streaming_type",
|
|
32
|
+
"meeting_url",
|
|
33
|
+
"current_attendance",
|
|
34
|
+
"attendees_expected_learnt",
|
|
35
|
+
"show_sponsors",
|
|
36
|
+
"duration",
|
|
37
|
+
// RSVP fields
|
|
38
|
+
'rsvp_type',
|
|
39
|
+
'rsvp_capacity',
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const type_fields = ["type.id", "type.name", "type.allows_publishing_dates", "type.color"];
|
|
43
|
+
const tags_fields = ["tags.id", "tags.tag"];
|
|
44
|
+
const location_fields = ["location.id", "location.class_name", "location.name", "location.venue.name", "location.floor.name"];
|
|
45
|
+
const track_fields = ["track.id", "track.name", "track.icon_url", "track.color", "track.text_color", "track.parent_id"];
|
|
46
|
+
const track_groups_fields = ["track_groups.id", "track_groups.name", "track_groups.parent_id", "track_groups.color", "track_groups.order"];
|
|
47
|
+
const speakers_badge_feature_fields = ["speakers.badge_features.id", "speakers.badge_features.name", "speakers.badge_features.image"];
|
|
48
|
+
const sponsors_fields = ["sponsors.id", "sponsors.name", "sponsors.logo"];
|
|
49
|
+
|
|
50
|
+
const speakers_fields = SPEAKER_MODERATOR_FIELDS.map((e) => `speakers.${e}`);
|
|
51
|
+
const moderator_fields = SPEAKER_MODERATOR_FIELDS.map((e) => `moderator.${e}`);
|
|
52
|
+
const media_upload_fields = DOCUMENTS_FIELDS.map((e) => `media_uploads.${e}`)
|
|
53
|
+
const slides_fields = DOCUMENTS_FIELDS.map((e) => `slides.${e}`)
|
|
54
|
+
const links_fields = DOCUMENTS_FIELDS.map((e) => `links.${e}`)
|
|
55
|
+
const video_fields = DOCUMENTS_FIELDS.map((e) => `videos.${e}`)
|
|
56
|
+
const current_attendance_fields = CURRENT_ATTENDANCE_FIELDS.map((e) => `current_attendance.${e}`)
|
|
57
|
+
|
|
58
|
+
const primary_relations = [
|
|
59
|
+
"slides",
|
|
60
|
+
"links",
|
|
61
|
+
"videos",
|
|
62
|
+
"media_uploads",
|
|
63
|
+
"type",
|
|
64
|
+
"track",
|
|
65
|
+
"location",
|
|
66
|
+
"speakers",
|
|
67
|
+
"moderator",
|
|
68
|
+
"sponsors",
|
|
69
|
+
"tags",
|
|
70
|
+
"current_attendance",
|
|
71
|
+
"allowed_ticket_types"
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const speakers_relations = ["speakers.badge_features", "speakers.presentations", "speakers.moderated_presentations"];
|
|
75
|
+
|
|
76
|
+
const track_relations = ["track.track_groups"];
|
|
77
|
+
|
|
78
|
+
const type_relations = ["type.allowed_ticket_types"];
|
|
79
|
+
|
|
80
|
+
const locations_relations = ["location.venue", "location.floor", "location.venue.none", "location.floor.none"];
|
|
81
|
+
|
|
82
|
+
// TODO: review relations for "current_attendance"
|
|
83
|
+
|
|
84
|
+
const relations = [
|
|
85
|
+
...track_relations,
|
|
86
|
+
...type_relations,
|
|
87
|
+
...speakers_relations,
|
|
88
|
+
...locations_relations,
|
|
89
|
+
...primary_relations,
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
const speakers_expand = ["speakers.badge_features"];
|
|
93
|
+
|
|
94
|
+
const location_expand = ["location.venue", "location.floor"];
|
|
95
|
+
|
|
96
|
+
const track_expand = [
|
|
97
|
+
"track.subtracks",
|
|
98
|
+
"track.allowed_access_levels",
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
const expands = [
|
|
102
|
+
"slides",
|
|
103
|
+
"links",
|
|
104
|
+
"videos",
|
|
105
|
+
"media_uploads",
|
|
106
|
+
"type",
|
|
107
|
+
"track",
|
|
108
|
+
"location",
|
|
109
|
+
"speakers",
|
|
110
|
+
"moderator",
|
|
111
|
+
"sponsors",
|
|
112
|
+
"tags",
|
|
113
|
+
"current_attendance",
|
|
114
|
+
...track_expand,
|
|
115
|
+
...speakers_expand,
|
|
116
|
+
...location_expand
|
|
117
|
+
];
|
|
118
|
+
|
|
119
|
+
super(
|
|
120
|
+
[
|
|
121
|
+
...primary_fields,
|
|
122
|
+
...type_fields,
|
|
123
|
+
...tags_fields,
|
|
124
|
+
...location_fields,
|
|
125
|
+
...track_fields,
|
|
126
|
+
...track_groups_fields,
|
|
127
|
+
...sponsors_fields,
|
|
128
|
+
...speakers_fields,
|
|
129
|
+
...moderator_fields,
|
|
130
|
+
...media_upload_fields,
|
|
131
|
+
...slides_fields,
|
|
132
|
+
...links_fields,
|
|
133
|
+
...video_fields,
|
|
134
|
+
...current_attendance_fields,
|
|
135
|
+
...speakers_badge_feature_fields
|
|
136
|
+
],
|
|
137
|
+
relations,
|
|
138
|
+
expands
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
if (!EventAPIRequest.instance) {
|
|
142
|
+
EventAPIRequest.instance = this;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
static getInstance() {
|
|
147
|
+
if (!EventAPIRequest.instance) {
|
|
148
|
+
new EventAPIRequest();
|
|
149
|
+
}
|
|
150
|
+
return EventAPIRequest.instance;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static getParams(apiUrl) {
|
|
154
|
+
const instance = EventAPIRequest.getInstance();
|
|
155
|
+
apiUrl.addQuery("fields", instance.getFields());
|
|
156
|
+
apiUrl.addQuery("expand", instance.getExpands());
|
|
157
|
+
apiUrl.addQuery("relations", instance.getRelations());
|
|
158
|
+
return apiUrl.query(true);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static build(apiUrl) {
|
|
162
|
+
const instance = EventAPIRequest.getInstance();
|
|
163
|
+
apiUrl.addQuery("fields", instance.getFields());
|
|
164
|
+
apiUrl.addQuery("expand", instance.getExpands());
|
|
165
|
+
apiUrl.addQuery("relations", instance.getRelations());
|
|
166
|
+
|
|
167
|
+
return apiUrl.toString();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
module.exports = EventAPIRequest;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const BaseAPIRequest = require("./BaseAPIRequest");
|
|
2
|
+
class SpeakersAPIRequest extends BaseAPIRequest {
|
|
3
|
+
static instance;
|
|
4
|
+
|
|
5
|
+
constructor() {
|
|
6
|
+
|
|
7
|
+
const primary_fields =
|
|
8
|
+
['id', 'first_name', 'last_name', 'title', 'bio', 'member_id', 'pic', 'big_pic', 'company'];
|
|
9
|
+
|
|
10
|
+
const badge_features_fields =
|
|
11
|
+
['badge_features.id', 'badge_features.image', 'badge_features.name'];
|
|
12
|
+
|
|
13
|
+
const relations = [
|
|
14
|
+
'badge_features',
|
|
15
|
+
'presentations',
|
|
16
|
+
'moderated_presentations',
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const expands = [
|
|
20
|
+
'badge_features'
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
super(
|
|
24
|
+
[
|
|
25
|
+
...primary_fields,
|
|
26
|
+
...badge_features_fields
|
|
27
|
+
],
|
|
28
|
+
relations,
|
|
29
|
+
expands
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
if (!SpeakersAPIRequest.instance) {
|
|
33
|
+
SpeakersAPIRequest.instance = this;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static getInstance() {
|
|
38
|
+
if (!SpeakersAPIRequest.instance) {
|
|
39
|
+
new SpeakersAPIRequest();
|
|
40
|
+
}
|
|
41
|
+
return SpeakersAPIRequest.instance;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static getParams(apiUrl) {
|
|
45
|
+
const instance = SpeakersAPIRequest.getInstance();
|
|
46
|
+
apiUrl.addQuery("fields", instance.getFields());
|
|
47
|
+
apiUrl.addQuery("expand", instance.getExpands());
|
|
48
|
+
apiUrl.addQuery("relations", instance.getRelations());
|
|
49
|
+
return apiUrl.query(true);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static build(apiUrl) {
|
|
53
|
+
const instance = SpeakersAPIRequest.getInstance();
|
|
54
|
+
apiUrl.addQuery("fields", instance.getFields());
|
|
55
|
+
apiUrl.addQuery("expand", instance.getExpands());
|
|
56
|
+
apiUrl.addQuery("relations", instance.getRelations());
|
|
57
|
+
|
|
58
|
+
return apiUrl.toString();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = SpeakersAPIRequest;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
const BaseAPIRequest = require("./BaseAPIRequest");
|
|
2
|
+
|
|
3
|
+
class SummitAPIRequest extends BaseAPIRequest {
|
|
4
|
+
static instance;
|
|
5
|
+
|
|
6
|
+
constructor() {
|
|
7
|
+
const primary_fields = [
|
|
8
|
+
"id", "name", "start_date", "end_date", "time_zone_id", "time_zone_label", "secondary_logo", "slug",
|
|
9
|
+
"support_email", "start_showing_venues_date", "dates_with_events", "logo",
|
|
10
|
+
"registration_allowed_refund_request_till_date", "allow_update_attendee_extra_questions", "is_virtual",
|
|
11
|
+
"registration_disclaimer_mandatory", "registration_disclaimer_content", "reassign_ticket_till_date",
|
|
12
|
+
"is_main", "title", "description", "time_zone"
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
// TODO: to be reviewed later with data syncs actions to match the needs of the data update
|
|
16
|
+
const event_types_fields = [
|
|
17
|
+
"event_types.id"
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const tracks_fields = [
|
|
21
|
+
"tracks.id", "tracks.name", "tracks.code", "tracks.order", "tracks.parent_id", "tracks.color","tracks.text_color",
|
|
22
|
+
"tracks.subtracks.id", "tracks.subtracks.name", "tracks.subtracks.code", "tracks.subtracks.order",
|
|
23
|
+
"tracks.subtracks.parent_id", "tracks.subtracks.color","tracks.subtracks.text_color",
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const ticket_types_fields = [
|
|
27
|
+
"ticket_types.id", "ticket_types.name", "ticket_types.created", "ticket_types.cost"
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const track_groups_fields = [
|
|
31
|
+
"track_groups.id", "track_groups.name", "track_groups.color"
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
const location_fields = [
|
|
35
|
+
"locations.id", "locations.class_name", "locations.is_main", "locations.name", "locations.city",
|
|
36
|
+
"locations.country", "locations.venue.name"
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const ticket_types_relations = ["ticket_types.none"];
|
|
40
|
+
const tracks_relations = ["tracks", "tracks.subtracks.none"];
|
|
41
|
+
const track_groups_relations = ["track_groups.none"];
|
|
42
|
+
const location_relations = ["locations.none, locations.venue.none"];
|
|
43
|
+
const event_types_relations = ["event_types.none"];
|
|
44
|
+
|
|
45
|
+
const relations = [
|
|
46
|
+
"dates_with_events",
|
|
47
|
+
"locations",
|
|
48
|
+
"payment_profiles",
|
|
49
|
+
"time_zone",
|
|
50
|
+
...ticket_types_relations,
|
|
51
|
+
...tracks_relations,
|
|
52
|
+
...track_groups_relations,
|
|
53
|
+
...location_relations,
|
|
54
|
+
...event_types_relations
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const schedule_settings_expands = [
|
|
58
|
+
"schedule_settings.filters",
|
|
59
|
+
"schedule_settings.pre_filters"
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
const track_expands = ["tracks.subtracks"];
|
|
63
|
+
|
|
64
|
+
const locations_expands = ["locations.venue"];
|
|
65
|
+
|
|
66
|
+
const expands = [
|
|
67
|
+
"event_types",
|
|
68
|
+
"badge_features_types",
|
|
69
|
+
"tracks",
|
|
70
|
+
"track_groups",
|
|
71
|
+
"presentation_levels",
|
|
72
|
+
"locations",
|
|
73
|
+
"schedule_settings",
|
|
74
|
+
"ticket_types",
|
|
75
|
+
...schedule_settings_expands,
|
|
76
|
+
...track_expands,
|
|
77
|
+
...locations_expands
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
super(
|
|
81
|
+
[
|
|
82
|
+
...primary_fields,
|
|
83
|
+
...event_types_fields,
|
|
84
|
+
...tracks_fields,
|
|
85
|
+
...ticket_types_fields,
|
|
86
|
+
...track_groups_fields,
|
|
87
|
+
...location_fields,
|
|
88
|
+
],
|
|
89
|
+
relations,
|
|
90
|
+
expands
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
if (!SummitAPIRequest.instance) {
|
|
94
|
+
SummitAPIRequest.instance = this;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static getInstance() {
|
|
99
|
+
if (!SummitAPIRequest.instance) {
|
|
100
|
+
new SummitAPIRequest();
|
|
101
|
+
}
|
|
102
|
+
return SummitAPIRequest.instance;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static build = (apiUrl) => {
|
|
106
|
+
const instance = SummitAPIRequest.getInstance();
|
|
107
|
+
apiUrl.addQuery("fields", instance.getFields());
|
|
108
|
+
apiUrl.addQuery("expand", instance.getExpands());
|
|
109
|
+
apiUrl.addQuery("relations", instance.getRelations());
|
|
110
|
+
|
|
111
|
+
return apiUrl.toString();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
module.exports = SummitAPIRequest;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import expiredToken from './expiredToken';
|
|
2
|
-
import { stopLoading } from "openstack-uicore-foundation/lib/utils/actions";
|
|
3
2
|
import Swal from 'sweetalert2';
|
|
3
|
+
import {RSVP_INVITATION_ERROR} from "../actions/user-actions";
|
|
4
|
+
import {
|
|
5
|
+
createAction,
|
|
6
|
+
stopLoading,
|
|
7
|
+
} from 'openstack-uicore-foundation/lib/utils/actions';
|
|
8
|
+
|
|
4
9
|
|
|
5
10
|
export const customErrorHandler = (err, res) => (dispatch, state) => {
|
|
6
11
|
let code = err.status;
|
|
@@ -76,4 +81,38 @@ export const customBadgeHandler = (err, res) => (dispatch, state) => {
|
|
|
76
81
|
default:
|
|
77
82
|
break;
|
|
78
83
|
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const customRSVPHandler = (err, res) => (dispatch, state) => {
|
|
87
|
+
let code = err.status;
|
|
88
|
+
dispatch(stopLoading());
|
|
89
|
+
let msg = '';
|
|
90
|
+
switch (code) {
|
|
91
|
+
case 401:
|
|
92
|
+
console.log('authErrorHandler 401 - re login');
|
|
93
|
+
expiredToken(err);
|
|
94
|
+
break;
|
|
95
|
+
case 404:
|
|
96
|
+
msg = "";
|
|
97
|
+
|
|
98
|
+
if (err.response.body && err.response.body.message) msg = err.response.body.message;
|
|
99
|
+
else if (err.response.error && err.response.error.message) msg = err.response.error.message;
|
|
100
|
+
else msg = err.message;
|
|
101
|
+
|
|
102
|
+
dispatch(createAction(RSVP_INVITATION_ERROR)({ errorMessage: msg }))
|
|
103
|
+
break;
|
|
104
|
+
case 412:
|
|
105
|
+
for (var [key, value] of Object.entries(err.response.body.errors)) {
|
|
106
|
+
if (isNaN(key)) {
|
|
107
|
+
msg += key + ': ';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
msg += value + '<br>';
|
|
111
|
+
}
|
|
112
|
+
dispatch(createAction(RSVP_INVITATION_ERROR)({ errorMessage: msg }))
|
|
113
|
+
break;
|
|
114
|
+
default:
|
|
115
|
+
dispatch(createAction(RSVP_INVITATION_ERROR)({ errorMessage: "Internal Error. Please contact support " }))
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
79
118
|
}
|