iticket-seatingplan-dev 1.1.1 → 1.1.3

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,24 @@ 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
+ 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
+ }]);
123
122
  }
124
123
  }).catch(error => {
125
- chosenSeat.circle.target.setStyle({
124
+ ;
125
+ (chosenSeat || cs).circle.target.setStyle({
126
126
  fillColor: statusColors.available
127
127
  });
128
128
  const event = {
@@ -194,7 +194,10 @@ const SeatingPlan = _ref => {
194
194
  });
195
195
  if (s.s === 1) {
196
196
  const availablePrices = seats.pricing.filter(price => price.psId === priceSectionId);
197
- availablePrices.length === 1 && addTicketToCart(s, availablePrices[0].paId);
197
+ availablePrices.length === 1 && addTicketToCart(s, availablePrices[0].paId, {
198
+ circle: e,
199
+ seat: s
200
+ });
198
201
  } else {
199
202
  removeTicketFromCart(s, e);
200
203
  }
@@ -223,12 +226,12 @@ const SeatingPlan = _ref => {
223
226
  const img = new Image();
224
227
  img.src = data.background;
225
228
  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,
229
+ ssId: s.ssId,
230
+ r: s.r,
231
+ c: s.c,
229
232
  showingId: showingId,
230
- price: price || s.defaultPrice,
231
- priceAgeName: s.priceAgeName
233
+ p: price || s.defaultPrice,
234
+ paName: s.priceAgeName
232
235
  })));
233
236
  img.onload = () => {
234
237
  setHeight(img.height * 0.5);
@@ -284,7 +287,7 @@ const SeatingPlan = _ref => {
284
287
  }, /*#__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
288
  whenReady: setMap,
286
289
  center: [height * 0.015, width * 0.015],
287
- zoom: 5,
290
+ zoom: 6,
288
291
  zoomControl: true,
289
292
  scrollWheelZoom: true,
290
293
  style: {
@@ -312,7 +315,7 @@ const SeatingPlan = _ref => {
312
315
  cursor: 'pointer'
313
316
  }
314
317
  }, /*#__PURE__*/_react.default.createElement("img", {
315
- src: "https://www.iticket.com.au/assets/images/fit-icon.jpg",
318
+ src: "https://au-iticket-shop-legacy.azurewebsites.net/assets/images/fit-icon.jpg",
316
319
  style: {
317
320
  height: '17px'
318
321
  }
@@ -332,7 +335,7 @@ const SeatingPlan = _ref => {
332
335
  }
333
336
  }, /*#__PURE__*/_react.default.createElement("img", {
334
337
  className: isReloading ? 'rotate' : '',
335
- src: "https://www.iticket.com.au/assets/images/refresh.png",
338
+ src: "https://au-iticket-shop-legacy.azurewebsites.net/assets/images/refresh.png",
336
339
  style: {
337
340
  height: '17px'
338
341
  }
@@ -344,7 +347,7 @@ const SeatingPlan = _ref => {
344
347
  key: i
345
348
  }, /*#__PURE__*/_react.default.createElement(_reactLeaflet.ImageOverlay, {
346
349
  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]
350
+ 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
351
  // [height * 0.0302 - s.y * 0.602 - 0.3, s.x * 0.61 - 0.3],
349
352
  // [height * 0.0302 - s.y * 0.602 + 0.3, s.x * 0.61 + 0.3],
350
353
  // [height * 0.0302 - s.y * 0.602 - 0.17, s.x * 0.61 - 0.17],
@@ -364,7 +367,7 @@ const SeatingPlan = _ref => {
364
367
  // height * 0.0302 - s.y * 0.602 + 0.17,
365
368
  // s.x * 0.61 + 0.17,
366
369
  // ],
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]],
370
+ [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
371
  zIndex: 10
369
372
  }) : /*#__PURE__*/_react.default.createElement(_reactLeaflet.Circle, {
370
373
  center: [
@@ -373,7 +376,7 @@ const SeatingPlan = _ref => {
373
376
  // height * (height > 700 ? 0.0001 : 0.0006),
374
377
  // s.x * 0.6 + 0.25,
375
378
 
376
- height * 0.05 - s.y / 3.35 - height / 50, s.x * 0.3 + 0.15
379
+ height * 0.05 - s.y / 3.35 - height / 48, s.x * 0.3 + 0.15
377
380
 
378
381
  // -s.y * (height * 0.00037) + 24.2,
379
382
  // s.x * 0.3 + 0.15,
@@ -385,10 +388,7 @@ const SeatingPlan = _ref => {
385
388
  click: e => handleClick(e, s)
386
389
  }
387
390
  // 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", {
391
+ }, s.s === 1 && !processing && /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, null, /*#__PURE__*/_react.default.createElement("p", {
392
392
  style: {
393
393
  marginTop: '0.2rem',
394
394
  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.1",
5
+ "version": "1.1.3",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "iticket",