contentoh-components-library 21.4.71 → 21.4.72

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.
@@ -893,9 +893,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
893
893
 
894
894
  var loadData = /*#__PURE__*/function () {
895
895
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
896
- var _product$article, _product$article2, _product$article3, _services$, _services$$values;
896
+ var _product$article, _product$article2, _product$article3, _services$, _services$$values, _product$retailersAva2;
897
897
 
898
- var services, data;
898
+ var services, data, headers;
899
899
  return _regenerator.default.wrap(function _callee8$(_context8) {
900
900
  while (1) {
901
901
  switch (_context8.prev = _context8.next) {
@@ -916,20 +916,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
916
916
  init: services[2]
917
917
  });
918
918
  if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
919
- data = [(0, _objectSpread3.default)((0, _objectSpread3.default)({}, product), {}, {
920
- retailersAvailable: product.retailersAvailable.map(function (_ref7) {
919
+ data = [{
920
+ id_article: product.id_article,
921
+ id_category: product.id_category,
922
+ version: product.version,
923
+ id_retailer_array: ((_product$retailersAva2 = product.retailersAvailable) !== null && _product$retailersAva2 !== void 0 ? _product$retailersAva2 : product.retailers).map(function (_ref7) {
921
924
  var id = _ref7.id;
922
925
  return id;
923
926
  })
924
- })];
927
+ }];
928
+ headers = {
929
+ Authorization: token
930
+ };
925
931
  (0, _data.getPercentage)({
926
- data: data
932
+ data: data,
933
+ headers: headers
927
934
  }).then(function (res) {
928
935
  setPercentages(res[0]);
929
936
  });
930
937
  setLoading(false);
931
938
 
932
- case 11:
939
+ case 12:
933
940
  case "end":
934
941
  return _context8.stop();
935
942
  }
@@ -31,63 +31,58 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica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z3CAPR7xZU19txSDyjGHIwya2zV9uOHxauS0-orNRry8lfpZHQt_ISF2W-XSARUvCG1SqTXi41-o53DsWfZhqe9dQk6DGDnvFzXFsaEbaxAPjTfYc491sHCpOjf4W98quBuzDZCRtdCsr9u3A0AnX8Lh1Jquvn83nrHN2ZeefpLyKc-xGGp50Oy6EnJgSK4PcAAV631nwYV9DfVaLb3SIWDrJIIuBjFjBBCXBcnGJBieErlnF-4gumHzsro_QqF-s7aq_3EJChAhfslFvczNSyDc-LXJVkpDuZW3TaYKlHwhoFxz1aMuYRFQ8xy5Pz8FDNKQ",
35
35
  productSelected: {
36
- services: {
37
- datasheets: 1,
38
- descriptions: 1,
39
- images: 1
40
- },
41
- orderId: 15275,
42
- status: "AC",
43
- datasheet_status: "AC",
36
+ orderId: 15190,
37
+ status: "RA",
38
+ datasheet_status: "NS",
44
39
  prio: "none",
45
40
  version: 3,
46
- description_status: "AC",
47
- images_status: "AC",
48
- statusByRetailer: {
49
- 34: {
50
- datasheet: "AC",
51
- description: "AC",
52
- images: "AC"
53
- }
41
+ description_status: "NS",
42
+ images_status: "RA",
43
+ brand: null,
44
+ retailerOrder: 0,
45
+ missing: {
46
+ datasheet: null,
47
+ descriptions: null,
48
+ images: null
49
+ },
50
+ services: {
51
+ datasheets: 0,
52
+ descriptions: 0,
53
+ images: 1
54
54
  },
55
55
  article: {
56
- id_article: 39485,
57
- id_category: "11",
58
- name: "Mix de nueces",
59
- upc: "7543453453",
60
- timestamp: "2023-07-14T21:02:54.000Z",
61
- id_user: 28,
62
- status: "NULL",
63
- active: 1,
64
- company_id: 1,
56
+ category: "Abarrotes Básicos|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
65
57
  company_name: "GRUPO BRAHMA",
66
58
  country: "México",
67
- id_order: 15275,
68
- id_datasheet_especialist: 54,
69
- id_datasheet_facilitator: 52,
70
- id_description_especialist: 54,
71
- id_description_facilitator: 52,
59
+ id_category: "4004",
60
+ id_datasheet_especialist: null,
61
+ id_datasheet_facilitator: null,
62
+ id_description_especialist: null,
63
+ id_description_facilitator: null,
72
64
  id_images_especialist: 55,
73
65
  id_images_facilitator: 53,
66
+ id_order: 15190,
67
+ id_article: 39364,
74
68
  id_auditor: 37,
75
- id_recepcionist: null,
76
- category: "Abarrotes|Abarrotes Secos|Frutos Secos",
77
- missingAttributes: 0,
78
- missingDescriptions: 0,
79
- missingImages: 0
69
+ name: "test 2 img ba",
70
+ timestamp: "2023-05-05T02:56:16.000Z",
71
+ upc: "4353242"
80
72
  },
81
73
  retailers: [{
82
- id: 34,
83
- name: "San Pablo"
74
+ id: 70,
75
+ name: "Bodega Aurrera"
84
76
  }],
85
- country: "México",
86
- upc: "7543453453"
77
+ statusByRetailer: {
78
+ 70: {
79
+ images: "RA/AC"
80
+ }
81
+ }
87
82
  },
88
83
  location: {
89
84
  product: {
90
- articleId: 354,
85
+ articleId: 39364,
91
86
  versionId: 3
92
87
  },
93
88
  state: {
@@ -103,7 +98,7 @@ RetailerProductEditionDefault.args = {
103
98
  position: "Auditor",
104
99
  telephone: "",
105
100
  country: "México",
106
- id_company: 2,
101
+ id_company: 254,
107
102
  id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
108
103
  birth_Date: null,
109
104
  about_me: "",
@@ -117,16 +112,16 @@ RetailerProductEditionDefault.args = {
117
112
  email_notify: 1,
118
113
  is_user_tech: null,
119
114
  membership: {
120
- id: 2,
121
- start_date: "2021-11-05T02:35:12.000Z",
122
- end_date: "2022-11-05T02:34:49.000Z",
123
- planID: 1,
124
- plan: "prod_KtkvuFFLpOdP6e",
125
- name: "Plan Free",
126
- user_limit: "1",
127
- products_limit: "3",
128
- type: "PyMES"
115
+ id: 137,
116
+ start_date: "2023-10-04T15:46:14.000Z",
117
+ end_date: "2024-10-04T08:46:09.000Z",
118
+ planID: 8,
119
+ plan: "prod_KtlhECVSFG2iro",
120
+ name: "Plan Pro",
121
+ user_limit: "50",
122
+ products_limit: "5000",
123
+ type: "Enterprise"
129
124
  },
130
- src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1692750648813"
125
+ src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1701902088068"
131
126
  }
132
127
  };
@@ -573,7 +573,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
573
573
 
574
574
  var loadData = /*#__PURE__*/function () {
575
575
  var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
576
- var _product$article4, _product$article5, _product$article6, _services$, _services$$values, _services;
576
+ var _product$article4, _product$article5, _product$article6, _services$, _services$$values, _product$retailersAva, _services, data, headers;
577
577
 
578
578
  return _regenerator.default.wrap(function _callee3$(_context3) {
579
579
  while (1) {
@@ -598,26 +598,39 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
598
598
  init: _services[2]
599
599
  });
600
600
  if (((_services$ = _services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
601
+ data = [{
602
+ id_article: product.article.id_article,
603
+ id_category: product.article.id_category,
604
+ version: product.version,
605
+ id_retailer_array: ((_product$retailersAva = product.retailersAvailable) !== null && _product$retailersAva !== void 0 ? _product$retailersAva : product.retailers).map(function (_ref6) {
606
+ var id = _ref6.id;
607
+ return id;
608
+ })
609
+ }];
610
+ headers = {
611
+ Authorization: token
612
+ };
601
613
  (0, _data2.getPercentage)({
602
- data: [product]
614
+ data: data,
615
+ headers: headers
603
616
  }).then(function (res) {
604
- return setPercentages(res[0]);
617
+ setPercentages(res[0]);
605
618
  });
606
619
  setLoading(false);
607
- _context3.next = 16;
620
+ _context3.next = 18;
608
621
  break;
609
622
 
610
- case 13:
611
- _context3.prev = 13;
623
+ case 15:
624
+ _context3.prev = 15;
612
625
  _context3.t0 = _context3["catch"](0);
613
626
  console.log(_context3.t0);
614
627
 
615
- case 16:
628
+ case 18:
616
629
  case "end":
617
630
  return _context3.stop();
618
631
  }
619
632
  }
620
- }, _callee3, null, [[0, 13]]);
633
+ }, _callee3, null, [[0, 15]]);
621
634
  }));
622
635
 
623
636
  return function loadData() {
@@ -626,7 +639,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
626
639
  }();
627
640
 
628
641
  var getServices = /*#__PURE__*/function () {
629
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
642
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
630
643
  var _product$article7, _product$article8, _servicesResponse$dat;
631
644
 
632
645
  var servicesResponse, parsedResponse, retailers, retailerResponse, active;
@@ -659,7 +672,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
659
672
  }));
660
673
 
661
674
  return function getServices() {
662
- return _ref6.apply(this, arguments);
675
+ return _ref7.apply(this, arguments);
663
676
  };
664
677
  }();
