@openeventkit/event-site 2.0.93 → 2.0.95
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/package.json +1 -1
- package/src/actions/user-actions.js +8 -9
- package/src/cms/config/collections/defaultPagesCollection/invitationsRejectPage/index.js +12 -1
- package/src/cms/config/collections/defaultPagesCollection/invitationsRejectPage/typeDefs.js +3 -1
- package/src/components/LiteScheduleComponent.js +6 -3
- package/src/components/LiveEventWidgetComponent.js +5 -3
- package/src/components/SpeakersWidgetComponent.js +6 -4
- package/src/components/UpcomingEventsComponent.js +5 -3
- package/src/content/invitations-reject-page/index.json +6 -6
- package/src/pages/a/[...].js +2 -0
- package/src/templates/full-profile-page.js +1 -0
- package/src/templates/invitations-reject-page.js +66 -36
- package/src/templates/lobby-page.js +1 -0
- package/src/utils/schedule.js +16 -0
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ import axios from "axios";
|
|
|
22
22
|
import { navigate } from 'gatsby';
|
|
23
23
|
import { customErrorHandler, customBadgeHandler, voidErrorHandler } from '../utils/customErrorHandler';
|
|
24
24
|
import { getEnvVariable, SUMMIT_API_BASE_URL, SUMMIT_ID } from "../utils/envVariables";
|
|
25
|
+
import expiredToken from "../utils/expiredToken";
|
|
25
26
|
|
|
26
27
|
export const GET_DISQUS_SSO = 'GET_DISQUS_SSO';
|
|
27
28
|
export const GET_USER_PROFILE = 'GET_USER_PROFILE';
|
|
@@ -93,7 +94,11 @@ export const getUserProfile = () => async (dispatch) => {
|
|
|
93
94
|
|
|
94
95
|
let params = {
|
|
95
96
|
access_token: accessToken,
|
|
96
|
-
expand:
|
|
97
|
+
expand:
|
|
98
|
+
'groups,summit_tickets,summit_tickets.ticket_type,summit_tickets.owner,summit_tickets.owner.presentation_votes,' +
|
|
99
|
+
'summit_tickets.owner.extra_questions,summit_tickets.badge,summit_tickets.badge.features,summit_tickets.badge.type,' +
|
|
100
|
+
'summit_tickets.badge.type.access_levels,summit_tickets.badge.type.features,favorite_summit_events,feedback,' +
|
|
101
|
+
'schedule_summit_events,rsvp,rsvp.answers'
|
|
97
102
|
};
|
|
98
103
|
|
|
99
104
|
return getRequest(
|
|
@@ -582,7 +587,6 @@ export const doVirtualCheckIn = (attendee) => async (dispatch, getState) => {
|
|
|
582
587
|
});
|
|
583
588
|
};
|
|
584
589
|
|
|
585
|
-
|
|
586
590
|
/**
|
|
587
591
|
* Get invitation by token to allow reject
|
|
588
592
|
* @param token
|
|
@@ -590,12 +594,11 @@ export const doVirtualCheckIn = (attendee) => async (dispatch, getState) => {
|
|
|
590
594
|
*/
|
|
591
595
|
export const getInvitation = (token) => async (dispatch) => {
|
|
592
596
|
dispatch(startLoading());
|
|
593
|
-
|
|
594
597
|
return getRequest(
|
|
595
598
|
createAction(REQUEST_INVITATION),
|
|
596
599
|
createAction(RECEIVE_INVITATION),
|
|
597
600
|
`${window.API_BASE_URL}/api/public/v1/summits/${window.SUMMIT_ID}/registration-invitations/${token}`,
|
|
598
|
-
|
|
601
|
+
null
|
|
599
602
|
)({})(dispatch)
|
|
600
603
|
.finally(() => dispatch(stopLoading()));
|
|
601
604
|
}
|
|
@@ -607,17 +610,13 @@ export const getInvitation = (token) => async (dispatch) => {
|
|
|
607
610
|
*/
|
|
608
611
|
export const rejectInvitation = (token) => async (dispatch) => {
|
|
609
612
|
dispatch(startLoading());
|
|
610
|
-
|
|
611
613
|
return deleteRequest(
|
|
612
614
|
null,
|
|
613
615
|
createAction(REJECT_INVITATION),
|
|
614
616
|
`${window.API_BASE_URL}/api/public/v1/summits/${window.SUMMIT_ID}/registration-invitations/${token}/reject`,
|
|
615
617
|
{},
|
|
616
|
-
|
|
618
|
+
null
|
|
617
619
|
)({})(dispatch)
|
|
618
|
-
.then(() => {
|
|
619
|
-
//redirect ?
|
|
620
|
-
})
|
|
621
620
|
.finally(() => dispatch(stopLoading()));
|
|
622
621
|
}
|
|
623
622
|
|
|
@@ -38,8 +38,19 @@ const invitationsRejectPage = {
|
|
|
38
38
|
required: false,
|
|
39
39
|
default: "Reject Invitation"
|
|
40
40
|
}),
|
|
41
|
+
stringField({
|
|
42
|
+
label: "Already Accepted Invitation Error",
|
|
43
|
+
name: "alreadyAcceptedInvitationError",
|
|
44
|
+
required: false,
|
|
45
|
+
default: "This invitation has already been accepted. Please contact the event organizer if you feel this is an error."
|
|
46
|
+
}),
|
|
47
|
+
stringField({
|
|
48
|
+
label: "Already Rejected Invitation Error",
|
|
49
|
+
name: "alreadyRejectedInvitationError",
|
|
50
|
+
required: false,
|
|
51
|
+
default: "This invitation has already been declined. Please contact the event organizer if you feel this is an error."
|
|
52
|
+
}),
|
|
41
53
|
]
|
|
42
54
|
};
|
|
43
55
|
|
|
44
56
|
export default invitationsRejectPage;
|
|
45
|
-
|
|
@@ -21,16 +21,19 @@ const LiteScheduleComponent = ({
|
|
|
21
21
|
page,
|
|
22
22
|
addToSchedule,
|
|
23
23
|
removeFromSchedule,
|
|
24
|
-
|
|
24
|
+
schedules,
|
|
25
25
|
summit,
|
|
26
|
+
schedKey = 'schedule-main',
|
|
26
27
|
...rest
|
|
27
28
|
}) => {
|
|
28
29
|
const wrapperClass = page === 'marketing-site' ? 'schedule-container-marketing' : 'schedule-container';
|
|
29
30
|
const { getSettingByKey } = useMarketingSettings();
|
|
30
31
|
const defaultImage = getSettingByKey(MARKETING_SETTINGS_KEYS.schedultDefaultImage);
|
|
32
|
+
const scheduleState = schedules?.find( s => s.key === schedKey);
|
|
33
|
+
|
|
31
34
|
const componentProps = {
|
|
32
35
|
defaultImage: defaultImage,
|
|
33
|
-
eventsData:
|
|
36
|
+
eventsData: scheduleState?.allEvents || [],
|
|
34
37
|
summitData: summit,
|
|
35
38
|
marketingData: colorSettings,
|
|
36
39
|
userProfile: userProfile,
|
|
@@ -60,7 +63,7 @@ const LiteScheduleComponent = ({
|
|
|
60
63
|
|
|
61
64
|
const mapStateToProps = ({userState, summitState, allSchedulesState, settingState}) => ({
|
|
62
65
|
userProfile: userState.userProfile,
|
|
63
|
-
|
|
66
|
+
schedules: allSchedulesState.schedules,
|
|
64
67
|
summit: summitState.summit,
|
|
65
68
|
colorSettings: settingState.colorSettings
|
|
66
69
|
});
|
|
@@ -13,7 +13,7 @@ import useMarketingSettings, { MARKETING_SETTINGS_KEYS } from "@utils/useMarketi
|
|
|
13
13
|
import { SentryFallbackFunction } from "./SentryErrorComponent";
|
|
14
14
|
|
|
15
15
|
const LiveEventWidgetComponent = ({
|
|
16
|
-
|
|
16
|
+
schedules,
|
|
17
17
|
summit,
|
|
18
18
|
colorSettings,
|
|
19
19
|
className = "live-event-container",
|
|
@@ -21,10 +21,12 @@ const LiveEventWidgetComponent = ({
|
|
|
21
21
|
}) => {
|
|
22
22
|
const { getSettingByKey } = useMarketingSettings();
|
|
23
23
|
const defaultImage = getSettingByKey(MARKETING_SETTINGS_KEYS.schedultDefaultImage);
|
|
24
|
+
const scheduleState = schedules?.find( s => s.key === 'schedule-main');
|
|
25
|
+
|
|
24
26
|
const widgetProps = {
|
|
25
27
|
title: "",
|
|
26
28
|
defaultImage: defaultImage,
|
|
27
|
-
eventsData: allEvents,
|
|
29
|
+
eventsData: scheduleState?.allEvents || [],
|
|
28
30
|
summitData: summit,
|
|
29
31
|
marketingData: colorSettings,
|
|
30
32
|
...rest
|
|
@@ -41,7 +43,7 @@ const LiveEventWidgetComponent = ({
|
|
|
41
43
|
|
|
42
44
|
const mapStateToProps = ({ summitState, allSchedulesState, settingState }) => ({
|
|
43
45
|
summit: summitState.summit,
|
|
44
|
-
|
|
46
|
+
schedules: allSchedulesState.schedules,
|
|
45
47
|
colorSettings: settingState.colorSettings
|
|
46
48
|
});
|
|
47
49
|
|
|
@@ -9,12 +9,14 @@ import 'speakers-widget/dist/index.css';
|
|
|
9
9
|
|
|
10
10
|
import { SentryFallbackFunction } from "./SentryErrorComponent";
|
|
11
11
|
|
|
12
|
-
const SpeakersWidgetComponent = ({now, colorSettings, allEvents, speakers, ...props}) => {
|
|
12
|
+
const SpeakersWidgetComponent = ({now, colorSettings, allEvents, speakers, schedules, ...props}) => {
|
|
13
|
+
const scheduleState = schedules?.find( s => s.key === 'schedule-main');
|
|
14
|
+
|
|
13
15
|
const widgetProps = {
|
|
14
16
|
date: now,
|
|
15
17
|
// featured: true,
|
|
16
18
|
speakersData: speakers,
|
|
17
|
-
eventsData: allEvents,
|
|
19
|
+
eventsData: scheduleState?.allEvents || [],
|
|
18
20
|
marketingData: colorSettings,
|
|
19
21
|
...props
|
|
20
22
|
};
|
|
@@ -30,10 +32,10 @@ const SpeakersWidgetComponent = ({now, colorSettings, allEvents, speakers, ...pr
|
|
|
30
32
|
)
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
const mapStateToProps = ({ clockState,
|
|
35
|
+
const mapStateToProps = ({ clockState, allSchedulesState, speakerState, settingState }) => ({
|
|
34
36
|
now: clockState.nowUtc,
|
|
35
37
|
colorSettings: settingState.colorSettings,
|
|
36
|
-
|
|
38
|
+
schedules: allSchedulesState.schedules,
|
|
37
39
|
speakers: speakerState.speakers
|
|
38
40
|
});
|
|
39
41
|
|
|
@@ -21,16 +21,18 @@ const UpcomingEventsComponent = ({
|
|
|
21
21
|
addToSchedule,
|
|
22
22
|
removeFromSchedule,
|
|
23
23
|
colorSettings,
|
|
24
|
-
|
|
24
|
+
schedules,
|
|
25
25
|
summit,
|
|
26
26
|
...rest
|
|
27
27
|
}) => {
|
|
28
28
|
const wrapperClass = page === "marketing-site" ? "schedule-container-marketing" : "schedule-container";
|
|
29
29
|
const { getSettingByKey } = useMarketingSettings();
|
|
30
30
|
const defaultImage = getSettingByKey(MARKETING_SETTINGS_KEYS.schedultDefaultImage);
|
|
31
|
+
const scheduleState = schedules?.find( s => s.key === 'schedule-main');
|
|
32
|
+
|
|
31
33
|
const componentProps = {
|
|
32
34
|
defaultImage: defaultImage,
|
|
33
|
-
eventsData: allEvents,
|
|
35
|
+
eventsData: scheduleState?.allEvents || [],
|
|
34
36
|
summitData: summit,
|
|
35
37
|
marketingData: colorSettings,
|
|
36
38
|
userProfile: userProfile,
|
|
@@ -62,7 +64,7 @@ const mapStateToProps = ({ userState, summitState, allSchedulesState, settingSta
|
|
|
62
64
|
userProfile: userState.userProfile,
|
|
63
65
|
colorSettings: settingState.colorSettings,
|
|
64
66
|
summit: summitState.summit,
|
|
65
|
-
|
|
67
|
+
schedules: allSchedulesState.schedules,
|
|
66
68
|
});
|
|
67
69
|
|
|
68
70
|
export default connect(mapStateToProps, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "Invitation
|
|
3
|
-
"notFoundText": "
|
|
4
|
-
"rejectedText": "You have
|
|
5
|
-
"rejectText": "
|
|
6
|
-
"rejectCTALabel": "
|
|
7
|
-
}
|
|
2
|
+
"title": "Decline Invitation",
|
|
3
|
+
"notFoundText": "Sorry, we cannot locate your invitation. Please email for additional assistance.",
|
|
4
|
+
"rejectedText": "Thank you. You have declined this invitation.",
|
|
5
|
+
"rejectText": "Are you sure? Last chance to get your ticket!",
|
|
6
|
+
"rejectCTALabel": "Decline"
|
|
7
|
+
}
|
package/src/pages/a/[...].js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {useEffect, useState
|
|
1
|
+
import React, {useEffect, useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import {connect} from "react-redux";
|
|
4
4
|
import Layout from "../components/Layout";
|
|
@@ -10,72 +10,102 @@ import styles from "../styles/invitation-reject.module.scss";
|
|
|
10
10
|
|
|
11
11
|
const InvitationsRejectPage = ({data, location, invitationToken, invitation, loading, ...props}) => {
|
|
12
12
|
const [loaded, setLoaded] = useState(false);
|
|
13
|
+
const [error, setError] = useState(null);
|
|
13
14
|
const [rejecting, setRejecting] = useState(false);
|
|
14
|
-
const {invitationsRejectPageJson: {title, notFoundText, rejectedText, rejectText, rejectCTALabel}} = data;
|
|
15
|
+
const {invitationsRejectPageJson: {title, notFoundText, rejectedText, rejectText, rejectCTALabel, alreadyAcceptedInvitationError, alreadyRejectedInvitationError}} = data;
|
|
15
16
|
const titleStr = title || "Reject invitation"
|
|
16
17
|
const rejectStr = rejectText || "To reject please click on the button below."
|
|
17
18
|
const rejectCTA = rejectCTALabel || "Reject"
|
|
18
19
|
const notFoundStr = notFoundText || "Invitation not found."
|
|
19
20
|
const rejectedStr = rejectedText || "Invitation has already been rejected."
|
|
20
21
|
|
|
22
|
+
const invitationErrorhandler = (e) => {
|
|
23
|
+
const { res } = e;
|
|
24
|
+
let code = res.status;
|
|
25
|
+
switch(code){
|
|
26
|
+
case 404:
|
|
27
|
+
setError(notFoundStr)
|
|
28
|
+
break;
|
|
29
|
+
case 412: {
|
|
30
|
+
const response = res?.body;
|
|
31
|
+
let apiErrors = '';
|
|
32
|
+
response.errors.forEach(val => apiErrors += val + '\n');
|
|
33
|
+
switch (response.code) {
|
|
34
|
+
case 1:
|
|
35
|
+
apiErrors = alreadyAcceptedInvitationError || apiErrors;
|
|
36
|
+
break;
|
|
37
|
+
case 2:
|
|
38
|
+
apiErrors = alreadyRejectedInvitationError || apiErrors;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
setError(apiErrors);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
21
47
|
useEffect(() => {
|
|
22
48
|
setLoaded(false);
|
|
23
49
|
if (invitationToken) {
|
|
24
50
|
props.getInvitation(invitationToken)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
51
|
+
.catch(invitationErrorhandler)
|
|
52
|
+
.finally(() => {
|
|
53
|
+
setLoaded(true)
|
|
54
|
+
});
|
|
28
55
|
}
|
|
29
56
|
}, []);
|
|
30
57
|
|
|
31
58
|
const rejectInvitation = () => {
|
|
32
59
|
setRejecting(true);
|
|
33
60
|
props.rejectInvitation(invitationToken)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
.catch(invitationErrorhandler)
|
|
62
|
+
.finally(() => {
|
|
63
|
+
setRejecting(false);
|
|
64
|
+
});
|
|
37
65
|
}
|
|
38
66
|
|
|
39
67
|
const getMessage = () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
68
|
+
|
|
69
|
+
if (!invitationToken) {
|
|
70
|
+
return (
|
|
71
|
+
<>
|
|
72
|
+
<div>Missing token.</div>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!loaded) return null;
|
|
78
|
+
|
|
48
79
|
if (!invitation) {
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<div>{notFoundStr}</div>
|
|
52
|
-
</>
|
|
53
|
-
);
|
|
54
|
-
} else {
|
|
55
|
-
if (invitation.status === 'Rejected') {
|
|
56
80
|
return (
|
|
57
81
|
<>
|
|
58
|
-
|
|
82
|
+
<div>{error}</div>
|
|
59
83
|
</>
|
|
60
|
-
)
|
|
61
|
-
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (invitation.status === 'Rejected') {
|
|
62
88
|
return (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{rejectCTA}
|
|
67
|
-
</button>
|
|
68
|
-
</>
|
|
89
|
+
<>
|
|
90
|
+
<div>{rejectedStr}</div>
|
|
91
|
+
</>
|
|
69
92
|
)
|
|
70
|
-
|
|
93
|
+
}
|
|
71
94
|
|
|
95
|
+
if (invitation.status === 'Pending') {
|
|
96
|
+
return (
|
|
97
|
+
<>
|
|
98
|
+
<div>{rejectStr}</div>
|
|
99
|
+
<button className="button is-large" onClick={rejectInvitation} disabled={rejecting}>
|
|
100
|
+
{rejectCTA}
|
|
101
|
+
</button>
|
|
102
|
+
</>
|
|
103
|
+
)
|
|
72
104
|
}
|
|
73
|
-
|
|
105
|
+
|
|
74
106
|
return null;
|
|
75
|
-
}
|
|
76
107
|
}
|
|
77
108
|
|
|
78
|
-
|
|
79
109
|
return (
|
|
80
110
|
<Layout location={location}>
|
|
81
111
|
<div className={`container ${styles.container}`}>
|
package/src/utils/schedule.js
CHANGED
|
@@ -4,6 +4,7 @@ import { epochToMomentTimeZone , getFromLocalStorage, putOnLocalStorage }
|
|
|
4
4
|
import { isString } from "lodash";
|
|
5
5
|
import { getEnvVariable, SCHEDULE_EXCLUDING_TAGS } from "./envVariables";
|
|
6
6
|
import {getUserAccessLevelIds, isAuthorizedUser} from './authorizedGroups';
|
|
7
|
+
import {uniq} from "lodash";
|
|
7
8
|
|
|
8
9
|
const groupByDay = (events) => {
|
|
9
10
|
let groupedEvents = [];
|
|
@@ -58,6 +59,19 @@ export const filterEventsByTags = (events) => {
|
|
|
58
59
|
: events;
|
|
59
60
|
};
|
|
60
61
|
|
|
62
|
+
export const filterEventsByTicket = (events, user) => {
|
|
63
|
+
const assignedTickets = user?.summit_tickets || [];
|
|
64
|
+
const ticketTypeIds = uniq(assignedTickets.map(t => t.ticket_type?.id));
|
|
65
|
+
|
|
66
|
+
return events.filter(ev => {
|
|
67
|
+
const hasEventRestriction = ev.allowed_ticket_types.length > 0;
|
|
68
|
+
const typeAllowed = ev.type.allowed_ticket_types.length === 0 || ev.type.allowed_ticket_types.some(att => ticketTypeIds.includes(att));
|
|
69
|
+
const eventAllowed = !hasEventRestriction || ev.allowed_ticket_types.some(att => ticketTypeIds.includes(att));
|
|
70
|
+
|
|
71
|
+
return hasEventRestriction ? eventAllowed : typeAllowed;
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
61
75
|
const filterMyEvents = (myEvents, events) => {
|
|
62
76
|
const myEventsIds = myEvents?.map(ev => ev.id) || [];
|
|
63
77
|
return events.filter(ev => myEventsIds.includes(ev.id));
|
|
@@ -75,6 +89,8 @@ export const preFilterEvents = (events, filters, summitTimezone, userProfile, fi
|
|
|
75
89
|
result = filterEventsByAccessLevel(result, userProfile);
|
|
76
90
|
}
|
|
77
91
|
|
|
92
|
+
result = filterEventsByTicket(result, userProfile);
|
|
93
|
+
|
|
78
94
|
return getFilteredEvents(result, filters, summitTimezone, hidePast);
|
|
79
95
|
};
|
|
80
96
|
|