contentoh-components-library 21.1.25 → 21.1.28

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.
@@ -23,8 +23,9 @@ var ValidationPanel = function ValidationPanel(_ref) {
23
23
  setShowValidationPanel = _ref.setShowValidationPanel,
24
24
  approve = _ref.approve,
25
25
  reject = _ref.reject,
26
+ approveAll = _ref.approveAll,
27
+ rejectAll = _ref.rejectAll,
26
28
  showApproveRejectAll = _ref.showApproveRejectAll;
27
- console.log(showApproveRejectAll);
28
29
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
29
30
  id: id,
30
31
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
@@ -52,7 +53,7 @@ var ValidationPanel = function ValidationPanel(_ref) {
52
53
  }), showApproveRejectAll && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
53
54
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
54
55
  onClick: function onClick() {
55
- approve && approve();
56
+ approveAll && approveAll();
56
57
  },
57
58
  className: "validation-option",
58
59
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -63,7 +64,7 @@ var ValidationPanel = function ValidationPanel(_ref) {
63
64
  })]
64
65
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
65
66
  onClick: function onClick() {
66
- reject && reject();
67
+ rejectAll && rejectAll();
67
68
  },
68
69
  className: "validation-option",
69
70
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -30,6 +30,8 @@ var AvatarAndValidation = function AvatarAndValidation(_ref) {
30
30
  showValidationButtons = _ref.showValidationButtons,
31
31
  approve = _ref.approve,
32
32
  reject = _ref.reject,
33
+ approveAll = _ref.approveAll,
34
+ rejectAll = _ref.rejectAll,
33
35
  showApproveRejectAll = _ref.showApproveRejectAll;
34
36
 
35
37
  var _useState = (0, _react.useState)(false),
@@ -74,6 +76,8 @@ var AvatarAndValidation = function AvatarAndValidation(_ref) {
74
76
  setShowValidationPanel: setShowValidationPanel,
75
77
  approve: approve,
76
78
  reject: reject,
79
+ approveAll: approveAll,
80
+ rejectAll: rejectAll,
77
81
  showApproveRejectAll: showApproveRejectAll
78
82
  })]
79
83
  });
@@ -31,6 +31,8 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
31
31
  showValidationButtons = _ref.showValidationButtons,
32
32
  approve = _ref.approve,
33
33
  reject = _ref.reject,
34
+ approveAll = _ref.approveAll,
35
+ rejectAll = _ref.rejectAll,
34
36
  servicesData = _ref.servicesData,
35
37
  showApproveRejectAll = _ref.showApproveRejectAll;
36
38
 
@@ -82,7 +84,9 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
82
84
  showValidationButtons: showValidationButtons,
83
85
  showApproveRejectAll: showApproveRejectAll,
84
86
  approve: approve,
85
- reject: reject
87
+ reject: reject,
88
+ approveAll: approveAll,
89
+ rejectAll: rejectAll
86
90
  })]
87
91
  })]
88
92
  });
@@ -31,124 +31,114 @@ ProviderProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05Z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"AP",
39
+ orderId: 55,
40
+ article_status: "AP",
41
41
  datasheet_status: "AP",
42
- prio: "none",
43
- version: 7,
44
42
  description_status: "AP",
45
43
  images_status: "AP",
46
- brand: "1",
47
- retailerOrder: 0,
48
- missing: {
49
- datasheet: null,
50
- descriptions: null,
51
- images: null
52
- },
53
- services: {
54
- datasheets: 1,
55
- descriptions: 1,
56
- images: 1
57
- },
44
+ prio: "none",
45
+ version: 2,
46
+ brand: null,
58
47
  article: {
59
- category: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
60
- company_name: "COMPANY DEV",
48
+ category: "ILUMINACIÓN|FOCOS|FOCOS",
49
+ company_name: "THD Proveedor",
61
50
  country: "México",
62
- id_category: "41",
63
- id_datasheet_especialist: 54,
64
- id_datasheet_facilitator: 52,
65
- id_description_especialist: 54,
66
- id_description_facilitator: 52,
67
- id_images_especialist: 55,
68
- id_images_facilitator: 53,
69
- id_order: 64,
70
- id_article: 35707,
71
- id_auditor: 37,
72
- name: "chetos",
73
- upc: "1010101010"
51
+ id_category: "2143",
52
+ id_article: 55118,
53
+ name: "FOCO BLUETOOTH SPOT PHILIPS 6 WATTS 300 LÚMENES MULTICOLOR",
54
+ upc: "145582"
74
55
  },
