contentoh-components-library 21.2.81 → 21.2.83

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,178 +31,92 @@ ProviderProductEditionDefault.args = {
31
31
  "Ficha técnica": true,
32
32
  Imágenes: true
33
33
  },
34
- token: "eeyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIwNTE0MWZiOS1lNmM1LTQ0YWUtYTA4OS01MzM4N2IzZmQ2OWMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MjEwNjk3MiwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2NjIxMTA1NzIsImlhdCI6MTY2MjEwNjk3MiwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oL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c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2ODEwODQ1MiwibmFtZSI6IkVsaSBJbmRhIiwicGhvbmVfbnVtYmVyIjoiKzUyMzExMTkwODg2OCIsImV4cCI6MTY2ODExMjA1MiwiaWF0IjoxNjY4MTA4NDUyLCJlbWFpbCI6Im1hcnRoYTI1Lm1pb0BnbWFpbC5jb20ifQ.JbpinyPv_38xvwwT_td3M_vP3xEffZ6dI0Xl3B9EVjPF7uW4ctZ_B7nKydPyUcB6LTaYEzCI1RfAgZpUQUFbYTfFHJ3T9kgwa9b9mDeDx3kiy2GK3CdYIuWiii5ZivxVKK10gV871OvxDish4w-vEOsClXDncoTX2zAx3wDM4xO83UdI0ahECOTYszuGB3FRnkrHnWJO0b2dpsyhqAmhw0aEcw6gwbqP5l-spOjMM3lE-bGm89pK_9oLYcyRMr09vcGJartmk_ctUisCflrYudnwVgwTwCi1PRBkiaUoDywYeGr6HxRoU1zsiC3LwB-m9b2YnNhEZmPanLfPstKVbw",
35
35
  articleId: 238,
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- orderId: 125,
40
- status: "AA",
41
- datasheet_status: "AA",
42
- prio: "none",
43
- version: 3,
44
- description_status: "AA",
45
- images_status: "AA",
46
- brand: "DESCRIPCION PRUEBA",
47
- retailerOrder: 0,
48
- missing: {
49
- datasheet: null,
50
- descriptions: null,
51
- images: null
39
+ "orderId": 3366,
40
+ "article_status": "AP",
41
+ "datasheet_status": "NS",
42
+ "description_status": "NS",
43
+ "images_status": "AP",
44
+ "prio": "none",
45
+ "version": 3,
46
+ "brand": null,
47
+ "article": {
48
+ "category": "Iluminación|Lámparas|Lámparas de Mesa",
49
+ "company_name": "Norday",
50
+ "id_company": 810,
51
+ "country": "México",
52
+ "id_category": "2454",
53
+ "id_article": 84492,
54
+ "name": "prueba dos",
55
+ "upc": "8375"
52
56
  },
53
- services: {
54
- datasheets: 1,
55
- descriptions: 1,
56
- images: 1
57
- },
58
- article: {
59
- category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
60
- company_name: "COMPANY DEV",
61
- country: "México",
62
- id_category: "682",
63
- id_datasheet_especialist: 54,
64
- id_datasheet_facilitator: 52,
65
- id_description_especialist: 55,
66
- id_description_facilitator: 52,
67
- id_images_especialist: 55,
68
- id_images_facilitator: 53,
69
- id_order: 125,
70
- id_article: 76125,
71
- id_auditor: 30,
72
- name: "prueba 11",
73
- timestamp: "2022-07-20T19:20:46.000Z",
74
- upc: "35646655"
75
- },
76
- retailers: [{
77
- id: 2,
78
- name: "Walmart Mercancías Generales"
79
- }, {
80
- id: 3,
81
- name: "Sam´s Club"
82
- }, {
83
- id: 5,
84
- name: "Chedraui"
57
+ "retailers": [{
58
+ "id": 59,
59
+ "name": "The Home Depot Platinum"
85
60
  }],
86
- statusByRetailer: {
87
- 2: {
88
- datasheet: "AA",
89
- datasheetTranslations: "AA",
90
- description: "AA",
91
- images: "AA"
92
- },
93
- 3: {
94
- datasheet: "AA",
95
- datasheetTranslations: "AA",
96
- description: "AA",
97
- images: "AA"
98
- },
99
- 5: {
100
- datasheet: "AA",
101
- datasheetTranslations: "AA",
102
- description: "AA",
103
- images: "AA"
61
+ "services": {
62
+ "datasheets": 0,
63
+ "descriptions": 0,
64
+ "images": 1
65
+ },
66
+ "statusByRetailer": {
67
+ "59": {
68
+ "images": "AP"
104
69
  }
105
70
  },
106
- retailersAvailable: [{
107
- id: 2,
108
- name: "Walmart Mercancías Generales"
109
- }, {
110
- id: 3,
111
- name: "Sam´s Club"
112
- }, {
113
- id: 5,
114
- name: "Chedraui"
115
- }],
116
- categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
117
- upc: "35646655",
118
- id_article: 76125,
119
- id_order: 125
71
+ "retailersWithService": ["59"],
72
+ "id_article": 84492,
73
+ "retailersAvailable": [{
74
+ "id": 59,
75
+ "name": "The Home Depot Platinum"
76
+ }]
120
77
  },
121
78
  productToEdit: {
122
- ArticleId: 76125,
123
- idCategory: "682",
124
- product: {
125
- orderId: 125,
126
- status: "AA",
127
- datasheet_status: "AA",
128
- prio: "none",
129
- version: 3,
130
- description_status: "AA",
131
- images_status: "AA",
132
- brand: "DESCRIPCION PRUEBA",
133
- retailerOrder: 0,
134
- missing: {
135
- datasheet: null,
136
- descriptions: null,
137
- images: null
79
+ "ArticleId": 84492,
80
+ "idCategory": "2454",
81
+ "product": {
82
+ "orderId": 3366,
83
+ "article_status": "AP",
84
+ "datasheet_status": "NS",
85
+ "description_status": "NS",
86
+ "images_status": "AP",
87
+ "prio": "none",
88
+ "version": 3,
89
+ "brand": null,
90
+ "article": {
91
+ "category": "Iluminación|Lámparas|Lámparas de Mesa",
92
+ "company_name": "Norday",
93
+ "id_company": 810,
94
+ "country": "México",
95
+ "id_category": "2454",
96
+ "id_article": 84492,
97
+ "name": "prueba dos",
98
+ "upc": "8375"
138
99
  },
139
- services: {
140
- datasheets: 1,
141
- descriptions: 1,
142
- images: 1
143
- },
144
- article: {
145
- category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
146
- company_name: "COMPANY DEV",
147
- country: "México",
148
- id_category: "682",
149
- id_datasheet_especialist: 54,
150
- id_datasheet_facilitator: 52,
151
- id_description_especialist: 55,
152
- id_description_facilitator: 52,
153
- id_images_especialist: 55,
154
- id_images_facilitator: 53,
155
- id_order: 125,
156
- id_article: 76125,
157
- id_auditor: 30,
158
- name: "prueba 11",
159
- timestamp: "2022-07-20T19:20:46.000Z",
160
- upc: "35646655"
161
- },
162
- retailers: [{
163
- id: 2,
164
- name: "Walmart Mercancías Generales"
165
- }, {
166
- id: 3,
167
- name: "Sam´s Club"
168
- }, {
169
- id: 5,
170
- name: "Chedraui"
100
+ "retailers": [{
101
+ "id": 59,
102
+ "name": "The Home Depot Platinum"
171
103
  }],
172
- statusByRetailer: {
173
- 2: {
174
- datasheet: "AA",
175
- datasheetTranslations: "AA",
176
- description: "AA",
177
- images: "AA"
178
- },
179
- 3: {
180
- datasheet: "AA",
181
- datasheetTranslations: "AA",
182
- description: "AA",
183
- images: "AA"
184
- },
185
- 5: {
186
- datasheet: "AA",
187
- datasheetTranslations: "AA",
188
- description: "AA",
189
- images: "AA"
104
+ "services": {
105
+ "datasheets": 0,
106
+ "descriptions": 0,
107
+ "images": 1
108
+ },
109
+ "statusByRetailer": {
110
+ "59": {
111
+ "images": "AP"
190
112
  }
191
113
  },
192
- retailersAvailable: [{
193
- id: 2,
194
- name: "Walmart Mercancías Generales"
195
- }, {
196
- id: 3,
197
- name: "Sam´s Club"
198
- }, {
199
- id: 5,
200
- name: "Chedraui"
201
- }],
202
- categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
203
- upc: "35646655",
204
- id_article: 76125,
205
- id_order: 125
114
+ "retailersWithService": ["59"],
115
+ "id_article": 84492,
116
+ "retailersAvailable": [{
117
+ "id": 59,
118
+ "name": "The Home Depot Platinum"
119
+ }]
206
120
  }
207
121
  },
208
122
  location: {
@@ -211,50 +125,78 @@ ProviderProductEditionDefault.args = {
211
125
  }
212
126
  },
213
127
  user: {
214
- id_user: 28,
215
- name: "Proveedor",
216
- last_name: "Colgate",
217
- email: "ilopez@contentoh.com",
218
- position: "Prueba Admin",
219
- telephone: "+523111366336",
220
- country: "México",
221
- id_company: 1,
222
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
223
- birth_Date: null,
224
- about_me: null,
225
- zip_code: null,
226
- address: null,
227
- job: null,
228
- id_stripe: "cus_KuEt6R6vwmN09f",
229
- id_role: 0,
230
- active: 1,
231
- is_retailer: 0,
232
- email_notify: 1,
233
- membership: {
234
- id: 76,
235
- start_date: "2022-01-18T17:25:35.000Z",
236
- end_date: "2023-01-18T17:25:35.000Z",
237
- planID: 8,
238
- plan: "prod_KtlhECVSFG2iro",
239
- name: "Plan Pro",
240
- user_limit: "20",
241
- products_limit: "5000",
242
- type: "Enterprise"
128
+ "id_user": 59,
129
+ "name": "The Home",
130
+ "last_name": "Depot",
131
+ "email": "cadena.ismael@allfreemail.net",
132
+ "position": "Admin",
133
+ "telephone": "+523111366336",
134
+ "country": "México",
135
+ "id_company": 817,
136
+ "id_cognito": "5884ae34-59d6-4454-b98e-821518bcc3a7",
137
+ "birth_Date": null,
138
+ "about_me": "",
139
+ "zip_code": "",
140
+ "address": "",
141
+ "job": "",
142
+ "id_stripe": "",
143
+ "id_role": 0,
144
+ "active": 1,
145
+ "is_retailer": 1,
146
+ "email_notify": 0,
147
+ "is_user_tech": null,
148
+ "membership": {
149
+ "id": 47,
150
+ "start_date": "2022-05-25T14:31:12.000Z",
151
+ "end_date": "2023-05-25T14:31:12.000Z",
152
+ "planID": 5,
153
+ "plan": "prod_Ktl6B5Ou2gqTB2",
154
+ "name": "Plan Pro",
155
+ "user_limit": "5",
156
+ "products_limit": "500",
157
+ "type": "PyMES"
243
158
  },
244
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1662106973155"
159
+ "src": "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1668127460068"
245
160
  },
246
161
  company: {
247
- id_company: 1,
248
- trade_name: "COMPANY DEV",
249
- company_name: "COMPANY DEV",
250
- rfc: null,
251
- adress: "",
252
- about_company: "...",
253
- telephone: "",
254
- web_site: "",
255
- zip_code: "",
256
- email: null,
257
- social_link: "",
258
- is_retailer: 0
162
+ "id_company": 817,
163
+ "trade_name": "Retailer acc",
164
+ "company_name": "Retailer acc",
165
+ "rfc": "ASER12345",
166
+ "adress": "Av. Insurgentes",
167
+ "about_company": null,
168
+ "telephone": null,
169
+ "web_site": null,
170
+ "zip_code": null,
171
+ "email": null,
172
+ "social_link": null,
173
+ "is_retailer": 1,
174
+ "financedRetailers": [{
175
+ "id": 68,
176
+ "name": "The Home Depot Merchants",
177
+ "country": "México",
178
+ "id_region": 1,
179
+ "active": 1
180
+ }],
181
+ "retailers": [{
182
+ "id": 59,
183
+ "name": "The Home Depot Platinum",
184
+ "country": "México"
185
+ }, {
186
+ "id": 60,
187
+ "name": "The Home Depot Resizing",
188
+ "country": "México"
189
+ }, {
190
+ "id": 61,
191
+ "name": "Home Depot TAB",
192
+ "country": "México"
193
+ }, {
194
+ "id": 68,
195
+ "name": "The Home Depot Merchants",
196
+ "country": "México"
197
+ }]
198
+ },
199
+ showSurvey: function showSurvey(v) {
200
+ return v && alert('se muestra');
259
201
  }
260
202
  };
@@ -106,8 +106,7 @@ var _jsxRuntime = require("react/jsx-runtime");
106
106
  var reducerImages = function reducerImages(state, action) {
107
107
  var _action$init, _action$init$inputsBy;
108
108
 
109
- var _state$values = state.values,
110
- values = _state$values === void 0 ? [] : _state$values,
109
+ var values = state.values,
111
110
  attrForImgs = state.attrForImgs,
112
111
  inputsByRetailer = state.inputsByRetailer;
113
112
 
@@ -183,7 +182,7 @@ var reducerImages = function reducerImages(state, action) {
183
182
  inputs = inputsInitial === null || inputsInitial === void 0 ? void 0 : inputsInitial.filter(function (input) {
184
183
  return imageIdArray.includes(input.id);
185
184
  });
186
- if (orderedImages.length > 0) values = orderedImages;
185
+ values = orderedImages.length > 0 ? orderedImages : [];
187
186
  } catch (error) {
188
187
  console.log(error);
189
188
  }
@@ -1409,7 +1408,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1409
1408
  var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
1410
1409
  var _productTemp$id_order;
1411
1410
 
1412
- var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
1411
+ var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
1413
1412
 
1414
1413
  return _regenerator.default.wrap(function _callee12$(_context12) {
1415
1414
  while (1) {
@@ -1432,7 +1431,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1432
1431
  _context12.prev = 9;
1433
1432
 
1434
1433
  if (!result) {
1435
- _context12.next = 25;
1434
+ _context12.next = 27;
1436
1435
  break;
1437
1436
  }
1438
1437
 
@@ -1453,22 +1452,24 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1453
1452
  newProductEdit = productEdit;
1454
1453
  newProductEdit.product[sectionStatusKey] = serviceStatus;
1455
1454
  setProductEdit(newProductEdit);
1456
- showSurvey && showSurvey(!user.is_retailer && orderStatus[orderId] === "AP");
1457
- _context12.next = 28;
1455
+ showSurveyByProvider = !user.is_retailer && orderStatus[orderId] === "AP";
1456
+ showSurveyByRetailer = user.is_retailer && orderStatus[orderId] === "ACA";
1457
+ showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
1458
+ _context12.next = 30;
1458
1459
  break;
1459
1460
 
1460
- case 25:
1461
- _context12.next = 27;
1461
+ case 27:
1462
+ _context12.next = 29;
1462
1463
  return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1463
1464
  headers: {
1464
1465
  Authorization: token
1465
1466
  }
1466
1467
  });
1467
1468
 
1468
- case 27:
1469
+ case 29:
1469
1470
  res = _context12.sent;
1470
1471
 
1471
- case 28:
1472
+ case 30:
1472
1473
  if (res.data.statusCode === 200) {
1473
1474
  _JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
1474
1475
  if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
@@ -1489,23 +1490,23 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1489
1490
  });
1490
1491
  }
1491
1492
 
1492
- _context12.next = 34;
1493
+ _context12.next = 36;
1493
1494
  break;
1494
1495
 
1495
- case 31:
1496
- _context12.prev = 31;
1496
+ case 33:
1497
+ _context12.prev = 33;
1497
1498
  _context12.t0 = _context12["catch"](9);
1498
1499
  console.log(_context12.t0);
1499
1500
 
1500
- case 34:
1501
+ case 36:
1501
1502
  loadData();
1502
1503
 
1503
- case 35:
1504
+ case 37:
1504
1505
  case "end":
1505
1506
  return _context12.stop();
1506
1507
  }
1507
1508
  }
1508
- }, _callee12, null, [[9, 31]]);
1509
+ }, _callee12, null, [[9, 33]]);
1509
1510
  }));
1510
1511
 
1511
1512
  return function sendEvaluation(_x7) {
@@ -84,8 +84,7 @@ var _jsxRuntime = require("react/jsx-runtime");
84
84
  var reducerImages = function reducerImages(state, action) {
85
85
  var _action$init, _action$init$inputsBy;
86
86
 
87
- var _state$values = state.values,
88
- values = _state$values === void 0 ? [] : _state$values,
87
+ var values = state.values,
89
88
  attrForImgs = state.attrForImgs,
90
89
  inputsByRetailer = state.inputsByRetailer;
91
90
 
@@ -157,7 +156,11 @@ var reducerImages = function reducerImages(state, action) {
157
156
 
158
157
  var orderedImages = [];
159
158
  var imageIdArray = [];
160
- if (action !== null && action !== void 0 && action.retailerId && !_inputsByRetailer[action.retailerId]) _inputsByRetailer[action.retailerId] = [];
159
+
160
+ if (action !== null && action !== void 0 && action.retailerId && !_inputsByRetailer[action.retailerId]) {
161
+ _inputsByRetailer[action.retailerId] = [];
162
+ }
163
+
161
164
  action.retailerId && ((_inputsByRetailer$act = _inputsByRetailer[action.retailerId]) === null || _inputsByRetailer$act === void 0 ? void 0 : _inputsByRetailer$act.filter(function (input) {
162
165
  imageIdArray.push(input.id_image);
163
166
  valuesInitial.forEach(function (value) {
@@ -167,7 +170,7 @@ var reducerImages = function reducerImages(state, action) {
167
170
  inputs = inputsInitial === null || inputsInitial === void 0 ? void 0 : inputsInitial.filter(function (input) {
168
171
  return imageIdArray.includes(input.id);
169
172
  });
170
- if (orderedImages.length > 0) values = orderedImages;
173
+ values = orderedImages.length > 0 ? orderedImages : [];
171
174
  } catch (error) {
172
175
  console.log(error);
173
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.81",
3
+ "version": "21.2.83",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -16,244 +16,187 @@ ProviderProductEditionDefault.args = {
16
16
  Imágenes: true,
17
17
  },
18
18
  token:
19
- "eeyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIwNTE0MWZiOS1lNmM1LTQ0YWUtYTA4OS01MzM4N2IzZmQ2OWMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MjEwNjk3MiwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2NjIxMTA1NzIsImlhdCI6MTY2MjEwNjk3MiwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.LtlrjlQ19EDcMR5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MTY2ODEwODQ1MiwibmFtZSI6IkVsaSBJbmRhIiwicGhvbmVfbnVtYmVyIjoiKzUyMzExMTkwODg2OCIsImV4cCI6MTY2ODExMjA1MiwiaWF0IjoxNjY4MTA4NDUyLCJlbWFpbCI6Im1hcnRoYTI1Lm1pb0BnbWFpbC5jb20ifQ.JbpinyPv_38xvwwT_td3M_vP3xEffZ6dI0Xl3B9EVjPF7uW4ctZ_B7nKydPyUcB6LTaYEzCI1RfAgZpUQUFbYTfFHJ3T9kgwa9b9mDeDx3kiy2GK3CdYIuWiii5ZivxVKK10gV871OvxDish4w-vEOsClXDncoTX2zAx3wDM4xO83UdI0ahECOTYszuGB3FRnkrHnWJO0b2dpsyhqAmhw0aEcw6gwbqP5l-spOjMM3lE-bGm89pK_9oLYcyRMr09vcGJartmk_ctUisCflrYudnwVgwTwCi1PRBkiaUoDywYeGr6HxRoU1zsiC3LwB-m9b2YnNhEZmPanLfPstKVbw",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 125,
25
- status: "AA",
26
- datasheet_status: "AA",
27
- prio: "none",
28
- version: 3,
29
- description_status: "AA",
30
- images_status: "AA",
31
- brand: "DESCRIPCION PRUEBA",
32
- retailerOrder: 0,
33
- missing: {
34
- datasheet: null,
35
- descriptions: null,
36
- images: null,
24
+ "orderId": 3366,
25
+ "article_status": "AP",
26
+ "datasheet_status": "NS",
27
+ "description_status": "NS",
28
+ "images_status": "AP",
29
+ "prio": "none",
30
+ "version": 3,
31
+ "brand": null,
32
+ "article": {
33
+ "category": "Iluminación|Lámparas|Lámparas de Mesa",
34
+ "company_name": "Norday",
35
+ "id_company": 810,
36
+ "country": "México",
37
+ "id_category": "2454",
38
+ "id_article": 84492,
39
+ "name": "prueba dos",
40
+ "upc": "8375"
37
41
  },
38
- services: {
39
- datasheets: 1,
40
- descriptions: 1,
41
- images: 1,
42
- },
43
- article: {
44
- category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
45
- company_name: "COMPANY DEV",
46
- country: "México",
47
- id_category: "682",
48
- id_datasheet_especialist: 54,
49
- id_datasheet_facilitator: 52,
50
- id_description_especialist: 55,
51
- id_description_facilitator: 52,
52
- id_images_especialist: 55,
53
- id_images_facilitator: 53,
54
- id_order: 125,
55
- id_article: 76125,
56
- id_auditor: 30,
57
- name: "prueba 11",
58
- timestamp: "2022-07-20T19:20:46.000Z",
59
- upc: "35646655",
60
- },
61
- retailers: [
62
- {
63
- id: 2,
64
- name: "Walmart Mercancías Generales",
65
- },
66
- {
67
- id: 3,
68
- name: "Sam´s Club",
69
- },
70
- {
71
- id: 5,
72
- name: "Chedraui",
73
- },
42
+ "retailers": [
43
+ {
44
+ "id": 59,
45
+ "name": "The Home Depot Platinum"
46
+ }
74
47
  ],
75
- statusByRetailer: {
76
- 2: {
77
- datasheet: "AA",
78
- datasheetTranslations: "AA",
79
- description: "AA",
80
- images: "AA",
81
- },
82
- 3: {
83
- datasheet: "AA",
84
- datasheetTranslations: "AA",
85
- description: "AA",
86
- images: "AA",
87
- },
88
- 5: {
89
- datasheet: "AA",
90
- datasheetTranslations: "AA",
91
- description: "AA",
92
- images: "AA",
93
- },
48
+ "services": {
49
+ "datasheets": 0,
50
+ "descriptions": 0,
51
+ "images": 1
52
+ },
53
+ "statusByRetailer": {
54
+ "59": {
55
+ "images": "AP"
56
+ }
94
57
  },
95
- retailersAvailable: [
96
- {
97
- id: 2,
98
- name: "Walmart Mercancías Generales",
99
- },
100
- {
101
- id: 3,
102
- name: "Sam´s Club",
103
- },
104
- {
105
- id: 5,
106
- name: "Chedraui",
107
- },
58
+ "retailersWithService": [
59
+ "59"
108
60
  ],
109
- categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
110
- upc: "35646655",
111
- id_article: 76125,
112
- id_order: 125,
61
+ "id_article": 84492,
62
+ "retailersAvailable": [
63
+ {
64
+ "id": 59,
65
+ "name": "The Home Depot Platinum"
66
+ }
67
+ ]
113
68
  },
114
69
  productToEdit: {
115
- ArticleId: 76125,
116
- idCategory: "682",
117
- product: {
118
- orderId: 125,
119
- status: "AA",
120
- datasheet_status: "AA",
121
- prio: "none",
122
- version: 3,
123
- description_status: "AA",
124
- images_status: "AA",
125
- brand: "DESCRIPCION PRUEBA",
126
- retailerOrder: 0,
127
- missing: {
128
- datasheet: null,
129
- descriptions: null,
130
- images: null,
131
- },
132
- services: {
133
- datasheets: 1,
134
- descriptions: 1,
135
- images: 1,
136
- },
137
- article: {
138
- category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
139
- company_name: "COMPANY DEV",
140
- country: "México",
141
- id_category: "682",
142
- id_datasheet_especialist: 54,
143
- id_datasheet_facilitator: 52,
144
- id_description_especialist: 55,
145
- id_description_facilitator: 52,
146
- id_images_especialist: 55,
147
- id_images_facilitator: 53,
148
- id_order: 125,
149
- id_article: 76125,
150
- id_auditor: 30,
151
- name: "prueba 11",
152
- timestamp: "2022-07-20T19:20:46.000Z",
153
- upc: "35646655",
154
- },
155
- retailers: [
156
- {
157
- id: 2,
158
- name: "Walmart Mercancías Generales",
159
- },
160
- {
161
- id: 3,
162
- name: "Sam´s Club",
163
- },
164
- {
165
- id: 5,
166
- name: "Chedraui",
167
- },
168
- ],
169
- statusByRetailer: {
170
- 2: {
171
- datasheet: "AA",
172
- datasheetTranslations: "AA",
173
- description: "AA",
174
- images: "AA",
70
+ "ArticleId": 84492,
71
+ "idCategory": "2454",
72
+ "product": {
73
+ "orderId": 3366,
74
+ "article_status": "AP",
75
+ "datasheet_status": "NS",
76
+ "description_status": "NS",
77
+ "images_status": "AP",
78
+ "prio": "none",
79
+ "version": 3,
80
+ "brand": null,
81
+ "article": {
82
+ "category": "Iluminación|Lámparas|Lámparas de Mesa",
83
+ "company_name": "Norday",
84
+ "id_company": 810,
85
+ "country": "México",
86
+ "id_category": "2454",
87
+ "id_article": 84492,
88
+ "name": "prueba dos",
89
+ "upc": "8375"
175
90
  },
176
- 3: {
177
- datasheet: "AA",
178
- datasheetTranslations: "AA",
179
- description: "AA",
180
- images: "AA",
91
+ "retailers": [
92
+ {
93
+ "id": 59,
94
+ "name": "The Home Depot Platinum"
95
+ }
96
+ ],
97
+ "services": {
98
+ "datasheets": 0,
99
+ "descriptions": 0,
100
+ "images": 1
181
101
  },
182
- 5: {
183
- datasheet: "AA",
184
- datasheetTranslations: "AA",
185
- description: "AA",
186
- images: "AA",
102
+ "statusByRetailer": {
103
+ "59": {
104
+ "images": "AP"
105
+ }
187
106
  },
188
- },
189
- retailersAvailable: [
190
- {
191
- id: 2,
192
- name: "Walmart Mercancías Generales",
193
- },
194
- {
195
- id: 3,
196
- name: "Sam´s Club",
197
- },
198
- {
199
- id: 5,
200
- name: "Chedraui",
201
- },
202
- ],
203
- categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
204
- upc: "35646655",
205
- id_article: 76125,
206
- id_order: 125,
207
- },
107
+ "retailersWithService": [
108
+ "59"
109
+ ],
110
+ "id_article": 84492,
111
+ "retailersAvailable": [
112
+ {
113
+ "id": 59,
114
+ "name": "The Home Depot Platinum"
115
+ }
116
+ ]
117
+ }
208
118
  },
209
119
  location: {
210
120
  state: { origin: "Contentoh" },
211
121
  },
212
122
  user: {
213
- id_user: 28,
214
- name: "Proveedor",
215
- last_name: "Colgate",
216
- email: "ilopez@contentoh.com",
217
- position: "Prueba Admin",
218
- telephone: "+523111366336",
219
- country: "México",
220
- id_company: 1,
221
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
222
- birth_Date: null,
223
- about_me: null,
224
- zip_code: null,
225
- address: null,
226
- job: null,
227
- id_stripe: "cus_KuEt6R6vwmN09f",
228
- id_role: 0,
229
- active: 1,
230
- is_retailer: 0,
231
- email_notify: 1,
232
- membership: {
233
- id: 76,
234
- start_date: "2022-01-18T17:25:35.000Z",
235
- end_date: "2023-01-18T17:25:35.000Z",
236
- planID: 8,
237
- plan: "prod_KtlhECVSFG2iro",
238
- name: "Plan Pro",
239
- user_limit: "20",
240
- products_limit: "5000",
241
- type: "Enterprise",
123
+ "id_user": 59,
124
+ "name": "The Home",
125
+ "last_name": "Depot",
126
+ "email": "cadena.ismael@allfreemail.net",
127
+ "position": "Admin",
128
+ "telephone": "+523111366336",
129
+ "country": "México",
130
+ "id_company": 817,
131
+ "id_cognito": "5884ae34-59d6-4454-b98e-821518bcc3a7",
132
+ "birth_Date": null,
133
+ "about_me": "",
134
+ "zip_code": "",
135
+ "address": "",
136
+ "job": "",
137
+ "id_stripe": "",
138
+ "id_role": 0,
139
+ "active": 1,
140
+ "is_retailer": 1,
141
+ "email_notify": 0,
142
+ "is_user_tech": null,
143
+ "membership": {
144
+ "id": 47,
145
+ "start_date": "2022-05-25T14:31:12.000Z",
146
+ "end_date": "2023-05-25T14:31:12.000Z",
147
+ "planID": 5,
148
+ "plan": "prod_Ktl6B5Ou2gqTB2",
149
+ "name": "Plan Pro",
150
+ "user_limit": "5",
151
+ "products_limit": "500",
152
+ "type": "PyMES"
242
153
  },
243
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1662106973155",
154
+ "src": "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1668127460068"
244
155
  },
245
156
  company: {
246
- id_company: 1,
247
- trade_name: "COMPANY DEV",
248
- company_name: "COMPANY DEV",
249
- rfc: null,
250
- adress: "",
251
- about_company: "...",
252
- telephone: "",
253
- web_site: "",
254
- zip_code: "",
255
- email: null,
256
- social_link: "",
257
- is_retailer: 0,
157
+ "id_company": 817,
158
+ "trade_name": "Retailer acc",
159
+ "company_name": "Retailer acc",
160
+ "rfc": "ASER12345",
161
+ "adress": "Av. Insurgentes",
162
+ "about_company": null,
163
+ "telephone": null,
164
+ "web_site": null,
165
+ "zip_code": null,
166
+ "email": null,
167
+ "social_link": null,
168
+ "is_retailer": 1,
169
+ "financedRetailers": [
170
+ {
171
+ "id": 68,
172
+ "name": "The Home Depot Merchants",
173
+ "country": "México",
174
+ "id_region": 1,
175
+ "active": 1
176
+ }
177
+ ],
178
+ "retailers": [
179
+ {
180
+ "id": 59,
181
+ "name": "The Home Depot Platinum",
182
+ "country": "México"
183
+ },
184
+ {
185
+ "id": 60,
186
+ "name": "The Home Depot Resizing",
187
+ "country": "México"
188
+ },
189
+ {
190
+ "id": 61,
191
+ "name": "Home Depot TAB",
192
+ "country": "México"
193
+ },
194
+ {
195
+ "id": 68,
196
+ "name": "The Home Depot Merchants",
197
+ "country": "México"
198
+ }
199
+ ]
258
200
  },
201
+ showSurvey: (v) => v && alert('se muestra'),
259
202
  };
@@ -45,7 +45,7 @@ import { useCloseModal } from "../../../global-files/customHooks";
45
45
  import { CreateVersion } from "../../organisms/CreateVersion";
46
46
 
47
47
  const reducerImages = (state, action) => {
48
- let { values = [], attrForImgs, inputsByRetailer } = state;
48
+ let { values, attrForImgs, inputsByRetailer } = state;
49
49
  switch (action.action) {
50
50
  case "init":
51
51
  const newInputsByRetailer = {};
@@ -100,7 +100,7 @@ const reducerImages = (state, action) => {
100
100
  imageIdArray.includes(input.id)
101
101
  );
102
102
 
103
- if (orderedImages.length > 0) values = orderedImages;
103
+ values = orderedImages.length > 0 ? orderedImages : [];
104
104
  } catch (error) {
105
105
  console.log(error);
106
106
  }
@@ -877,8 +877,11 @@ export const ProviderProductEdition = ({
877
877
  const newProductEdit = productEdit;
878
878
  newProductEdit.product[sectionStatusKey] = serviceStatus;
879
879
  setProductEdit(newProductEdit);
880
- showSurvey &&
881
- showSurvey(!user.is_retailer && orderStatus[orderId] === "AP");
880
+ const showSurveyByProvider =
881
+ !user.is_retailer && orderStatus[orderId] === "AP";
882
+ const showSurveyByRetailer =
883
+ user.is_retailer && orderStatus[orderId] === "ACA";
884
+ showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
882
885
  } else {
883
886
  res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
884
887
  headers: {
@@ -35,7 +35,7 @@ import { useCloseModal } from "../../../global-files/customHooks";
35
35
  import { CreateVersion } from "../../organisms/CreateVersion";
36
36
 
37
37
  const reducerImages = (state, action) => {
38
- let { values = [], attrForImgs, inputsByRetailer } = state;
38
+ let { values, attrForImgs, inputsByRetailer } = state;
39
39
  switch (action.action) {
40
40
  case "init":
41
41
  const newInputsByRetailer = {};
@@ -80,8 +80,9 @@ const reducerImages = (state, action) => {
80
80
  try {
81
81
  const orderedImages = [];
82
82
  const imageIdArray = [];
83
- if (action?.retailerId && !inputsByRetailer[action.retailerId])
83
+ if (action?.retailerId && !inputsByRetailer[action.retailerId]) {
84
84
  inputsByRetailer[action.retailerId] = [];
85
+ }
85
86
  action.retailerId &&
86
87
  inputsByRetailer[action.retailerId]?.filter((input) => {
87
88
  imageIdArray.push(input.id_image);
@@ -89,12 +90,10 @@ const reducerImages = (state, action) => {
89
90
  if (value.image_id === input.id_image) orderedImages.push(value);
90
91
  });
91
92
  });
92
-
93
93
  inputs = inputsInitial?.filter((input) =>
94
94
  imageIdArray.includes(input.id)
95
95
  );
96
-
97
- if (orderedImages.length > 0) values = orderedImages;
96
+ values = orderedImages.length > 0 ? orderedImages : [];
98
97
  } catch (error) {
99
98
  console.log(error);
100
99
  }