iticket-seatingplan-dev 1.1.2 → 1.1.4

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.
@@ -58,7 +58,7 @@ const SeatingPlan = _ref => {
58
58
  fillOpacity: 100
59
59
  };
60
60
  };
61
- const addTicketToCart = (s, priceAgeId) => {
61
+ const addTicketToCart = (s, priceAgeId, cs) => {
62
62
  map.target.closePopup();
63
63
  setProcessing(true);
64
64
  fetch("".concat(baseUrl, "/legacy/").concat(countryCode, "/shop/events/").concat(eventId, "/").concat(eventVenueId, "/showings/").concat(showingId, "/tickets/allocated/").concat(areaId), {
@@ -73,10 +73,10 @@ const SeatingPlan = _ref => {
73
73
  }
74
74
  }).then(response => {
75
75
  if ((response === null || response === void 0 ? void 0 : response.status) === 403) {
76
- chosenSeat.circle.target.setStyle({
76
+ ;
77
+ (chosenSeat || cs).circle.target.setStyle({
77
78
  fillColor: statusColors.sold
78
- });
79
- chosenSeat.seat.s = 2;
79
+ })(chosenSeat || cs).seat.s = 2;
80
80
  const event = {
81
81
  type: 'error',
82
82
  details: {
@@ -89,7 +89,8 @@ const SeatingPlan = _ref => {
89
89
  callbackFunction(event);
90
90
  setProcessing(false);
91
91
  } else if ((response === null || response === void 0 ? void 0 : response.status) === 429) {
92
- chosenSeat.circle.target.setStyle({
92
+ ;
93
+ (chosenSeat || cs).circle.target.setStyle({
93
94
  fillColor: statusColors.available
94
95
  });
95
96
  const event = {
@@ -104,25 +105,25 @@ const SeatingPlan = _ref => {
104
105
  callbackFunction(event);
105
106
  setProcessing(false);
106
107
  } else {
107
- {
108
- s.s = 4;
109
- s.bookedPrice = price;
110
- chosenSeat.circle.target.setStyle({
111
- fillColor: statusColors.booked
112
- });
113
- setProcessing(false);
114
- setBookedSeats([...bookedSeats, {
115
- ssId: s.ssId,
116
- r: s.r,
117
- c: s.c,
118
- showingId: showingId,
119
- p: price || s.defaultPrice,
120
- paName: s.priceAgeName
121
- }]);
122
- }
108
+ s.s = 4;
109
+ s.bookedPrice = price;
110
+ (chosenSeat || cs).circle.target.setStyle({
111
+ fillColor: statusColors.booked
112
+ });
113
+ setProcessing(false);
114
+ setChosenSeat(null);
115
+ setBookedSeats([...bookedSeats, {
116
+ ssId: s.ssId,
117
+ r: s.r,
118
+ c: s.c,
119
+ showingId: showingId,
120
+ p: price || s.defaultPrice,
121
+ paName: s.priceAgeName
122
+ }]);
123
123
  }
124
124
  }).catch(error => {
125
- chosenSeat.circle.target.setStyle({
125
+ ;
126
+ (chosenSeat || cs).circle.target.setStyle({
126
127
  fillColor: statusColors.available
127
128
  });
128
129
  const event = {
@@ -141,6 +142,7 @@ const SeatingPlan = _ref => {
141
142
  };
142
143
  callbackFunction(event);
143
144
  setProcessing(false);
145
+ setChosenSeat(null);
144
146
  });
145
147
  };
146
148
  const removeTicketFromCart = (s, e) => {
@@ -158,6 +160,7 @@ const SeatingPlan = _ref => {
158
160
  });
159
161
  setBookedSeats(bookedSeats.filter(bs => bs.ssId !== s.ssId));
160
162
  setProcessing(false);
163
+ setChosenSeat(null);
161
164
  }).catch(error => {
162
165
  e.target.setStyle({
163
166
  fillColor: statusColors.booked
@@ -173,6 +176,7 @@ const SeatingPlan = _ref => {
173
176
  };
174
177
  callbackFunction(event);
175
178
  setProcessing(false);
179
+ setChosenSeat(null);
176
180
  });
177
181
  };
178
182
  const handleClick = (e, s) => {
@@ -194,7 +198,10 @@ const SeatingPlan = _ref => {
194
198
  });
195
199
  if (s.s === 1) {
196
200
  const availablePrices = seats.pricing.filter(price => price.psId === priceSectionId);
197
- availablePrices.length === 1 && addTicketToCart(s, availablePrices[0].paId);
201
+ availablePrices.length === 1 && addTicketToCart(s, availablePrices[0].paId, {
202
+ circle: e,
203
+ seat: s
204
+ });
198
205
  } else {
199
206
  removeTicketFromCart(s, e);
200
207
  }
@@ -223,12 +230,12 @@ const SeatingPlan = _ref => {
223
230
  const img = new Image();
224
231
  img.src = data.background;
225
232
  setBookedSeats(data.seats.filter(s => s.s === 4 && s.bookedPrice === price).map(s => ({
226
- showingSeatId: s.ssId,
227
- rowName: s.r,
228
- columnName: s.c,
233
+ ssId: s.ssId,
234
+ r: s.r,
235
+ c: s.c,
229
236
  showingId: showingId,
230
- price: price || s.defaultPrice,
231
- priceAgeName: s.priceAgeName
237
+ p: price || s.defaultPrice,
238
+ paName: s.priceAgeName
232
239
  })));
233
240
  img.onload = () => {
234
241
  setHeight(img.height * 0.5);
@@ -284,7 +291,7 @@ const SeatingPlan = _ref => {
284
291
  }, /*#__PURE__*/_react.default.createElement("h1", null, "OOPS!"), /*#__PURE__*/_react.default.createElement("div", null, error.response.data.message)) : position ? /*#__PURE__*/_react.default.createElement(_reactLeaflet.MapContainer, {
285
292
  whenReady: setMap,
286
293
  center: [height * 0.015, width * 0.015],
287
- zoom: 5,
294
+ zoom: 6,
288
295
  zoomControl: true,
289
296
  scrollWheelZoom: true,
290
297
  style: {
@@ -344,7 +351,7 @@ const SeatingPlan = _ref => {
344
351
  key: i
345
352
  }, /*#__PURE__*/_react.default.createElement(_reactLeaflet.ImageOverlay, {
346
353
  url: "https://iticketseatingplan.blob.core.windows.net/embed/static/media/rippleload.08e6a08dd832819226ef.gif",
347
- bounds: [[height * 0.05 - s.y / 3.35 - height / 50 - 0.11, s.x * 0.3 + 0.15 - 0.11], [height * 0.05 - s.y / 3.35 - height / 50 + 0.11, s.x * 0.3 + 0.15 + 0.11]
354
+ bounds: [[height * 0.05 - s.y / 3.35 - height / 48 - 0.11, s.x * 0.3 + 0.15 - 0.11], [height * 0.05 - s.y / 3.35 - height / 48 + 0.11, s.x * 0.3 + 0.15 + 0.11]
348
355
  // [height * 0.0302 - s.y * 0.602 - 0.3, s.x * 0.61 - 0.3],
349
356
  // [height * 0.0302 - s.y * 0.602 + 0.3, s.x * 0.61 + 0.3],
350
357
  // [height * 0.0302 - s.y * 0.602 - 0.17, s.x * 0.61 - 0.17],
@@ -364,7 +371,7 @@ const SeatingPlan = _ref => {
364
371
  // height * 0.0302 - s.y * 0.602 + 0.17,
365
372
  // s.x * 0.61 + 0.17,
366
373
  // ],
367
- [height * 0.05 - s.y / 3.35 - height / 50 - 0.11, s.x * 0.3 + 0.15 - 0.11], [height * 0.05 - s.y / 3.35 - height / 50 + 0.11, s.x * 0.3 + 0.15 + 0.11]],
374
+ [height * 0.05 - s.y / 3.35 - height / 48 - 0.11, s.x * 0.3 + 0.15 - 0.11], [height * 0.05 - s.y / 3.35 - height / 48 + 0.11, s.x * 0.3 + 0.15 + 0.11]],
368
375
  zIndex: 10
369
376
  }) : /*#__PURE__*/_react.default.createElement(_reactLeaflet.Circle, {
370
377
  center: [
@@ -373,7 +380,7 @@ const SeatingPlan = _ref => {
373
380
  // height * (height > 700 ? 0.0001 : 0.0006),
374
381
  // s.x * 0.6 + 0.25,
375
382
 
376
- height * 0.05 - s.y / 3.35 - height / 50, s.x * 0.3 + 0.15
383
+ height * 0.05 - s.y / 3.35 - height / 48, s.x * 0.3 + 0.15
377
384
 
378
385
  // -s.y * (height * 0.00037) + 24.2,
379
386
  // s.x * 0.3 + 0.15,
@@ -385,10 +392,7 @@ const SeatingPlan = _ref => {
385
392
  click: e => handleClick(e, s)
386
393
  }
387
394
  // value={s}
388
- }, /*#__PURE__*/_react.default.createElement(_reactLeaflet.Tooltip, {
389
- direction: 'top',
390
- offset: [0, height * 0.03 + -30]
391
- }, s.r + '-' + s.c, ' '), s.s === 1 && !processing && /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, null, /*#__PURE__*/_react.default.createElement("p", {
395
+ }, s.s === 1 && !processing && /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, null, /*#__PURE__*/_react.default.createElement("p", {
392
396
  style: {
393
397
  marginTop: '0.2rem',
394
398
  marginBottom: '0.2rem',
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "iticket-seatingplan-dev",
3
3
  "description": "Seating plan with FLEXi pricing",
4
4
  "author": "gedwyne",
5
- "version": "1.1.2",
5
+ "version": "1.1.4",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "iticket",