contentoh-components-library 21.2.70 → 21.2.72

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.
@@ -37,7 +37,8 @@ var TagAndInput = function TagAndInput(_ref) {
37
37
  inputOnChange = _ref.inputOnChange,
38
38
  color = _ref.color,
39
39
  disabled = _ref.disabled,
40
- onKeyDown = _ref.onKeyDown;
40
+ onKeyDown = _ref.onKeyDown,
41
+ showTooltip = _ref.showTooltip;
41
42
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
42
43
  inputType: inputType,
43
44
  className: "input-container",
@@ -47,7 +48,7 @@ var TagAndInput = function TagAndInput(_ref) {
47
48
  text: label,
48
49
  headerType: "input-name-header",
49
50
  color: color
50
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
51
+ }), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
51
52
  className: "tooltip",
52
53
  children: label
53
54
  })]
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .title-container {\n //position: relative;\n .tooltip {\n display: none;\n position: absolute;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: 14px;\n line-height: 19px;\n left: 0;\n top: 0;\n height: fit-content;\n transition: display 2s;\n }\n\n &:hover {\n .tooltip {\n display: block;\n }\n }\n }\n\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n & + * {\n margin-top: ", "px;\n }\n"])), _variables.GlobalColors.white, function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .title-container {\n position: relative;\n .tooltip {\n display: none;\n position: absolute;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: 14px;\n line-height: 19px;\n left: 0;\n top: 0;\n height: fit-content;\n transition: display 2s;\n }\n\n &:hover {\n .tooltip {\n display: block;\n }\n }\n }\n\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n & + * {\n margin-top: ", "px;\n }\n"])), _variables.GlobalColors.white, function (_ref) {
19
19
  var color = _ref.color;
20
20
  return color ? color : _variables.GlobalColors.s5;
21
21
  }, _variables.FontFamily.Raleway, function (_ref2) {
@@ -67,7 +67,8 @@ var InputGroup = function InputGroup(_ref) {
67
67
  setUpdatedDatasheets: setUpdatedDatasheets,
68
68
  maxChar: (_dataInputs$input9 = dataInputs[input]) !== null && _dataInputs$input9 !== void 0 && _dataInputs$input9.max_chars ? (_dataInputs$input10 = dataInputs[input]) === null || _dataInputs$input10 === void 0 ? void 0 : _dataInputs$input10.max_chars : 999,
69
69
  optionList: (_dataInputs$input11 = dataInputs[input]) === null || _dataInputs$input11 === void 0 ? void 0 : _dataInputs$input11.option_list,
70
- description: (_dataInputs$input12 = dataInputs[input]) === null || _dataInputs$input12 === void 0 ? void 0 : _dataInputs$input12.description
70
+ description: (_dataInputs$input12 = dataInputs[input]) === null || _dataInputs$input12 === void 0 ? void 0 : _dataInputs$input12.description,
71
+ showTooltip: true
71
72
  }, index + "-" + ((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.value) + "-" + ((_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
72
73
  inputId: input.id,
73
74
  index: index,
@@ -82,7 +83,8 @@ var InputGroup = function InputGroup(_ref) {
82
83
  articleId: articleId,
83
84
  version: version,
84
85
  dinamicHeight: dinamicHeight,
85
- description: input === null || input === void 0 ? void 0 : input.description
86
+ description: input === null || input === void 0 ? void 0 : input.description,
87
+ showTooltip: true
86
88
  }, index + "-" + (input === null || input === void 0 ? void 0 : input.value));
87
89
  })
88
90
  })]
@@ -31,73 +31,66 @@ RetailerProductEditionDefault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oFx2jJmU53UA8GZU1SFDvDlR1QZR-EtANz2wfNs8RqY_mKTz5WjY7RdGTFVkowTv-Y1Q9T7x_fpv_5o-nB5GzLBQoHwTLQ_vjguSLH17l2BUn0QxLi2WJVs-qWX4ze4QysADVxYOlMkAQql328oqoqdXRbZrntnxYxa5EMpmref1bGbSOFk4qgHax4qa3gD2_h291NLjCZS7IMGDSIhOk9r7irItbojM01Q",
35
35
  productSelected: {
36
36
  services: {
37
37
  datasheets: 1,
38
38
  descriptions: 1,
39
39
  images: 1
40
40
  },
41
- orderId: 149,
42
- status: "IE",
43
- datasheet_status: "IE",
41
+ orderId: 3321,
42
+ status: "PA",
43
+ datasheet_status: "AC",
44
44
  prio: "none",
45
45
  version: 2,
46
- description_status: "IE",
47
- images_status: "IE",
46
+ description_status: "AC",
47
+ images_status: "PA",
48
+ statusByRetailer: {
49
+ 58: {
50
+ datasheet: "AC",
51
+ description: "AC",
52
+ images: "PA"
53
+ }
54
+ },
48
55
  article: {
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
- status: "NULL",
56
+ id_article: 85655,
57
+ id_category: "2052",
58
+ name: "EXTENSION P/ EXTERIOR 3X10 AWG 10M ROJO",
59
+ upc: "165679",
60
+ timestamp: "2022-11-01T15:46:51.000Z",
61
+ id_user: 1436,
62
+ status: null,
56
63
  active: 1,
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,
64
+ company_id: 409,
65
+ SKU: null,
66
+ Descripcion: null,
67
+ Proveedor: null,
68
+ id_proveedor: 0,
69
+ company_name: "HIGHLINE-WARREN LLC",
70
+ country: null,
71
+ id_order: 3321,
72
+ id_datasheet_especialist: 1248,
73
+ id_datasheet_facilitator: null,
74
+ id_description_especialist: 1248,
75
+ id_description_facilitator: null,
76
+ id_images_especialist: null,
77
+ id_images_facilitator: null,
78
+ id_auditor: null,
68
79
  id_recepcionist: null,
69
- category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
70
- missingAttributes: 0,
71
- missingDescriptions: 0,
72
- missingImages: 0
80
+ category: "Eléctrico|Extensiones y Multicontactos|Extensiones y Multicontactos",
81
+ missingAttributes: null,
82
+ missingDescriptions: null,
83
+ missingImages: null
73
84
  },
74
85
  retailers: [{
75
86
  id: 58,
76
87
  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"]
80
- }, {
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"]
86
- }, {
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"]
92
- }, {
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"]
88
+ country: "México",
89
+ id_region: 1,
90
+ active: 1
98
91
  }],
99
- country: "México",
100
- upc: "222222222"
92
+ country: null,
93
+ upc: "165679"
101
94
  },
102
95
  location: {
103
96
  product: {
@@ -106,36 +99,36 @@ RetailerProductEditionDefault.args = {
106
99
  }
107
100
  },
108
101
  user: {
109
- id_user: 52,
110
- name: "FACILITADOR TXT PRUEBA",
111
- last_name: "",
112
- email: "azarate@contentoh.com",
113
- position: null,
102
+ id_user: 426,
103
+ name: "Especialista Textos",
104
+ last_name: " ",
105
+ email: "karafe3218@mom2kid.com",
106
+ position: "Tester",
114
107
  telephone: null,
115
108
  country: null,
116
- id_company: 2,
117
- id_cognito: "b2ce5b2a-609c-4e79-9ea9-2f74cff43889",
109
+ id_company: 254,
110
+ id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
118
111
  birth_Date: null,
119
112
  about_me: null,
120
113
  zip_code: null,
121
114
  address: null,
122
115
  job: null,
123
116
  id_stripe: null,
124
- id_role: 4,
117
+ id_role: 7,
125
118
  active: 1,
126
119
  is_retailer: 0,
127
- email_notify: 0,
120
+ email_notify: null,
128
121
  membership: {
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"
122
+ id: 750,
123
+ start_date: "2022-01-07T21:32:54.000Z",
124
+ end_date: "2023-01-07T21:32:54.000Z",
125
+ planID: 6,
126
+ plan: "prod_KvGd6YSTJyR3AP",
127
+ name: "Plan Small",
128
+ user_limit: "10",
129
+ products_limit: "1000",
130
+ type: "Enterprise"
138
131
  },
139
- src: "https://content-management-profile.s3.amazonaws.com/id-52/52.png?1662065576139"
132
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1667321494598"
140
133
  }
141
134
  };
@@ -770,62 +770,65 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
770
770
 
771
771
  var saveDescriptions = /*#__PURE__*/function () {
772
772
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
773
- var _product$article9;
774
-
775
- var productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
773
+ var _product$article9, productTemp, _articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
776
774
 
777
775
  return _regenerator.default.wrap(function _callee5$(_context5) {
778
776
  while (1) {
779
777
  switch (_context5.prev = _context5.next) {
780
778
  case 0:
779
+ if (!updatedDescriptions) {
780
+ _context5.next = 24;
781
+ break;
782
+ }
783
+
781
784
  setLoading(true);
782
785
  productTemp = product;
783
- articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
786
+ _articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
784
787
  dataObject = {
785
- articleId: articleId,
788
+ articleId: _articleId,
786
789
  articleData: updatedDescriptions
787
790
  };
788
791
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
789
- _context5.prev = 5;
790
- _context5.next = 8;
792
+ _context5.prev = 6;
793
+ _context5.next = 9;
791
794
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
792
795
  headers: {
793
796
  Authorization: token
794
797
  }
795
798
  });
796
799
 
797
- case 8:
800
+ case 9:
798
801
  res = _context5.sent;
799
802
 
800
803
  if (!(res.data.statusCode === 200)) {
801
- _context5.next = 18;
804
+ _context5.next = 19;
802
805
  break;
803
806
  }
804
807
 
805
808
  _JSON$parse2 = JSON.parse(res.data.body), newStatus = _JSON$parse2.newStatus, newArticleStatus = _JSON$parse2.newArticleStatus;
806
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
809
+ if (newArticleStatus) productTemp.status = newArticleStatus[_articleId];
807
810
  if (newStatus) productTemp.description_status = newStatus;
808
811
  setProduct(productTemp);
809
812
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
810
813
  setMessage("Descripciones guardadas con éxito");
811
- _context5.next = 18;
814
+ _context5.next = 19;
812
815
  return loadData();
813
816
 
814
- case 18:
815
- _context5.next = 23;
817
+ case 19:
818
+ _context5.next = 24;
816
819
  break;
817
820
 
818
- case 20:
819
- _context5.prev = 20;
820
- _context5.t0 = _context5["catch"](5);
821
+ case 21:
822
+ _context5.prev = 21;
823
+ _context5.t0 = _context5["catch"](6);
821
824
  console.log(_context5.t0);
822
825
 
823
- case 23:
826
+ case 24:
824
827
  case "end":
825
828
  return _context5.stop();
826
829
  }
827
830
  }
828
- }, _callee5, null, [[5, 20]]);
831
+ }, _callee5, null, [[6, 21]]);
829
832
  }));
830
833
 
831
834
  return function saveDescriptions() {
@@ -835,62 +838,65 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
835
838
 
836
839
  var saveDatasheets = /*#__PURE__*/function () {
837
840
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
838
- var _product$article10;
839
-
840
- var productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
841
+ var _product$article10, productTemp, _articleId2, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
841
842
 
842
843
  return _regenerator.default.wrap(function _callee6$(_context6) {
843
844
  while (1) {
844
845
  switch (_context6.prev = _context6.next) {
845
846
  case 0:
847
+ if (!(updatedDatasheets.length > 0)) {
848
+ _context6.next = 24;
849
+ break;
850
+ }
851
+
846
852
  setLoading(true);
847
853
  productTemp = product;
848
- articleId = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
854
+ _articleId2 = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
849
855
  dataObject = {
850
- articleId: articleId,
856
+ articleId: _articleId2,
851
857
  articleData: updatedDatasheets
852
858
  };
853
859
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
854
- _context6.prev = 5;
855
- _context6.next = 8;
860
+ _context6.prev = 6;
861
+ _context6.next = 9;
856
862
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
857
863
  headers: {
858
864
  Authorization: token
859
865
  }
860
866
  });
861
867
 
862
- case 8:
868
+ case 9:
863
869
  res = _context6.sent;
864
870
 
865
871
  if (!(res.data.statusCode === 200)) {
866
- _context6.next = 18;
872
+ _context6.next = 19;
867
873
  break;
868
874
  }
869
875
 
870
876
  _JSON$parse3 = JSON.parse(res.data.body), newStatus = _JSON$parse3.newStatus, newArticleStatus = _JSON$parse3.newArticleStatus;
871
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
877
+ if (newArticleStatus) productTemp.status = newArticleStatus[_articleId2];
872
878
  if (newStatus) productTemp.datasheet_status = newStatus;
873
879
  setProduct(productTemp);
874
880
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
875
881
  setMessage("Fichas técnicas guardadas");
876
- _context6.next = 18;
882
+ _context6.next = 19;
877
883
  return loadData();
878
884
 
879
- case 18:
880
- _context6.next = 23;
885
+ case 19:
886
+ _context6.next = 24;
881
887
  break;
882
888
 
883
- case 20:
884
- _context6.prev = 20;
885
- _context6.t0 = _context6["catch"](5);
889
+ case 21:
890
+ _context6.prev = 21;
891
+ _context6.t0 = _context6["catch"](6);
886
892
  console.log(_context6.t0);
887
893
 
888
- case 23:
894
+ case 24:
889
895
  case "end":
890
896
  return _context6.stop();
891
897
  }
892
898
  }
893
- }, _callee6, null, [[5, 20]]);
899
+ }, _callee6, null, [[6, 21]]);
894
900
  }));
895
901
 
896
902
  return function saveDatasheets() {
@@ -1219,7 +1225,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1219
1225
 
1220
1226
  var sendToFacilitator = /*#__PURE__*/function () {
1221
1227
  var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
1222
- var concept, productTemp, evalStatus, _articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1228
+ var concept, productTemp, evalStatus, _articleId3, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1223
1229
 
1224
1230
  return _regenerator.default.wrap(function _callee9$(_context9) {
1225
1231
  while (1) {
@@ -1230,10 +1236,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1230
1236
  concept = getConcept(activeTab);
1231
1237
  productTemp = (0, _objectSpread2.default)({}, product);
1232
1238
  evalStatus = retailerStatus;
1233
- _articleId = product.article.id_article;
1239
+ _articleId3 = product.article.id_article;
1234
1240
  orderId = product.orderId;
1235
1241
  data = {
1236
- articleId: _articleId,
1242
+ articleId: _articleId3,
1237
1243
  orderId: orderId,
1238
1244
  concept: concept,
1239
1245
  evalStatus: evalStatus,
@@ -1287,7 +1293,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1287
1293
  }
1288
1294
 
1289
1295
  _JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
1290
- if (newOrderStatus) productTemp.status = newArticleStatus[_articleId];
1296
+ if (newOrderStatus) productTemp.status = newArticleStatus[_articleId3];
1291
1297
  productTemp["".concat(concept, "_status")] = newStatus;
1292
1298
  _context9.next = 27;
1293
1299
  return loadData();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.70",
3
+ "version": "21.2.72",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -27,6 +27,7 @@ export const TagAndInput = ({
27
27
  color,
28
28
  disabled,
29
29
  onKeyDown,
30
+ showTooltip,
30
31
  }) => {
31
32
  return (
32
33
  <Container
@@ -40,7 +41,7 @@ export const TagAndInput = ({
40
41
  headerType={"input-name-header"}
41
42
  color={color}
42
43
  />
43
- <span className="tooltip">{label}</span>
44
+ {showTooltip && <span className="tooltip">{label}</span>}
44
45
  </div>
45
46
  <GeneralInput
46
47
  inputId={inputId}
@@ -3,7 +3,7 @@ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
3
 
4
4
  export const Container = styled.div`
5
5
  .title-container {
6
- //position: relative;
6
+ position: relative;
7
7
  .tooltip {
8
8
  display: none;
9
9
  position: absolute;
@@ -71,6 +71,7 @@ export const InputGroup = ({
71
71
  }
72
72
  optionList={dataInputs[input]?.option_list}
73
73
  description={dataInputs[input]?.description}
74
+ showTooltip={true}
74
75
  />
75
76
  ) : (
76
77
  <TagAndInput
@@ -89,6 +90,7 @@ export const InputGroup = ({
89
90
  version={version}
90
91
  dinamicHeight={dinamicHeight}
91
92
  description={input?.description}
93
+ showTooltip={true}
92
94
  />
93
95
  )
94
96
  )}
@@ -16,117 +16,104 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJiMmNlNWIyYS02MDljLTRlNzktOWVhOS0yZjc0Y2ZmNDM4ODkiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImIyY2U1YjJhLTYwOWMtNGU3OS05ZWE5LTJmNzRjZmY0Mzg4OSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhYW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1rIiwiZXZlbnRfaWQiOiI2ZWY3Y2UxYy0xYjBjLTRkNGYtYTc3Yy1jMWIwYTk0ZjIwOWEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2NzMyMTQ5NCwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2NzMyNTA5NCwiaWF0IjoxNjY3MzIxNDk0LCJlbWFpbCI6ImthcmFmZTMyMThAbW9tMmtpZC5jb20ifQ.GjBtY-LW5eYzvNfrIJOdb9pDMU_CZlIxRAn1ZszjMfWNU9s8s_j6o4_2x0J7AyiSjgu9TaLRcRpF6FZ5pzwNGs8G5AxnO3r_PIg2mznM44QLnt5PTfdoFx2jJmU53UA8GZU1SFDvDlR1QZR-EtANz2wfNs8RqY_mKTz5WjY7RdGTFVkowTv-Y1Q9T7x_fpv_5o-nB5GzLBQoHwTLQ_vjguSLH17l2BUn0QxLi2WJVs-qWX4ze4QysADVxYOlMkAQql328oqoqdXRbZrntnxYxa5EMpmref1bGbSOFk4qgHax4qa3gD2_h291NLjCZS7IMGDSIhOk9r7irItbojM01Q",
20
20
  productSelected: {
21
21
  services: {
22
22
  datasheets: 1,
23
23
  descriptions: 1,
24
24
  images: 1,
25
25
  },
26
- orderId: 149,
27
- status: "IE",
28
- datasheet_status: "IE",
26
+ orderId: 3321,
27
+ status: "PA",
28
+ datasheet_status: "AC",
29
29
  prio: "none",
30
30
  version: 2,
31
- description_status: "IE",
32
- images_status: "IE",
31
+ description_status: "AC",
32
+ images_status: "PA",
33
+ statusByRetailer: {
34
+ 58: {
35
+ datasheet: "AC",
36
+ description: "AC",
37
+ images: "PA",
38
+ },
39
+ },
33
40
  article: {
34
- id_article: 76225,
35
- id_category: "2028",
36
- name: "Para documentar",
37
- upc: "222222222",
38
- timestamp: "2022-08-03T06:00:23.000Z",
39
- id_user: 59,
40
- status: "NULL",
41
+ id_article: 85655,
42
+ id_category: "2052",
43
+ name: "EXTENSION P/ EXTERIOR 3X10 AWG 10M ROJO",
44
+ upc: "165679",
45
+ timestamp: "2022-11-01T15:46:51.000Z",
46
+ id_user: 1436,
47
+ status: null,
41
48
  active: 1,
42
- company_id: 1,
43
- company_name: "Cadena Ismael",
44
- country: "México",
45
- id_order: 149,
46
- id_datasheet_especialist: 54,
47
- id_datasheet_facilitator: 52,
48
- id_description_especialist: 54,
49
- id_description_facilitator: 52,
50
- id_images_especialist: 55,
51
- id_images_facilitator: 53,
52
- id_auditor: 37,
49
+ company_id: 409,
50
+ SKU: null,
51
+ Descripcion: null,
52
+ Proveedor: null,
53
+ id_proveedor: 0,
54
+ company_name: "HIGHLINE-WARREN LLC",
55
+ country: null,
56
+ id_order: 3321,
57
+ id_datasheet_especialist: 1248,
58
+ id_datasheet_facilitator: null,
59
+ id_description_especialist: 1248,
60
+ id_description_facilitator: null,
61
+ id_images_especialist: null,
62
+ id_images_facilitator: null,
63
+ id_auditor: null,
53
64
  id_recepcionist: null,
54
- category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
55
- missingAttributes: 0,
56
- missingDescriptions: 0,
57
- missingImages: 0,
65
+ category:
66
+ "Eléctrico|Extensiones y Multicontactos|Extensiones y Multicontactos",
67
+ missingAttributes: null,
68
+ missingDescriptions: null,
69
+ missingImages: null,
58
70
  },
59
71
  retailers: [
60
72
  {
61
73
  id: 58,
62
74
  name: "The Home Depot Golden",
63
- percentage: 66.66666666666667,
64
- image:
65
- "https://content-management-images.s3.amazonaws.com/retailers/58.png",
66
- services: ["CA", "CA", "AS", "NA", "NA", "NA", "NA", "NA"],
67
- },
68
- {
69
- id: 59,
70
- name: "The Home Depot Platinum",
71
- percentage: 66.66666666666667,
72
- image:
73
- "https://content-management-images.s3.amazonaws.com/retailers/59.png",
74
- services: ["NA", "NA", "NA", "AS", "NA", "NA", "NA", "NA"],
75
- },
76
- {
77
- id: 60,
78
- name: "The Home Depot Resizing",
79
- percentage: null,
80
- image:
81
- "https://content-management-images.s3.amazonaws.com/retailers/60.png",
82
- services: ["NA", "NA", "NA", "NA", "AS", "NA", "NA", "NA"],
83
- },
84
- {
85
- id: 61,
86
- name: "Home Depot TAB",
87
- percentage: null,
88
- image:
89
- "https://content-management-images.s3.amazonaws.com/retailers/61.png",
90
- services: ["NA", "NA", "NA", "NA", "NA", "CA", "CA", "AS"],
75
+ country: "México",
76
+ id_region: 1,
77
+ active: 1,
91
78
  },
92
79
  ],
93
- country: "México",
94
- upc: "222222222",
80
+ country: null,
81
+ upc: "165679",
95
82
  },
96
83
  location: {
97
84
  product: { articleId: 109485, versionId: 3 },
98
85
  },
99
86
  user: {
100
- id_user: 52,
101
- name: "FACILITADOR TXT PRUEBA",
102
- last_name: "",
103
- email: "azarate@contentoh.com",
104
- position: null,
87
+ id_user: 426,
88
+ name: "Especialista Textos",
89
+ last_name: " ",
90
+ email: "karafe3218@mom2kid.com",
91
+ position: "Tester",
105
92
  telephone: null,
106
93
  country: null,
107
- id_company: 2,
108
- id_cognito: "b2ce5b2a-609c-4e79-9ea9-2f74cff43889",
94
+ id_company: 254,
95
+ id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
109
96
  birth_Date: null,
110
97
  about_me: null,
111
98
  zip_code: null,
112
99
  address: null,
113
100
  job: null,
114
101
  id_stripe: null,
115
- id_role: 4,
102
+ id_role: 7,
116
103
  active: 1,
117
104
  is_retailer: 0,
118
- email_notify: 0,
105
+ email_notify: null,
119
106
  membership: {
120
- id: 2,
121
- start_date: "2021-11-05T02:35:12.000Z",
122
- end_date: "2022-11-05T02:34:49.000Z",
123
- planID: 1,
124
- plan: "prod_KtkvuFFLpOdP6e",
125
- name: "Plan Free",
126
- user_limit: "1",
127
- products_limit: "3",
128
- type: "PyMES",
107
+ id: 750,
108
+ start_date: "2022-01-07T21:32:54.000Z",
109
+ end_date: "2023-01-07T21:32:54.000Z",
110
+ planID: 6,
111
+ plan: "prod_KvGd6YSTJyR3AP",
112
+ name: "Plan Small",
113
+ user_limit: "10",
114
+ products_limit: "1000",
115
+ type: "Enterprise",
129
116
  },
130
- src: "https://content-management-profile.s3.amazonaws.com/id-52/52.png?1662065576139",
117
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1667321494598",
131
118
  },
132
119
  };
@@ -441,70 +441,82 @@ export const RetailerProductEdition = ({
441
441
  };
442
442
 
443
443
  const saveDescriptions = async () => {
444
- setLoading(true);
445
- const productTemp = product;
446
- const articleId = product?.article?.id_article;
447
- const dataObject = {
448
- articleId,
449
- articleData: updatedDescriptions,
450
- };
451
- if (product?.orderId) dataObject["orderId"] = product?.orderId;
452
- try {
453
- const res = await axios.put(
454
- `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
455
- dataObject,
456
- {
457
- headers: {
458
- Authorization: token,
459
- },
460
- }
461
- );
462
- if (res.data.statusCode === 200) {
463
- const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
464
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
465
- if (newStatus) productTemp.description_status = newStatus;
466
- setProduct(productTemp);
467
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
444
+ if (updatedDescriptions) {
445
+ setLoading(true);
446
+ const productTemp = product;
447
+ const articleId = product?.article?.id_article;
448
+ const dataObject = {
449
+ articleId,
450
+ articleData: updatedDescriptions,
451
+ };
452
+ if (product?.orderId) dataObject["orderId"] = product?.orderId;
453
+ try {
454
+ const res = await axios.put(
455
+ `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
456
+ dataObject,
457
+ {
458
+ headers: {
459
+ Authorization: token,
460
+ },
461
+ }
462
+ );
463
+ if (res.data.statusCode === 200) {
464
+ const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
465
+ if (newArticleStatus)
466
+ productTemp.status = newArticleStatus[articleId];
467
+ if (newStatus) productTemp.description_status = newStatus;
468
+ setProduct(productTemp);
469
+ sessionStorage.setItem(
470
+ "productSelected",
471
+ JSON.stringify(productTemp)
472
+ );
468
473
 
469
- setMessage("Descripciones guardadas con éxito");
470
- await loadData();
474
+ setMessage("Descripciones guardadas con éxito");
475
+ await loadData();
476
+ }
477
+ } catch (error) {
478
+ console.log(error);
471
479
  }
472
- } catch (error) {
473
- console.log(error);
474
480
  }
475
481
  };
476
482
 
477
483
  const saveDatasheets = async () => {
478
- setLoading(true);
479
- const productTemp = product;
480
- const articleId = product?.article?.id_article;
481
- const dataObject = {
482
- articleId,
483
- articleData: updatedDatasheets,
484
- };
485
- if (product?.orderId) dataObject["orderId"] = product?.orderId;
486
- try {
487
- const res = await axios.put(
488
- `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?datasheet=true&version=${version}`,
489
- dataObject,
490
- {
491
- headers: {
492
- Authorization: token,
493
- },
494
- }
495
- );
496
- if (res.data.statusCode === 200) {
497
- const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
498
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
499
- if (newStatus) productTemp.datasheet_status = newStatus;
500
- setProduct(productTemp);
501
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
484
+ if (updatedDatasheets.length > 0) {
485
+ setLoading(true);
486
+ const productTemp = product;
487
+ const articleId = product?.article?.id_article;
488
+ const dataObject = {
489
+ articleId,
490
+ articleData: updatedDatasheets,
491
+ };
492
+ if (product?.orderId) dataObject["orderId"] = product?.orderId;
493
+ try {
494
+ const res = await axios.put(
495
+ `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?datasheet=true&version=${version}`,
496
+ dataObject,
497
+ {
498
+ headers: {
499
+ Authorization: token,
500
+ },
501
+ }
502
+ );
503
+ if (res.data.statusCode === 200) {
504
+ const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
505
+ if (newArticleStatus)
506
+ productTemp.status = newArticleStatus[articleId];
507
+ if (newStatus) productTemp.datasheet_status = newStatus;
508
+ setProduct(productTemp);
509
+ sessionStorage.setItem(
510
+ "productSelected",
511
+ JSON.stringify(productTemp)
512
+ );
502
513
 
503
- setMessage("Fichas técnicas guardadas");
504
- await loadData();
514
+ setMessage("Fichas técnicas guardadas");
515
+ await loadData();
516
+ }
517
+ } catch (error) {
518
+ console.log(error);
505
519
  }
506
- } catch (error) {
507
- console.log(error);
508
520
  }
509
521
  };
510
522