contentoh-components-library 21.1.29 → 21.1.30

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: 1236,
165
- name: "THD",
166
- last_name: "Proveedor",
167
- email: "thd@allfreemail.net",
168
- position: "Prod test",
169
- telephone: "+523111111111",
154
+ id_user: 59,
155
+ name: "The Home",
156
+ last_name: "Depot",
157
+ email: "cadena.ismael@allfreemail.net",
158
+ position: "Admin",
159
+ telephone: "+523111366336",
170
160
  country: "México",
171
- id_company: 816,
172
- id_cognito: "d660ccca-f906-4970-892c-6d152e832e5d",
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: null,
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: 797,
185
- start_date: "2022-06-19T04:18:39.000Z",
186
- end_date: "2023-06-19T04:18:39.000Z",
187
- planID: 6,
188
- plan: "prod_KvGd6YSTJyR3AP",
189
- name: "Plan Small",
190
- user_limit: "10",
191
- products_limit: "1000",
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
  };
@@ -479,7 +479,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
479
479
 
480
480
  var loadData = /*#__PURE__*/function () {
481
481
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
482
- var _product$article, _product$article2, _services$, _services$$values;
482
+ var _product$article, _product$article2, _product$article3, _services$, _services$$values;
483
483
 
484
484
  var services;
485
485
  return _regenerator.default.wrap(function _callee2$(_context2) {
@@ -487,7 +487,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
487
487
  switch (_context2.prev = _context2.next) {
488
488
  case 0:
489
489
  _context2.next = 2;
490
- 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);
490
+ 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);
491
491
 
492
492
  case 2:
493
493
  services = _context2.sent;
@@ -527,7 +527,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
527
527
 
528
528
  var getServices = /*#__PURE__*/function () {
529
529
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
530
- var _product$article3;
530
+ var _product$article4;
531
531
 
532
532
  var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
533
533
 
@@ -536,7 +536,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
536
536
  switch (_context3.prev = _context3.next) {
537
537
  case 0:
538
538
  productInOrder = product.id_order || product.orderId;
539
- 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);
539
+ 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);
540
540
 
541
541
  if (!(isRevision() || productInOrder)) {
542
542
  _context3.next = 11;
@@ -1250,10 +1250,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1250
1250
  });
1251
1251
 
1252
1252
  if (imgsInBack.length > 0) {
1253
- var _product$article4;
1253
+ var _product$article5;
1254
1254
 
1255
1255
  var data = {
1256
- 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),
1256
+ 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),
1257
1257
  deleteImages: imgsInBack
1258
1258
  };
1259
1259
 
@@ -1347,7 +1347,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1347
1347
  });
1348
1348
 
1349
1349
  case 7:
1350
- _context13.next = 18;
1350
+ _context13.next = 19;
1351
1351
  break;
1352
1352
 
1353
1353
  case 9:
@@ -1367,6 +1367,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1367
1367
  });
1368
1368
 
1369
1369
  setProduct(productTemp);
1370
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1370
1371
  setProductEdit({
1371
1372
  ArticleId: productTemp.id_article,
1372
1373
  idCategory: productTemp.article.id_category,
@@ -1381,11 +1382,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1381
1382
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, "Evaluated"));
1382
1383
  });
1383
1384
 
1384
- case 18:
1385
+ case 19:
1385
1386
  loadData();
1386
1387
  showSurvey && showSurvey(confirmStatusComplete());
1387
1388
 
1388
- case 20:
1389
+ case 21:
1389
1390
  case "end":
1390
1391
  return _context13.stop();
1391
1392
  }
@@ -1400,58 +1401,86 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1400
1401
 