665
678
 
@@ -673,7 +686,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
673
686
  };
674
687
 
675
688
  var getComments = /*#__PURE__*/function () {
676
- var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
689
+ var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
677
690
  var _product$article9, _product$article10, _product$article11;
678
691
 
679
692
  var tab,
@@ -708,7 +721,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
708
721
  }));
709
722
 
710
723
  return function getComments() {
711
- return _ref7.apply(this, arguments);
724
+ return _ref8.apply(this, arguments);
712
725
  };
713
726
  }();
714
727
 
@@ -879,7 +892,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
879
892
  };
880
893
 
881
894
  var saveDescriptions = /*#__PURE__*/function () {
882
- var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
895
+ var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
883
896
  var dataClean, _product$article12, productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
884
897
 
885
898
  return _regenerator.default.wrap(function _callee7$(_context7) {
@@ -947,12 +960,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
947
960
  }));
948
961
 
949
962
  return function saveDescriptions() {
950
- return _ref9.apply(this, arguments);
963
+ return _ref10.apply(this, arguments);
951
964
  };
952
965
  }();
953
966
 
954
967
  var saveDatasheets = /*#__PURE__*/function () {
955
- var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
968
+ var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
956
969
  var dataClean, _product$article13, productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
957
970
 
958
971
  return _regenerator.default.wrap(function _callee8$(_context8) {
@@ -1020,7 +1033,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1020
1033
  }));
