@openeventkit/event-site 2.1.48 → 2.1.50
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 +3 -3
- package/src/actions/user-actions.js +9 -10
- package/src/components/RegistrationLiteComponent.js +1 -1
- package/src/components/VimeoPlayer.js +2 -2
- package/src/content/site-settings/index.json +1 -1
- package/src/content/sponsors.json +1 -1
- package/src/styles/colors.scss +11 -11
- package/src/templates/extra-questions-page.js +1 -1
- package/src/templates/full-profile-page.js +2 -3
- package/src/utils/alerts.js +34 -27
- package/src/utils/customErrorHandler.js +4 -4
- package/src/utils/ticketConstants.js +10 -0
- package/src/components/summit-my-orders-tickets/components/ConfirmPopup/ConfirmPopup.js +0 -96
- package/src/components/summit-my-orders-tickets/components/ConfirmPopup/confirm-popup.scss +0 -57
- package/src/components/summit-my-orders-tickets/components/DelegatePopup/DelegatePopup.js +0 -50
- package/src/components/summit-my-orders-tickets/components/DelegatePopup/delegate-popup.scss +0 -57
- package/src/components/summit-my-orders-tickets/components/MyOrdersTickets.js +0 -79
- package/src/components/summit-my-orders-tickets/components/OrderDetails/OrderDetails.js +0 -112
- package/src/components/summit-my-orders-tickets/components/OrderDetails/order-details.scss +0 -128
- package/src/components/summit-my-orders-tickets/components/OrderList/OrderList.js +0 -80
- package/src/components/summit-my-orders-tickets/components/OrderList/OrderListItem.js +0 -85
- package/src/components/summit-my-orders-tickets/components/OrderList/order-list.scss +0 -60
- package/src/components/summit-my-orders-tickets/components/OrderOptions/OrderOptions.js +0 -83
- package/src/components/summit-my-orders-tickets/components/OrderOptions/order-options.scss +0 -50
- package/src/components/summit-my-orders-tickets/components/OrderSummary/OrderSummary.js +0 -64
- package/src/components/summit-my-orders-tickets/components/OrderSummary/OrderSummaryTable.js +0 -97
- package/src/components/summit-my-orders-tickets/components/OrderSummary/order-summary.scss +0 -178
- package/src/components/summit-my-orders-tickets/components/OrderTicketDetails/OrderTicketDetails.js +0 -102
- package/src/components/summit-my-orders-tickets/components/OrderTicketDetails/order-ticket-details.scss +0 -129
- package/src/components/summit-my-orders-tickets/components/OrderTicketList/OrderTicketList.js +0 -19
- package/src/components/summit-my-orders-tickets/components/OrderTicketList/OrderTicketListItem.js +0 -13
- package/src/components/summit-my-orders-tickets/components/OrderTicketList/order-ticket-list.scss +0 -21
- package/src/components/summit-my-orders-tickets/components/TicketDetails/TicketDetails.js +0 -93
- package/src/components/summit-my-orders-tickets/components/TicketDetails/ticket-details.scss +0 -129
- package/src/components/summit-my-orders-tickets/components/TicketList/TicketList.js +0 -65
- package/src/components/summit-my-orders-tickets/components/TicketList/TicketListItem.js +0 -16
- package/src/components/summit-my-orders-tickets/components/TicketList/ticket-list.scss +0 -21
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopup.js +0 -186
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupAssignForm.js +0 -136
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupEditDetailsForm/TicketPopupEditDetailsForm.js +0 -468
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupEditDetailsForm/ticket-popup-edit-details-form.scss +0 -71
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupNotifyForm.js +0 -64
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupReassignForm.js +0 -193
- package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupRefundForm.js +0 -64
- package/src/components/summit-my-orders-tickets/components/TicketPopup/ticket-popup.scss +0 -416
- package/src/components/summit-my-orders-tickets/context/TicketAssignedContext.js +0 -24
- package/src/components/summit-my-orders-tickets/global/constants.js +0 -10
- package/src/components/summit-my-orders-tickets/i18n/index.js +0 -37
- package/src/components/summit-my-orders-tickets/i18n/locales/en.json +0 -296
- package/src/components/summit-my-orders-tickets/i18n/locales/es.json +0 -296
- package/src/components/summit-my-orders-tickets/index.js +0 -1
- package/src/components/summit-my-orders-tickets/store/actions/base-actions.js +0 -7
- package/src/components/summit-my-orders-tickets/store/actions/order-actions.js +0 -96
- package/src/components/summit-my-orders-tickets/store/actions/summit-actions.js +0 -64
- package/src/components/summit-my-orders-tickets/store/actions/ticket-actions.js +0 -666
- package/src/components/summit-my-orders-tickets/store/actions/timer-actions.js +0 -29
- package/src/components/summit-my-orders-tickets/store/actions/user-actions.js +0 -42
- package/src/components/summit-my-orders-tickets/store/history.js +0 -16
- package/src/components/summit-my-orders-tickets/store/index.js +0 -117
- package/src/components/summit-my-orders-tickets/store/reducers/base-reducer.js +0 -67
- package/src/components/summit-my-orders-tickets/store/reducers/clock-reducer.js +0 -31
- package/src/components/summit-my-orders-tickets/store/reducers/order-reducer.js +0 -95
- package/src/components/summit-my-orders-tickets/store/reducers/summit-reducer.js +0 -52
- package/src/components/summit-my-orders-tickets/store/reducers/ticket-reducer.js +0 -92
- package/src/components/summit-my-orders-tickets/store/reducers/user-reducer.js +0 -35
- package/src/components/summit-my-orders-tickets/styles/_variables.scss +0 -17
- package/src/components/summit-my-orders-tickets/styles/general.scss +0 -17
- package/src/components/summit-my-orders-tickets/summit-my-orders-tickets.js +0 -86
- package/src/components/summit-my-orders-tickets/util/helpers/capitalizeFirstLetter.js +0 -1
- package/src/components/summit-my-orders-tickets/util/helpers/createReducer.js +0 -11
- package/src/components/summit-my-orders-tickets/util/helpers/formatCurrency.js +0 -15
- package/src/components/summit-my-orders-tickets/util/helpers/getDayNumberFromDate.js +0 -9
- package/src/components/summit-my-orders-tickets/util/helpers/getDaysBetweenDates.js +0 -16
- package/src/components/summit-my-orders-tickets/util/helpers/getDocumentOffset.js +0 -8
- package/src/components/summit-my-orders-tickets/util/helpers/getFormattedDate.js +0 -7
- package/src/components/summit-my-orders-tickets/util/helpers/getFormattedTime.js +0 -9
- package/src/components/summit-my-orders-tickets/util/helpers/getWindowScroll.js +0 -6
- package/src/components/summit-my-orders-tickets/util/helpers/index.js +0 -22
- package/src/components/summit-my-orders-tickets/util/index.js +0 -5
- package/src/components/summit-my-orders-tickets/util/order/calculateOrderTotals.js +0 -28
- package/src/components/summit-my-orders-tickets/util/order/getOrderStatusData.js +0 -71
- package/src/components/summit-my-orders-tickets/util/order/index.js +0 -2
- package/src/components/summit-my-orders-tickets/util/summit/checkSummitPast.js +0 -10
- package/src/components/summit-my-orders-tickets/util/summit/checkSummitStarted.js +0 -5
- package/src/components/summit-my-orders-tickets/util/summit/getSummitFormattedDate.js +0 -29
- package/src/components/summit-my-orders-tickets/util/summit/getSummitFormattedReassignDate.js +0 -8
- package/src/components/summit-my-orders-tickets/util/summit/getSummitLocation.js +0 -9
- package/src/components/summit-my-orders-tickets/util/summit/getSummitReassignDate.js +0 -7
- package/src/components/summit-my-orders-tickets/util/summit/index.js +0 -7
- package/src/components/summit-my-orders-tickets/util/summit/useSummitDetails.js +0 -36
- package/src/components/summit-my-orders-tickets/util/ticket/getTicketRole.js +0 -11
- package/src/components/summit-my-orders-tickets/util/ticket/getTicketStatusData.js +0 -48
- package/src/components/summit-my-orders-tickets/util/ticket/getTicketType.js +0 -1
- package/src/components/summit-my-orders-tickets/util/ticket/index.js +0 -4
- package/src/components/summit-my-orders-tickets/util/ticket/useTicketDetails.js +0 -60
- package/src/components/summit-my-orders-tickets/util/timer/index.js +0 -1
- package/src/components/summit-my-orders-tickets/util/timer/useNow.js +0 -8
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
authErrorHandler,
|
|
3
|
-
putRequest,
|
|
4
|
-
createAction,
|
|
5
|
-
stopLoading,
|
|
6
|
-
startLoading
|
|
7
|
-
} from 'openstack-uicore-foundation/lib/utils/actions';
|
|
8
|
-
|
|
9
|
-
export const START_LOADING_IDP_PROFILE = 'START_LOADING_IDP_PROFILE';
|
|
10
|
-
export const STOP_LOADING_IDP_PROFILE = 'STOP_LOADING_IDP_PROFILE';
|
|
11
|
-
export const UPDATE_IDP_PROFILE = 'UPDATE_IDP_PROFILE';
|
|
12
|
-
export const SET_USER = 'SET_USER';
|
|
13
|
-
|
|
14
|
-
export const setUser = (user) => (dispatch) => dispatch(createAction(SET_USER)(user));
|
|
15
|
-
|
|
16
|
-
export const updateProfile = (profile) => async (dispatch, getState, { getAccessToken, idpBaseUrl, loginUrl }) => {
|
|
17
|
-
const accessToken = await getAccessToken().catch(() => {
|
|
18
|
-
dispatch(stopLoading());
|
|
19
|
-
console.log('REJECTING PROMISE AFTER STOP LOADING')
|
|
20
|
-
return Promise.reject();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
if (!accessToken) return Promise.reject();
|
|
24
|
-
|
|
25
|
-
dispatch(startLoading());
|
|
26
|
-
|
|
27
|
-
const params = {
|
|
28
|
-
access_token: accessToken,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
dispatch(createAction(START_LOADING_IDP_PROFILE)());
|
|
32
|
-
|
|
33
|
-
return putRequest(
|
|
34
|
-
null,
|
|
35
|
-
createAction(UPDATE_IDP_PROFILE),
|
|
36
|
-
// TODO: need IDP_BASE_URL
|
|
37
|
-
`${idpBaseUrl}/api/v1/users/me`,
|
|
38
|
-
profile,
|
|
39
|
-
authErrorHandler
|
|
40
|
-
)(params)(dispatch)
|
|
41
|
-
.catch(() => dispatch(createAction(STOP_LOADING_IDP_PROFILE)()));
|
|
42
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
* See the License for the specific language governing permissions and
|
|
11
|
-
* limitations under the License.
|
|
12
|
-
**/
|
|
13
|
-
|
|
14
|
-
import { createBrowserHistory } from 'history'
|
|
15
|
-
|
|
16
|
-
export default createBrowserHistory();
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
* See the License for the specific language governing permissions and
|
|
11
|
-
* limitations under the License.
|
|
12
|
-
**/
|
|
13
|
-
import { useMemo } from 'react';
|
|
14
|
-
import { createStore, applyMiddleware, compose } from 'redux';
|
|
15
|
-
import thunk from 'redux-thunk';
|
|
16
|
-
import { persistStore, persistCombineReducers } from 'redux-persist'
|
|
17
|
-
import storage from 'redux-persist/lib/storage'
|
|
18
|
-
import { loggedUserReducer } from "openstack-uicore-foundation/lib/security/reducers"
|
|
19
|
-
import baseReducer from './reducers/base-reducer'
|
|
20
|
-
import summitReducer from './reducers/summit-reducer'
|
|
21
|
-
import orderReducer from './reducers/order-reducer'
|
|
22
|
-
import ticketReducer from './reducers/ticket-reducer'
|
|
23
|
-
import userReducer from './reducers/user-reducer';
|
|
24
|
-
import clockReducer from './reducers/clock-reducer';
|
|
25
|
-
|
|
26
|
-
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
|
27
|
-
|
|
28
|
-
export const getStore = ({
|
|
29
|
-
clientId,
|
|
30
|
-
apiBaseUrl,
|
|
31
|
-
idpBaseUrl,
|
|
32
|
-
loginUrl,
|
|
33
|
-
supportEmail,
|
|
34
|
-
getAccessToken,
|
|
35
|
-
getUserProfile,
|
|
36
|
-
summit,
|
|
37
|
-
user
|
|
38
|
-
}) => {
|
|
39
|
-
const config = {
|
|
40
|
-
key: `root_registration_${clientId}`,
|
|
41
|
-
storage,
|
|
42
|
-
blacklist: [
|
|
43
|
-
// this will be not saved to persistent storage see
|
|
44
|
-
// https://github.com/rt2zz/redux-persist#blacklist--whitelist
|
|
45
|
-
'orderState',
|
|
46
|
-
'summitState',
|
|
47
|
-
'ticketState',
|
|
48
|
-
'timerState',
|
|
49
|
-
'userState'
|
|
50
|
-
]
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const reducers = persistCombineReducers(config, {
|
|
54
|
-
globalState: baseReducer,
|
|
55
|
-
loggedUserState: loggedUserReducer,
|
|
56
|
-
summitState: summitReducer,
|
|
57
|
-
orderState: orderReducer,
|
|
58
|
-
ticketState: ticketReducer,
|
|
59
|
-
timerState: clockReducer,
|
|
60
|
-
userState: userReducer
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const initialState = {
|
|
64
|
-
// Note: set config/env variables on the `globalState` for use in components as needed.
|
|
65
|
-
globalState: {
|
|
66
|
-
clientId,
|
|
67
|
-
apiBaseUrl,
|
|
68
|
-
idpBaseUrl,
|
|
69
|
-
loginUrl,
|
|
70
|
-
supportEmail,
|
|
71
|
-
},
|
|
72
|
-
userState: user,
|
|
73
|
-
summitState: { summit }
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const store = createStore(
|
|
77
|
-
reducers,
|
|
78
|
-
// Initialize the userState with the user passed in to the widget props.
|
|
79
|
-
initialState,
|
|
80
|
-
composeEnhancers(
|
|
81
|
-
applyMiddleware(
|
|
82
|
-
thunk.withExtraArgument({
|
|
83
|
-
apiBaseUrl,
|
|
84
|
-
idpBaseUrl,
|
|
85
|
-
loginUrl,
|
|
86
|
-
supportEmail,
|
|
87
|
-
getAccessToken,
|
|
88
|
-
getUserProfile
|
|
89
|
-
})
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
return store;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const getPersistor = (store) => {
|
|
98
|
-
const onRehydrateComplete = () => {
|
|
99
|
-
const { loggedUserState } = store.getState();
|
|
100
|
-
|
|
101
|
-
// repopulate access token on global access variable
|
|
102
|
-
window.accessToken = loggedUserState?.accessToken;
|
|
103
|
-
window.idToken = loggedUserState?.idToken;
|
|
104
|
-
window.sessionState = loggedUserState?.sessionState;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const persistor = persistStore(store, null, onRehydrateComplete);
|
|
108
|
-
|
|
109
|
-
return persistor;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const useInitStore = (config) => {
|
|
113
|
-
const store = useMemo(() => getStore(config), []);
|
|
114
|
-
const persistor = useMemo(() => getPersistor(store), [store]);
|
|
115
|
-
|
|
116
|
-
return { store, persistor };
|
|
117
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
* See the License for the specific language governing permissions and
|
|
11
|
-
* limitations under the License.
|
|
12
|
-
**/
|
|
13
|
-
|
|
14
|
-
import { START_LOADING, STOP_LOADING } from "openstack-uicore-foundation/lib/utils/actions";
|
|
15
|
-
import {LOGOUT_USER} from "openstack-uicore-foundation/lib/security/actions";
|
|
16
|
-
import { RESET_STATE } from "../actions/base-actions";
|
|
17
|
-
import { RECEIVE_MARKETING_SETTINGS, CLEAR_MARKETING_SETTINGS } from '../actions/summit-actions';
|
|
18
|
-
|
|
19
|
-
const DEFAULT_STATE = {
|
|
20
|
-
loading: false,
|
|
21
|
-
marketingSettings: null,
|
|
22
|
-
favicon: null,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const baseReducer = (state = DEFAULT_STATE, action) => {
|
|
26
|
-
const { type, payload } = action
|
|
27
|
-
|
|
28
|
-
switch (type) {
|
|
29
|
-
case RESET_STATE:
|
|
30
|
-
return { ...state, ...DEFAULT_STATE };
|
|
31
|
-
break;
|
|
32
|
-
case LOGOUT_USER:
|
|
33
|
-
return { ...state, ...DEFAULT_STATE };
|
|
34
|
-
case START_LOADING:
|
|
35
|
-
return { ...state, loading: true };
|
|
36
|
-
break;
|
|
37
|
-
case STOP_LOADING:
|
|
38
|
-
return { ...state, loading: false };
|
|
39
|
-
break;
|
|
40
|
-
case CLEAR_MARKETING_SETTINGS: {
|
|
41
|
-
// reset state we are getting new summits
|
|
42
|
-
return { ...state, marketingSettings: [], favicon: window.DEFAULT_FAV_ICON };
|
|
43
|
-
}
|
|
44
|
-
case RECEIVE_MARKETING_SETTINGS: {
|
|
45
|
-
const { data } = payload.response;
|
|
46
|
-
// default one
|
|
47
|
-
let favicon = window.DEFAULT_FAV_ICON;
|
|
48
|
-
// set color vars
|
|
49
|
-
if (typeof document !== 'undefined') {
|
|
50
|
-
data.forEach(setting => {
|
|
51
|
-
if (getComputedStyle(document.documentElement).getPropertyValue(`--${setting.key}`)) {
|
|
52
|
-
document.documentElement.style.setProperty(`--${setting.key}`, setting.value);
|
|
53
|
-
document.documentElement.style.setProperty(`--${setting.key}50`, `${setting.value}50`);
|
|
54
|
-
}
|
|
55
|
-
if (setting.key === 'favicon') {
|
|
56
|
-
favicon = setting.file;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return { ...state, marketingSettings: data, favicon };
|
|
61
|
-
}
|
|
62
|
-
default:
|
|
63
|
-
return state;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export default baseReducer
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { START_LOADING, STOP_LOADING } from "openstack-uicore-foundation/lib/utils/actions";
|
|
2
|
-
import { LOGOUT_USER } from "openstack-uicore-foundation/lib/security/actions";
|
|
3
|
-
import { UPDATE_CLOCK } from '../actions/timer-actions';
|
|
4
|
-
|
|
5
|
-
const localNowUtc = Math.round(+new Date() / 1000);
|
|
6
|
-
// calculate on initial state the nowUtc ( local ) and the summit phase using the json data
|
|
7
|
-
const DEFAULT_STATE = {
|
|
8
|
-
loading: false,
|
|
9
|
-
nowUtc: localNowUtc,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const clockReducer = (state = DEFAULT_STATE, action) => {
|
|
13
|
-
const { type, payload } = action;
|
|
14
|
-
|
|
15
|
-
switch (type) {
|
|
16
|
-
case LOGOUT_USER:
|
|
17
|
-
return DEFAULT_STATE;
|
|
18
|
-
case START_LOADING:
|
|
19
|
-
return { ...state, loading: true };
|
|
20
|
-
case STOP_LOADING:
|
|
21
|
-
return { ...state, loading: false };
|
|
22
|
-
case UPDATE_CLOCK: {
|
|
23
|
-
const { timestamp } = payload;
|
|
24
|
-
return { ...state, nowUtc: timestamp };
|
|
25
|
-
}
|
|
26
|
-
default:
|
|
27
|
-
return state;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default clockReducer;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
* See the License for the specific language governing permissions and
|
|
11
|
-
* limitations under the License.
|
|
12
|
-
**/
|
|
13
|
-
|
|
14
|
-
import { START_LOADING, STOP_LOADING } from "openstack-uicore-foundation/lib/utils/actions";
|
|
15
|
-
import { LOGOUT_USER } from "openstack-uicore-foundation/lib/security/actions";
|
|
16
|
-
import { RESET_STATE } from "../actions/base-actions";
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
GET_USER_ORDERS,
|
|
20
|
-
SET_ACTIVE_ORDER_ID,
|
|
21
|
-
REFUND_ORDER,
|
|
22
|
-
} from "../actions/order-actions";
|
|
23
|
-
import { GET_TICKETS_BY_ORDER, GET_TICKETS_BY_ORDER_ERROR } from "../actions/ticket-actions";
|
|
24
|
-
|
|
25
|
-
const DEFAULT_ENTITY = {
|
|
26
|
-
first_name: '',
|
|
27
|
-
last_name: '',
|
|
28
|
-
email: '',
|
|
29
|
-
company: {
|
|
30
|
-
name: '',
|
|
31
|
-
id: null
|
|
32
|
-
},
|
|
33
|
-
billing_country: '',
|
|
34
|
-
billing_address: '',
|
|
35
|
-
billing_address_two: '',
|
|
36
|
-
billing_city: '',
|
|
37
|
-
billing_state: '',
|
|
38
|
-
billing_zipcode: '',
|
|
39
|
-
currentStep: null,
|
|
40
|
-
tickets: [],
|
|
41
|
-
reservation: {},
|
|
42
|
-
checkout: {},
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const DEFAULT_STATE = {
|
|
46
|
-
purchaseOrder: DEFAULT_ENTITY,
|
|
47
|
-
memberOrders: [],
|
|
48
|
-
errors: {},
|
|
49
|
-
stripeForm: false,
|
|
50
|
-
loaded: false,
|
|
51
|
-
loading: false,
|
|
52
|
-
activeOrderId: null,
|
|
53
|
-
isOrderLoading: false,
|
|
54
|
-
current_page: 1,
|
|
55
|
-
last_page: 1,
|
|
56
|
-
per_page: 5,
|
|
57
|
-
total: 0,
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const orderReducer = (state = DEFAULT_STATE, action) => {
|
|
61
|
-
const { type, payload } = action
|
|
62
|
-
|
|
63
|
-
switch (type) {
|
|
64
|
-
case RESET_STATE:
|
|
65
|
-
return DEFAULT_STATE;
|
|
66
|
-
break;
|
|
67
|
-
case LOGOUT_USER:
|
|
68
|
-
return { ...DEFAULT_STATE, purchaseOrder: { ...state.purchaseOrder } };
|
|
69
|
-
break;
|
|
70
|
-
case START_LOADING:
|
|
71
|
-
return { ...state, loading: true };
|
|
72
|
-
break;
|
|
73
|
-
case STOP_LOADING:
|
|
74
|
-
return { ...state, loading: false };
|
|
75
|
-
break;
|
|
76
|
-
case SET_ACTIVE_ORDER_ID:
|
|
77
|
-
return { ...state, activeOrderId: payload, isOrderLoading: true };
|
|
78
|
-
break;
|
|
79
|
-
case GET_TICKETS_BY_ORDER_ERROR:
|
|
80
|
-
case GET_TICKETS_BY_ORDER:
|
|
81
|
-
return { ...state, isOrderLoading: false };
|
|
82
|
-
break;
|
|
83
|
-
case GET_USER_ORDERS:
|
|
84
|
-
let { data, current_page, total, last_page } = payload.response;
|
|
85
|
-
return { ...state, memberOrders: data, current_page, total, last_page };
|
|
86
|
-
break;
|
|
87
|
-
case REFUND_ORDER:
|
|
88
|
-
return { ...state }
|
|
89
|
-
default:
|
|
90
|
-
return state;
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export default orderReducer
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
* See the License for the specific language governing permissions and
|
|
11
|
-
* limitations under the License.
|
|
12
|
-
**/
|
|
13
|
-
import { START_LOADING, STOP_LOADING } from "openstack-uicore-foundation/lib/utils/actions";
|
|
14
|
-
import { LOGOUT_USER } from "openstack-uicore-foundation/lib/security/actions";
|
|
15
|
-
import { RESET_STATE } from "../actions/base-actions";
|
|
16
|
-
import { GET_MAIN_EXTRA_QUESTIONS, SET_SUMMIT } from "../actions/summit-actions";
|
|
17
|
-
|
|
18
|
-
const DEFAULT_STATE = {
|
|
19
|
-
loading: true,
|
|
20
|
-
summit: null,
|
|
21
|
-
extra_questions: []
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const summitReducer = (state = DEFAULT_STATE, action) => {
|
|
25
|
-
const { type, payload } = action;
|
|
26
|
-
|
|
27
|
-
switch (type) {
|
|
28
|
-
case RESET_STATE:
|
|
29
|
-
return DEFAULT_STATE;
|
|
30
|
-
break;
|
|
31
|
-
case LOGOUT_USER:
|
|
32
|
-
return DEFAULT_STATE;
|
|
33
|
-
case START_LOADING:
|
|
34
|
-
return { ...state, loading: true };
|
|
35
|
-
break;
|
|
36
|
-
case STOP_LOADING:
|
|
37
|
-
return { ...state, loading: false };
|
|
38
|
-
break;
|
|
39
|
-
case SET_SUMMIT:
|
|
40
|
-
return { ...state, summit: payload };
|
|
41
|
-
break;
|
|
42
|
-
case GET_MAIN_EXTRA_QUESTIONS: {
|
|
43
|
-
const extraQuestions = payload.response.data;
|
|
44
|
-
return { ...state, loading: false, extra_questions: extraQuestions }
|
|
45
|
-
}
|
|
46
|
-
default:
|
|
47
|
-
return state;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default summitReducer
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2022
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
* See the License for the specific language governing permissions and
|
|
11
|
-
* limitations under the License.
|
|
12
|
-
**/
|
|
13
|
-
|
|
14
|
-
import { START_LOADING, STOP_LOADING } from "openstack-uicore-foundation/lib/utils/actions";
|
|
15
|
-
import { LOGOUT_USER } from "openstack-uicore-foundation/lib/security/actions";
|
|
16
|
-
import { RESET_STATE } from "../actions/base-actions";
|
|
17
|
-
import {
|
|
18
|
-
GET_TICKETS,
|
|
19
|
-
REMOVE_TICKET_ATTENDEE,
|
|
20
|
-
ASSIGN_TICKET,
|
|
21
|
-
GET_TICKETS_BY_ORDER,
|
|
22
|
-
GET_TICKET_DETAILS,
|
|
23
|
-
GET_ORDER_TICKET_DETAILS
|
|
24
|
-
} from "../actions/ticket-actions";
|
|
25
|
-
|
|
26
|
-
const DEFAULT_STATE = {
|
|
27
|
-
loading: false,
|
|
28
|
-
orderTickets: {
|
|
29
|
-
total: 0,
|
|
30
|
-
per_page: 5,
|
|
31
|
-
current_page: 1,
|
|
32
|
-
last_page: 1,
|
|
33
|
-
tickets: []
|
|
34
|
-
},
|
|
35
|
-
selectedTicket: null,
|
|
36
|
-
memberTickets: [],
|
|
37
|
-
errors: {},
|
|
38
|
-
current_page: 1,
|
|
39
|
-
last_page: 1,
|
|
40
|
-
per_page: 5,
|
|
41
|
-
total: 0,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const ticketReducer = (state = DEFAULT_STATE, action) => {
|
|
45
|
-
const { type, payload } = action
|
|
46
|
-
|
|
47
|
-
switch (type) {
|
|
48
|
-
case RESET_STATE:
|
|
49
|
-
return DEFAULT_STATE;
|
|
50
|
-
break;
|
|
51
|
-
case LOGOUT_USER:
|
|
52
|
-
return DEFAULT_STATE;
|
|
53
|
-
case START_LOADING:
|
|
54
|
-
return { ...state, loading: true };
|
|
55
|
-
case STOP_LOADING:
|
|
56
|
-
return { ...state, loading: false };
|
|
57
|
-
case GET_TICKETS:
|
|
58
|
-
let { data, current_page, total, last_page } = payload.response;
|
|
59
|
-
const lastEditedTicket = state.selectedTicket;
|
|
60
|
-
if (lastEditedTicket) {
|
|
61
|
-
const ticketToUpdate = data.find(t => t.id === lastEditedTicket.id)
|
|
62
|
-
data = [...data.filter(t => t.id !== lastEditedTicket.id), {...ticketToUpdate, ...lastEditedTicket}];
|
|
63
|
-
}
|
|
64
|
-
return { ...state, memberTickets: data, current_page, total, last_page, selectedTicket: null };
|
|
65
|
-
case ASSIGN_TICKET:
|
|
66
|
-
return { ...state, selectedTicket: payload.response };
|
|
67
|
-
case REMOVE_TICKET_ATTENDEE:
|
|
68
|
-
return { ...state, selectedTicket: payload.response };
|
|
69
|
-
case GET_TICKETS_BY_ORDER: {
|
|
70
|
-
const { total, per_page, current_page, last_page, data } = payload.response;
|
|
71
|
-
return { ...state, orderTickets: { total, per_page, current_page, last_page, tickets: data } }
|
|
72
|
-
}
|
|
73
|
-
case GET_ORDER_TICKET_DETAILS: {
|
|
74
|
-
const ticket = payload.response;
|
|
75
|
-
const oldTicket = state.orderTickets.tickets.find(t => t.id === ticket.id);
|
|
76
|
-
const updatedTicket = { ...oldTicket, ...ticket };
|
|
77
|
-
const orderTickets = [...state.orderTickets.tickets.filter(t => t.id !== ticket.id), updatedTicket].sort((a, b) => b.id - a.id);
|
|
78
|
-
return { ...state, orderTickets: { ...state.orderTickets, tickets: orderTickets} }
|
|
79
|
-
}
|
|
80
|
-
case GET_TICKET_DETAILS: {
|
|
81
|
-
const ticket = payload.response;
|
|
82
|
-
const oldTicket = state.memberTickets.find(t => t.id === ticket.id);
|
|
83
|
-
const updatedTicket = { ...oldTicket, ...ticket };
|
|
84
|
-
const memberTickets = [...state.memberTickets.filter(t => t.id !== ticket.id), updatedTicket].sort((a, b) => b.id - a.id);
|
|
85
|
-
return { ...state, memberTickets }
|
|
86
|
-
}
|
|
87
|
-
default:
|
|
88
|
-
return state;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export default ticketReducer;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { LOGOUT_USER } from "openstack-uicore-foundation/lib/security/actions";
|
|
2
|
-
import { RESET_STATE } from "../actions/base-actions";
|
|
3
|
-
import { SET_USER } from "../actions/user-actions";
|
|
4
|
-
/**
|
|
5
|
-
* Copyright 2022
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
**/
|
|
16
|
-
|
|
17
|
-
const DEFAULT_STATE = {};
|
|
18
|
-
|
|
19
|
-
const userReducer = (state = DEFAULT_STATE, action) => {
|
|
20
|
-
const { type, payload } = action;
|
|
21
|
-
|
|
22
|
-
switch (type) {
|
|
23
|
-
case RESET_STATE:
|
|
24
|
-
return DEFAULT_STATE;
|
|
25
|
-
break;
|
|
26
|
-
case LOGOUT_USER:
|
|
27
|
-
return DEFAULT_STATE;
|
|
28
|
-
case SET_USER:
|
|
29
|
-
return payload;
|
|
30
|
-
default:
|
|
31
|
-
return state;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default userReducer
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// TODO: Make sure these align with theme colors.
|
|
2
|
-
$color-primary: var(--color_primary, #d4e5f4);
|
|
3
|
-
$color-primary-contrast: var(--color_primary_contrast, #e6f3ff);
|
|
4
|
-
$color-secondary-contrast: var(--color_secondary_contrast, #3fa2f7);
|
|
5
|
-
$color-text-dark: var(--color_text_dark, #3486cd);
|
|
6
|
-
$color-text-input-hints: var(--color_text_input_hints, #a4c7e6);
|
|
7
|
-
|
|
8
|
-
$color-white: #fff;
|
|
9
|
-
$color-black: #000;
|
|
10
|
-
|
|
11
|
-
$color-gray-light: #ddd;
|
|
12
|
-
$color-gray-lighter: #eee;
|
|
13
|
-
$color-gray-lightest: #f9f9f9;
|
|
14
|
-
|
|
15
|
-
$color-warning: #cc9933;
|
|
16
|
-
$color-success: #669933;
|
|
17
|
-
$color-danger: #da0000;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react"
|
|
2
|
-
import { Provider } from "react-redux";
|
|
3
|
-
import { PersistGate } from 'redux-persist/integration/react'
|
|
4
|
-
import PropTypes from 'prop-types'
|
|
5
|
-
import './i18n';
|
|
6
|
-
import { useInitStore } from './store';
|
|
7
|
-
import { RESET_STATE } from './store/actions/base-actions';
|
|
8
|
-
import { updateClock } from './store/actions/timer-actions';
|
|
9
|
-
import { setUser } from "./store/actions/user-actions";
|
|
10
|
-
import { setSummit } from "./store/actions/summit-actions";
|
|
11
|
-
import { MyOrdersTickets } from "./components/MyOrdersTickets";
|
|
12
|
-
import Clock from 'openstack-uicore-foundation/lib/components/clock';
|
|
13
|
-
import './styles/general.scss';
|
|
14
|
-
|
|
15
|
-
import { TicketAssignedProvider } from "./context/TicketAssignedContext";
|
|
16
|
-
|
|
17
|
-
export const MyOrdersTicketsWidget = ({
|
|
18
|
-
className,
|
|
19
|
-
clientId,
|
|
20
|
-
apiBaseUrl,
|
|
21
|
-
idpBaseUrl,
|
|
22
|
-
loginUrl,
|
|
23
|
-
supportEmail,
|
|
24
|
-
getAccessToken,
|
|
25
|
-
getUserProfile,
|
|
26
|
-
summit,
|
|
27
|
-
user,
|
|
28
|
-
onTicketAssigned,
|
|
29
|
-
...props
|
|
30
|
-
}) => {
|
|
31
|
-
const { store, persistor } = useInitStore({
|
|
32
|
-
clientId,
|
|
33
|
-
apiBaseUrl,
|
|
34
|
-
idpBaseUrl,
|
|
35
|
-
loginUrl,
|
|
36
|
-
supportEmail,
|
|
37
|
-
getAccessToken,
|
|
38
|
-
getUserProfile,
|
|
39
|
-
summit,
|
|
40
|
-
user
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const handleBeforeLift = () => {
|
|
44
|
-
const params = new URLSearchParams(window.location.search);
|
|
45
|
-
const flush = params.has("flushState");
|
|
46
|
-
if (flush) store.dispatch({ type: RESET_STATE, payload: null });
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
// Update the internal userState when the external userState changes
|
|
51
|
-
store.dispatch(setUser(user));
|
|
52
|
-
}, [user]);
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
// Update the internal summitState when the external summitState changes
|
|
56
|
-
store.dispatch(setSummit(summit));
|
|
57
|
-
}, [summit]);
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<Provider store={store}>
|
|
61
|
-
<PersistGate onBeforeLift={handleBeforeLift} loading={null} persistor={persistor}>
|
|
62
|
-
<Clock onTick={(timestamp) => store.dispatch(updateClock(timestamp))} timezone={summit.time_zone_id} />
|
|
63
|
-
<TicketAssignedProvider onTicketAssigned={onTicketAssigned} >
|
|
64
|
-
<MyOrdersTickets {...props} />
|
|
65
|
-
</TicketAssignedProvider>
|
|
66
|
-
</PersistGate>
|
|
67
|
-
</Provider>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
MyOrdersTicketsWidget.propTypes = {
|
|
72
|
-
clientId: PropTypes.string.isRequired,
|
|
73
|
-
apiBaseUrl: PropTypes.string.isRequired,
|
|
74
|
-
idpBaseUrl: PropTypes.string.isRequired,
|
|
75
|
-
loginUrl: PropTypes.string.isRequired,
|
|
76
|
-
supportEmail: PropTypes.string.isRequired,
|
|
77
|
-
getAccessToken: PropTypes.func.isRequired,
|
|
78
|
-
getUserProfile: PropTypes.func.isRequired,
|
|
79
|
-
summit: PropTypes.object.isRequired,
|
|
80
|
-
user: PropTypes.object.isRequired
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// TODO: Move this to the consuming code.
|
|
84
|
-
MyOrdersTicketsWidget.defaultProps = {
|
|
85
|
-
loginUrl: '/'
|
|
86
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const capitalizeFirstLetter = (string) => string.charAt(0).toUpperCase() + string.slice(1);
|