iticket-seatingplan-dev 1.8.3 → 1.8.5
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.
|
@@ -33,7 +33,7 @@ function Controls(_ref) {
|
|
|
33
33
|
isReloading,
|
|
34
34
|
onReload
|
|
35
35
|
} = _ref;
|
|
36
|
-
const [isLegendOpen, setIsLegendOpen] = (0, _react.useState)(
|
|
36
|
+
const [isLegendOpen, setIsLegendOpen] = (0, _react.useState)(true);
|
|
37
37
|
const map = (0, _reactLeaflet.useMap)();
|
|
38
38
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, preventOrphanedSeats && /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
|
|
39
39
|
position: "topright"
|
|
@@ -24,8 +24,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
24
24
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
25
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
26
26
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
|
-
const
|
|
28
|
-
const BOOKING_MAX_RETRIES = 2;
|
|
27
|
+
const MAX_RETRIES = 5;
|
|
29
28
|
const SeatingPlan = _ref => {
|
|
30
29
|
var _document, _document2, _document3;
|
|
31
30
|
let {
|
|
@@ -68,7 +67,6 @@ const SeatingPlan = _ref => {
|
|
|
68
67
|
const [seatsToRemove, setSeatsToRemove] = (0, _react.useState)([]);
|
|
69
68
|
const [removeMultipleSeatsPopupOpen, setRemoveMultipleSeatsPopupOpen] = (0, _react.useState)(false);
|
|
70
69
|
const [invalidSeatsPopupOpen, setInvalidSeatsPopupOpen] = (0, _react.useState)(false);
|
|
71
|
-
const [retrying, setRetrying] = (0, _react.useState)([]);
|
|
72
70
|
const mapRef = (0, _react.useRef)(null);
|
|
73
71
|
const canMultiSelect = bookingMode === _utils.bookingModes.POS;
|
|
74
72
|
const apiUrl = "".concat(baseUrl, "/legacy/").concat(countryCode, "/shop/events/").concat(eventId, "/").concat(eventVenueId, "/showings/").concat(showingId, "/tickets/allocated/").concat(areaId);
|
|
@@ -85,22 +83,17 @@ const SeatingPlan = _ref => {
|
|
|
85
83
|
};
|
|
86
84
|
callbackFunction === null || callbackFunction === void 0 || callbackFunction(event);
|
|
87
85
|
};
|
|
88
|
-
const
|
|
89
|
-
if (seatIndex !== -1) {
|
|
90
|
-
setSeats(prev => {
|
|
91
|
-
const updatedSeats = _objectSpread({}, prev);
|
|
92
|
-
updatedSeats.seats[seatIndex] = newSeat;
|
|
93
|
-
return updatedSeats;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const _addTicketToCart = async function addTicketToCart(s, priceage) {
|
|
86
|
+
const addTicketToCart = (s, priceage) => {
|
|
98
87
|
var _mapRef$current;
|
|
99
|
-
|
|
100
|
-
const seatIndex =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
88
|
+
const updatedSeats = _objectSpread({}, seats);
|
|
89
|
+
const seatIndex = updatedSeats.seats.findIndex(seat => seat.ssId === s.ssId);
|
|
90
|
+
const setSeatLoading = loading => {
|
|
91
|
+
if (seatIndex !== -1) {
|
|
92
|
+
updatedSeats.seats[seatIndex].loading = loading;
|
|
93
|
+
setSeats(updatedSeats);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
setSeatLoading(true);
|
|
104
97
|
const isSeatAvailable = (s.s === _utils.statuses.UNSOLD || s.s === _utils.statuses.USER_PENDING) && !(bookedSeats.length >= quantity && s.s === _utils.statuses.UNSOLD) && (priceage.q === null || priceage.q > 0);
|
|
105
98
|
if (!isSeatAvailable) {
|
|
106
99
|
if (bookedSeats.length >= quantity) {
|
|
@@ -112,70 +105,50 @@ const SeatingPlan = _ref => {
|
|
|
112
105
|
message: _utils.ERROR_MESSAGES.NO_ALLOCATION
|
|
113
106
|
});
|
|
114
107
|
}
|
|
115
|
-
|
|
116
|
-
loading: false
|
|
117
|
-
}));
|
|
108
|
+
setSeatLoading(false);
|
|
118
109
|
return;
|
|
119
110
|
}
|
|
120
111
|
(_mapRef$current = mapRef.current) === null || _mapRef$current === void 0 || (_mapRef$current = _mapRef$current.target) === null || _mapRef$current === void 0 || _mapRef$current.closePopup();
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"basket-key": sessionId
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
if ((response === null || response === void 0 ? void 0 : response.status) === 429) {
|
|
136
|
-
if (retryCount < BOOKING_MAX_RETRIES) {
|
|
137
|
-
setRetrying(prev => [...prev, s.ssId]);
|
|
138
|
-
const delay = (0, _utils.getRetryDelay)(response, retryCount);
|
|
139
|
-
await new Promise(resolve => setTimeout(resolve, delay));
|
|
140
|
-
return _addTicketToCart(s, priceage, retryCount + 1);
|
|
141
|
-
}
|
|
142
|
-
updateSeat(seatIndex, _objectSpread(_objectSpread({}, s), {}, {
|
|
143
|
-
loading: false
|
|
144
|
-
}));
|
|
145
|
-
setRetrying(prev => prev.filter(id => id !== s.ssId));
|
|
146
|
-
handleError({
|
|
147
|
-
code: 429,
|
|
148
|
-
message: _utils.ERROR_MESSAGES.MAX_RETRIES
|
|
149
|
-
});
|
|
150
|
-
return;
|
|
112
|
+
fetch(apiUrl, {
|
|
113
|
+
method: "POST",
|
|
114
|
+
body: JSON.stringify({
|
|
115
|
+
priceAgeId: priceage.paId,
|
|
116
|
+
seatId: s.ssId,
|
|
117
|
+
price: priceage.p,
|
|
118
|
+
connectedShowings: connectedShowings
|
|
119
|
+
}),
|
|
120
|
+
headers: {
|
|
121
|
+
"content-type": "application/json",
|
|
122
|
+
"basket-key": sessionId
|
|
151
123
|
}
|
|
152
|
-
|
|
153
|
-
if ((response === null || response === void 0 ? void 0 : response.status) === 403) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
124
|
+
}).then(response => {
|
|
125
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 403 || (response === null || response === void 0 ? void 0 : response.status) === 400) {
|
|
126
|
+
if (seatIndex !== -1) {
|
|
127
|
+
updatedSeats.seats[seatIndex] = _objectSpread(_objectSpread({}, s), {}, {
|
|
128
|
+
loading: false,
|
|
129
|
+
s: _utils.statuses.SOLD
|
|
130
|
+
});
|
|
131
|
+
setSeats(updatedSeats);
|
|
132
|
+
}
|
|
158
133
|
handleError({
|
|
159
134
|
code: 403,
|
|
160
|
-
message: _utils.ERROR_MESSAGES.
|
|
135
|
+
message: response.status === 400 ? _utils.ERROR_MESSAGES.INCOMPATIBLE_TICKETS : _utils.ERROR_MESSAGES.SEAT_UNAVAILABLE
|
|
161
136
|
});
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
updateSeat(seatIndex, _objectSpread(_objectSpread({}, s), {}, {
|
|
165
|
-
loading: false
|
|
166
|
-
}));
|
|
167
|
-
if (!(response !== null && response !== void 0 && response.ok)) {
|
|
137
|
+
} else if ((response === null || response === void 0 ? void 0 : response.status) === 429) {
|
|
138
|
+
setSeatLoading(false);
|
|
168
139
|
handleError({
|
|
169
|
-
code:
|
|
170
|
-
message:
|
|
140
|
+
code: 429,
|
|
141
|
+
message: _utils.ERROR_MESSAGES.SEAT_TAKEN
|
|
171
142
|
});
|
|
172
143
|
} else {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
144
|
+
if (seatIndex !== -1) {
|
|
145
|
+
updatedSeats.seats[seatIndex] = _objectSpread(_objectSpread({}, s), {}, {
|
|
146
|
+
s: _utils.statuses.USER_PENDING,
|
|
147
|
+
bookedPrice: price,
|
|
148
|
+
loading: false
|
|
149
|
+
});
|
|
150
|
+
setSeats(updatedSeats);
|
|
151
|
+
}
|
|
179
152
|
setBookedSeats(prev => [...prev, {
|
|
180
153
|
ssId: s.ssId,
|
|
181
154
|
r: s.r,
|
|
@@ -199,33 +172,40 @@ const SeatingPlan = _ref => {
|
|
|
199
172
|
};
|
|
200
173
|
callbackFunction === null || callbackFunction === void 0 || callbackFunction(event);
|
|
201
174
|
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
loading: false
|
|
205
|
-
}));
|
|
206
|
-
setRetrying(prev => prev.filter(id => id !== s.ssId));
|
|
175
|
+
}).catch(() => {
|
|
176
|
+
setSeatLoading(false);
|
|
207
177
|
handleError({
|
|
208
178
|
code: 500,
|
|
209
179
|
message: _utils.ERROR_MESSAGES.GENERIC_ERROR
|
|
210
180
|
});
|
|
211
|
-
}
|
|
181
|
+
}).finally(() => {
|
|
182
|
+
_initialFetch(true);
|
|
183
|
+
});
|
|
212
184
|
};
|
|
213
185
|
const removeTicketFromCart = (s, e) => {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
186
|
+
const updatedSeats = _objectSpread({}, seats);
|
|
187
|
+
const seatIndex = updatedSeats.seats.findIndex(seat => seat.ssId === s.ssId);
|
|
188
|
+
const setSeatLoading = loading => {
|
|
189
|
+
if (seatIndex !== -1) {
|
|
190
|
+
updatedSeats.seats[seatIndex].loading = loading;
|
|
191
|
+
setSeats(updatedSeats);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
setSeatLoading(true);
|
|
218
195
|
fetch("".concat(apiUrl, "/seat/").concat(s.ssId), {
|
|
219
196
|
method: "DELETE",
|
|
220
197
|
headers: {
|
|
221
198
|
"basket-key": sessionId
|
|
222
199
|
}
|
|
223
200
|
}).then(() => {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
201
|
+
if (seatIndex !== -1) {
|
|
202
|
+
updatedSeats.seats[seatIndex] = _objectSpread(_objectSpread({}, s), {}, {
|
|
203
|
+
loading: false,
|
|
204
|
+
s: _utils.statuses.UNSOLD,
|
|
205
|
+
bookedPrice: null
|
|
206
|
+
});
|
|
207
|
+
setSeats(updatedSeats);
|
|
208
|
+
}
|
|
229
209
|
setBookedSeats(prev => prev.filter(bs => bs.ssId !== s.ssId));
|
|
230
210
|
const event = {
|
|
231
211
|
type: "cart-change-remove",
|
|
@@ -233,81 +213,64 @@ const SeatingPlan = _ref => {
|
|
|
233
213
|
};
|
|
234
214
|
callbackFunction === null || callbackFunction === void 0 || callbackFunction(event);
|
|
235
215
|
}).catch(() => {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
216
|
+
setSeatLoading(false);
|
|
217
|
+
e.target.setStyle({
|
|
218
|
+
fillColor: _utils.statusColors.booked
|
|
219
|
+
});
|
|
239
220
|
handleError({
|
|
240
221
|
code: 500,
|
|
241
222
|
message: _utils.ERROR_MESSAGES.GENERIC_ERROR
|
|
242
223
|
});
|
|
224
|
+
}).finally(() => {
|
|
225
|
+
_initialFetch(true);
|
|
243
226
|
});
|
|
244
227
|
};
|
|
245
228
|
const batchAddTicketsToCart = async seatsToBook => {
|
|
246
229
|
if (!canMultiSelect && !seats.preventOrphanedSeats || seatsToBook.length === 0) {
|
|
247
230
|
return;
|
|
248
231
|
}
|
|
232
|
+
const updatedSeats = _objectSpread({}, seats);
|
|
233
|
+
const seatIds = seatsToBook.map(s => s.seat.ssId);
|
|
249
234
|
const setSeatsLoading = loading => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
seat
|
|
255
|
-
} = _ref2;
|
|
256
|
-
const seatIndex = updatedSeats.seats.findIndex(s => s.ssId === seat.ssId);
|
|
257
|
-
if (seatIndex !== -1) {
|
|
258
|
-
updatedSeats.seats[seatIndex] = _objectSpread(_objectSpread({}, updatedSeats.seats[seatIndex]), {}, {
|
|
259
|
-
loading: loading
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
return updatedSeats;
|
|
235
|
+
updatedSeats.seats.forEach(s => {
|
|
236
|
+
if (seatIds.includes(s.ssId)) {
|
|
237
|
+
s.loading = loading;
|
|
238
|
+
}
|
|
264
239
|
});
|
|
240
|
+
setSeats(updatedSeats);
|
|
265
241
|
};
|
|
266
242
|
setSeatsLoading(true);
|
|
267
243
|
const succeeded = [];
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
setRetrying(prev => [...prev, seatToBook.seat.ssId]);
|
|
287
|
-
const delay = (0, _utils.getRetryDelay)(res, retryCount);
|
|
288
|
-
await new Promise(resolve => setTimeout(resolve, delay));
|
|
289
|
-
return _tryBook(seatToBook, retryCount + 1);
|
|
290
|
-
} else {
|
|
291
|
-
throw new Error("429");
|
|
244
|
+
try {
|
|
245
|
+
for (const seat of seatsToBook) {
|
|
246
|
+
try {
|
|
247
|
+
const res = await fetch(apiUrl, {
|
|
248
|
+
method: "POST",
|
|
249
|
+
body: JSON.stringify({
|
|
250
|
+
priceAgeId: seat.priceage.paId,
|
|
251
|
+
seatId: seat.seat.ssId,
|
|
252
|
+
price: seat.priceage.p,
|
|
253
|
+
connectedShowings: connectedShowings
|
|
254
|
+
}),
|
|
255
|
+
headers: {
|
|
256
|
+
"content-type": "application/json",
|
|
257
|
+
"basket-key": sessionId
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
if (!res.ok) {
|
|
261
|
+
throw new Error("".concat(res.status));
|
|
292
262
|
}
|
|
293
|
-
|
|
294
|
-
|
|
263
|
+
succeeded.push(seat);
|
|
264
|
+
} catch (error) {
|
|
265
|
+
console.error("Failed to book seat ".concat(seat.seat.r, " ").concat(seat.seat.c, ":"), error);
|
|
266
|
+
throw new Error(error === "429" ? error : "Booking failed for seat ".concat(seat.seat.r, " ").concat(seat.seat.c));
|
|
295
267
|
}
|
|
296
|
-
succeeded.push(seatToBook.seat);
|
|
297
|
-
} catch (_unused2) {
|
|
298
|
-
throw new Error("Booking failed for seat ".concat(seatToBook.seat.r, " ").concat(seatToBook.seat.c));
|
|
299
268
|
}
|
|
300
|
-
|
|
301
|
-
try {
|
|
302
|
-
for (const seatToBook of seatsToBook) {
|
|
303
|
-
await _tryBook(seatToBook);
|
|
304
|
-
}
|
|
305
|
-
setRetrying(prev => prev.filter(id => !seatsToBook.some(s => s.seat.ssId === id)));
|
|
306
|
-
setBookedSeats(prev => [...prev, ...seatsToBook.map(_ref3 => {
|
|
269
|
+
setBookedSeats(prev => [...prev, ...seatsToBook.map(_ref2 => {
|
|
307
270
|
let {
|
|
308
271
|
seat,
|
|
309
272
|
priceage
|
|
310
|
-
} =
|
|
273
|
+
} = _ref2;
|
|
311
274
|
return {
|
|
312
275
|
ssId: seat.ssId,
|
|
313
276
|
r: seat.r,
|
|
@@ -318,30 +281,21 @@ const SeatingPlan = _ref => {
|
|
|
318
281
|
paName: priceage.paName
|
|
319
282
|
};
|
|
320
283
|
})]);
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const seatIndex = updatedSeats.seats.findIndex(s => s.ssId === seat.ssId);
|
|
328
|
-
if (seatIndex !== -1) {
|
|
329
|
-
updatedSeats.seats[seatIndex] = _objectSpread(_objectSpread({}, updatedSeats.seats[seatIndex]), {}, {
|
|
330
|
-
loading: false,
|
|
331
|
-
s: _utils.statuses.USER_PENDING,
|
|
332
|
-
bookedPrice: price
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
return updatedSeats;
|
|
284
|
+
updatedSeats.seats.forEach(s => {
|
|
285
|
+
if (seatIds.includes(s.ssId)) {
|
|
286
|
+
s.s = _utils.statuses.USER_PENDING;
|
|
287
|
+
s.bookedPrice = price;
|
|
288
|
+
s.loading = false;
|
|
289
|
+
}
|
|
337
290
|
});
|
|
291
|
+
setSeats(updatedSeats);
|
|
338
292
|
const event = {
|
|
339
293
|
type: "cart-change-add",
|
|
340
|
-
details: [...bookedSeats, ...seatsToBook.map(
|
|
294
|
+
details: [...bookedSeats, ...seatsToBook.map(_ref3 => {
|
|
341
295
|
let {
|
|
342
296
|
seat,
|
|
343
297
|
priceage
|
|
344
|
-
} =
|
|
298
|
+
} = _ref3;
|
|
345
299
|
return {
|
|
346
300
|
ssId: seat.ssId,
|
|
347
301
|
r: seat.r,
|
|
@@ -355,7 +309,6 @@ const SeatingPlan = _ref => {
|
|
|
355
309
|
};
|
|
356
310
|
callbackFunction === null || callbackFunction === void 0 || callbackFunction(event);
|
|
357
311
|
} catch (error) {
|
|
358
|
-
setRetrying(prev => prev.filter(id => !seatsToBook.some(s => s.seat.ssId === id)));
|
|
359
312
|
console.error("Failed to book seats:", error);
|
|
360
313
|
for (const seat of succeeded) {
|
|
361
314
|
await fetch("".concat(apiUrl, "/seat/").concat(seat.ssId), {
|
|
@@ -368,26 +321,24 @@ const SeatingPlan = _ref => {
|
|
|
368
321
|
setSeatsLoading(false);
|
|
369
322
|
handleError({
|
|
370
323
|
code: error === "429" ? 429 : 500,
|
|
371
|
-
message: _utils.ERROR_MESSAGES.GENERIC_ERROR
|
|
324
|
+
message: error === "429" ? _utils.ERROR_MESSAGES.SEAT_TAKEN : _utils.ERROR_MESSAGES.GENERIC_ERROR
|
|
372
325
|
});
|
|
326
|
+
} finally {
|
|
327
|
+
_initialFetch(true);
|
|
373
328
|
}
|
|
374
329
|
};
|
|
375
330
|
const batchRemoveTicketsFromCart = async seatsToRemove => {
|
|
376
331
|
if (!canMultiSelect && !seats.preventOrphanedSeats || seatsToRemove.length === 0) {
|
|
377
332
|
return;
|
|
378
333
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
loading: true
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
});
|
|
389
|
-
return updatedSeats;
|
|
334
|
+
const updatedSeats = _objectSpread({}, seats);
|
|
335
|
+
const seatIds = seatsToRemove.map(s => s.ssId);
|
|
336
|
+
updatedSeats.seats.forEach(s => {
|
|
337
|
+
if (seatIds.includes(s.ssId)) {
|
|
338
|
+
s.loading = true;
|
|
339
|
+
}
|
|
390
340
|
});
|
|
341
|
+
setSeats(updatedSeats);
|
|
391
342
|
const succeededIds = [];
|
|
392
343
|
try {
|
|
393
344
|
for (const seat of seatsToRemove) {
|
|
@@ -406,27 +357,23 @@ const SeatingPlan = _ref => {
|
|
|
406
357
|
console.error("Failed to remove seat ".concat(seat, ":"), error);
|
|
407
358
|
}
|
|
408
359
|
}
|
|
409
|
-
} catch (
|
|
360
|
+
} catch (_unused) {
|
|
410
361
|
handleError({
|
|
411
362
|
code: 500,
|
|
412
363
|
message: _utils.ERROR_MESSAGES.GENERIC_ERROR
|
|
413
364
|
});
|
|
414
365
|
}
|
|
415
366
|
setBookedSeats(prev => [...prev.filter(v => !succeededIds.includes(v.ssId))]);
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
loading: false,
|
|
423
|
-
s: succeededIds.includes(s.ssId) ? _utils.statuses.UNSOLD : s.s,
|
|
424
|
-
bookedPrice: null
|
|
425
|
-
});
|
|
367
|
+
updatedSeats.seats.forEach(s => {
|
|
368
|
+
if (seatIds.includes(s.ssId)) {
|
|
369
|
+
s.loading = false;
|
|
370
|
+
if (succeededIds.includes(s.ssId)) {
|
|
371
|
+
s.s = _utils.statuses.UNSOLD;
|
|
372
|
+
s.bookedPrice = null;
|
|
426
373
|
}
|
|
427
|
-
}
|
|
428
|
-
return updatedSeats;
|
|
374
|
+
}
|
|
429
375
|
});
|
|
376
|
+
setSeats(updatedSeats);
|
|
430
377
|
setSeatsToRemove([]);
|
|
431
378
|
if (succeededIds.length > 0) {
|
|
432
379
|
const event = {
|
|
@@ -435,6 +382,7 @@ const SeatingPlan = _ref => {
|
|
|
435
382
|
};
|
|
436
383
|
callbackFunction === null || callbackFunction === void 0 || callbackFunction(event);
|
|
437
384
|
}
|
|
385
|
+
_initialFetch(true);
|
|
438
386
|
};
|
|
439
387
|
const handleClickSeat = (e, s) => {
|
|
440
388
|
setChosenSeat({
|
|
@@ -454,7 +402,7 @@ const SeatingPlan = _ref => {
|
|
|
454
402
|
const availablePrices = ((_seats$pricing = seats.pricing) === null || _seats$pricing === void 0 ? void 0 : _seats$pricing.filter(price => (!priceSectionIds || priceSectionIds.includes(price.psId)) && s.psId === price.psId)) || [];
|
|
455
403
|
const isSingleFlexi = availablePrices.length === 1 && !!availablePrices[0].pMax && !!availablePrices[0].pMin && availablePrices[0].pMax > availablePrices[0].pMin;
|
|
456
404
|
if (availablePrices.length === 1 && !isSingleFlexi) {
|
|
457
|
-
|
|
405
|
+
addTicketToCart(s, availablePrices[0]);
|
|
458
406
|
}
|
|
459
407
|
} else {
|
|
460
408
|
removeTicketFromCart(s, e);
|
|
@@ -478,7 +426,7 @@ const SeatingPlan = _ref => {
|
|
|
478
426
|
}
|
|
479
427
|
});
|
|
480
428
|
if (response.status === 429) {
|
|
481
|
-
if (retryCount >=
|
|
429
|
+
if (retryCount >= MAX_RETRIES) {
|
|
482
430
|
throw new Error("We're experiencing high demand. Please try again later.");
|
|
483
431
|
}
|
|
484
432
|
const delay = (0, _utils.getRetryDelay)(response, retryCount);
|
|
@@ -568,9 +516,7 @@ const SeatingPlan = _ref => {
|
|
|
568
516
|
pricing: seats.pricing,
|
|
569
517
|
priceSectionIds: priceSectionIds,
|
|
570
518
|
batchAddTicketsToCart: batchAddTicketsToCart
|
|
571
|
-
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null),
|
|
572
|
-
className: "retrying"
|
|
573
|
-
}, "Looks like things are busy right now. Please wait while we continue to confirm your selection...") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null), seats.preventOrphanedSeats && selectQuantityPopupOpen ? /*#__PURE__*/_react.default.createElement(_SelectQuantityPopup.default, {
|
|
519
|
+
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null), seats.preventOrphanedSeats && selectQuantityPopupOpen ? /*#__PURE__*/_react.default.createElement(_SelectQuantityPopup.default, {
|
|
574
520
|
quantity: desiredSeatQuantity,
|
|
575
521
|
setQuantity: v => {
|
|
576
522
|
setDesiredSeatQuantity(v);
|
|
@@ -607,7 +553,7 @@ const SeatingPlan = _ref => {
|
|
|
607
553
|
setTicketPopupOpen: setTicketPopupOpen,
|
|
608
554
|
chosenSeat: chosenSeat,
|
|
609
555
|
bookedSeats: bookedSeats,
|
|
610
|
-
addTicketToCart:
|
|
556
|
+
addTicketToCart: addTicketToCart,
|
|
611
557
|
batchRemoveTicketsFromCart: batchRemoveTicketsFromCart,
|
|
612
558
|
isReloading: isReloading,
|
|
613
559
|
initialFetch: _initialFetch,
|
|
@@ -1597,22 +1597,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
|
1597
1597
|
transform: translateX(-50%);
|
|
1598
1598
|
}
|
|
1599
1599
|
|
|
1600
|
-
.retrying {
|
|
1601
|
-
position: absolute;
|
|
1602
|
-
top: 10px;
|
|
1603
|
-
left: 50%;
|
|
1604
|
-
transform: translateX(-50%);
|
|
1605
|
-
background: white;
|
|
1606
|
-
border-radius: 5px;
|
|
1607
|
-
padding: 0.5rem;
|
|
1608
|
-
font-size: 0.875rem;
|
|
1609
|
-
color: #333;
|
|
1610
|
-
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
|
|
1611
|
-
z-index: 1005;
|
|
1612
|
-
animation: fade-in 400ms;
|
|
1613
|
-
max-width: 50%;
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
1600
|
/* Printing */
|
|
1617
1601
|
|
|
1618
1602
|
@media print {
|
package/dist/utils/enums.js
CHANGED
|
@@ -42,6 +42,5 @@ const ERROR_MESSAGES = exports.ERROR_MESSAGES = {
|
|
|
42
42
|
SEAT_TAKEN: "Someone else selected this first. Please try again",
|
|
43
43
|
GENERIC_ERROR: "Oops! Something went wrong. Please try again.",
|
|
44
44
|
MAX_QUANTITY: "Maximum ticket booking quantity specified reached.",
|
|
45
|
-
NO_ALLOCATION: "Allocation exhausted, please try another area or price."
|
|
46
|
-
MAX_RETRIES: "Looks like things are busy and we couldn't complete your request. Please try again."
|
|
45
|
+
NO_ALLOCATION: "Allocation exhausted, please try another area or price."
|
|
47
46
|
};
|