1021
1034
 
1022
1035
  return function saveDatasheets() {
1023
- return _ref10.apply(this, arguments);
1036
+ return _ref11.apply(this, arguments);
1024
1037
  };
1025
1038
  }();
1026
1039
 
@@ -1308,8 +1321,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1308
1321
  break;
1309
1322
  }
1310
1323
 
1311
- var services = servicesData.filter(function (_ref13) {
1312
- var service = _ref13.service;
1324
+ var services = servicesData.filter(function (_ref14) {
1325
+ var service = _ref14.service;
1313
1326
  return concepts.includes(service);
1314
1327
  });
1315
1328
  var adminFacilitatorCanEvaluate = services.every(function (srv) {
@@ -1419,7 +1432,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1419
1432
 
1420
1433
 
1421
1434
  var sendToFacilitator = /*#__PURE__*/function () {
1422
- var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
1435
+ var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
1423
1436
  var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus, messageToChat, _data;
1424
1437
 
1425
1438
  return _regenerator.default.wrap(function _callee11$(_context11) {
@@ -1539,7 +1552,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1539
1552
  }));
1540
1553
 
1541
1554
  return function sendToFacilitator(_x) {
1542
- return _ref14.apply(this, arguments);
1555
+ return _ref15.apply(this, arguments);
1543
1556
  };
1544
1557
  }();
1545
1558
 
@@ -1570,7 +1583,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1570
1583
  };
1571
1584
 
1572
1585
  var createComment = /*#__PURE__*/function () {
1573
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1586
+ var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1574
1587
  var messages,
1575
1588
  retailerId,
1576
1589
  data,
@@ -1605,7 +1618,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1605
1618
  }));
1606
1619
 
1607
1620
  return function createComment() {
1608
- return _ref15.apply(this, arguments);
1621
+ return _ref16.apply(this, arguments);
1609
1622
  };
1610
1623
  }();
1611
1624
 
@@ -1683,7 +1696,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1683
1696
  }, [activeTab]);
1684
1697
 