75
56
  retailers: [{
76
- id: 3,
77
- name: "Sam´s Club"
57
+ id: 58,
58
+ name: "The Home Depot Golden"
59
+ }, {
60
+ id: 59,
61
+ name: "The Home Depot Platinum"
78
62
  }, {
79
- id: 8,
80
- name: "Fragua"
63
+ id: 60,
64
+ name: "The Home Depot Resizing"
65
+ }, {
66
+ id: 61,
67
+ name: "Home Depot TAB"
81
68
  }],
69
+ services: {
70
+ datasheets: 1,
71
+ descriptions: 1,
72
+ images: 1
73
+ },
74
+ id_article: 55118,
82
75
  retailersAvailable: [{
83
- id: 3,
84
- name: "Sam´s Club"
76
+ id: 58,
77
+ name: "The Home Depot Golden"
85
78
  }, {
86
- id: 8,
87
- name: "Fragua"
88
- }],
89
- categoryName: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
90
- upc: "1010101010",
91
- id_article: 35707,
92
- id_order: 64
79
+ id: 59,
80
+ name: "The Home Depot Platinum"
81
+ }, {
82
+ id: 60,
83
+ name: "The Home Depot Resizing"
84
+ }, {
85
+ id: 61,
86
+ name: "Home Depot TAB"
87
+ }]
93
88
  },
94
89
  productToEdit: {
95
- ArticleId: 35707,
96
- idCategory: "41",
90
+ ArticleId: 55118,
91
+ idCategory: "2143",
97
92
  product: {
98
- orderId: 64,
99
- status: "AP",
93
+ orderId: 55,
94
+ article_status: "AP",
100
95
  datasheet_status: "AP",
101
- prio: "none",
102
- version: 7,
103
96
  description_status: "AP",
104
97
  images_status: "AP",
105
- brand: "1",
106
- retailerOrder: 0,
107
- missing: {
108
- datasheet: null,
109
- descriptions: null,
110
- images: null
111
- },
112
- services: {
113
- datasheets: 1,
114
- descriptions: 1,
115
- images: 1
116
- },
98
+ prio: "none",
99
+ version: 2,
100
+ brand: null,
117
101
  article: {
118
- category: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
119
- company_name: "COMPANY DEV",
102
+ category: "ILUMINACIÓN|FOCOS|FOCOS",
103
+ company_name: "THD Proveedor",
120
104
  country: "México",
121
- id_category: "41",
122
- id_datasheet_especialist: 54,
123
- id_datasheet_facilitator: 52,
124
- id_description_especialist: 54,
125
- id_description_facilitator: 52,
126
- id_images_especialist: 55,
127
- id_images_facilitator: 53,
128
- id_order: 64,
129
- id_article: 35707,
130
- id_auditor: 37,
131
- name: "chetos",
132
- upc: "1010101010"
105
+ id_category: "2143",
106
+ id_article: 55118,
107
+ name: "FOCO BLUETOOTH SPOT PHILIPS 6 WATTS 300 LÚMENES MULTICOLOR",
108
+ upc: "145582"
133
109
  },
134
110
  retailers: [{
135
- id: 3,
136
- name: "Sam´s Club"
111
+ id: 58,
112
+ name: "The Home Depot Golden"
113
+ }, {
114
+ id: 59,
115
+ name: "The Home Depot Platinum"
137
116
  }, {
138
- id: 8,
139
- name: "Fragua"
117
+ id: 60,
118
+ name: "The Home Depot Resizing"
119
+ }, {
120
+ id: 61,
121
+ name: "Home Depot TAB"
140
122
  }],
123
+ services: {
124
+ datasheets: 1,
125
+ descriptions: 1,
126
+ images: 1
127
+ },
128
+ id_article: 55118,
141
129
  retailersAvailable: [{
142
- id: 3,
143
- name: "Sam´s Club"
130
+ id: 58,
131
+ name: "The Home Depot Golden"
144
132
  }, {
145
- id: 8,
146
- name: "Fragua"
147
- }],
148
- categoryName: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
149
- upc: "1010101010",
150
- id_article: 35707,
151
- id_order: 64
133
+ id: 59,
134
+ name: "The Home Depot Platinum"
135
+ }, {
136
+ id: 60,
137
+ name: "The Home Depot Resizing"
138
+ }, {
139
+ id: 61,
140
+ name: "Home Depot TAB"
141
+ }]
152
142
  }
