contentoh-components-library 21.5.18 → 21.5.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,97 +31,100 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIxMGZiNTE4Mi1jMGI5LTQyZGUtYTAyZC1lOTJlZWI2NWFlN2QiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcwMTkwMjA4NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTcwMTkwNTY4NywiaWF0IjoxNzAxOTAyMDg3LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.JpoKZHuzPZG2ttaT7Oz3CAPR7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kHTvvjC0VUfoQexjuvlVixeb_J3ZP8uzGFgdDur8m3v0Wad32fUM3eOsTzrsXp_c0HJHHuT_7x9h27pCyLoeTmi5j_y9Rfyu4RXj9xEejE3_Ge7LXupdvYuo3-kI577vcQjrHjYShjLZ0RFNDQVxbrBLS19qRXYj7DJXM0tenLG4v5wLNZyhdmW5OdnIYjA8VfDCxV_fO2v9pFie0DUbmgGGnpzqHBVJfhbBVOrjq2PGmx4HvTy5Ne8b4pyio3Gs5LSYA7ZMTvVMaZWKTFfgNM69tY4NNCZVAfe56EL5DzOBhCtLGXljVqTrEIkd1bPHX_CmM2nGkzhbTwYtstg",
35
35
  productSelected: {
36
- orderId: 15190,
37
- status: "RA",
38
- datasheet_status: "NS",
39
- prio: "none",
40
- version: 3,
41
- description_status: "NS",
42
- images_status: "RA",
43
- brand: null,
44
- retailerOrder: 0,
45
- missing: {
46
- datasheet: null,
47
- descriptions: null,
48
- images: null
49
- },
50
36
  services: {
51
- datasheets: 0,
52
- descriptions: 0,
37
+ datasheets: 1,
38
+ descriptions: 1,
53
39
  images: 1
54
40
  },
41
+ orderId: 7961,
42
+ status: "RP",
43
+ datasheet_status: "AA",
44
+ prio: "none",
45
+ version: 3,
46
+ description_status: "RP",
47
+ images_status: "AA",
48
+ statusByRetailer: {
49
+ "58": {
50
+ datasheet: "AA",
51
+ description: "RP",
52
+ images: "AA"
53
+ }
54
+ },
55
55
  article: {
56
- category: "Abarrotes Básicos|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
57
- company_name: "GRUPO BRAHMA",
56
+ id_article: 126855,
57
+ id_category: "3066",
58
+ name: "ORGANIZADOR 3 CUBOS ITALIA 92 X 33 X 30 CM",
59
+ upc: "217141",
60
+ timestamp: "2024-05-17T18:52:34.000Z",
61
+ id_user: 1636,
62
+ status: null,
63
+ active: 1,
64
+ company_id: 315,
65
+ company_name: "MADERAS Y DISEÑOS DEL NORTE S.A. DE C.V.",
58
66
  country: "México",
59
- id_category: "4004",
60
- id_datasheet_especialist: null,
67
+ id_order: 7961,
68
+ id_datasheet_especialist: 2757,
61
69
  id_datasheet_facilitator: null,
62
- id_description_especialist: null,
70
+ id_description_especialist: 2757,
63
71
  id_description_facilitator: null,
64
- id_images_especialist: 55,
65
- id_images_facilitator: 53,
66
- id_order: 15190,
67
- id_article: 39364,
68
- id_auditor: 37,
69
- name: "test 2 img ba",
70
- timestamp: "2023-05-05T02:56:16.000Z",
71
- upc: "4353242"
72
+ id_images_especialist: 1251,
73
+ id_images_facilitator: null,
74
+ id_auditor: 514,
75
+ id_recepcionist: null,
76
+ category: "Muebles|Muebles para Oficina y Gamer|Libreros",
77
+ missingAttributes: 0,
78
+ missingDescriptions: 0,
79
+ missingImages: 0
72
80
  },
73
81
  retailers: [{
74
- id: 70,
75
- name: "Bodega Aurrera"
82
+ id: 58,
83
+ name: "The Home Depot Golden"
76
84
  }],
77
- statusByRetailer: {
78
- 70: {
79
- images: "RA/AC"
80
- }
81
- }
82
- },
83
- location: {
84
- product: {
85
- articleId: 39364,
86
- versionId: 3
87
- },
88
- state: {
89
- withChat: true,
90
- chatType: "product_status"
91
- }
85
+ country: "México",
86
+ upc: "217141"
92
87
  },