1685
1698
  var commentRevised = /*#__PURE__*/function () {
1686
- var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1699
+ var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1687
1700
  var data;
1688
1701
  return _regenerator.default.wrap(function _callee13$(_context13) {
1689
1702
  while (1) {
@@ -1713,12 +1726,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1713
1726
  }));
1714
1727
 
1715
1728
  return function commentRevised() {
1716
- return _ref16.apply(this, arguments);
1729
+ return _ref17.apply(this, arguments);
1717
1730
  };
1718
1731
  }();
1719
1732
 
1720
1733
  var setAssignation = /*#__PURE__*/function () {
1721
- var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
1734
+ var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
1722
1735
  var _product$article16;
1723
1736
 
1724
1737
  var concept, productTemp, data;
@@ -1777,7 +1790,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1777
1790
  }));
1778
1791
 
1779
1792
  return function setAssignation(_x2, _x3) {
1780
- return _ref17.apply(this, arguments);
1793
+ return _ref18.apply(this, arguments);
1781
1794
  };
1782
1795
  }();
1783
1796
 
@@ -1947,7 +1960,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1947
1960
  // };
1948
1961
 
1949
1962
  var validateAll = /*#__PURE__*/function () {
1950
- var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
1963
+ var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
1951
1964
  var evaluationArray, conceptArray, messages, productTemp, messagesResponse;
1952
1965
  return _regenerator.default.wrap(function _callee15$(_context15) {
1953
1966
  while (1) {
@@ -2031,7 +2044,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
2031
2044
  }));
2032
2045
 
2033
2046
  return function validateAll(_x4) {
2034
- return _ref18.apply(this, arguments);
2047
+ return _ref19.apply(this, arguments);
2035
2048
  };
2036
2049
  }();
2037
2050
 
