contentoh-components-library 21.1.11 → 21.1.12
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.
|
@@ -510,7 +510,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
510
510
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
511
511
|
var _product$article3;
|
|
512
512
|
|
|
513
|
-
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse,
|
|
513
|
+
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
|
|
514
514
|
|
|
515
515
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
516
516
|
while (1) {
|
|
@@ -530,13 +530,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
530
530
|
case 5:
|
|
531
531
|
servicesResponse = _context3.sent;
|
|
532
532
|
parsedResponse = JSON.parse(servicesResponse === null || servicesResponse === void 0 ? void 0 : (_servicesResponse$dat = servicesResponse.data) === null || _servicesResponse$dat === void 0 ? void 0 : _servicesResponse$dat.body).data;
|
|
533
|
-
|
|
534
|
-
|
|
533
|
+
retailers = product.retailers || product.retailersAvailable;
|
|
534
|
+
active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
|
|
535
535
|
return parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
|
|
536
536
|
return srv.id_retailer;
|
|
537
537
|
}).includes(retailer.id);
|
|
538
538
|
})[0];
|
|
539
|
-
!activeRetailer.id && setActiveRetailer(
|
|
539
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
540
540
|
setServicesData(parsedResponse);
|
|
541
541
|
|
|
542
542
|
case 11:
|
|
@@ -630,43 +630,39 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
630
630
|
case 0:
|
|
631
631
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
632
632
|
loadData();
|
|
633
|
-
setActiveRetailer(active ? active : retailers[0]); // getPercentage({ data: [product] }).then((res) =>
|
|
634
|
-
// setPercentages(res)
|
|
635
|
-
// );
|
|
636
|
-
|
|
637
633
|
getCart();
|
|
638
634
|
_context5.t0 = setUserGroups;
|
|
639
|
-
_context5.next =
|
|
635
|
+
_context5.next = 6;
|
|
640
636
|
return (0, _data2.fetchUsers)(token);
|
|
641
637
|
|
|
642
|
-
case
|
|
638
|
+
case 6:
|
|
643
639
|
_context5.t1 = _context5.sent;
|
|
644
640
|
(0, _context5.t0)(_context5.t1);
|
|
645
641
|
arr = [];
|
|
646
642
|
_context5.t2 = user.id_role;
|
|
647
|
-
_context5.next = _context5.t2 === 7 ?
|
|
643
|
+
_context5.next = _context5.t2 === 7 ? 12 : _context5.t2 === 8 ? 12 : _context5.t2 === 4 ? 14 : _context5.t2 === 5 ? 14 : _context5.t2 === 6 ? 16 : 18;
|
|
648
644
|
break;
|
|
649
645
|
|
|
650
|
-
case
|
|
646
|
+
case 12:
|
|
651
647
|
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
652
|
-
return _context5.abrupt("break",
|
|
648
|
+
return _context5.abrupt("break", 20);
|
|
653
649
|
|
|
654
|
-
case
|
|
650
|
+
case 14:
|
|
655
651
|
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
656
|
-
return _context5.abrupt("break",
|
|
652
|
+
return _context5.abrupt("break", 20);
|
|
657
653
|
|
|
658
|
-
case
|
|
654
|
+
case 16:
|
|
659
655
|
arr = ["RP", "RC", "AF"];
|
|
660
|
-
return _context5.abrupt("break",
|
|
656
|
+
return _context5.abrupt("break", 20);
|
|
661
657
|
|
|
662
|
-
case
|
|
658
|
+
case 18:
|
|
663
659
|
arr = [];
|
|
664
|
-
return _context5.abrupt("break",
|
|
660
|
+
return _context5.abrupt("break", 20);
|
|
665
661
|
|
|
666
|
-
case
|
|
662
|
+
case 20:
|
|
667
663
|
setStatusArray(arr);
|
|
668
664
|
|
|
669
|
-
case
|
|
665
|
+
case 21:
|
|
670
666
|
case "end":
|
|
671
667
|
return _context5.stop();
|
|
672
668
|
}
|
package/package.json
CHANGED
|
@@ -304,11 +304,6 @@ export const ProviderProductEdition = ({
|
|
|
304
304
|
useEffect(async () => {
|
|
305
305
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
306
306
|
loadData();
|
|
307
|
-
|
|
308
|
-
setActiveRetailer(active ? active : retailers[0]);
|
|
309
|
-
// getPercentage({ data: [product] }).then((res) =>
|
|
310
|
-
// setPercentages(res)
|
|
311
|
-
// );
|
|
312
307
|
getCart();
|
|
313
308
|
setUserGroups(await fetchUsers(token));
|
|
314
309
|
let arr = [];
|