contentoh-components-library 21.2.19 → 21.2.20

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.
@@ -31,197 +31,73 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjN2U1YTZhNC0yYjNmLTRkNTQtYWY5OC05ZTA5YTRjYmMwMWUiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6ImM3ZTVhNmE0LTJiM2YtNGQ1NC1hZjk4LTllMDlhNGNiYzAxZSIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIyYjcyOTIzYS04MWMzLTQ0NTYtODE1ZC1kMzI5ZWVkMDRmZmMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MTg5ODYzNSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MTkwMjIzNSwiaWF0IjoxNjYxODk4NjM1LCJlbWFpbCI6Imtpa2lqZTE0NjdAbXRsY3ouY29tIn0.EcQE9cjvjfyl4JlNVh57wlvDAxem7glTCJwZNLHs-oZj1Q0M_Sg1h24ISsES1WD_OjNaYjub46xU3rNH-i3IgA386H4hC3cfXzAkc82dxkhEcaRcUrAC9q8HUmoxT70XQpY40L2h2-DMjVm9Ka8C2JsFsgxVe-ulH2SpAXHk8Lt60qGYwoAdupP5jtJXBVMQKLKkWceAYrckWl-3AMq6uJLciB30zVQxMxjQ0EF8ZpldGDV8ypurZ2HkEtBZudepo2spBYj50L1IJ8oE-bBujcauOEzHw7kHFtBoL0W4xsjcBGiH9ejV7ULoWPO7AJr8MTZh1CVGkAYs1LmCWDAuHw",
34
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJiMmNlNWIyYS02MDljLTRlNzktOWVhOS0yZjc0Y2ZmNDM4ODkiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImIyY2U1YjJhLTYwOWMtNGU3OS05ZWE5LTJmNzRjZmY0Mzg4OSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhYWIzZDM1NS01MDYyLTQ2MTAtYjljZi03MjIyMTNlZTI4OWEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MjA2NTU3NSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MjA2OTE3NSwiaWF0IjoxNjYyMDY1NTc1LCJlbWFpbCI6ImF6YXJhdGVAY29udGVudG9oLmNvbSJ9.QtYQg6gjDDrfliKi9k5JnrJHRPt8XhqUphryq7l19BnK1GSFMUBVKx_4CVnbrML8MiKH7AwWFu4TSY5-M8qTEYKTQsr_sYrR-ICe6rAM_LQihD4x1e9THU7FAuXMDdRPv2JnCCUFCjzURbkc1A11oIIYIWnNfCwr33JTwcGQnX1LwYSY7PqhNdIU1pU9aat7lALIV8mFN4npn8m8AvSromfeonD07jl6AqQEs4SuOSiDaMkRENlp--hOx2rY4gEhvX2k3Zl4nHsvJU3Zh3DLaWhD3I9QdX4AOMUjrQOkUXJ7lkSEqY4p2o7fQXXL-D2nL28qAfwE-WlkVGJn-2LpHQ",
35
35
  productSelected: {
36
36
  services: {
37
- datasheets: 0,
38
- descriptions: 0,
37
+ datasheets: 1,
38
+ descriptions: 1,
39
39
  images: 1
40
40
  },
41
- orderId: 2612,
42
- status: "CA",
43
- datasheet_status: "NS",
41
+ orderId: 149,
42
+ status: "IE",
43
+ datasheet_status: "IE",
44
44
  prio: "none",
45
45
  version: 2,
46
- description_status: "NS",
46
+ description_status: "IE",
47
47
  images_status: "IE",
48
48
  article: {
49
- id_article: 79732,
50
- id_category: "42",
51
- name: "Bolos Naviesferas 6p 96g Bolsa RIC",
52
- upc: "7500810012130",
53
- timestamp: "2022-08-22T19:34:16.000Z",
54
- id_user: 467,
49
+ id_article: 76225,
50
+ id_category: "2028",
51
+ name: "Para documentar",
52
+ upc: "222222222",
53
+ timestamp: "2022-08-03T06:00:23.000Z",
54
+ id_user: 59,
55
55
  status: "NULL",
56
56
  active: 1,
57
- company_id: 229,
58
- SKU: null,
59
- Descripcion: null,
60
- Proveedor: null,
61
- id_proveedor: 0,
62
- company_name: "BIMBO SA DE CV",
63
- country: null,
64
- id_order: 2612,
65
- id_datasheet_especialist: null,
66
- id_datasheet_facilitator: null,
67
- id_description_especialist: null,
68
- id_description_facilitator: null,
69
- id_images_especialist: 427,
70
- id_images_facilitator: 160,
71
- id_auditor: 9,
57
+ company_id: 1,
58
+ company_name: "Cadena Ismael",
59
+ country: "México",
60
+ id_order: 149,
61
+ id_datasheet_especialist: 54,
62
+ id_datasheet_facilitator: 52,
63
+ id_description_especialist: 54,
64
+ id_description_facilitator: 52,
65
+ id_images_especialist: 55,
66
+ id_images_facilitator: 53,
67
+ id_auditor: 37,
72
68
  id_recepcionist: null,
73
- category: "Abarrotes|Botanas, Golosinas y Chocolates|Confitería",
74
- missingAttributes: 208,
75
- missingDescriptions: 9,
76
- missingImages: 8
69
+ category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
70
+ missingAttributes: 0,
71
+ missingDescriptions: 0,
72
+ missingImages: 0
77
73
  },
78
74
  retailers: [{
79
- id: 4,
80
- name: "Walmart Super y Superama",
81
- country: "México",
82
- id_region: 1,
83
- active: 1,
84
- percentage: 37.5,
85
- image: "https://content-management-images.s3.amazonaws.com/retailers/4.png",
86
- services: ["IE", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
87
- }, {
88
- id: 5,
89
- name: "Chedraui",
90
- country: "México",
91
- id_region: 1,
92
- active: 1,
93
- percentage: 35.29411764705882,
94
- image: "https://content-management-images.s3.amazonaws.com/retailers/5.png",
95
- services: ["NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
75
+ id: 58,
76
+ name: "The Home Depot Golden",
77
+ percentage: 66.66666666666667,
78
+ image: "https://content-management-images.s3.amazonaws.com/retailers/58.png",
79
+ services: ["CA", "CA", "AS", "NA", "NA", "NA", "NA", "NA"]
96
80
  }, {
97
- id: 6,
98
- name: "HEB",
99
- country: "México",
100
- id_region: 1,
101
- active: 1,
102
- percentage: 38.46153846153846,
103
- image: "https://content-management-images.s3.amazonaws.com/retailers/6.png",
104
- services: ["NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
81
+ id: 59,
82
+ name: "The Home Depot Platinum",
83
+ percentage: 66.66666666666667,
84
+ image: "https://content-management-images.s3.amazonaws.com/retailers/59.png",
85
+ services: ["NA", "NA", "NA", "AS", "NA", "NA", "NA", "NA"]
105
86
  }, {
106
- id: 9,
107
- name: "Amazon",
108
- country: "México",
109
- id_region: 1,
110
- active: 1,
111
- percentage: 34.72222222222222,
112
- image: "https://content-management-images.s3.amazonaws.com/retailers/9.png",
113
- services: ["NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
87
+ id: 60,
88
+ name: "The Home Depot Resizing",
89
+ percentage: null,
90
+ image: "https://content-management-images.s3.amazonaws.com/retailers/60.png",
91
+ services: ["NA", "NA", "NA", "NA", "AS", "NA", "NA", "NA"]
114
92
  }, {
115
- id: 13,
116
- name: "Soriana",
117
- country: "México",
118
- id_region: 1,
119
- active: 1,
120
- percentage: 40,
121
- image: "https://content-management-images.s3.amazonaws.com/retailers/13.png",
122
- services: ["NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
123
- }, {
124
- id: 16,
125
- name: "Rappi",
126
- country: "México",
127
- id_region: 1,
128
- active: 1,
129
- percentage: 36.666666666666664,
130
- image: "https://content-management-images.s3.amazonaws.com/retailers/16.png",
131
- services: ["NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
132
- }, {
133
- id: 17,
134
- name: "Genérico",
135
- country: "México",
136
- id_region: 1,
137
- active: 1,
138
- percentage: 34.78260869565217,
139
- image: "https://content-management-images.s3.amazonaws.com/retailers/17.png",
140
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
141
- }, {
142
- id: 24,
143
- name: "Alsuper",
144
- country: "México",
145
- id_region: 1,
146
- active: 1,
147
- percentage: 37.5,
148
- image: "https://content-management-images.s3.amazonaws.com/retailers/24.png",
149
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
150
- }, {
151
- id: 25,
152
- name: "Merqueo(México)",
153
- country: "México",
154
- id_region: 1,
155
- active: 1,
156
- percentage: 100,
157
- image: "https://content-management-images.s3.amazonaws.com/retailers/25.png",
158
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"]
159
- }, {
160
- id: 28,
161
- name: "Farmacias Benavides",
162
- country: "México",
163
- id_region: 1,
164
- active: 1,
165
- percentage: 100,
166
- image: "https://content-management-images.s3.amazonaws.com/retailers/28.png",
167
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA", "NA"]
168
- }, {
169
- id: 39,
170
- name: "Justo",
171
- country: "México",
172
- id_region: 1,
173
- active: 1,
174
- percentage: 35.416666666666664,
175
- image: "https://content-management-images.s3.amazonaws.com/retailers/39.png",
176
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA", "NA"]
177
- }, {
178
- id: 44,
179
- name: "Calimax",
180
- country: "México",
181
- id_region: 1,
182
- active: 1,
183
- percentage: 100,
184
- image: "https://content-management-images.s3.amazonaws.com/retailers/44.png",
185
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA", "NA"]
186
- }, {
187
- id: 45,
188
- name: "Casa Ley",
189
- country: "México",
190
- id_region: 1,
191
- active: 1,
192
- percentage: 100,
193
- image: "https://content-management-images.s3.amazonaws.com/retailers/45.png",
194
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA", "NA"]
195
- }, {
196
- id: 46,
197
- name: "S-Mart",
198
- country: "México",
199
- id_region: 1,
200
- active: 1,
201
- percentage: 100,
202
- image: "https://content-management-images.s3.amazonaws.com/retailers/46.png",
203
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA", "NA"]
204
- }, {
205
- id: 56,
206
- name: "JOKR",
207
- country: "Mexico",
208
- id_region: 1,
209
- active: 1,
210
- percentage: 100,
211
- image: "https://content-management-images.s3.amazonaws.com/retailers/56.png",
212
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA", "NA"]
213
- }, {
214
- id: 65,
215
- name: "Súper Aki",
216
- country: "México",
217
- id_region: 1,
218
- active: 1,
219
- percentage: 100,
220
- image: "https://content-management-images.s3.amazonaws.com/retailers/65.png",
221
- services: ["NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "CA"]
93
+ id: 61,
94
+ name: "Home Depot TAB",
95
+ percentage: null,
96
+ image: "https://content-management-images.s3.amazonaws.com/retailers/61.png",
97
+ services: ["NA", "NA", "NA", "NA", "NA", "CA", "CA", "AS"]
222
98
  }],
223
- country: null,
224
- upc: "7500810012130"
99
+ country: "México",
100
+ upc: "222222222"
225
101
  },
226
102
  location: {
227
103
  product: {
@@ -230,36 +106,36 @@ RetailerProductEditionDefault.args = {
230
106
  }
231
107
  },
232
108
  user: {
233
- id_user: 427,
234
- name: "Especialista Edición",
235
- last_name: " ",
236
- email: "kikije1467@mtlcz.com",
237
- position: "Tester",
109
+ id_user: 52,
110
+ name: "FACILITADOR TXT PRUEBA",
111
+ last_name: "",
112
+ email: "azarate@contentoh.com",
113
+ position: null,
238
114
  telephone: null,
239
115
  country: null,
240
- id_company: 254,
241
- id_cognito: "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
116
+ id_company: 2,
117
+ id_cognito: "b2ce5b2a-609c-4e79-9ea9-2f74cff43889",
242
118
  birth_Date: null,
243
119
  about_me: null,
244
120
  zip_code: null,
245
121
  address: null,
246
122
  job: null,
247
123
  id_stripe: null,
248
- id_role: 8,
124
+ id_role: 4,
249
125
  active: 1,
250
126
  is_retailer: 0,
251
- email_notify: null,
127
+ email_notify: 0,
252
128
  membership: {
253
- id: 750,
254
- start_date: "2022-01-07T21:32:54.000Z",
255
- end_date: "2023-01-07T21:32:54.000Z",
256
- planID: 6,
257
- plan: "prod_KvGd6YSTJyR3AP",
258
- name: "Plan Small",
259
- user_limit: "10",
260
- products_limit: "1000",
261
- type: "Enterprise"
129
+ id: 2,
130
+ start_date: "2021-11-05T02:35:12.000Z",
131
+ end_date: "2022-11-05T02:34:49.000Z",
132
+ planID: 1,
133
+ plan: "prod_KtkvuFFLpOdP6e",
134
+ name: "Plan Free",
135
+ user_limit: "1",
136
+ products_limit: "3",
137
+ type: "PyMES"
262
138
  },
263
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1661898636177"
139
+ src: "https://content-management-profile.s3.amazonaws.com/id-52/52.png?1662065576139"
264
140
  }
265
141
  };
@@ -615,7 +615,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
615
615
  break;
616
616
 
617
617
  case 12:
618
- arr = ["CA", "RC", "RA"];
618
+ arr = ["AS", "CA", "RC", "RA"];
619
619
  return _context4.abrupt("break", 20);
620
620
 
621
621
  case 14:
@@ -1163,6 +1163,41 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1163
1163
  return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
1164
1164
  };
1165
1165
 
1166
+ var approveRejectAllButtons = function approveRejectAllButtons() {
1167
+ var concepts = [];
1168
+
1169
+ switch (user.id_role) {
1170
+ case 4:
1171
+ concepts = ["description", "datasheet"];
1172
+ break;
1173
+
1174
+ case 5:
1175
+ concepts = ["images"];
1176
+ break;
1177
+
1178
+ default:
1179
+ concepts = ["description", "datasheet", "images"];
1180
+ break;
1181
+ }
1182
+
1183
+ var services = servicesData.filter(function (_ref10) {
1184
+ var service = _ref10.service;
1185
+ return concepts.includes(service);
1186
+ });
1187
+ var adminFacilitatorCanEvaluate = services.every(function (srv) {
1188
+ var _srv$status;
1189
+
1190
+ return (srv === null || srv === void 0 ? void 0 : (_srv$status = srv.status) === null || _srv$status === void 0 ? void 0 : _srv$status.replace(/.*\//, "")) === "IE";
1191
+ }) && [1, 4, 5].includes(user.id_role); //sessionStorage product
1192
+
1193
+ var adminAuditorCanEvaluate = servicesData.every(function (srv) {
1194
+ var _srv$status2;
1195
+
1196
+ return ["AC", "RP", "RCA"].includes(srv === null || srv === void 0 ? void 0 : (_srv$status2 = srv.status) === null || _srv$status2 === void 0 ? void 0 : _srv$status2.replace(/.*\//, ""));
1197
+ }) && [1, 6].includes(user.id_role);
1198
+ return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
1199
+ };
1200
+
1166
1201
  var getSectionIcon = function getSectionIcon() {
1167
1202
  switch (activeTab) {
1168
1203
  case "Ficha técnica":
@@ -1173,7 +1208,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1173
1208
  setIcon(_descriptionSent.default);
1174
1209
  break;
1175
1210
 
1176
- case "Imágenes0,,":
1211
+ case "Imágenes":
1177
1212
  setIcon(_uploadingImages.default);
1178
1213
  break;
1179
1214
 
@@ -1183,7 +1218,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1183
1218
  };
1184
1219
 
1185
1220
  var sendToFacilitator = /*#__PURE__*/function () {
1186
- var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
1221
+ var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
1187
1222
  var concept, productTemp, evalStatus, _articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1188
1223
 
1189
1224
  return _regenerator.default.wrap(function _callee9$(_context9) {
@@ -1283,7 +1318,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1283
1318
  }));
1284
1319
 
1285
1320
  return function sendToFacilitator(_x) {
1286
- return _ref10.apply(this, arguments);
1321
+ return _ref11.apply(this, arguments);
1287
1322
  };
1288
1323
  }();
1289
1324
 
@@ -1314,7 +1349,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1314
1349
  };
1315
1350
 
1316
1351
  var createComment = /*#__PURE__*/function () {
1317
- var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, body, tab) {
1352
+ var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, body, tab) {
1318
1353
  var _product$article12;
1319
1354
 
1320
1355
  var concept, data;
@@ -1371,7 +1406,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1371
1406
  }));
1372
1407
 
1373
1408
  return function createComment(_x2, _x3, _x4) {
1374
- return _ref11.apply(this, arguments);
1409
+ return _ref12.apply(this, arguments);
1375
1410
  };
1376
1411
  }();
1377
1412
 
@@ -1449,7 +1484,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1449
1484
  }, [activeTab]);
1450
1485
 
1451
1486
  var commentRevised = /*#__PURE__*/function () {
1452
- var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
1487
+ var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
1453
1488
  var data;
1454
1489
  return _regenerator.default.wrap(function _callee11$(_context11) {
1455
1490
  while (1) {
@@ -1479,12 +1514,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1479
1514
  }));
1480
1515
 
1481
1516
  return function commentRevised() {
1482
- return _ref12.apply(this, arguments);
1517
+ return _ref13.apply(this, arguments);
1483
1518
  };
1484
1519
  }();
1485
1520
 
1486
1521
  var setAssignation = /*#__PURE__*/function () {
1487
- var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(assignationType, assignationId) {
1522
+ var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(assignationType, assignationId) {
1488
1523
  var _product$article13;
1489
1524
 
1490
1525
  var concept, productTemp, data;
@@ -1543,7 +1578,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1543
1578
  }));
1544
1579
 
1545
1580
  return function setAssignation(_x5, _x6) {
1546
- return _ref13.apply(this, arguments);
1581
+ return _ref14.apply(this, arguments);
1547
1582
  };
1548
1583
  }();
1549
1584
 
@@ -1655,8 +1690,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1655
1690
  }, [loading]);
1656
1691
 
1657
1692
  var validateAll = /*#__PURE__*/function () {
1658
- var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
1659
- var evaluationArray, sendAll, conceptArray, productTemp;
1693
+ var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
1694
+ var _conceptArray, evaluationArray, sendAll, conceptArray, productTemp;
1695
+
1660
1696
  return _regenerator.default.wrap(function _callee13$(_context13) {
1661
1697
  while (1) {
1662
1698
  switch (_context13.prev = _context13.next) {
@@ -1665,29 +1701,48 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1665
1701
  setLoading(true);
1666
1702
  evaluationArray = [];
1667
1703
  sendAll = [];
1704
+ conceptArray = [];
1705
+ _context13.t0 = user.id_role;
1706
+ _context13.next = _context13.t0 === 4 ? 8 : _context13.t0 === 5 ? 10 : 12;
1707
+ break;
1708
+
1709
+ case 8:
1710
+ conceptArray = ["description", "datasheet"];
1711
+ return _context13.abrupt("break", 14);
1712
+
1713
+ case 10:
1714
+ conceptArray = ["images"];
1715
+ return _context13.abrupt("break", 14);
1716
+
1717
+ case 12:
1668
1718
  conceptArray = ["description", "datasheet", "images"];
1669
- servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1670
- var _product$id_order;
1719
+ return _context13.abrupt("break", 14);
1671
1720
 
1672
- var data = {
1673
- articleId: product.article.id_article,
1674
- orderId: (_product$id_order = product.id_order) !== null && _product$id_order !== void 0 ? _product$id_order : product.orderId,
1675
- concept: ret.service,
1676
- result: result,
1677
- evalStatus: product["".concat(ret.service, "_status")],
1678
- retailerId: ret.id_retailer
1679
- };
1680
- evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1681
- headers: {
1682
- Authorization: token
1683
- }
1684
- }));
1721
+ case 14:
1722
+ servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1723
+ if (conceptArray.includes(ret.service)) {
1724
+ var _product$id_order;
1725
+
1726
+ var data = {
1727
+ articleId: product.article.id_article,
1728
+ orderId: (_product$id_order = product.id_order) !== null && _product$id_order !== void 0 ? _product$id_order : product.orderId,
1729
+ concept: ret.service,
1730
+ result: result,
1731
+ evalStatus: product["".concat(ret.service, "_status")],
1732
+ retailerId: ret.id_retailer
1733
+ };
1734
+ evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1735
+ headers: {
1736
+ Authorization: token
1737
+ }
1738
+ }));
1739
+ }
1685
1740
  });