@@ -134,46 +134,31 @@ var getPercentage = /*#__PURE__*/function () {
134
134
 
135
135
  func = /*#__PURE__*/function () {
136
136
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
137
- var dataToSend, arrayRetailers, retailers;
137
+ var _params$headers$Autho, _params$headers;
138
+
139
+ var headers;
138
140
  return _regenerator.default.wrap(function _callee2$(_context2) {
139
141
  while (1) {
140
142
  switch (_context2.prev = _context2.next) {
141
143
  case 0:
142
- dataToSend = [];
143
- arrayRetailers = [];
144
- retailers = params.data[0].retailers || params.data[0].retailersAvailable;
145
- params.data.forEach(function (product, i) {
146
- dataToSend.push(product.article ? {
147
- id_article: product.article.id_article,
148
- id_category: product.article.id_category,
149
- version: product.version
150
- } : {
151
- id_article: product.id_article,
152
- id_category: product.id_category,
153
- version: product.version
154
- });
155
- retailers.forEach(function (retailer) {
156
- arrayRetailers.push(retailer.id);
157
- });
158
- dataToSend[i].id_retailer_array = arrayRetailers;
159
- });
160
- _context2.next = 6;
144
+ headers = {
145
+ Authorization: (_params$headers$Autho = params === null || params === void 0 ? void 0 : (_params$headers = params.headers) === null || _params$headers === void 0 ? void 0 : _params$headers.Authorization) !== null && _params$headers$Autho !== void 0 ? _params$headers$Autho : sessionStorage.getItem("jwt")
146
+ };
147
+ _context2.next = 3;
161
148
  return _axios.default.post(process.env.REACT_APP_VALID_EXPORT_ENDPOINT, {
162
- data: dataToSend
149
+ data: params.data
163
150
  }, {
164
- headers: {
165
- Authorization: sessionStorage.getItem("jwt")
166
- }
151
+ headers: headers
167
152
  }).then(function (response) {
168
153
  return [response.data];
169
154
  }).catch(function (err) {
170
155
  return console.log(err, "Errror");
171
156
  });
172
157
 
173
- case 6:
158
+ case 3:
174
159
  return _context2.abrupt("return", _context2.sent);
175
160
 
176
- case 7:
161
+ case 4:
177
162
  case "end":
178
163
  return _context2.stop();
179
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.71",
3
+ "version": "21.4.72",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -494,11 +494,16 @@ export const ProviderProductEdition = ({
494
494
  if (services[2]?.values?.length > 0) setActiveImage(0);
495
495
  const data = [
496
496
  {
497
- ...product,
498
- retailersAvailable: product.retailersAvailable.map(({ id }) => id),
497
+ id_article: product.id_article,
498
+ id_category: product.id_category,
499
+ version: product.version,
500
+ id_retailer_array: (
501
+ product.retailersAvailable ?? product.retailers
502
+ ).map(({ id }) => id),
499
503
  },
500
504
  ];
501
- getPercentage({ data }).then((res) => {
505
+ const headers = { Authorization: token };
506
+ getPercentage({ data, headers }).then((res) => {
502
507
  setPercentages(res[0]);
503
508
  });
504
509
  setLoading(false);
@@ -16,64 +16,60 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5OGE0NzYxMy04ZGIyLTRlZjUtYjA0Mi01ZDU3MWRkZjIwMWIiLCJ0b2tlbl91c2UiOiJpZCIsImF1d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l0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIxMGZiNTE4Mi1jMGI5LTQyZGUtYTAyZC1lOTJlZWI2NWFlN2QiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcwMTkwMjA4NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTcwMTkwNTY4NywiaWF0IjoxNzAxOTAyMDg3LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.JpoKZHuzPZG2ttaT7Oz3CAPR7xZU19txSDyjGHIwya2zV9uOHxauS0-orNRry8lfpZHQt_ISF2W-XSARUvCG1SqTXi41-o53DsWfZhqe9dQk6DGDnvFzXFsaEbaxAPjTfYc491sHCpOjf4W98quBuzDZCRtdCsr9u3A0AnX8Lh1Jquvn83nrHN2ZeefpLyKc-xGGp50Oy6EnJgSK4PcAAV631nwYV9DfVaLb3SIWDrJIIuBjFjBBCXBcnGJBieErlnF-4gumHzsro_QqF-s7aq_3EJChAhfslFvczNSyDc-LXJVkpDuZW3TaYKlHwhoFxz1aMuYRFQ8xy5Pz8FDNKQ",
20
20
  productSelected: {
21
- services: {
22
- datasheets: 1,
23
- descriptions: 1,
24
- images: 1,
25
- },
26
- orderId: 15275,
27
- status: "AC",
28
- datasheet_status: "AC",
21
+ orderId: 15190,
22
+ status: "RA",
23
+ datasheet_status: "NS",
29
24
  prio: "none",
30
25
  version: 3,
31
- description_status: "AC",
32
- images_status: "AC",
33
- statusByRetailer: {
34
- 34: {
35
- datasheet: "AC",
36
- description: "AC",
37
- images: "AC",
38
- },
26
+ description_status: "NS",
27
+ images_status: "RA",
28
+ brand: null,
29
+ retailerOrder: 0,
30
+ missing: {
31
+ datasheet: null,
32
+ descriptions: null,
33
+ images: null,
34
+ },
35
+ services: {
36
+ datasheets: 0,
37
+ descriptions: 0,
38
+ images: 1,
39
39
  },
40
40
  article: {
41
- id_article: 39485,
42
- id_category: "11",
43
- name: "Mix de nueces",
44
- upc: "7543453453",
45
- timestamp: "2023-07-14T21:02:54.000Z",
46
- id_user: 28,
47
- status: "NULL",
48
- active: 1,
49
- company_id: 1,
41
+ category:
42
+ "Abarrotes Básicos|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
50
43
  company_name: "GRUPO BRAHMA",
51
44
  country: "México",
52
- id_order: 15275,
53
- id_datasheet_especialist: 54,
54
- id_datasheet_facilitator: 52,
55
- id_description_especialist: 54,
56
- id_description_facilitator: 52,
45
+ id_category: "4004",
46
+ id_datasheet_especialist: null,
47
+ id_datasheet_facilitator: null,
48
+ id_description_especialist: null,
49
+ id_description_facilitator: null,
57
50
  id_images_especialist: 55,
58
51
  id_images_facilitator: 53,
52
+ id_order: 15190,
53
+ id_article: 39364,
59
54
  id_auditor: 37,
60
- id_recepcionist: null,
61
- category: "Abarrotes|Abarrotes Secos|Frutos Secos",
62
- missingAttributes: 0,
63
- missingDescriptions: 0,
64
- missingImages: 0,
55
+ name: "test 2 img ba",
56
+ timestamp: "2023-05-05T02:56:16.000Z",
57
+ upc: "4353242",
65
58
  },
66
59
  retailers: [
67
60
  {
68
- id: 34,
69
- name: "San Pablo",
61
+ id: 70,
62
+ name: "Bodega Aurrera",
70
63
  },
71
64
  ],
72
- country: "México",
73
- upc: "7543453453",
65
+ statusByRetailer: {
66
+ 70: {
67
+ images: "RA/AC",
68
+ },
69
+ },
74
70
  },
75
71
  location: {
76
- product: { articleId: 354, versionId: 3 },
72
+ product: { articleId: 39364, versionId: 3 },
77
73
  state: {
78
74
  withChat: true,
79
75
  chatType: "product_status",
@@ -87,7 +83,7 @@ RetailerProductEditionDefault.args = {
87
83
  position: "Auditor",
88
84
  telephone: "",
89
85
  country: "México",
90
- id_company: 2,
86
+ id_company: 254,
91
87
  id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
92
88
  birth_Date: null,
93
89
  about_me: "",
@@ -101,16 +97,16 @@ RetailerProductEditionDefault.args = {
101
97
  email_notify: 1,
102
98
  is_user_tech: null,
103
99
  membership: {
104
- id: 2,
105
- start_date: "2021-11-05T02:35:12.000Z",
106
- end_date: "2022-11-05T02:34:49.000Z",
107
- planID: 1,
108
- plan: "prod_KtkvuFFLpOdP6e",
109
- name: "Plan Free",
110
- user_limit: "1",
111
- products_limit: "3",
112
- type: "PyMES",
100
+ id: 137,
101
+ start_date: "2023-10-04T15:46:14.000Z",
102
+ end_date: "2024-10-04T08:46:09.000Z",
103
+ planID: 8,
104
+ plan: "prod_KtlhECVSFG2iro",
105
+ name: "Plan Pro",
106
+ user_limit: "50",
107
+ products_limit: "5000",
108
+ type: "Enterprise",
113
109
  },
114
- src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1692750648813",
110
+ src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1701902088068",
115
111
  },
116
112
  };
@@ -283,7 +283,20 @@ export const RetailerProductEdition = ({
283
283
  getServices();
284
284
  setImages({ action: "init", init: services[2] });
285
285
  if (services[2]?.values?.length > 0) setActiveImage(0);
286
- getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
286
+ const data = [
287
+ {
288
+ id_article: product.article.id_article,
289
+ id_category: product.article.id_category,
290
+ version: product.version,
291
+ id_retailer_array: (
292
+ product.retailersAvailable ?? product.retailers
293
+ ).map(({ id }) => id),
294
+ },
295
+ ];
296
+ const headers = { Authorization: token };
297
+ getPercentage({ data, headers }).then((res) => {
298
+ setPercentages(res[0]);
299
+ });
287
300
  setLoading(false);
288
301
  } catch (error) {
289
302
  console.log(error);
@@ -88,39 +88,15 @@ export const getImage = (imageGeneral, width = 250, height = 250) => {
88
88
 
89
89
  export const getPercentage = async (params = {}) => {
90
90
  const func = async () => {
91
- const dataToSend = [];
92
- const arrayRetailers = [];
93
- let retailers =
94
- params.data[0].retailers || params.data[0].retailersAvailable;
95
- params.data.forEach((product, i) => {
96
- dataToSend.push(
97
- product.article
98
- ? {
99
- id_article: product.article.id_article,
100
- id_category: product.article.id_category,
101
- version: product.version,
102
- }
103
- : {
104
- id_article: product.id_article,
105
- id_category: product.id_category,
106
- version: product.version,
107
- }
108
- );
109
- retailers.forEach((retailer) => {
110
- arrayRetailers.push(retailer.id);
111
- });
112
- dataToSend[i].id_retailer_array = arrayRetailers;
113
- });
114
-
91
+ const headers = {
92
+ Authorization:
93
+ params?.headers?.Authorization ?? sessionStorage.getItem("jwt"),
94
+ };
115
95
  return await axios
116
96
  .post(
117
97
  process.env.REACT_APP_VALID_EXPORT_ENDPOINT,
118
- { data: dataToSend },
119
- {
120
- headers: {
121
- Authorization: sessionStorage.getItem("jwt"),
122
- },
123
- }
98
+ { data: params.data },
99
+ { headers }
124
100
  )
125
101
  .then((response) => [response.data])
126
102
  .catch((err) => console.log(err, "Errror"));