1401
1402
  var validateAll = /*#__PURE__*/function () {
1402
1403
  var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
1403
- var evaluationArray, sendAll, conceptArray;
1404
+ var evaluationArray, sendAll, conceptArray, productTemp;
1404
1405
  return _regenerator.default.wrap(function _callee14$(_context14) {
1405
1406
  while (1) {
1406
1407
  switch (_context14.prev = _context14.next) {
1407
1408
  case 0:
1408
- try {
1409
- evaluationArray = [];
1410
- sendAll = [];
1411
- conceptArray = ["description", "datasheet", "images"];
1412
- console.log(servicesData);
1413
- servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1414
- var _product$id_order4;
1415
-
1416
- var data = {
1417
- articleId: product.id_article,
1418
- orderId: (_product$id_order4 = product.id_order) !== null && _product$id_order4 !== void 0 ? _product$id_order4 : product.orderId,
1419
- concept: ret.service,
1420
- result: result,
1421
- retailerId: ret.id_retailer
1422
- };
1423
- evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1424
- headers: {
1425
- Authorization: token
1426
- }
1427
- }));
1428
- });
1429
- conceptArray.forEach(function (concept) {
1430
- var _product$id_order5;
1431
-
1432
- var data = {
1433
- articleId: product.id_article,
1434
- orderId: (_product$id_order5 = product.id_order) !== null && _product$id_order5 !== void 0 ? _product$id_order5 : product.orderId,
1435
- concept: concept
1436
- };
1437
- sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1438
- headers: {
1439
- Authorization: token
1440
- }
1441
- }));
1442
- });
1443
- Promise.all(conceptArray);
1444
- Promise.all(sendAll);
1445
- } catch (error) {
1446
- console.log(error);
1447
- }
1409
+ _context14.prev = 0;
1410
+ setLoading(true);
1411
+ evaluationArray = [];
1412
+ sendAll = [];
1413
+ conceptArray = ["description", "datasheet", "images"];
1414
+ servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1415
+ var _product$id_order4;
1416
+
1417
+ var data = {
1418
+ articleId: product.id_article,
1419
+ orderId: (_product$id_order4 = product.id_order) !== null && _product$id_order4 !== void 0 ? _product$id_order4 : product.orderId,
1420
+ concept: ret.service,
1421
+ result: result,
1422
+ retailerId: ret.id_retailer
1423
+ };
1424
+ evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1425
+ headers: {
1426
+ Authorization: token
1427
+ }
1428
+ }));
1429
+ });
1430
+ _context14.next = 8;
1431
+ return Promise.all(evaluationArray);
1448
1432
 
1449
- case 1:
1433
+ case 8:
1434
+ conceptArray === null || conceptArray === void 0 ? void 0 : conceptArray.forEach(function (concept) {
1435
+ var _product$id_order5;
1436
+
1437
+ var data = {
1438
+ articleId: product.id_article,
1439
+ orderId: (_product$id_order5 = product.id_order) !== null && _product$id_order5 !== void 0 ? _product$id_order5 : product.orderId,
1440
+ concept: concept
1441
+ };
1442
+ sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1443
+ headers: {
1444
+ Authorization: token
1445
+ }
1446
+ }));
1447
+ });
1448
+ _context14.next = 11;
1449
+ return Promise.all(sendAll);
1450
+
1451
+ case 11:
1452
+ productTemp = product;
1453
+ productTemp.article_status = "".concat(result, "C");
1454
+ productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "C");
1455
+ productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "C");
1456
+ productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "C");
1457
+ setProduct(productTemp);
1458
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1459
+ setProductEdit({
1460
+ ArticleId: productTemp.id_article,
1461
+ idCategory: productTemp.article.id_category,
1462
+ product: productTemp
1463
+ });
1464
+ sessionStorage.setItem("productEdit", JSON.stringify({
1465
+ ArticleId: productTemp.id_article,
1466
+ idCategory: productTemp.article.id_category,
1467
+ product: productTemp
1468
+ }));
1469
+ loadData();
1470
+ _context14.next = 26;
1471
+ break;
1472
+
1473
+ case 23:
1474
+ _context14.prev = 23;
1475
+ _context14.t0 = _context14["catch"](0);
1476
+ console.log(_context14.t0);
1477
+
1478
+ case 26:
1450
1479
  case "end":