88
+ // location: {
89
+ // product: { articleId: 126855, versionId: 3 },
90
+ // state: {
91
+ // withChat: true,
92
+ // chatType: "product_status",
93
+ // },
94
+ // },
93
95
  user: {
94
- id_user: 37,
95
- name: "José",
96
- last_name: "Castañeda",
97
- email: "ismael97lopez@gmail.com",
98
- position: "Auditor",
99
- telephone: "",
100
- country: "México",
96
+ id_user: 1973,
97
+ name: "Estefany",
98
+ last_name: "Montaño",
99
+ email: "emontano@contentoh.com",
100
+ position: "Front-End Developer",
101
+ telephone: null,
102
+ country: null,
101
103
  id_company: 254,
102
- id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
103
- birth_Date: null,
104
- about_me: "",
105
- zip_code: "",
106
- address: "",
107
- job: "",
108
- id_stripe: "",
109
- id_role: 6,
104
+ id_cognito: "f4db8263-cb05-4312-9e45-e3deca669e72",
105
+ birth_Date: "1999-10-06T00:00:00.000Z",
106
+ about_me: null,
107
+ zip_code: null,
108
+ address: null,
109
+ job: null,
110
+ id_stripe: null,
111
+ id_role: 1,
110
112
  active: 1,
111
113
  is_retailer: 0,
112
114
  email_notify: 1,
113
- is_user_tech: null,
115
+ is_user_tech: "ADMIN-AS",
116
+ is_onboarding: 0,
114
117
  membership: {
115
- id: 137,
116
- start_date: "2023-10-04T15:46:14.000Z",
117
- end_date: "2024-10-04T08:46:09.000Z",
118
- planID: 8,
119
- plan: "prod_KtlhECVSFG2iro",
120
- name: "Plan Pro",
121
- user_limit: "50",
122
- products_limit: "5000",
118
+ id: 750,
119
+ start_date: "2022-01-07T21:32:54.000Z",
120
+ end_date: "2023-01-07T21:32:54.000Z",
121
+ planID: 6,
122
+ plan: "prod_KvGd6YSTJyR3AP",
123
+ name: "Plan Small",
124
+ user_limit: "10",
125
+ products_limit: "1000",
123
126
  type: "Enterprise"
124
127
  },
125
- src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1701902088068"
128
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-1973/1973.png?1718213428633"
126
129
  }
127
130
  };
@@ -179,7 +179,7 @@ var reducerImages = function reducerImages(state, action) {
179
179
  while (1) {
180
180
  switch (_context.prev = _context.next) {
181
181
  case 0:
182
- videoSrc = 'data:video/mp4;base64,' + base64.split(',')[1]; // Añade el tipo MIME adecuado
182
+ videoSrc = "data:video/mp4;base64," + base64.split(",")[1]; // Añade el tipo MIME adecuado
183
183
 
184
184
  _context.next = 3;
185
185
  return (0, _generateThumnail.default)(videoSrc, 2);
@@ -199,7 +199,7 @@ var reducerImages = function reducerImages(state, action) {
199
199
  return _ref2.apply(this, arguments);
200
200
  };
201
201
  }()).catch(function (error) {
202
- console.error('Error:', error);
202
+ console.error("Error:", error);
203
203
  });
204
204
  }
205
205
 