1686
- _context13.next = 8;
1741
+ _context13.next = 17;
1687
1742
  return Promise.all(evaluationArray);
1688
1743
 
1689
- case 8:
1690
- conceptArray === null || conceptArray === void 0 ? void 0 : conceptArray.forEach(function (concept) {
1744
+ case 17:
1745
+ (_conceptArray = conceptArray) === null || _conceptArray === void 0 ? void 0 : _conceptArray.forEach(function (concept) {
1691
1746
  var _product$id_order2;
1692
1747
 
1693
1748
  var data = {
@@ -1702,10 +1757,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1702
1757
  }
1703
1758
  }));
1704
1759
  });
1705
- _context13.next = 11;
1760
+ _context13.next = 20;
1706
1761
  return Promise.all(sendAll);
1707
1762
 
1708
- case 11:
1763
+ case 20:
1709
1764
  productTemp = product;
1710
1765
  productTemp.status = "".concat(result, "A");
1711
1766
  productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "A");
@@ -1713,28 +1768,28 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1713
1768
  productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "A");
1714
1769
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1715
1770
  setProduct(productTemp);
1716
- _context13.next = 20;
1771
+ _context13.next = 29;
1717
1772
  return loadData();
1718
1773
 
1719
- case 20:
1720
- _context13.next = 25;
1774
+ case 29:
1775
+ _context13.next = 34;
1721
1776
  break;
1722
1777
 
1723
- case 22:
1724
- _context13.prev = 22;
1725
- _context13.t0 = _context13["catch"](0);
1726
- console.log(_context13.t0);
1778
+ case 31:
1779
+ _context13.prev = 31;
1780
+ _context13.t1 = _context13["catch"](0);
1781
+ console.log(_context13.t1);
1727
1782
 
1728
- case 25:
1783
+ case 34:
1729
1784
  case "end":
1730
1785
  return _context13.stop();
1731
1786
  }
1732
1787
  }
1733
- }, _callee13, null, [[0, 22]]);
1788
+ }, _callee13, null, [[0, 31]]);
1734
1789
  }));
1735
1790
 
1736
1791
  return function validateAll(_x7) {
1737
- return _ref14.apply(this, arguments);
1792
+ return _ref15.apply(this, arguments);
1738
1793
  };
1739
1794
  }();
1740
1795
 
@@ -1805,9 +1860,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1805
1860
  }
1806
1861
  })]);
1807
1862
  },
1808
- showApproveRejectAll: isAuditor && servicesData.every(function (serv) {
1809
- return ["RA", "AA", "AP", "ACA", "AC"].includes(serv.status);
1810
- }) && approveRejectButtons() && (auditorAssigned() || userAssigned()),
1863
+ showApproveRejectAll: approveRejectAllButtons() && (auditorAssigned() || userAssigned()),
1811
1864
  showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned()),
1812
1865
  approveAll: function approveAll() {
1813
1866
  return validateAll("A");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.19",
3
+ "version": "21.2.20",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",