153
143
  },
154
144
  location: {
@@ -161,36 +151,36 @@ ProviderProductEditionDefault.args = {
161
151
  }
162
152
  },
163
153
  user: {
164
- id_user: 28,
165
- name: "Proveedor",
166
- last_name: "Colgate",
167
- email: "ilopez@contentoh.com",
168
- position: "Prueba Admin",
154
+ id_user: 59,
155
+ name: "The Home",
156
+ last_name: "Depot",
157
+ email: "cadena.ismael@allfreemail.net",
158
+ position: "Admin",
169
159
  telephone: "+523111366336",
170
160
  country: "México",
171
- id_company: 1,
172
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
161
+ id_company: 7,
162
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
173
163
  birth_Date: null,
174
164
  about_me: null,
175
165
  zip_code: null,
176
166
  address: null,
177
167
  job: null,
178
- id_stripe: "cus_KuEt6R6vwmN09f",
168
+ id_stripe: "",
179
169
  id_role: 0,
180
170
  active: 1,
181
- is_retailer: 1,
182
- email_notify: 0,
171
+ is_retailer: 0,
172
+ email_notify: 1,
183
173
  membership: {
184
- id: 38,
185
- start_date: "2022-01-18T17:25:35.000Z",
186
- end_date: "2023-01-18T17:25:35.000Z",
187
- planID: 8,
188
- plan: "prod_KtlhECVSFG2iro",
189
- name: "Plan Pro",
190
- user_limit: "20",
191
- products_limit: "5000",
174
+ id: 24,
175
+ start_date: "2021-11-23T03:35:50.000Z",
176
+ end_date: "2022-11-23T03:35:50.000Z",
177
+ planID: 9,
178
+ plan: "prod_KtlkzZVGq6bRTO",
179
+ name: "Plan Enterprise Full",
180
+ user_limit: "30",
181
+ products_limit: "10000",
192
182
  type: "Enterprise"
193
183
  },
194
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1656087239674"
184
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1656113146885"
195
185
  }
196
186
  };
@@ -465,7 +465,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
465
465
 
466
466
  var loadData = /*#__PURE__*/function () {
467
467
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
468
- var _product$article, _product$article2, _services$, _services$$values;
468
+ var _product$article, _product$article2, _product$article3, _services$, _services$$values;
469
469
 
470
470
  var services;
471
471
  return _regenerator.default.wrap(function _callee2$(_context2) {
@@ -473,7 +473,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
473
473
  switch (_context2.prev = _context2.next) {
474
474
  case 0:
475
475
  _context2.next = 2;
476
- return (0, _data2.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article), parseInt((product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), product === null || product === void 0 ? void 0 : product.version);
476
+ return (0, _data2.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article), (product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.company_name) || (product === null || product === void 0 ? void 0 : product.categoryName), parseInt((product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), product === null || product === void 0 ? void 0 : product.version);
477
477
 
478
478
  case 2:
479
479
  services = _context2.sent;
@@ -513,7 +513,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
513
513
 
514
514
  var getServices = /*#__PURE__*/function () {
515
515
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
516
- var _product$article3;
516
+ var _product$article4;
517
517
 
518
518
  var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
519
519
 
@@ -522,7 +522,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
522
522
  switch (_context3.prev = _context3.next) {
523
523
  case 0:
524
524
  productInOrder = product.id_order || product.orderId;
525
- idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_article);
525
+ idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article);
526
526
 
527
527
  if (!(isRevision() || productInOrder)) {
528
528
  _context3.next = 11;
@@ -1236,10 +1236,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1236
1236
  });
1237
1237
 
1238
1238
  if (imgsInBack.length > 0) {
1239
- var _product$article4;
1239
+ var _product$article5;
1240
1240
 
1241
1241
  var data = {
1242
- articleId: (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article),
1242
+ articleId: (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.id_article),
1243
1243
  deleteImages: imgsInBack
1244
1244
  };
1245
1245
 
@@ -1333,7 +1333,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1333
1333
  });
1334
1334
 
1335
1335
  case 7:
1336
- _context13.next = 18;
1336
+ _context13.next = 19;
1337
1337
  break;
1338
1338
 
1339
1339
  case 9:
@@ -1353,6 +1353,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1353
1353
  });
1354
1354
 
1355
1355
  setProduct(productTemp);
1356
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1356
1357
  setProductEdit({
1357
1358
  ArticleId: productTemp.id_article,
1358
1359
  idCategory: productTemp.article.id_category,
@@ -1367,11 +1368,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1367
1368
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, "Evaluated"));
1368
1369
  });
1369
1370
 
1370
- case 18:
1371
+ case 19:
1371
1372
  loadData();
1372
1373
  showSurvey && showSurvey(confirmStatusComplete());
1373
1374
 
1374
- case 20:
1375
+ case 21:
1375
1376
  case "end":
1376
1377
  return _context13.stop();
1377
1378
  }
@@ -1386,58 +1387,86 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1386
1387
 
1387
1388
  var validateAll = /*#__PURE__*/function () {
1388
1389
  var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
1389
- var evaluationArray, sendAll, conceptArray;
1390
+ var evaluationArray, sendAll, conceptArray, productTemp;
1390
1391
  return _regenerator.default.wrap(function _callee14$(_context14) {
1391
1392
  while (1) {
1392
1393
  switch (_context14.prev = _context14.next) {
1393
1394
  case 0:
1394
- try {
1395
- evaluationArray = [];
1396
- sendAll = [];
1397
- conceptArray = ["description", "datasheet", "images"];
1398
- console.log(servicesData);
1399
- servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1400
- var _product$id_order4;
1401
-
1402
- var data = {
1403
- articleId: product.id_article,
1404
- orderId: (_product$id_order4 = product.id_order) !== null && _product$id_order4 !== void 0 ? _product$id_order4 : product.orderId,
1405
- concept: ret.service,
1406
- result: result,
1407
- retailerId: ret.id_retailer
1408
- };
1409
- evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1410
- headers: {
1411
- Authorization: token
1412
- }
1413
- }));
1414
- });
1415
- conceptArray.forEach(function (concept) {
1416
- var _product$id_order5;
1417
-
1418
- var data = {
1419
- articleId: product.id_article,
1420
- orderId: (_product$id_order5 = product.id_order) !== null && _product$id_order5 !== void 0 ? _product$id_order5 : product.orderId,
1421
- concept: concept
1422
- };
1423
- sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1424
- headers: {
1425
- Authorization: token
1426
- }
1427
- }));
1428
- });
1429
- Promise.all(conceptArray);
1430
- Promise.all(sendAll);
1431
- } catch (error) {
1432
- console.log(error);
1433
- }
1395
+ _context14.prev = 0;
1396
+ setLoading(true);
1397
+ evaluationArray = [];
1398
+ sendAll = [];
1399
+ conceptArray = ["description", "datasheet", "images"];
1400
+ servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1401
+ var _product$id_order4;
1402
+
1403
+ var data = {
1404
+ articleId: product.id_article,
1405
+ orderId: (_product$id_order4 = product.id_order) !== null && _product$id_order4 !== void 0 ? _product$id_order4 : product.orderId,
1406
+ concept: ret.service,
1407
+ result: result,
1408
+ retailerId: ret.id_retailer
1409
+ };
1410
+ evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1411
+ headers: {
1412
+ Authorization: token
1413
+ }
1414
+ }));
1415
+ });
1416
+ _context14.next = 8;
1417
+ return Promise.all(evaluationArray);
1418
+
1419
+ case 8:
1420
+ conceptArray === null || conceptArray === void 0 ? void 0 : conceptArray.forEach(function (concept) {
1421
+ var _product$id_order5;
1422
+
1423
+ var data = {
1424
+ articleId: product.id_article,
1425
+ orderId: (_product$id_order5 = product.id_order) !== null && _product$id_order5 !== void 0 ? _product$id_order5 : product.orderId,
1426
+ concept: concept
1427
+ };
1428
+ sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1429
+ headers: {
1430
+ Authorization: token
1431
+ }
1432
+ }));
1433
+ });
1434
+ _context14.next = 11;
1435
+ return Promise.all(sendAll);
1436
+
1437
+ case 11:
1438
+ productTemp = product;
1439
+ productTemp.article_status = "".concat(result, "C");
1440
+ productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "C");
1441
+ productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "C");
1442
+ productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "C");
1443
+ setProduct(productTemp);
1444
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1445
+ setProductEdit({
1446
+ ArticleId: productTemp.id_article,
1447
+ idCategory: productTemp.article.id_category,
1448
+ product: productTemp
1449
+ });
1450
+ sessionStorage.setItem("productEdit", JSON.stringify({
1451
+ ArticleId: productTemp.id_article,
1452
+ idCategory: productTemp.article.id_category,
1453
+ product: productTemp
1454
+ }));
1455
+ loadData();
1456
+ _context14.next = 26;
1457
+ break;
1458
+
1459
+ case 23:
1460
+ _context14.prev = 23;
1461
+ _context14.t0 = _context14["catch"](0);
1462
+ console.log(_context14.t0);
1434
1463
 
1435
- case 1:
1464
+ case 26:
1436
1465
  case "end":
1437
1466
  return _context14.stop();
1438
1467
  }
1439
1468
  }
1440
- }, _callee14);
1469
+ }, _callee14, null, [[0, 23]]);
1441
1470
  }));
1442
1471
 
1443
1472
  return function validateAll(_x8) {
@@ -1515,7 +1544,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1515
1544
  (0, _react.useEffect)(function () {
1516
1545
  setSaving(loading);
1517
1546
  }, [loading]);
1518
- console.log(user.is_retailer === 1, product.id_order || product.orderId, isRevision(), getSectionStatus(), "XD");
1519
1547
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1520
1548
  headerTop: headerTop,
1521
1549
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
@@ -1553,12 +1581,68 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1553
1581
  setActiveRetailer: setActiveRetailer,
1554
1582
  showValidationButtons: isRevision() && getSectionStatus(),
1555
1583
  servicesData: servicesData ? servicesData : null,
1556
- showApproveRejectAll: user.is_retailer === 1 && (product.id_order || product.orderId) && isRevision() && getSectionStatus(),
1584
+ showApproveRejectAll: isRevision() && getSectionStatus(),
1557
1585
  approveAll: function approveAll() {
1558
- return validateAll("A");
1586
+ if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1587
+ setDataGenericModal(function (prev) {
1588
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1589
+ button2: {
1590
+ name: "Continuar",
1591
+ action: function action() {
1592
+ return evaluationToRetailer("A");
1593
+ }
1594
+ }
1595
+ });
1596
+ });
1597
+ setShowGenericModal(true);
1598
+ } else {
1599
+ if (user.is_retailer) {
1600
+ if (product.id_order || product.orderId) {
1601
+ validateAll("A");
1602
+ } else {
1603
+ setDataGenericModal(function (prev) {
1604
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1605
+ button2: {
1606
+ name: "Continuar",
1607
+ action: function action() {
1608
+ return evaluationToRetailer("A");
1609
+ }
1610
+ }
1611
+ });
1612
+ });
1613
+ setShowGenericModal(true);
1614
+ }
1615
+ } else {
1616
+ validateAll("A");
1617
+ }
1618
+ }
1559
1619
  },
1560
1620
  rejectAll: function rejectAll() {
1561
- return validateAll("R");
1621
+ if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1622
+ return;
1623
+ } else {
1624
+ if (user.is_retailer) {
1625
+ if (product.id_order || product.orderId) {
1626
+ validateAll("R");
1627
+ setModalViewError(true);
1628
+ } else {
1629
+ setDataGenericModal(function (prev) {
1630
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1631
+ button2: {
1632
+ name: "Continuar",
1633
+ action: function action() {
1634
+ return evaluationToRetailer("R");
1635
+ }
1636
+ }
1637
+ });
1638
+ });
1639
+ setShowGenericModal(true);
1640
+ }
1641
+ } else {
1642
+ validateAll("R");
1643
+ setModalViewError(true);
1644
+ }
1645
+ }
1562
1646
  },
1563
1647
  approve: function approve() {
1564
1648
  if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {