contentoh-components-library 21.0.8 → 21.0.9

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.
@@ -44,7 +44,7 @@ var FullTabsMenu = function FullTabsMenu(_ref) {
44
44
  setImagesSection: setImagesSection,
45
45
  setActiveTab: setActiveTab
46
46
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.StatusAsignationInfo, {
47
- status: status[activeTab],
47
+ status: status(),
48
48
  activeTab: activeTab,
49
49
  setImageLayout: setImageLayout,
50
50
  imagesSection: imagesSection,
@@ -68,7 +68,7 @@ RetailerProductEditionDefault.args = {
68
68
  "Ficha técnica": false,
69
69
  Imágenes: false
70
70
  },
71
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6IjU2M2I0NTFlLTVhZDQtNGMzNy1iNjIzLTc3NjMwM2Y3YjJiNSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjQ4NzYwODcwLCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjQ4NzY0NDcwLCJpYXQiOjE2NDg3NjA4NzAsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.Y2gmN-9KDeYyvvSJOzKJUP-WL8O4AmZhdLnfHxSB_9lAXQFns6uJUbX1nzE75cuqeQ3NeiNZy4hu8y5Y7hckPuQFy01nY3OoY3SfD06W0SciNz0txNSR7oN6KH_c_9FOwQiQ0mnOs9udo9nDM4faFFUuu9UD6RMVfeLW1gfZmtyc3lfmy6YO6feJcS3opSSQpXH4Mgh415fXFjbyz344ssd5nl7Onyh8jq5i-LAex3OPXhKzjrBnDRpGg3BQPIfpsquGZNKBiWqyos--CuohFBeyevMLGoKOcU-Ga-zIdEfonTtDVRe6CQLgOZJ2xTPdswlzRPby1gFoZjNebeeRVw",
71
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJiMmNlNWIyYS02MDljLTRlNzktOWVhOS0yZjc0Y2ZmNDM4ODkiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImIyY2U1YjJhLTYwOWMtNGU3OS05ZWE5LTJmNzRjZmY0Mzg4OSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJkMGQ0NDUxYS01ODg1LTQ0ZTctYjZhNi0xODdkY2NjNDI4MTgiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1MTIyMDI2NiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1MTIyMzg2NiwiaWF0IjoxNjUxMjIwMjY2LCJlbWFpbCI6ImF6YXJhdGVAY29udGVudG9oLmNvbSJ9.lhlgp4NoHgFu4LrpIWiGCTD08MIHo-mLQ17SNx1rAmyHP5YosGp9LKJXEgNcpAIaVfFiy4Zd-YGTf2QExMcP9kAYksoKHI1G6jSg87yh3Pg3V3aGE6X6JkuOOflz2M8jZgyYMRvbkJfG7oi6uj_nZ-tCjq7VMnmZyfWL4LjTvF5E0EqzVC93fcPViwW5ozqr51VvGhIoXGHiG01i4CPbsorp0jJjlU795cq4ETNw6i0d61Wz9pLDUttYmt5RCEMrbCp3ctSymtxHuz3eJTXzsF330KAmGL2SG4hJ8l-kdyoYRSlkGy3PTy4tYdFVrcubpHL3LOFzJWMrmLn98J3MoA",
72
72
  articleId: 238,
73
73
  category: 846,
74
74
  version: 2,
@@ -78,72 +78,72 @@ RetailerProductEditionDefault.args = {
78
78
  descriptions: 1,
79
79
  images: 1
80
80
  },
81
- orderId: 123,
81
+ orderId: 125,
82
82
  status: "IN_PROGRESS",
83
- datasheet_status: "IN_PROGRESS",
83
+ datasheet_status: "QF",
84
84
  prio: "none",
85
85
  version: 2,
86
- description_status: "IN_PROGRESS",
87
- images_status: null,
86
+ description_status: "QF",
87
+ images_status: "IN_PROGRESS",
88
88
  article: {
89
- id_article: 109481,
90
- id_category: "9",
91
- name: "Barrita de nuez",
92
- upc: "168489",
93
- timestamp: "2022-04-27T15:06:59.000Z",
89
+ id_article: 109483,
90
+ id_category: "2046",
91
+ name: "Celular",
92
+ upc: "31313131",
93
+ timestamp: "2022-04-28T21:42:27.000Z",
94
94
  id_user: 28,
95
95
  status: "NULL",
96
96
  active: 1,
97
97
  company_id: 1,
98
98
  company_name: "COMPANY DEV",
99
99
  country: "Colombia",
100
- id_order: 123,
100
+ id_order: 125,
101
101
  id_datasheet_especialist: 54,
102
102
  id_datasheet_facilitator: 52,
103
103
  id_description_especialist: 54,
104
104
  id_description_facilitator: 52,
105
- id_images_especialist: null,
106
- id_images_facilitator: null,
105
+ id_images_especialist: 55,
106
+ id_images_facilitator: 53,
107
107
  id_auditor: 30,
108
108
  id_recepcionist: null,
109
- category: "ABARROTES|ABARROTES SECOS|CEREALES Y BARRAS",
109
+ category: "ELÉCTRICO|ELECTRÓNICA|ANTENAS Y ACCESORIOS",
110
110
  missingAttributes: null,
111
111
  missingDescriptions: null,
112
112
  missingImages: null
113
113
  },
114
114
  retailers: [{
115
- id: 4,
116
- name: "Walmart Super y Superama",
115
+ id: 58,
116
+ name: "The Home Depot",
117
117
  country: "México",
118
118
  id_region: 1,
119
119
  active: 1
120
120
  }, {
121
- id: 6,
122
- name: "HEB",
121
+ id: 59,
122
+ name: "Home Depot Platinum",
123
123
  country: "México",
124
124
  id_region: 1,
125
125
  active: 1
126
126
  }],
127
127
  country: "Colombia",
128
- upc: "168489"
128
+ upc: "31313131"
129
129
  },
130
130
  user: {
131
- id_user: 30,
132
- name: "Admin",
133
- last_name: "Ulises",
134
- email: "salmeron.5@hotmail.com",
135
- position: "Admin",
131
+ id_user: 52,
132
+ name: "FACILITADOR TXT PRUEBA",
133
+ last_name: "",
134
+ email: "azarate@contentoh.com",
135
+ position: null,
136
136
  telephone: null,
137
- country: "México",
137
+ country: null,
138
138
  id_company: 2,
139
- id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
139
+ id_cognito: "b2ce5b2a-609c-4e79-9ea9-2f74cff43889",
140
140
  birth_Date: null,
141
141
  about_me: null,
142
142
  zip_code: null,
143
143
  address: null,
144
144
  job: null,
145
145
  id_stripe: null,
146
- id_role: 6,
146
+ id_role: 4,
147
147
  active: 1,
148
148
  is_retailer: 0,
149
149
  membership: {
@@ -157,6 +157,6 @@ RetailerProductEditionDefault.args = {
157
157
  products_limit: "3",
158
158
  type: "PyMES"
159
159
  },
160
- src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1649896700986"
160
+ src: "https://content-management-profile.s3.amazonaws.com/id-52/52.png?1651207506986"
161
161
  }
162
162
  };
@@ -123,7 +123,7 @@ var myBucket = new _awsSdk.default.S3({
123
123
  });
124
124
 
125
125
  var RetailerProductEdition = function RetailerProductEdition(_ref) {
126
- var _productSelected$reta, _product$services5, _product$services6, _datasheets$, _datasheets$$data, _product$services7, _product$article4, _product$services8;
126
+ var _productSelected$reta, _product$services5, _product$services6, _datasheets$, _datasheets$$data, _product$services7, _product$article6, _product$services8;
127
127
 
128
128
  var tabsSections = _ref.tabsSections,
129
129
  _ref$productSelected = _ref.productSelected,
@@ -284,7 +284,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
284
284
  message = _useState34[0],
285
285
  setMessage = _useState34[1];
286
286
 
287
- var _useState35 = (0, _react.useState)({}),
287
+ var _useState35 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
288
288
  _useState36 = (0, _slicedToArray2.default)(_useState35, 2),
289
289
  product = _useState36[0],
290
290
  setProduct = _useState36[1];
@@ -382,7 +382,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
382
382
  init: services[2]
383
383
  });
384
384
  if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
385
- setProduct(productSelected);
386
385
  (0, _data2.getPercentage)({
387
386
  data: [productSelected]
388
387
  }).then(function (res) {
@@ -390,7 +389,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
390
389
  });
391
390
  setLoading(false);
392
391
 
393
- case 10:
392
+ case 9:
394
393
  case "end":
395
394
  return _context2.stop();
396
395
  }
@@ -405,7 +404,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
405
404
 
406
405
  var getServices = /*#__PURE__*/function () {
407
406
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(tab) {
408
- var _selected$article, _selected$article2, _servicesResponse$dat;
407
+ var _product$article, _product$article2, _servicesResponse$dat;
409
408
 
410
409
  var serviceActive, selected, servicesResponse, parsedResponse;
411
410
  return _regenerator.default.wrap(function _callee3$(_context3) {
@@ -432,7 +431,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
432
431
  case 10:
433
432
  selected = productSelected;
434
433
  _context3.next = 13;
435
- return _axios.default.get("".concat(process.env.REACT_APP_SERVICES_ENDPOINT, "?articleId=").concat(selected === null || selected === void 0 ? void 0 : (_selected$article = selected.article) === null || _selected$article === void 0 ? void 0 : _selected$article.id_article, "&orderId=").concat(selected === null || selected === void 0 ? void 0 : (_selected$article2 = selected.article) === null || _selected$article2 === void 0 ? void 0 : _selected$article2.id_order, "&end=true"));
434
+ return _axios.default.get("".concat(process.env.REACT_APP_SERVICES_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, "&orderId=").concat(product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.id_order, "&end=true"));
436
435
 
437
436
  case 13:
438
437
  servicesResponse = _context3.sent;
@@ -746,7 +745,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
746
745
  }();
747
746
 
748
747
  var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
749
- var _images$values2, _product$article, _data$articleData, _data$articleData2, _data$updateImages;
748
+ var _images$values2, _product$article3, _data$articleData, _data$articleData2, _data$updateImages;
750
749
 
751
750
  var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
752
751
 
@@ -765,7 +764,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
765
764
  attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs);
766
765
  attrForImgs.pop();
767
766
  data = {
768
- articleId: product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article,
767
+ articleId: product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_article,
769
768
  attrReqImgs: attrForImgs === null || attrForImgs === void 0 ? void 0 : attrForImgs.map(function (e) {
770
769
  var _e$, _e$2;
771
770
 
@@ -930,7 +929,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
930
929
  }
931
930
 
932
931
  concept = action ? action : concept;
933
- return productSelected["".concat(concept, "_status")] === "QF" && (user.id_role === 1 || user.id_role === 4 || user.id_role === 5) || productSelected["".concat(concept, "_status")] === "AF" && (user.id_role === 1 || user.id_role === 6) || productSelected["".concat(concept, "_status")] === "RP" && (user.id_role === 1 || user.id_role === 6);
932
+ return product["".concat(concept, "_status")] === "QF" && (user.id_role === 1 || user.id_role === 4 || user.id_role === 5) || product["".concat(concept, "_status")] === "AF" && ( //sessionStorage productSelected
933
+ user.id_role === 1 || user.id_role === 6) || product["".concat(concept, "_status")] === "RP" && (user.id_role === 1 || user.id_role === 6) || product["".concat(concept, "_status")] === "RC" && (user.id_role === 1 || user.id_role === 6);
934
934
  };
935
935
 
936
936
  var getSectionIcon = function getSectionIcon() {
@@ -954,7 +954,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
954
954
 
955
955
  var updateCompaniesList = function updateCompaniesList(status, result, retailerId, concept) {
956
956
  var serv = servicesData.slice();
957
- var item = serv === null || serv === void 0 ? void 0 : serv.find(function (item) {
957
+ var item = serv.find(function (item) {
958
958
  return item.id_retailer === retailerId && item.service === concept;
959
959
  });
960
960
  var index = serv.indexOf(item);
@@ -1016,7 +1016,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1016
1016
 
1017
1017
  var sendToFacilitator = /*#__PURE__*/function () {
1018
1018
  var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(result) {
1019
- var concept, evalStatus, productTemp, specialistDone, data;
1019
+ var concept, productTemp, evalStatus, specialistDone, data;
1020
1020
  return _regenerator.default.wrap(function _callee10$(_context10) {
1021
1021
  while (1) {
1022
1022
  switch (_context10.prev = _context10.next) {
@@ -1028,116 +1028,125 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1028
1028
 
1029
1029
  case 4:
1030
1030
  concept = "description";
1031
- return _context10.abrupt("break", 11);
1031
+ return _context10.abrupt("break", 10);
1032
1032
 
1033
1033
  case 6:
1034
1034
  concept = "datasheet";
1035
- return _context10.abrupt("break", 11);
1035
+ return _context10.abrupt("break", 10);
1036
1036
 
1037
1037
  case 8:
1038
1038
  concept = "images";
1039
- return _context10.abrupt("break", 11);
1039
+ return _context10.abrupt("break", 10);
1040
1040
 
1041
1041
  case 10:
1042
- return _context10.abrupt("break", 11);
1043
-
1044
- case 11:
1045
- evalStatus = "";
1046
- productTemp = productSelected;
1047
- evalStatus = productSelected["".concat(concept, "_status")];
1042
+ productTemp = (0, _objectSpread2.default)({}, product);
1043
+ evalStatus = product["".concat(concept, "_status")];
1048
1044
  specialistDone = evalStatus === "RF" || evalStatus === "RA" || evalStatus === "IN_PROGRESS";
1049
1045
 
1050
1046
  if (specialistDone) {
1051
1047
  setMessage("".concat(activeTab, " enviada a facilitador"));
1052
1048
  getSectionIcon();
1053
1049
  productTemp["".concat(concept, "_status")] = "QF";
1054
- evalStatus = "QF";
1055
1050
  } else if (evalStatus === "QF") {
1056
1051
  setMessage("Evaluación enviada");
1057
1052
  getSectionIcon();
1058
1053
  productTemp["".concat(concept, "_status")] = "AF";
1059
- evalStatus = "AF";
1060
1054
  } else if (evalStatus === "AF") {
1061
1055
  setMessage("Evaluación enviada");
1062
1056
  getSectionIcon();
1063
1057
  productTemp["".concat(concept, "_status")] = "AA";
1064
- evalStatus = "AA";
1065
1058
  } else if (evalStatus === "RP") {
1066
1059
  setMessage("Evaluación enviada");
1067
1060
  getSectionIcon();
1068
1061
  productTemp["".concat(concept, "_status")] = "AA";
1069
- evalStatus = "AA";
1062
+ } else if (evalStatus === "RC") {
1063
+ setMessage("Evaluación enviada");
1064
+ getSectionIcon();
1065
+ productTemp["".concat(concept, "_status")] = "AP";
1070
1066
  }
1071
1067
 
1072
1068
  data = {};
1073
1069
 
1074
1070
  if (!result) {
1075
- _context10.next = 24;
1071
+ _context10.next = 28;
1076
1072
  break;
1077
1073
  }
1078
1074
 
1079
1075
  updateCompaniesList(evalStatus, result, activeRetailer.id, concept);
1080
1076
  data = {
1081
- articleId: productSelected.article.id_article,
1082
- orderId: productSelected.orderId,
1077
+ articleId: product.article.id_article,
1078
+ orderId: product.orderId,
1083
1079
  concept: concept,
1084
1080
  result: result,
1085
1081
  evalStatus: evalStatus,
1086
1082
  retailerId: activeRetailer.id
1087
1083
  };
1088
- _context10.next = 22;
1084
+ _context10.prev = 18;
1085
+ _context10.next = 21;
1089
1086
  return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1090
1087
  headers: {
1091
1088
  Authorization: token
1092
1089
  }
1093
1090
  });
1094
1091
 
1095
- case 22:
1096
- _context10.next = 36;
1092
+ case 21:
1093
+ _context10.next = 26;
1097
1094
  break;
1098
1095
 
1099
- case 24:
1096
+ case 23:
1097
+ _context10.prev = 23;
1098
+ _context10.t1 = _context10["catch"](18);
1099
+ console.log(_context10.t1);
1100
+
1101
+ case 26:
1102
+ _context10.next = 42;
1103
+ break;
1104
+
1105
+ case 28:
1100
1106
  if (specialistDone) {
1101
- updateCompaniesList(evalStatus, result, activeRetailer.id);
1107
+ updateCompaniesList(evalStatus, result, activeRetailer.id, concept);
1102
1108
  }
1103
1109
 
1104
1110
  data = {
1105
- articleId: productSelected.article.id_article,
1106
- orderId: productSelected.orderId,
1111
+ articleId: product.article.id_article,
1112
+ orderId: product.orderId,
1107
1113
  concept: concept,
1108
1114
  evalStatus: evalStatus,
1109
1115
  retailerId: activeRetailer.id
1110
1116
  };
1111
- _context10.t1 = user.id_role;
1112
- _context10.next = _context10.t1 === 7 ? 29 : _context10.t1 === 8 ? 29 : _context10.t1 === 4 ? 31 : _context10.t1 === 5 ? 31 : 33;
1117
+ _context10.t2 = user.id_role;
1118
+ _context10.next = _context10.t2 === 7 ? 33 : _context10.t2 === 8 ? 33 : _context10.t2 === 4 ? 35 : _context10.t2 === 5 ? 35 : 37;
1113
1119
  break;
1114
1120
 
1115
- case 29:
1121
+ case 33:
1116
1122
  data.especialist = true;
1117
- return _context10.abrupt("break", 34);
1123
+ return _context10.abrupt("break", 38);
1118
1124
 
1119
- case 31:
1125
+ case 35:
1120
1126
  data.facilitator = true;
1121
- return _context10.abrupt("break", 34);
1127
+ return _context10.abrupt("break", 38);
1122
1128
 
1123
- case 33:
1124
- return _context10.abrupt("break", 34);
1129
+ case 37:
1130
+ return _context10.abrupt("break", 38);
1131
+
1132
+ case 38:
1133
+ console.log(data);
1125
1134
 
1126
- case 34:
1127
1135
  _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1128
1136
  headers: {
1129
1137
  Authorization: token
1130
1138
  }
1131
1139
  });
1132
1140
 
1141
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1133
1142
  setProduct(productTemp); //setModalSent(true);
1134
1143
 
1135
- case 36:
1144
+ case 42:
1136
1145
  case "end":
1137
1146
  return _context10.stop();
1138
1147
  }
1139
1148
  }
1140
- }, _callee10);
1149
+ }, _callee10, null, [[18, 23]]);
1141
1150
  }));
1142
1151
 
1143
1152
  return function sendToFacilitator(_x3) {
@@ -1164,6 +1173,21 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1164
1173
 
1165
1174
  var allowedRoles = [1, 4, 5, 6, 7, 8];
1166
1175
  var validUser = allowedRoles.indexOf(user === null || user === void 0 ? void 0 : user.id_role) !== -1;
1176
+
1177
+ if (!rol) {
1178
+ switch (user.id_role) {
1179
+ case 4:
1180
+ case 5:
1181
+ rol = "facilitator";
1182
+ break;
1183
+
1184
+ case 7:
1185
+ case 8:
1186
+ rol = "especialist";
1187
+ break;
1188
+ }
1189
+ }
1190
+
1167
1191
  return productSelected.article["id_".concat(concept, "_").concat(rol)] === user.id_user && validUser;
1168
1192
  };
1169
1193
 
@@ -1173,7 +1197,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1173
1197
 
1174
1198
  var createComment = /*#__PURE__*/function () {
1175
1199
  var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e, body, tab) {
1176
- var _product$article2;
1200
+ var _product$article4;
1177
1201
 
1178
1202
  var concept, data;
1179
1203
  return _regenerator.default.wrap(function _callee11$(_context11) {
@@ -1199,7 +1223,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1199
1223
 
1200
1224
  case 10:
1201
1225
  data = {
1202
- articleId: product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.id_article,
1226
+ articleId: product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article,
1203
1227
  orderId: product === null || product === void 0 ? void 0 : product.orderId,
1204
1228
  message: body,
1205
1229
  concept: concept,
@@ -1306,7 +1330,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1306
1330
 
1307
1331
  var setAssignation = /*#__PURE__*/function () {
1308
1332
  var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(assignationType, assignationId) {
1309
- var _product$article3;
1333
+ var _product$article5;
1310
1334
 
1311
1335
  var concept, productTemp, data;
1312
1336
  return _regenerator.default.wrap(function _callee13$(_context13) {
@@ -1336,7 +1360,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1336
1360
  data = (0, _defineProperty2.default)({
1337
1361
  articleList: [{
1338
1362
  orderId: product.orderId,
1339
- articleId: product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_article
1363
+ articleId: product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.id_article
1340
1364
  }],
1341
1365
  concept: concept
1342
1366
  }, "".concat(assignationType, "Id"), assignationId);
@@ -1364,10 +1388,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1364
1388
  };
1365
1389
  }();
1366
1390
 
1367
- var evaluationComplete = function evaluationComplete(tab) {
1391
+ var evaluationComplete = function evaluationComplete() {
1368
1392
  var concept = "";
1369
1393
 
1370
- switch (tab) {
1394
+ switch (activeTab) {
1371
1395
  case "Ficha técnica":
1372
1396
  concept = "datasheet";
1373
1397
  break;
@@ -1376,7 +1400,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1376
1400
  concept = "images";
1377
1401
  break;
1378
1402
 
1379
- default:
1403
+ case "Descripción":
1380
1404
  concept = "description";
1381
1405
  break;
1382
1406
  }
@@ -1470,9 +1494,26 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1470
1494
  }
1471
1495
  };
1472
1496
 
1473
- (0, _react.useEffect)(function () {
1474
- console.log(requiredNull[activeTab], evaluationComplete(activeTab));
1475
- }, [activeTab]);
1497
+ var specialistValid = function specialistValid(tab) {
1498
+ var concept = "";
1499
+
1500
+ switch (tab) {
1501
+ case "Ficha técnica":
1502
+ concept = "datasheet";
1503
+ break;
1504
+
1505
+ case "Imágenes":
1506
+ concept = "images";
1507
+ break;
1508
+
1509
+ case "Descripción":
1510
+ concept = "description";
1511
+ break;
1512
+ }
1513
+
1514
+ return product["".concat(concept, "_status")] === "IN_PROGRESS" || product["".concat(concept, "_status")] === "RF" || product["".concat(concept, "_status")] === "RA";
1515
+ };
1516
+
1476
1517
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1477
1518
  headerTop: headerTop,
1478
1519
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
@@ -1512,14 +1553,44 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1512
1553
  sendToFacilitator: sendToFacilitator,
1513
1554
  auditorAssigned: auditorAssigned,
1514
1555
  userAssigned: function userAssigned() {
1515
- return _userAssigned(activeTab, "facilitator");
1556
+ return _userAssigned(activeTab);
1516
1557
  }
1517
1558
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1518
1559
  tabsSections: tabsSections,
1519
- status: {
1520
- Descripción: product === null || product === void 0 ? void 0 : product.description_status,
1521
- "Ficha técnica": product === null || product === void 0 ? void 0 : product.datasheet_status,
1522
- Imágenes: product === null || product === void 0 ? void 0 : product.images_status
1560
+ status: // {
1561
+ // Descripción: product?.description_status,
1562
+ // "Ficha técnica": product?.datasheet_status,
1563
+ // Imágenes: product?.images_status,
1564
+ // }
1565
+ function status() {
1566
+ var _retailerService;
1567
+
1568
+ var concept = "";
1569
+
1570
+ switch (activeTab) {
1571
+ case "Ficha técnica":
1572
+ concept = "datasheet";
1573
+ break;
1574
+
1575
+ case "Imágenes":
1576
+ concept = "images";
1577
+ break;
1578
+
1579
+ case "Descripción":
1580
+ concept = "description";
1581
+ break;
1582
+ }
1583
+
1584
+ var retailerService = {};
1585
+
1586
+ var _servicesData$filter = servicesData.filter(function (service) {
1587
+ return service.id_retailer === activeRetailer.id && service.service === concept;
1588
+ });
1589
+
1590
+ var _servicesData$filter2 = (0, _slicedToArray2.default)(_servicesData$filter, 1);
1591
+
1592
+ retailerService = _servicesData$filter2[0];
1593
+ return (_retailerService = retailerService) === null || _retailerService === void 0 ? void 0 : _retailerService.status;
1523
1594
  },
1524
1595
  activeTab: activeTab,
1525
1596
  setActiveTab: setActiveTab,
@@ -1574,7 +1645,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1574
1645
  inputGroup: descriptions[0],
1575
1646
  updatedDescriptions: updatedDescriptions,
1576
1647
  setUpdatedDescriptions: setUpdatedDescriptions,
1577
- articleId: product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article,
1648
+ articleId: product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_article,
1578
1649
  version: version,
1579
1650
  dinamicHeight: true
1580
1651
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
@@ -1594,7 +1665,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1594
1665
  headerType: "input-name-header"
1595
1666
  }))]
1596
1667
  })
1597
- }), (_userAssigned(activeTab, "especialist" || "facilitator") || auditorAssigned()) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1668
+ }), (_userAssigned(activeTab) || auditorAssigned()) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1598
1669
  className: "commentary-box",
1599
1670
  children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1600
1671
  className: "commentary",
@@ -1639,7 +1710,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1639
1710
  }))
1640
1711
  })]
1641
1712
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1642
- buttonType: approveRejectButtons() || requiredNull[activeTab] === 0 || evaluationComplete(activeTab) ? "general-green-button" : "general-button-disabled",
1713
+ buttonType: evaluationComplete() && requiredNull[activeTab] === 0 && approveRejectButtons() ? "general-green-button" : "general-button-disabled",
1643
1714
  label: "Enviar evaluación",
1644
1715
  onClick: function onClick() {
1645
1716
  return sendToFacilitator();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.0.8",
3
+ "version": "21.0.9",
4
4
  "dependencies": {
5
5
  "@babel/runtime": "^7.17.2",
6
6
  "@storybook/addon-postcss": "^2.0.0",