@@ -243,8 +243,8 @@ var REGION = "us-east-1";
243
243
  function convertirVideoABase64(url) {
244
244
  return new Promise(function (resolve, reject) {
245
245
  var xhr = new XMLHttpRequest();
246
- xhr.open('GET', url, true);
247
- xhr.responseType = 'blob';
246
+ xhr.open("GET", url, true);
247
+ xhr.responseType = "blob";
248
248
 
249
249
  xhr.onload = function () {
250
250
  if (xhr.status === 200) {
@@ -257,12 +257,12 @@ function convertirVideoABase64(url) {
257
257
 
258
258
  reader.readAsDataURL(blob);
259
259
  } else {
260
- reject(new Error('Error al cargar el video'));
260
+ reject(new Error("Error al cargar el video"));
261
261
  }
262
262
  };
263
263
 
264
264
  xhr.onerror = function () {
265
- reject(new Error('Error de red al cargar el video'));
265
+ reject(new Error("Error de red al cargar el video"));
266
266
  };
267
267
 
268
268
  xhr.send();
@@ -271,12 +271,12 @@ function convertirVideoABase64(url) {
271
271
 
272
272
  function obtenerDuracionVideoBase64(base64Data) {
273
273
  return new Promise(function (resolve, reject) {
274
- var video = document.createElement('video');
274
+ var video = document.createElement("video");
275
275
  video.src = base64Data;
276
- video.addEventListener('loadedmetadata', function () {
276
+ video.addEventListener("loadedmetadata", function () {
277
277
  resolve(video.duration);
278
278
  });
279
- video.addEventListener('error', reject);
279
+ video.addEventListener("error", reject);
280
280
  });
281
281
  }
282
282
 
@@ -293,7 +293,7 @@ var myBucket = new _awsSdk.default.S3({
293
293
  });
294
294
 
295
295
  var RetailerProductEdition = function RetailerProductEdition(_ref3) {
296
- var _product$retailers, _location$state, _location$state2, _product$services2, _datasheets$, _datasheets$$data, _product$article17;
296
+ var _product$retailers, _location$state, _location$state2, _product$services2, _datasheets$, _datasheets$$data, _product$article17, _comment$message;
297
297
 
298
298
  var tabsSections = _ref3.tabsSections,
299
299
  _ref3$productSelected = _ref3.productSelected,
@@ -2341,15 +2341,57 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
2341
2341
  headerType: "input-name-header"
2342
2342
  }))]
2343
2343
  })
2344
- }), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2344
+ }), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2345
2345
  className: "commentary-box",
2346
- children: [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2346
+ children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2347
+ className: "commentary",
2348
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2349
+ label: "Caja de Comentario",
2350
+ inputType: "textarea",
2351
+ inputCols: 80,
2352
+ inputRows: 4,
2353
+ inputId: "commentary-box",
2354
+ index: 0
2355
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2356
+ className: "buttons-box",
2357
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2358
+ buttonType: "general-transparent-button",
2359
+ label: "Enviar comentario",
2360
+ onClick: function onClick(e) {
2361
+ return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
2362
+ }
2363
+ })
2364
+ })]
2365
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2366
+ className: "feedback-box",
2367
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Commentary, {
2368
+ comment: comment === null || comment === void 0 ? void 0 : (_comment$message = comment.message) === null || _comment$message === void 0 ? void 0 : _comment$message.replace(/<.*?\/?>/gm, ""),
2369
+ reviewed: crossComment
2370
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2371
+ buttonType: "circular-button accept-button",
2372
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2373
+ return _regenerator.default.wrap(function _callee21$(_context21) {
2374
+ while (1) {
2375
+ switch (_context21.prev = _context21.next) {
2376
+ case 0:
2377
+ setCrossComment(true);
2378
+ commentRevised();
2379
+
2380
+ case 2:
2381
+ case "end":
2382
+ return _context21.stop();
2383
+ }
2384
+ }
2385
+ }, _callee21);
2386
+ }))
2387
+ })]
2388
+ }), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2347
2389
  buttonType: evaluationFinished(user.id_role, activeTab, statusArray) && requiredNull[activeTab] === 0 ? "general-green-button" : "general-button-disabled",
2348
2390
  label: "Enviar evaluación",
2349
2391
  onClick: function onClick() {
2350
2392
  return sendToFacilitator();
2351
2393
  }
2352
- })
2394
+ })]
2353
2395
  })]
2354
2396
  })]
2355
2397
  }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
@@ -2398,18 +2440,18 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
2398
2440
  type: "pink",
2399
2441
  label: "Aceptar",
2400
2442
  size: 12,
2401
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2443
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
2402
2444
  var body, messages;
2403
- return _regenerator.default.wrap(function _callee21$(_context21) {
2445
+ return _regenerator.default.wrap(function _callee22$(_context22) {
2404
2446
  while (1) {
2405
- switch (_context21.prev = _context21.next) {
2447
+ switch (_context22.prev = _context22.next) {
2406
2448
  case 0:
2407
2449
  body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
2408
2450
  messages = [{
2409
2451
  type: "message",
2410
2452
  value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
2411
2453
  }];
2412
- _context21.next = 4;
2454
+ _context22.next = 4;
2413
2455
  return createComment(messages, activeRetailer.id);
2414
2456
 
2415
2457
  case 4:
@@ -2419,10 +2461,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
2419
2461
 
2420
2462
  case 7:
2421
2463
  case "end":
2422
- return _context21.stop();
2464
+ return _context22.stop();
2423
2465
  }
2424
2466
  }
2425
- }, _callee21);
2467
+ }, _callee22);
2426
2468
  }))
2427
2469
  }, "btn-Aceptar")]
2428
2470
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.5.18",
3
+ "version": "21.5.20",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -16,97 +16,104 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIxMGZiNTE4Mi1jMGI5LTQyZGUtYTAyZC1lOTJlZWI2NWFlN2QiLCJ0b2t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Q1YjMwMTQxMTgiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODIxMzQyOCwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTcxODIxNzAyNywiaWF0IjoxNzE4MjEzNDI4LCJlbWFpbCI6ImVtb250YW5vQGNvbnRlbnRvaC5jb20ifQ.TQfkHTvvjC0VUfoQexjuvlVixeb_J3ZP8uzGFgdDur8m3v0Wad32fUM3eOsTzrsXp_c0HJHHuT_7x9h27pCyLoeTmi5j_y9Rfyu4RXj9xEejE3_Ge7LXupdvYuo3-kI577vcQjrHjYShjLZ0RFNDQVxbrBLS19qRXYj7DJXM0tenLG4v5wLNZyhdmW5OdnIYjA8VfDCxV_fO2v9pFie0DUbmgGGnpzqHBVJfhbBVOrjq2PGmx4HvTy5Ne8b4pyio3Gs5LSYA7ZMTvVMaZWKTFfgNM69tY4NNCZVAfe56EL5DzOBhCtLGXljVqTrEIkd1bPHX_CmM2nGkzhbTwYtstg",
20
20
  productSelected: {
21
- orderId: 15190,
22
- status: "RA",
23
- datasheet_status: "NS",
24
- prio: "none",
25
- version: 3,
26
- description_status: "NS",
27
- images_status: "RA",
28
- brand: null,
29
- retailerOrder: 0,
30
- missing: {
31
- datasheet: null,
32
- descriptions: null,
33
- images: null,
34
- },
35
21
  services: {
36
- datasheets: 0,
37
- descriptions: 0,
22
+ datasheets: 1,
23
+ descriptions: 1,
38
24
  images: 1,
39
25
  },
26
+ orderId: 7961,
27
+ status: "RP",
28
+ datasheet_status: "AA",
29
+ prio: "none",
30
+ version: 3,
31
+ description_status: "RP",
32
+ images_status: "AA",
33
+ statusByRetailer: {
34
+ "58": {
35
+ datasheet: "AA",
36
+ description: "RP",
37
+ images: "AA",
38
+ },
39
+ },
40
40
  article: {
41
- category:
42
- "Abarrotes Básicos|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
43
- company_name: "GRUPO BRAHMA",
41
+ id_article: 126855,
42
+ id_category: "3066",
43
+ name: "ORGANIZADOR 3 CUBOS ITALIA 92 X 33 X 30 CM",
44
+ upc: "217141",
45
+ timestamp: "2024-05-17T18:52:34.000Z",
46
+ id_user: 1636,
47
+ status: null,
48
+ active: 1,
49
+ company_id: 315,
50
+ company_name: "MADERAS Y DISEÑOS DEL NORTE S.A. DE C.V.",
44
51
  country: "México",
45
- id_category: "4004",
46
- id_datasheet_especialist: null,
52
+ id_order: 7961,
53
+ id_datasheet_especialist: 2757,
47
54
  id_datasheet_facilitator: null,
48
- id_description_especialist: null,
55
+ id_description_especialist: 2757,
49
56
  id_description_facilitator: null,
50
- id_images_especialist: 55,
51
- id_images_facilitator: 53,
52
- id_order: 15190,
53
- id_article: 39364,
54
- id_auditor: 37,
55
- name: "test 2 img ba",
56
- timestamp: "2023-05-05T02:56:16.000Z",
57
- upc: "4353242",
57
+ id_images_especialist: 1251,
58
+ id_images_facilitator: null,
59
+ id_auditor: 514,
60
+ id_recepcionist: null,
61
+ category: "Muebles|Muebles para Oficina y Gamer|Libreros",
62
+ missingAttributes: 0,
63
+ missingDescriptions: 0,
64
+ missingImages: 0,
58
65
  },
59
66
  retailers: [
60
67
  {
61
- id: 70,
62
- name: "Bodega Aurrera",
68
+ id: 58,
69
+ name: "The Home Depot Golden",
63
70
  },
64
71
  ],
65
- statusByRetailer: {
66
- 70: {
67
- images: "RA/AC",
68
- },
69
- },
70
- },
71
- location: {
72
- product: { articleId: 39364, versionId: 3 },
73
- state: {
74
- withChat: true,
75
- chatType: "product_status",
76
- },
77
- },
78
- user: {
79
- id_user: 37,
80
- name: "José",
81
- last_name: "Castañeda",
82
- email: "ismael97lopez@gmail.com",
83
- position: "Auditor",
84
- telephone: "",
85
72
  country: "México",
73
+ upc: "217141",
74
+ }
75
+ ,
76
+ // location: {
77
+ // product: { articleId: 126855, versionId: 3 },
78
+ // state: {
79
+ // withChat: true,
80
+ // chatType: "product_status",
81
+ // },
82
+ // },
83
+ user: {
84
+ id_user: 1973,
85
+ name: "Estefany",
86
+ last_name: "Montaño",
87
+ email: "emontano@contentoh.com",
88
+ position: "Front-End Developer",
89
+ telephone: null,
90
+ country: null,
86
91
  id_company: 254,
87
- id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
88
- birth_Date: null,
89
- about_me: "",
90
- zip_code: "",
91
- address: "",
92
- job: "",
93
- id_stripe: "",
94
- id_role: 6,
92
+ id_cognito: "f4db8263-cb05-4312-9e45-e3deca669e72",
93
+ birth_Date: "1999-10-06T00:00:00.000Z",
94
+ about_me: null,
95
+ zip_code: null,
96
+ address: null,
97
+ job: null,
98
+ id_stripe: null,
99
+ id_role: 1,
95
100
  active: 1,
96
101
  is_retailer: 0,
97
102
  email_notify: 1,
98
- is_user_tech: null,
103
+ is_user_tech: "ADMIN-AS",
104
+ is_onboarding: 0,
99
105
  membership: {
100
- id: 137,
101
- start_date: "2023-10-04T15:46:14.000Z",
102
- end_date: "2024-10-04T08:46:09.000Z",
103
- planID: 8,
104
- plan: "prod_KtlhECVSFG2iro",
105
- name: "Plan Pro",
106
- user_limit: "50",
107
- products_limit: "5000",
106
+ id: 750,
107
+ start_date: "2022-01-07T21:32:54.000Z",
108
+ end_date: "2023-01-07T21:32:54.000Z",
109
+ planID: 6,
110
+ plan: "prod_KvGd6YSTJyR3AP",
111
+ name: "Plan Small",
112
+ user_limit: "10",
113
+ products_limit: "1000",
108
114
  type: "Enterprise",
109
115
  },
110
- src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1701902088068",
111
- },
116
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-1973/1973.png?1718213428633",
117
+ }
118
+ ,
112
119
  };
@@ -93,18 +93,21 @@ const reducerImages = (state, action) => {
93
93
  inputsByRetailer[action.retailerId]?.filter((input) => {
94
94
  imageIdArray.push(input.id_image);
95
95
  valuesInitial.forEach(async (value) => {
96
- if(value.ext=="mp4"){
97
- convertirVideoABase64("https://" +
98
- process.env.REACT_APP_IMAGES_BUCKET +
99
- ".s3.amazonaws.com/" +
100
- value.srcDB)
101
- .then(async base64 => {
102
- const videoSrc = 'data:video/mp4;base64,' + base64.split(',')[1]; // Añade el tipo MIME adecuado
103
- value.src= await generateThumbnail(videoSrc,2);
104
- })
105
- .catch(error => {
106
- console.error('Error:', error);
107
- });
96
+ if (value.ext == "mp4") {
97
+ convertirVideoABase64(
98
+ "https://" +
99
+ process.env.REACT_APP_IMAGES_BUCKET +
100
+ ".s3.amazonaws.com/" +
101
+ value.srcDB
102
+ )
103
+ .then(async (base64) => {
104
+ const videoSrc =
105
+ "data:video/mp4;base64," + base64.split(",")[1]; // Añade el tipo MIME adecuado
106
+ value.src = await generateThumbnail(videoSrc, 2);
107
+ })
108
+ .catch((error) => {
109
+ console.error("Error:", error);
110
+ });
108
111
  }
109
112
  if (value.image_id === input.id_image) orderedImages.push(value);
110
113
  });
@@ -129,22 +132,22 @@ const REGION = "us-east-1";
129
132
  function convertirVideoABase64(url) {
130
133
  return new Promise((resolve, reject) => {
131
134
  const xhr = new XMLHttpRequest();
132
- xhr.open('GET', url, true);
133
- xhr.responseType = 'blob';
134
- xhr.onload = function() {
135
+ xhr.open("GET", url, true);
136
+ xhr.responseType = "blob";
137
+ xhr.onload = function () {
135
138
  if (xhr.status === 200) {
136
139
  const blob = xhr.response;
137
140
  const reader = new FileReader();
138
- reader.onloadend = function() {
141
+ reader.onloadend = function () {
139
142
  resolve(reader.result);
140
143
  };
141
144
  reader.readAsDataURL(blob);
142
145
  } else {
143
- reject(new Error('Error al cargar el video'));
146
+ reject(new Error("Error al cargar el video"));
144
147
  }
145
148
  };
146
- xhr.onerror = function() {
147
- reject(new Error('Error de red al cargar el video'));
149
+ xhr.onerror = function () {
150
+ reject(new Error("Error de red al cargar el video"));
148
151
  };
149
152
  xhr.send();
150
153
  });
@@ -152,16 +155,15 @@ function convertirVideoABase64(url) {
152
155
 
153
156
  function obtenerDuracionVideoBase64(base64Data) {
154
157
  return new Promise((resolve, reject) => {
155
- const video = document.createElement('video');
158
+ const video = document.createElement("video");
156
159
  video.src = base64Data;
157
- video.addEventListener('loadedmetadata', () => {
160
+ video.addEventListener("loadedmetadata", () => {
158
161
  resolve(video.duration);
159
162
  });
160
- video.addEventListener('error', reject);
163
+ video.addEventListener("error", reject);
161
164
  });
162
165
  }
163
166
 
164
-
165
167
  AWS.config.update({
166
168
  accessKeyId: process.env.REACT_APP_KUTS3,
167
169
  secretAccessKey: process.env.REACT_APP_AKUTS3,
@@ -312,7 +314,7 @@ export const RetailerProductEdition = ({
312
314
  const [auditDescriptions, setAuditDescriptions] = useState([]);
313
315
  const [auditImages, setAuditImages] = useState([]);
314
316
  const [compare, setCompare] = useState(false);
315
- const [observation,setObservation] = useState();
317
+ const [observation, setObservation] = useState();
316
318
  const [valRejAll, setValRejAll] = useState(false);
317
319
  const [modalAlert, setModalAlert] = useState({
318
320
  show: false,
@@ -761,14 +763,13 @@ export const RetailerProductEdition = ({
761
763
  const promiseArray = [];
762
764
  data?.articleData?.forEach((e) => {
763
765
  let file;
764
- if(e.ext=="mp4"){
766
+ if (e.ext == "mp4") {
765
767
  file = Buffer.from(
766
768
  e.video_src.replace(/^data:video\/\w+;base64,/, ""),
767
769
  "base64"
768
770
  );
769
- e.video_src="";
770
- }
771
- else{
771
+ e.video_src = "";
772
+ } else {
772
773
  file = Buffer.from(
773
774
  e.src.replace(/^data:image\/\w+;base64,/, ""),
774
775
  "base64"
@@ -1494,7 +1495,7 @@ export const RetailerProductEdition = ({
1494
1495
  isObservationVisible={isObservationVisible}
1495
1496
  toggleObservation={toggleObservation}
1496
1497
  // handleClickOutside={handleClickOutside}
1497
- hideObservation={hideObservation}
1498
+ hideObservation={hideObservation}
1498
1499
  />
1499
1500
  <FullTabsMenu
1500
1501
  tabsSections={tabsSections}
@@ -1626,9 +1627,71 @@ export const RetailerProductEdition = ({
1626
1627
  </>
1627
1628
  )}
1628
1629
  </div>
1630
+ {/* {(userAssigned(activeTab) || auditorAssigned()) &&
1631
+ product[`${getConcept(activeTab)}_status`] !== "NS" && (
1632
+ <div className="commentary-box">
1633
+ {[7, 8].includes(user.id_role) && (
1634
+ <Button
1635
+ buttonType={
1636
+ evaluationFinished(
1637
+ user.id_role,
1638
+ activeTab,
1639
+ statusArray
1640
+ ) && requiredNull[activeTab] === 0
1641
+ ? "general-green-button"
1642
+ : "general-button-disabled"
1643
+ }
1644
+ label={"Enviar evaluación"}
1645
+ onClick={() => sendToFacilitator()}
1646
+ />
1647
+ )}
1648
+ </div>
1649
+ )} */}
1650
+
1629
1651
  {(userAssigned(activeTab) || auditorAssigned()) &&
1630
1652
  product[`${getConcept(activeTab)}_status`] !== "NS" && (
1631
1653
  <div className="commentary-box">
1654
+ {!comment ? (
1655
+ <div className="commentary">
1656
+ <TagAndInput
1657
+ label={"Caja de Comentario"}
1658
+ inputType={"textarea"}
1659
+ inputCols={80}
1660
+ inputRows={4}
1661
+ inputId={"commentary-box"}
1662
+ index={0}
1663
+ />
1664
+ <div className="buttons-box">
1665
+ <Button
1666
+ buttonType={"general-transparent-button"}
1667
+ label={"Enviar comentario"}
1668
+ onClick={(e) =>
1669
+ createComment(
1670
+ e,
1671
+ document.querySelector(
1672
+ "#commentary-box .ql-container .ql-editor > p"
1673
+ ).innerHTML,
1674
+ activeTab
1675
+ )
1676
+ }
1677
+ />
1678
+ </div>
1679
+ </div>
1680
+ ) : (
1681
+ <div className="feedback-box">
1682
+ <Commentary
1683
+ comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
1684
+ reviewed={crossComment}
1685
+ />
1686
+ <Button
1687
+ buttonType={"circular-button accept-button"}
1688
+ onClick={async () => {
1689
+ setCrossComment(true);
1690
+ commentRevised();
1691
+ }}
1692
+ />
1693
+ </div>
1694
+ )}
1632
1695
  {[7, 8].includes(user.id_role) && (
1633
1696
  <Button
1634
1697
  buttonType={