1451
1480
  return _context14.stop();
1452
1481
  }
1453
1482
  }
1454
- }, _callee14);
1483
+ }, _callee14, null, [[0, 23]]);
1455
1484
  }));
1456
1485
 
1457
1486
  return function validateAll(_x8) {
@@ -1526,6 +1555,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1526
1555
  }
1527
1556
  };
1528
1557
 
1558
+ (0, _react.useEffect)(function () {
1559
+ setSaving(loading);
1560
+ }, [loading]);
1529
1561
  var slidefront = [{
1530
1562
  slide: _slide.default,
1531
1563
  description: "Creamos tu contenido, y todo lo que haga falta para tu producto, cada sección puedes socilitar contenido enriquecido, y nosotros lo haremos por ti."
@@ -1543,10 +1575,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1543
1575
  title: "Bienvenido al modo Content-oh!",
1544
1576
  description: "Finalmente elige la forma de pago que más te guste, procede con el pago y listo."
1545
1577
  }];
1546
- (0, _react.useEffect)(function () {
1547
- setSaving(loading);
1548
- }, [loading]);
1549
- console.log(user.is_retailer === 1, product.id_order || product.orderId, isRevision(), getSectionStatus(), "XD");
1550
1578
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1551
1579
  headerTop: headerTop,
1552
1580
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
@@ -1584,12 +1612,68 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1584
1612
  setActiveRetailer: setActiveRetailer,
1585
1613
  showValidationButtons: isRevision() && getSectionStatus(),
1586
1614
  servicesData: servicesData ? servicesData : null,
1587
- showApproveRejectAll: user.is_retailer === 1 && (product.id_order || product.orderId) && isRevision() && getSectionStatus(),
1615
+ showApproveRejectAll: isRevision() && getSectionStatus(),
1588
1616
  approveAll: function approveAll() {
1589
- return validateAll("A");
1617
+ if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1618
+ setDataGenericModal(function (prev) {
1619
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1620
+ button2: {
1621
+ name: "Continuar",
1622
+ action: function action() {
1623
+ return evaluationToRetailer("A");
1624
+ }
1625
+ }
1626
+ });
1627
+ });
1628
+ setShowGenericModal(true);
1629
+ } else {
1630
+ if (user.is_retailer) {
1631
+ if (product.id_order || product.orderId) {
1632
+ validateAll("A");
1633
+ } else {
1634
+ setDataGenericModal(function (prev) {
1635
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1636
+ button2: {
1637
+ name: "Continuar",
1638
+ action: function action() {
1639
+ return evaluationToRetailer("A");
1640
+ }
1641
+ }
1642
+ });
1643
+ });
1644
+ setShowGenericModal(true);
1645
+ }
1646
+ } else {
1647
+ validateAll("A");
1648
+ }
1649
+ }
1590
1650
  },
1591
1651
  rejectAll: function rejectAll() {
1592
- return validateAll("R");
1652
+ if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1653
+ return;
1654
+ } else {
1655
+ if (user.is_retailer) {
1656
+ if (product.id_order || product.orderId) {
1657
+ validateAll("R");
1658
+ setModalViewError(true);
1659
+ } else {
1660
+ setDataGenericModal(function (prev) {
1661
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1662
+ button2: {
1663
+ name: "Continuar",
1664
+ action: function action() {
1665
+ return evaluationToRetailer("R");
1666
+ }
1667
+ }
1668
+ });
1669
+ });
1670
+ setShowGenericModal(true);
1671
+ }
1672
+ } else {
1673
+ validateAll("R");
1674
+ setModalViewError(true);
1675
+ }
1676
+ }
1593
1677
  },
1594
1678
  approve: function approve() {
1595
1679
  if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {