@openeventkit/event-site 2.1.49 → 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 +2 -2
- 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/.playwright-mcp/console-2026-02-26T16-44-19-373Z.log +0 -4
- package/.playwright-mcp/console-2026-02-26T16-47-01-636Z.log +0 -2
- package/.playwright-mcp/console-2026-02-26T16-49-02-149Z.log +0 -4
- package/.playwright-mcp/console-2026-02-26T16-49-40-507Z.log +0 -2
- package/.playwright-mcp/console-2026-02-26T16-50-19-509Z.log +0 -2
- package/.playwright-mcp/console-2026-02-26T16-57-54-251Z.log +0 -3
- package/.playwright-mcp/console-2026-02-26T19-57-40-442Z.log +0 -1
- package/.playwright-mcp/console-2026-02-26T19-57-58-088Z.log +0 -2
- package/.playwright-mcp/console-2026-02-26T20-05-42-541Z.log +0 -2
- package/.playwright-mcp/console-2026-02-26T20-06-33-506Z.log +0 -9
- package/.playwright-mcp/console-2026-02-26T20-42-10-293Z.log +0 -34
- package/.playwright-mcp/console-2026-02-26T20-42-57-262Z.log +0 -65
- package/.playwright-mcp/console-2026-02-26T21-01-25-696Z.log +0 -33
- package/.playwright-mcp/console-2026-02-26T21-03-18-294Z.log +0 -47
- package/.playwright-mcp/console-2026-02-27T00-27-06-325Z.log +0 -131
- package/.playwright-mcp/console-2026-02-27T00-49-26-441Z.log +0 -104
- package/.playwright-mcp/page-2026-02-26T16-51-33-776Z.png +0 -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
package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupNotifyForm.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useDispatch } from "react-redux";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { CSSTransition } from "react-transition-group";
|
|
5
|
-
import Alert from 'react-bootstrap/lib/Alert';
|
|
6
|
-
import { resendNotification } from '../../store/actions/ticket-actions';
|
|
7
|
-
import { getSummitFormattedReassignDate } from '../../util';
|
|
8
|
-
|
|
9
|
-
export const TicketPopupNotifyForm = ({ ticket, summit }) => {
|
|
10
|
-
const { t } = useTranslation();
|
|
11
|
-
const dispatch = useDispatch();
|
|
12
|
-
const [showSaveMessage, setShowSaveMessage] = useState(false);
|
|
13
|
-
const [message, setMessage] = useState('')
|
|
14
|
-
|
|
15
|
-
const toggleSaveMessage = () => {
|
|
16
|
-
setTimeout(() => {
|
|
17
|
-
setShowSaveMessage(true)
|
|
18
|
-
setMessage('');
|
|
19
|
-
}, 50);
|
|
20
|
-
setTimeout(() => setShowSaveMessage(false), 5000);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const handleNotifyButtonClick = () => {
|
|
24
|
-
dispatch(resendNotification({ ...ticket, message })).then(() => {
|
|
25
|
-
toggleSaveMessage();
|
|
26
|
-
setMessage('');
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className="ticket-notify-form">
|
|
32
|
-
<div className="ticket-popup-form-body">
|
|
33
|
-
{showSaveMessage && (
|
|
34
|
-
<CSSTransition
|
|
35
|
-
unmountOnExit
|
|
36
|
-
in={showSaveMessage}
|
|
37
|
-
timeout={2000}
|
|
38
|
-
classNames="fade-in-out"
|
|
39
|
-
>
|
|
40
|
-
<Alert bsStyle="success" className="ticket-popup-form-alert text-center">
|
|
41
|
-
{t("tickets.notify_success_message")}
|
|
42
|
-
</Alert>
|
|
43
|
-
</CSSTransition>
|
|
44
|
-
)}
|
|
45
|
-
|
|
46
|
-
<p>{t("ticket_popup.notify_text_1")} {getSummitFormattedReassignDate(summit)}.</p>
|
|
47
|
-
|
|
48
|
-
<p>
|
|
49
|
-
{t("ticket_popup.notify_text_2")} <b>{ticket.owner.email} </b>
|
|
50
|
-
{t("ticket_popup.notify_text_3")} <b>{ticket.owner.email}</b>
|
|
51
|
-
</p>
|
|
52
|
-
|
|
53
|
-
<p>
|
|
54
|
-
<label>{t("ticket_popup.notify_message")} </label> {t("ticket_popup.notify_message_condition")}
|
|
55
|
-
<br />
|
|
56
|
-
<textarea value={message} rows="4" onChange={(e) => setMessage(e.target.value)} style={{width: '80%', padding: 5}} />
|
|
57
|
-
</p>
|
|
58
|
-
<button className="btn btn-primary" onClick={handleNotifyButtonClick}>
|
|
59
|
-
{t("ticket_popup.notify_button")}
|
|
60
|
-
</button>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
};
|
package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupReassignForm.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useContext } from "react";
|
|
2
|
-
import { useDispatch, useSelector } from "react-redux";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { CSSTransition } from "react-transition-group";
|
|
5
|
-
import Alert from 'react-bootstrap/lib/Alert';
|
|
6
|
-
import { useFormik } from 'formik';
|
|
7
|
-
import * as Yup from 'yup';
|
|
8
|
-
import Input from 'openstack-uicore-foundation/lib/components/inputs/text-input'
|
|
9
|
-
import { changeTicketAttendee } from "../../store/actions/ticket-actions";
|
|
10
|
-
import { ConfirmPopup, CONFIRM_POPUP_CASE } from "../ConfirmPopup/ConfirmPopup";
|
|
11
|
-
import { getSummitFormattedReassignDate } from "../../util";
|
|
12
|
-
import { useTicketAssignedContext } from "../../context/TicketAssignedContext";
|
|
13
|
-
|
|
14
|
-
const initialValues = {
|
|
15
|
-
attendee_email: '',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const validationSchema = Yup.object().shape({
|
|
19
|
-
attendee_email: Yup.string().email('Please enter a valid email.').required('Email is required.'),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const TicketPopupReassignForm = ({ ticket, summit, order }) => {
|
|
23
|
-
const { t } = useTranslation();
|
|
24
|
-
const dispatch = useDispatch();
|
|
25
|
-
const userProfile = useSelector(state => state.userState.userProfile);
|
|
26
|
-
const [showConfirm, setShowConfirm] = useState(false);
|
|
27
|
-
const [newAttendeeEmail, setNewAttendeeEmail] = useState('');
|
|
28
|
-
const [showSaveMessage, setShowSaveMessage] = useState(false);
|
|
29
|
-
const [showErrorMessage, setShowErrorMessage] = useState(false);
|
|
30
|
-
const [message, setMessage] = useState('')
|
|
31
|
-
const [errorMessage, setErrorMessage] = useState('')
|
|
32
|
-
|
|
33
|
-
const { onTicketAssignChange } = useTicketAssignedContext();
|
|
34
|
-
|
|
35
|
-
const isUserTicketOwner = userProfile.email === ticket.owner?.email;
|
|
36
|
-
const isTicketPrinted = ticket.badge?.printed_times > 0 ? true : false
|
|
37
|
-
|
|
38
|
-
const toggleSaveMessage = () => {
|
|
39
|
-
setTimeout(() => setShowSaveMessage(true), 50);
|
|
40
|
-
setTimeout(() => setShowSaveMessage(false), 5000);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const toggleErrorMessage = () => {
|
|
44
|
-
setTimeout(() => setShowErrorMessage(true), 50);
|
|
45
|
-
setTimeout(() => setShowErrorMessage(false), 5000);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const handleSubmit = (values, formikHelpers) => {
|
|
49
|
-
setNewAttendeeEmail(values.attendee_email);
|
|
50
|
-
setShowConfirm(true);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const formik = useFormik({
|
|
54
|
-
initialValues,
|
|
55
|
-
onSubmit: handleSubmit,
|
|
56
|
-
validationSchema
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const assignTicketToSelf = () => {
|
|
60
|
-
formik.resetForm();
|
|
61
|
-
setNewAttendeeEmail(userProfile.email);
|
|
62
|
-
setShowConfirm(true);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const handleConfirmAccept = async () => {
|
|
66
|
-
setShowConfirm(false);
|
|
67
|
-
formik.resetForm();
|
|
68
|
-
setNewAttendeeEmail('');
|
|
69
|
-
|
|
70
|
-
dispatch(changeTicketAttendee({
|
|
71
|
-
ticket,
|
|
72
|
-
message,
|
|
73
|
-
order,
|
|
74
|
-
data: { attendee_email: newAttendeeEmail }
|
|
75
|
-
})).then((updatedTicket) => {
|
|
76
|
-
onTicketAssignChange(updatedTicket);
|
|
77
|
-
toggleSaveMessage();
|
|
78
|
-
setMessage('');
|
|
79
|
-
}).catch((err) => {
|
|
80
|
-
setErrorMessage(err);
|
|
81
|
-
toggleErrorMessage();
|
|
82
|
-
})
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const handleConfirmReject = () => {
|
|
86
|
-
setShowConfirm(false);
|
|
87
|
-
formik.resetForm();
|
|
88
|
-
setNewAttendeeEmail('')
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<>
|
|
93
|
-
<form className="ticket-reassign-form" onSubmit={formik.handleSubmit}>
|
|
94
|
-
<div className="ticket-popup-form-body">
|
|
95
|
-
{
|
|
96
|
-
isTicketPrinted ?
|
|
97
|
-
<>
|
|
98
|
-
<p>
|
|
99
|
-
{t("ticket_popup.reassign_printed_ticket")}
|
|
100
|
-
</p>
|
|
101
|
-
</>
|
|
102
|
-
:
|
|
103
|
-
<>
|
|
104
|
-
{showSaveMessage && (
|
|
105
|
-
<CSSTransition
|
|
106
|
-
unmountOnExit
|
|
107
|
-
in={showSaveMessage}
|
|
108
|
-
timeout={2000}
|
|
109
|
-
classNames="fade-in-out"
|
|
110
|
-
>
|
|
111
|
-
<Alert bsStyle="success" className="ticket-popup-form-alert text-center">
|
|
112
|
-
{t("tickets.reassign_success_message")}
|
|
113
|
-
</Alert>
|
|
114
|
-
</CSSTransition>
|
|
115
|
-
)}
|
|
116
|
-
|
|
117
|
-
{showErrorMessage && (
|
|
118
|
-
<CSSTransition
|
|
119
|
-
unmountOnExit
|
|
120
|
-
in={showErrorMessage}
|
|
121
|
-
timeout={2000}
|
|
122
|
-
classNames="fade-in-out"
|
|
123
|
-
>
|
|
124
|
-
<Alert bsStyle="warning" className="ticket-popup-form-alert text-center">
|
|
125
|
-
{errorMessage}
|
|
126
|
-
</Alert>
|
|
127
|
-
</CSSTransition>
|
|
128
|
-
)}
|
|
129
|
-
|
|
130
|
-
{!isUserTicketOwner && (
|
|
131
|
-
<>
|
|
132
|
-
<p>
|
|
133
|
-
{t("ticket_popup.reassign_text")}
|
|
134
|
-
<br />
|
|
135
|
-
<b>{ticket.owner.email}</b>
|
|
136
|
-
</p>
|
|
137
|
-
<button className="btn btn-primary" onClick={assignTicketToSelf} type="button">
|
|
138
|
-
{t("ticket_popup.reassign_me")}
|
|
139
|
-
</button>
|
|
140
|
-
|
|
141
|
-
<div className="ticket-popup-separator">
|
|
142
|
-
<div><hr /></div>
|
|
143
|
-
<span>{t("ticket_popup.assign_or")}</span>
|
|
144
|
-
<div><hr /></div>
|
|
145
|
-
</div>
|
|
146
|
-
</>
|
|
147
|
-
)}
|
|
148
|
-
|
|
149
|
-
<p>
|
|
150
|
-
{t("ticket_popup.reassign_want_text")}
|
|
151
|
-
{` (${t("ticket_popup.reassign_before")} ${getSummitFormattedReassignDate(summit)})`}
|
|
152
|
-
</p>
|
|
153
|
-
<span>{t("ticket_popup.reassign_enter_email")}</span>
|
|
154
|
-
|
|
155
|
-
<p>
|
|
156
|
-
<label>{t("ticket_popup.notify_message")} </label> {t("ticket_popup.notify_message_condition")}
|
|
157
|
-
<br />
|
|
158
|
-
<textarea value={message} rows="4" onChange={(e) => setMessage(e.target.value)} style={{width: '80%', padding: 5}} />
|
|
159
|
-
</p>
|
|
160
|
-
|
|
161
|
-
<Input
|
|
162
|
-
id="attendee_email"
|
|
163
|
-
name="attendee_email"
|
|
164
|
-
className="form-control"
|
|
165
|
-
placeholder="Email"
|
|
166
|
-
error={formik.errors.attendee_email}
|
|
167
|
-
onChange={formik.handleChange}
|
|
168
|
-
onBlur={formik.handleBlur}
|
|
169
|
-
value={formik.values.attendee_email}
|
|
170
|
-
/>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<button
|
|
174
|
-
type="submit"
|
|
175
|
-
className="btn btn-primary"
|
|
176
|
-
disabled={formik.isSubmitting || !formik.isValid || !formik.dirty}
|
|
177
|
-
>
|
|
178
|
-
{t("ticket_popup.reassign_someone")}
|
|
179
|
-
</button>
|
|
180
|
-
</>
|
|
181
|
-
}
|
|
182
|
-
</div>
|
|
183
|
-
</form>
|
|
184
|
-
|
|
185
|
-
<ConfirmPopup
|
|
186
|
-
isOpen={showConfirm}
|
|
187
|
-
popupCase={CONFIRM_POPUP_CASE.REASSIGN_TICKET}
|
|
188
|
-
onAccept={handleConfirmAccept}
|
|
189
|
-
onReject={handleConfirmReject}
|
|
190
|
-
/>
|
|
191
|
-
</>
|
|
192
|
-
)
|
|
193
|
-
};
|
package/src/components/summit-my-orders-tickets/components/TicketPopup/TicketPopupRefundForm.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { useDispatch } from 'react-redux';
|
|
4
|
-
import { CSSTransition } from "react-transition-group";
|
|
5
|
-
import Alert from 'react-bootstrap/lib/Alert';
|
|
6
|
-
import { refundTicket } from '../../store/actions/ticket-actions';
|
|
7
|
-
import { ConfirmPopup, CONFIRM_POPUP_CASE } from '../ConfirmPopup/ConfirmPopup';
|
|
8
|
-
|
|
9
|
-
export const TicketPopupRefundForm = ({ ticket, order }) => {
|
|
10
|
-
const { t } = useTranslation();
|
|
11
|
-
const dispatch = useDispatch();
|
|
12
|
-
const [showConfirm, setShowConfirm] = useState(false);
|
|
13
|
-
const [showRefundSuccess, setShowRefundSuccess] = useState(false);
|
|
14
|
-
|
|
15
|
-
const handleCancelClick = () => setShowConfirm(true);
|
|
16
|
-
|
|
17
|
-
const handleConfirmAccept = () => {
|
|
18
|
-
dispatch(refundTicket({ ticket, order })).then(() => {
|
|
19
|
-
setTimeout(() => setShowRefundSuccess(true), 500);
|
|
20
|
-
setTimeout(() => setShowRefundSuccess(false), 5000);
|
|
21
|
-
}).catch(() => { });
|
|
22
|
-
|
|
23
|
-
setShowConfirm(false);
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const handleConfirmReject = () => setShowConfirm(false);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<>
|
|
31
|
-
<div className="ticket-refund-form">
|
|
32
|
-
<div className="ticket-popup-form-body">
|
|
33
|
-
<CSSTransition
|
|
34
|
-
unmountOnExit
|
|
35
|
-
in={showRefundSuccess}
|
|
36
|
-
timeout={2000}
|
|
37
|
-
classNames="fade-in-out"
|
|
38
|
-
>
|
|
39
|
-
<Alert bsStyle="success" className="ticket-popup-form-alert text-center">
|
|
40
|
-
{t("tickets.refund_request_success_message")}
|
|
41
|
-
</Alert>
|
|
42
|
-
</CSSTransition>
|
|
43
|
-
|
|
44
|
-
<div className="row">
|
|
45
|
-
<div className="col-md-12 text-center">
|
|
46
|
-
<div className="ticket-refund-button">
|
|
47
|
-
<a onClick={handleCancelClick} className="cancel">
|
|
48
|
-
{t("ticket_popup.cancel_ticket")}
|
|
49
|
-
</a>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<ConfirmPopup
|
|
57
|
-
isOpen={showConfirm}
|
|
58
|
-
popupCase={CONFIRM_POPUP_CASE.CANCEL_TICKET}
|
|
59
|
-
onAccept={handleConfirmAccept}
|
|
60
|
-
onReject={handleConfirmReject}
|
|
61
|
-
/>
|
|
62
|
-
</>
|
|
63
|
-
);
|
|
64
|
-
};
|