contentoh-components-library 21.1.23 → 21.1.24

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.
@@ -19,6 +19,6 @@ var Container = _styledComponents.default.div(_templateObject || (_templateObjec
19
19
 
20
20
  exports.Container = Container;
21
21
 
22
- var Slider = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-family: sans-serif;\n margin: auto;\n background: #281f33;\n border-radius: 6px;\n width: 310px !important;\n padding: 16px;\n padding-top: 20px;\n box-sizing: border-box;\n position: absolute;\n cursor: default;\n z-index: 2;\n &.top-slide {\n top: calc(300% - 100px);\n left: calc(580px / 2);\n }\n &.bottom-slide {\n top: calc(100%);\n left: calc(-280px / 2);\n }\n #div-slider {\n width: 310px;\n }\n ul,\n li {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n .slider {\n position: relative;\n max-width: 300px;\n width: 100%;\n height: 270px;\n margin: 0;\n span {\n font-family: \"Avenir Next\";\n font-style: normal;\n font-weight: 700;\n font-size: 15px;\n line-height: 15px;\n text-align: center;\n letter-spacing: -0.015em;\n color: #fafafa;\n display: flex;\n justify-content: center;\n background-color: #281f33;\n & + * {\n margin-top: 10px;\n }\n }\n li {\n position: absolute;\n left: 0px;\n top: 0px;\n opacity: 0;\n width: inherit;\n height: inherit;\n transition: opacity 0.5s;\n background: transparent;\n img {\n width: 100%;\n height: 180px;\n border-radius: 4px;\n background-color: #fafafa;\n & + * {\n margin-top: 10px;\n }\n }\n p {\n font-family: \"Avenir Next\";\n font-style: normal;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n text-align: center;\n letter-spacing: -0.015em;\n color: #fafafa;\n background-color: #281f33;\n }\n div {\n background-color: #fafafa;\n height: 180px;\n border-radius: 4px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n img {\n width: 90%;\n }\n & + * {\n margin-top: 13px;\n }\n }\n }\n .end-div {\n div {\n height: 130px;\n width: 100%;\n background-color: #fafafa;\n display: flex;\n align-items: center;\n border-radius: 4px;\n img {\n width: 100%;\n height: 115px;\n object-fit: contain;\n }\n }\n .lema-end {\n justify-content: center;\n justify-content: space-evenly;\n height: 110px;\n background-color: #281f33;\n flex-direction: column;\n justify-content: space-evenly;\n border-radius: inherit;\n }\n button {\n display: none;\n justify-content: center;\n align-items: center;\n padding: 10px;\n width: 160px;\n height: 30px;\n border: 1px solid #d4d1d7;\n border-radius: 15px;\n color: #fafafa;\n background-color: #281f33;\n font-family: \"Avenir Next\";\n font-style: normal;\n font-weight: 400;\n font-size: 18px;\n line-height: 25px;\n letter-spacing: -0.015em;\n position: absolute;\n left: 22%;\n top: 90%;\n cursor: pointer;\n }\n }\n }\n li:first-child {\n opacity: 1;\n }\n li:target {\n opacity: 1;\n }\n .menu {\n margin: 0;\n text-align: center;\n li {\n display: inline-block;\n text-align: center;\n & + * {\n margin-left: 15px;\n }\n a {\n display: inline-block;\n text-decoration: none;\n background-color: #c4c4c4;\n width: 10px;\n height: 10px;\n border-radius: 100%;\n }\n #slidea1 {\n background-color: #e33aa9;\n }\n }\n }\n"])));
22
+ var Slider = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-family: sans-serif;\n margin: auto;\n background: #281f33;\n border-radius: 6px;\n width: 310px !important;\n padding: 16px;\n padding-top: 20px;\n box-sizing: border-box;\n position: absolute;\n cursor: default;\n z-index: 2;\n &.top-slide {\n top: calc(300% - 100px);\n left: calc(580px / 2);\n }\n &.bottom-slide {\n top: calc(100%);\n left: calc(-280px / 2);\n }\n #div-slider {\n width: 310px;\n }\n ul,\n li {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n .slider {\n position: relative;\n max-width: 300px;\n width: 100%;\n height: 270px;\n margin: 0;\n span {\n font-family: \"Avenir Next\";\n font-style: normal;\n font-weight: 500;\n font-size: 15px;\n line-height: 15px;\n text-align: center;\n letter-spacing: -0.015em;\n color: #fafafa;\n display: flex;\n justify-content: center;\n background-color: #281f33;\n & + * {\n margin-top: 10px;\n }\n }\n li {\n position: absolute;\n left: 0px;\n top: 0px;\n opacity: 0;\n width: inherit;\n height: inherit;\n transition: opacity 0.5s;\n background: transparent;\n img {\n width: 100%;\n height: 180px;\n border-radius: 4px;\n background-color: #fafafa;\n & + * {\n margin-top: 10px;\n }\n }\n p {\n font-family: \"Avenir Next\";\n font-style: normal;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n text-align: center;\n letter-spacing: -0.015em;\n color: #fafafa;\n background-color: #281f33;\n }\n div {\n background-color: #fafafa;\n height: 180px;\n border-radius: 4px;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n img {\n width: 90%;\n }\n & + * {\n margin-top: 13px;\n }\n }\n }\n .end-div {\n div {\n height: 130px;\n width: 100%;\n background-color: #fafafa;\n display: flex;\n align-items: center;\n border-radius: 4px;\n img {\n width: 100%;\n height: 115px;\n object-fit: contain;\n }\n }\n .lema-end {\n justify-content: center;\n justify-content: space-evenly;\n height: 110px;\n background-color: #281f33;\n flex-direction: column;\n justify-content: space-evenly;\n border-radius: inherit;\n }\n button {\n display: none;\n justify-content: center;\n align-items: center;\n padding: 10px;\n width: 160px;\n height: 30px;\n border: 1px solid #d4d1d7;\n border-radius: 15px;\n color: #fafafa;\n background-color: #281f33;\n font-family: \"Avenir Next\";\n font-style: normal;\n font-weight: 400;\n font-size: 18px;\n line-height: 25px;\n letter-spacing: -0.015em;\n position: absolute;\n left: 22%;\n top: 90%;\n cursor: pointer;\n }\n }\n }\n li:first-child {\n opacity: 1;\n }\n li:target {\n opacity: 1;\n }\n .menu {\n margin: 0;\n text-align: center;\n li {\n display: inline-block;\n text-align: center;\n & + * {\n margin-left: 15px;\n }\n a {\n display: inline-block;\n text-decoration: none;\n background-color: #c4c4c4;\n width: 10px;\n height: 10px;\n border-radius: 100%;\n }\n #slidea1 {\n background-color: #e33aa9;\n }\n }\n }\n"])));
23
23
 
24
24
  exports.Slider = Slider;
@@ -31,90 +31,83 @@ ProviderProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjYwY2NjYS1mOTA2LTQ5NzAtODkyYy02ZDE1MmU4MzJlNWQiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImQ2NjBjY2NhLWY5MDYtNDk3MC04OTJjLTZkMTUyZTgzMmU1ZCIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJiY2ZhOGZlNi0wMDRjLTQ3NzAtODFjOC01YmNmMmMxMzM3YmIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NTkxMTI4NywibmFtZSI6IlRIRCBQcm92ZWVkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMTExMTExIiwiZXhwIjoxNjU1OTE0ODg3LCJpYXQiOjE2NTU5MTEyODcsImVtYWlsIjoidGhkQGFsbGZyZWVtYWlsLm5ldCJ9.MWZiRXTcH2fBgHASZ-6rIr43-WzIkp48ToBS4XQgJt4klDp96qzZCO8o6siDK5ptw48CawlFT1nl4QszEA8b6WeqgdjsMo-MhTFF9v0QtYyjCZ97Sfs2roSLAU0pZC8-JT-yZV7auHfsoGzGWhR6CoDLQEtm0nk0pqJtwm2qObv1tZUeJUvS4qPRnLBX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BG8qCT2bv-zrqyFx6xyeKK85Ry-kRlQv3U2KrDasW6ea8zbNDJMJAGMu_7dDrk9mRUj0Mp-jW32T1IBOweWxivRKSYfWQzjMdJdOUcckCagVXp8zQ4W-DZJINI25iq1AEfl9--6WaTRybEdTLjKXgzzOmLCGk5QbUI2uSeT_3w7fZiHPlCDCFFTSgXaNKUqxnsyZ2llos97KKIhH7tmn7DBw8mTPTUFyxED6EzBc7mkCYrM1o0velAZF0bOYhiuNnA-TF0L8eqPIZ3_13WDzGjRk3_eOBM37z8AqlMtBCJYIyQFGf-uCIbpSG0yJzYTswrExCkLamlKDhwtQ",
35
35
  articleId: 238,
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- id_article: 55070,
40
- id_category: "2976",
41
- name: "TOALLERO CORTO ACCESS NEGRO ÉBANO",
42
- upc: "161788",
43
- timestamp: "2022-06-17T17:31:14.000Z",
39
+ id_article: 55081,
40
+ id_category: "157",
41
+ name: "Lavatrastes Axion toque de crema",
42
+ upc: "750954665375",
43
+ timestamp: "2022-06-17T18:43:45.000Z",
44
44
  status: "NULL",
45
- categoryName: "BAÑOS|ACCESORIOS PARA BAÑO|TOALLEROS",
45
+ categoryName: "CONSUMIBLES|PRODUCTOS DE LIMPIEZA Y LAVANDERÍA|JABONES Y LAVATRASTES",
46
46
  asignations: [],
47
47
  version: 1,
48
48
  version_status: null,
49
49
  retailersAvailable: [{
50
- id: 58,
51
- name: "The Home Depot Golden",
52
- country: "México",
53
- id_region: 1,
54
- active: 1
55
- }, {
56
- id: 59,
57
- name: "The Home Depot Platinum",
58
- country: "México",
59
- id_region: 1,
60
- active: 1
61
- }, {
62
- id: 60,
63
- name: "The Home Depot Resizing",
64
- country: "México",
65
- id_region: 1,
66
- active: 1
67
- }, {
68
- id: 61,
69
- name: "Home Depot TAB",
50
+ id: 4,
51
+ name: "Walmart Super y Superama",
70
52
  country: "México",
71
53
  id_region: 1,
72
54
  active: 1
73
55
  }],
74
- missing: {}
75
- },
76
- productToEdit: {
77
- idCategory: "2976",
78
- ArticleId: 55070,
79
- product: [{
80
- id_article: 55070,
81
- id_category: "2976",
82
- name: "TOALLERO CORTO ACCESS NEGRO ÉBANO",
83
- upc: "161788",
84
- timestamp: "2022-06-17T17:31:14.000Z",
85
- status: "NULL",
86
- categoryName: "BAÑOS|ACCESORIOS PARA BAÑO|TOALLEROS",
87
- asignations: [],
88
- version: 1,
89
- version_status: null,
90
- retailersAvailable: [{
91
- id: 58,
92
- name: "The Home Depot Golden",
93
- country: "México",
94
- id_region: 1,
95
- active: 1
96
- }, {
97
- id: 59,
98
- name: "The Home Depot Platinum",
99
- country: "México",
100
- id_region: 1,
101
- active: 1
102
- }, {
103
- id: 60,
104
- name: "The Home Depot Resizing",
105
- country: "México",
106
- id_region: 1,
107
- active: 1
108
- }, {
109
- id: 61,
110
- name: "Home Depot TAB",
111
- country: "México",
112
- id_region: 1,
113
- active: 1
114
- }],
115
- missing: {}
116
- }]
56
+ missing: {
57
+ datasheet: 10,
58
+ description: 6,
59
+ image: 32
60
+ }
117
61
  },
62
+ // productToEdit: {
63
+ // idCategory: "2976",
64
+ // ArticleId: 55070,
65
+ // product: [
66
+ // {
67
+ // id_article: 55070,
68
+ // id_category: "2976",
69
+ // name: "TOALLERO CORTO ACCESS NEGRO ÉBANO",
70
+ // upc: "161788",
71
+ // timestamp: "2022-06-17T17:31:14.000Z",
72
+ // status: "NULL",
73
+ // categoryName: "BAÑOS|ACCESORIOS PARA BAÑO|TOALLEROS",
74
+ // asignations: [],
75
+ // version: 1,
76
+ // version_status: null,
77
+ // retailersAvailable: [
78
+ // {
79
+ // id: 58,
80
+ // name: "The Home Depot Golden",
81
+ // country: "México",
82
+ // id_region: 1,
83
+ // active: 1,
84
+ // },
85
+ // {
86
+ // id: 59,
87
+ // name: "The Home Depot Platinum",
88
+ // country: "México",
89
+ // id_region: 1,
90
+ // active: 1,
91
+ // },
92
+ // {
93
+ // id: 60,
94
+ // name: "The Home Depot Resizing",
95
+ // country: "México",
96
+ // id_region: 1,
97
+ // active: 1,
98
+ // },
99
+ // {
100
+ // id: 61,
101
+ // name: "Home Depot TAB",
102
+ // country: "México",
103
+ // id_region: 1,
104
+ // active: 1,
105
+ // },
106
+ // ],
107
+ // missing: {},
108
+ // },
109
+ // ],
110
+ // },
118
111
  location: {
119
112
  product: {
120
113
  articleId: 109485,
@@ -152,6 +145,6 @@ ProviderProductEditionDefault.args = {
152
145
  products_limit: "1000",
153
146
  type: "Enterprise"
154
147
  },
155
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-1236/1236.png?1655911288481"
148
+ src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1656001689809"
156
149
  }
157
150
  };
@@ -760,49 +760,42 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
760
760
 
761
761
  var saveDescriptions = /*#__PURE__*/function () {
762
762
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
763
- var productTemp, dataObject;
763
+ var dataObject;
764
764
  return _regenerator.default.wrap(function _callee6$(_context6) {
765
765
  while (1) {
766
766
  switch (_context6.prev = _context6.next) {
767
767
  case 0:
768
768
  setLoading(true);
769
- productTemp = product;
770
769
  dataObject = {
771
770
  articleId: product === null || product === void 0 ? void 0 : product.id_article,
772
771
  articleData: updatedDescriptions
773
772
  };
774
773
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
775
- _context6.prev = 4;
776
- _context6.next = 7;
774
+ _context6.prev = 3;
775
+ _context6.next = 6;
777
776
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
778
777
  headers: {
779
778
  Authorization: token
780
779
  }
781
780
  });
782
781
 
783
- case 7:
784
- if (productTemp.status === "ASSIGNED") {
785
- productTemp.status = "IN_PROGRESS";
786
- setProduct(productTemp);
787
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
788
- }
789
-
782
+ case 6:
790
783
  setMessage("Descripciones guardadas con éxito");
791
784
  loadData();
792
- _context6.next = 15;
785
+ _context6.next = 13;
793
786
  break;
794
787
 
795
- case 12:
796
- _context6.prev = 12;
797
- _context6.t0 = _context6["catch"](4);
788
+ case 10:
789
+ _context6.prev = 10;
790
+ _context6.t0 = _context6["catch"](3);
798
791
  console.log(_context6.t0);
799
792
 
800
- case 15:
793
+ case 13:
801
794
  case "end":
802
795
  return _context6.stop();
803
796
  }
804
797
  }
805
- }, _callee6, null, [[4, 12]]);
798
+ }, _callee6, null, [[3, 10]]);
806
799
  }));
807
800
 
808
801
  return function saveDescriptions() {
@@ -833,28 +826,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
833
826
 
834
827
  case 6:
835
828
  setMessage("Fichas técnicas guardadas");
836
-
837
- if (productTemp.status === "ASSIGNED") {
838
- productTemp.status = "IN_PROGRESS";
839
- setProduct(productTemp);
840
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
841
- }
842
-
843
829
  loadData();
844
- _context7.next = 14;
830
+ _context7.next = 13;
845
831
  break;
846
832
 
847
- case 11:
848
- _context7.prev = 11;
833
+ case 10:
834
+ _context7.prev = 10;
849
835
  _context7.t0 = _context7["catch"](3);
850
836
  console.log(_context7.t0);
851
837
 
852
- case 14:
838
+ case 13:
853
839
  case "end":
854
840
  return _context7.stop();
855
841
  }
856
842
  }
857
- }, _callee7, null, [[3, 11]]);
843
+ }, _callee7, null, [[3, 10]]);
858
844
  }));
859
845
 
860
846
  return function saveDatasheets() {
@@ -1225,9 +1211,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1225
1211
  };
1226
1212
 
1227
1213
  var downloadImages = function downloadImages() {
1228
- selectedImages.forEach(function (e) {
1214
+ var _images$values3;
1215
+
1216
+ selectedImages.length > 0 ? selectedImages.forEach(function (e) {
1229
1217
  if (e.id) {
1230
- (0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.article.upc, "_").concat(e.name, ".").concat(e.ext));
1218
+ (0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.upc || product.article.upc, "_").concat(e.name, ".").concat(e.ext));
1219
+ }
1220
+ }) : images === null || images === void 0 ? void 0 : (_images$values3 = images.values) === null || _images$values3 === void 0 ? void 0 : _images$values3.forEach(function (e) {
1221
+ if (e.id) {
1222
+ (0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.upc || product.article.upc, "_").concat(e.name, ".").concat(e.ext));
1231
1223
  }
1232
1224
  });
1233
1225
  };
@@ -1297,26 +1289,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1297
1289
  }
1298
1290
  };
1299
1291
 
1300
- var specialistValid = function specialistValid(tab) {
1301
- var concept = "";
1302
-
1303
- switch (tab) {
1304
- case "Ficha técnica":
1305
- concept = "datasheet";
1306
- break;
1307
-
1308
- case "Imágenes":
1309
- concept = "images";
1310
- break;
1311
-
1312
- case "Descripción":
1313
- concept = "description";
1314
- break;
1315
- }
1316
-
1317
- return product["".concat(concept, "_status")] === "IN_PROGRESS" || product["".concat(concept, "_status")] === "RF" || product["".concat(concept, "_status")] === "RA";
1318
- };
1319
-
1320
1292
  var confirmStatusComplete = function confirmStatusComplete() {
1321
1293
  var datasheet_status = product.datasheet_status,
1322
1294
  description_status = product.description_status,
@@ -1331,7 +1303,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1331
1303
 
1332
1304
  var sendEvaluation = /*#__PURE__*/function () {
1333
1305
  var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
1334
- var data, retailerId, _product$id_order2, _product$id_order3, _productTemp, concept;
1306
+ var data, retailerId, _product$id_order2, _product$id_order3, productTemp, concept;
1335
1307
 
1336
1308
  return _regenerator.default.wrap(function _callee13$(_context13) {
1337
1309
  while (1) {
@@ -1365,9 +1337,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1365
1337
  break;
1366
1338
 
1367
1339
  case 9:
1368
- _productTemp = product;
1340
+ productTemp = product;
1369
1341
  concept = getConcept(activeTab);
1370
- _productTemp["".concat(concept, "_status")] = "Evaluated";
1342
+ productTemp["".concat(concept, "_status")] = "Evaluated";
1371
1343
  data = {
1372
1344
  articleId: product.id_article,
1373
1345
  orderId: (_product$id_order3 = product.id_order) !== null && _product$id_order3 !== void 0 ? _product$id_order3 : product.orderId,
@@ -1381,16 +1353,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1381
1353
  }
1382
1354
  });
1383
1355
 
1384
- setProduct(_productTemp);
1356
+ setProduct(productTemp);
1385
1357
  setProductEdit({
1386
- ArticleId: _productTemp.id_article,
1387
- idCategory: _productTemp.article.id_category,
1388
- product: _productTemp
1358
+ ArticleId: productTemp.id_article,
1359
+ idCategory: productTemp.article.id_category,
1360
+ product: productTemp
1389
1361
  });
1390
1362
  sessionStorage.setItem("productEdit", JSON.stringify({
1391
- ArticleId: _productTemp.id_article,
1392
- idCategory: _productTemp.article.id_category,
1393
- product: _productTemp
1363
+ ArticleId: productTemp.id_article,
1364
+ idCategory: productTemp.article.id_category,
1365
+ product: productTemp
1394
1366
  }));
1395
1367
  setOrigin(function (prev) {
1396
1368
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, "Evaluated"));
@@ -1441,7 +1441,13 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1441
1441
  }();
1442
1442
 
1443
1443
  var downloadImages = function downloadImages() {
1444
- selectedImages.forEach(function (e) {
1444
+ var _images$values3;
1445
+
1446
+ selectedImages.length > 0 ? selectedImages.forEach(function (e) {
1447
+ if (e.id) {
1448
+ (0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.article.upc, "_").concat(e.name, ".").concat(e.ext));
1449
+ }
1450
+ }) : images === null || images === void 0 ? void 0 : (_images$values3 = images.values) === null || _images$values3 === void 0 ? void 0 : _images$values3.forEach(function (e) {
1445
1451
  if (e.id) {
1446
1452
  (0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.article.upc, "_").concat(e.name, ".").concat(e.ext));
1447
1453
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.23",
3
+ "version": "21.1.24",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -58,7 +58,7 @@ export const Slider = styled.div`
58
58
  span {
59
59
  font-family: "Avenir Next";
60
60
  font-style: normal;
61
- font-weight: 700;
61
+ font-weight: 500;
62
62
  font-size: 15px;
63
63
  line-height: 15px;
64
64
  text-align: center;
@@ -16,102 +16,86 @@ ProviderProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjYwY2NjYS1mOTA2LTQ5NzAtODkyYy02ZDE1MmU4MzJlNWQiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImQ2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vbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI3ZTU5YmI1Yy1mNjI1LTQ1NzMtYjMzYS00ZWM4YzFmMzMyNTIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjAwMTY4OCwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2NTYwMDUyODgsImlhdCI6MTY1NjAwMTY4OCwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.ZUKMejBG8qCT2bv-zrqyFx6xyeKK85Ry-kRlQv3U2KrDasW6ea8zbNDJMJAGMu_7dDrk9mRUj0Mp-jW32T1IBOweWxivRKSYfWQzjMdJdOUcckCagVXp8zQ4W-DZJINI25iq1AEfl9--6WaTRybEdTLjKXgzzOmLCGk5QbUI2uSeT_3w7fZiHPlCDCFFTSgXaNKUqxnsyZ2llos97KKIhH7tmn7DBw8mTPTUFyxED6EzBc7mkCYrM1o0velAZF0bOYhiuNnA-TF0L8eqPIZ3_13WDzGjRk3_eOBM37z8AqlMtBCJYIyQFGf-uCIbpSG0yJzYTswrExCkLamlKDhwtQ",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- id_article: 55070,
25
- id_category: "2976",
26
- name: "TOALLERO CORTO ACCESS NEGRO ÉBANO",
27
- upc: "161788",
28
- timestamp: "2022-06-17T17:31:14.000Z",
24
+ id_article: 55081,
25
+ id_category: "157",
26
+ name: "Lavatrastes Axion toque de crema",
27
+ upc: "750954665375",
28
+ timestamp: "2022-06-17T18:43:45.000Z",
29
29
  status: "NULL",
30
- categoryName: "BAÑOS|ACCESORIOS PARA BAÑO|TOALLEROS",
30
+ categoryName:
31
+ "CONSUMIBLES|PRODUCTOS DE LIMPIEZA Y LAVANDERÍA|JABONES Y LAVATRASTES",
31
32
  asignations: [],
32
33
  version: 1,
33
34
  version_status: null,
34
35
  retailersAvailable: [
35
36
  {
36
- id: 58,
37
- name: "The Home Depot Golden",
38
- country: "México",
39
- id_region: 1,
40
- active: 1,
41
- },
42
- {
43
- id: 59,
44
- name: "The Home Depot Platinum",
45
- country: "México",
46
- id_region: 1,
47
- active: 1,
48
- },
49
- {
50
- id: 60,
51
- name: "The Home Depot Resizing",
52
- country: "México",
53
- id_region: 1,
54
- active: 1,
55
- },
56
- {
57
- id: 61,
58
- name: "Home Depot TAB",
37
+ id: 4,
38
+ name: "Walmart Super y Superama",
59
39
  country: "México",
60
40
  id_region: 1,
61
41
  active: 1,
62
42
  },
63
43
  ],
64
- missing: {},
65
- },
66
- productToEdit: {
67
- idCategory: "2976",
68
- ArticleId: 55070,
69
- product: [
70
- {
71
- id_article: 55070,
72
- id_category: "2976",
73
- name: "TOALLERO CORTO ACCESS NEGRO ÉBANO",
74
- upc: "161788",
75
- timestamp: "2022-06-17T17:31:14.000Z",
76
- status: "NULL",
77
- categoryName: "BAÑOS|ACCESORIOS PARA BAÑO|TOALLEROS",
78
- asignations: [],
79
- version: 1,
80
- version_status: null,
81
- retailersAvailable: [
82
- {
83
- id: 58,
84
- name: "The Home Depot Golden",
85
- country: "México",
86
- id_region: 1,
87
- active: 1,
88
- },
89
- {
90
- id: 59,
91
- name: "The Home Depot Platinum",
92
- country: "México",
93
- id_region: 1,
94
- active: 1,
95
- },
96
- {
97
- id: 60,
98
- name: "The Home Depot Resizing",
99
- country: "México",
100
- id_region: 1,
101
- active: 1,
102
- },
103
- {
104
- id: 61,
105
- name: "Home Depot TAB",
106
- country: "México",
107
- id_region: 1,
108
- active: 1,
109
- },
110
- ],
111
- missing: {},
112
- },
113
- ],
44
+ missing: {
45
+ datasheet: 10,
46
+ description: 6,
47
+ image: 32,
48
+ },
114
49
  },
50
+ // productToEdit: {
51
+ // idCategory: "2976",
52
+ // ArticleId: 55070,
53
+ // product: [
54
+ // {
55
+ // id_article: 55070,
56
+ // id_category: "2976",
57
+ // name: "TOALLERO CORTO ACCESS NEGRO ÉBANO",
58
+ // upc: "161788",
59
+ // timestamp: "2022-06-17T17:31:14.000Z",
60
+ // status: "NULL",
61
+ // categoryName: "BAÑOS|ACCESORIOS PARA BAÑO|TOALLEROS",
62
+ // asignations: [],
63
+ // version: 1,
64
+ // version_status: null,
65
+ // retailersAvailable: [
66
+ // {
67
+ // id: 58,
68
+ // name: "The Home Depot Golden",
69
+ // country: "México",
70
+ // id_region: 1,
71
+ // active: 1,
72
+ // },
73
+ // {
74
+ // id: 59,
75
+ // name: "The Home Depot Platinum",
76
+ // country: "México",
77
+ // id_region: 1,
78
+ // active: 1,
79
+ // },
80
+ // {
81
+ // id: 60,
82
+ // name: "The Home Depot Resizing",
83
+ // country: "México",
84
+ // id_region: 1,
85
+ // active: 1,
86
+ // },
87
+ // {
88
+ // id: 61,
89
+ // name: "Home Depot TAB",
90
+ // country: "México",
91
+ // id_region: 1,
92
+ // active: 1,
93
+ // },
94
+ // ],
95
+ // missing: {},
96
+ // },
97
+ // ],
98
+ // },
115
99
  location: {
116
100
  product: { articleId: 109485, versionId: 3 },
117
101
  state: {},
@@ -146,6 +130,6 @@ ProviderProductEditionDefault.args = {
146
130
  products_limit: "1000",
147
131
  type: "Enterprise",
148
132
  },
149
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-1236/1236.png?1655911288481",
133
+ src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1656001689809",
150
134
  },
151
135
  };
@@ -406,7 +406,6 @@ export const ProviderProductEdition = ({
406
406
 
407
407
  const saveDescriptions = async () => {
408
408
  setLoading(true);
409
- const productTemp = product;
410
409
  const dataObject = {
411
410
  articleId: product?.id_article,
412
411
  articleData: updatedDescriptions,
@@ -422,12 +421,6 @@ export const ProviderProductEdition = ({
422
421
  },
423
422
  }
424
423
  );
425
- if (productTemp.status === "ASSIGNED") {
426
- productTemp.status = "IN_PROGRESS";
427
- setProduct(productTemp);
428
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
429
- }
430
-
431
424
  setMessage("Descripciones guardadas con éxito");
432
425
  loadData();
433
426
  } catch (error) {
@@ -453,11 +446,6 @@ export const ProviderProductEdition = ({
453
446
  }
454
447
  );
455
448
  setMessage("Fichas técnicas guardadas");
456
- if (productTemp.status === "ASSIGNED") {
457
- productTemp.status = "IN_PROGRESS";
458
- setProduct(productTemp);
459
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
460
- }
461
449
  loadData();
462
450
  } catch (error) {
463
451
  console.log(error);
@@ -699,14 +687,23 @@ export const ProviderProductEdition = ({
699
687
  };
700
688
 
701
689
  const downloadImages = () => {
702
- selectedImages.forEach((e) => {
703
- if (e.id) {
704
- saveAs(
705
- `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
706
- `${product.article.upc}_${e.name}.${e.ext}`
707
- );
708
- }
709
- });
690
+ selectedImages.length > 0
691
+ ? selectedImages.forEach((e) => {
692
+ if (e.id) {
693
+ saveAs(
694
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
695
+ `${product.upc || product.article.upc}_${e.name}.${e.ext}`
696
+ );
697
+ }
698
+ })
699
+ : images?.values?.forEach((e) => {
700
+ if (e.id) {
701
+ saveAs(
702
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
703
+ `${product.upc || product.article.upc}_${e.name}.${e.ext}`
704
+ );
705
+ }
706
+ });
710
707
  };
711
708
 
712
709
  const deleteImages = () => {
@@ -782,26 +779,6 @@ export const ProviderProductEdition = ({
782
779
  }
783
780
  };
784
781
 
785
- const specialistValid = (tab) => {
786
- let concept = "";
787
- switch (tab) {
788
- case "Ficha técnica":
789
- concept = "datasheet";
790
- break;
791
- case "Imágenes":
792
- concept = "images";
793
- break;
794
- case "Descripción":
795
- concept = "description";
796
- break;
797
- }
798
- return (
799
- product[`${concept}_status`] === "IN_PROGRESS" ||
800
- product[`${concept}_status`] === "RF" ||
801
- product[`${concept}_status`] === "RA"
802
- );
803
- };
804
-
805
782
  const confirmStatusComplete = () => {
806
783
  const { datasheet_status, description_status, images_status } = product;
807
784
  const completionStates =
@@ -956,14 +956,23 @@ export const RetailerProductEdition = ({
956
956
  };
957
957
 
958
958
  const downloadImages = () => {
959
- selectedImages.forEach((e) => {
960
- if (e.id) {
961
- saveAs(
962
- `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
963
- `${product.article.upc}_${e.name}.${e.ext}`
964
- );
965
- }
966
- });
959
+ selectedImages.length > 0
960
+ ? selectedImages.forEach((e) => {
961
+ if (e.id) {
962
+ saveAs(
963
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
964
+ `${product.article.upc}_${e.name}.${e.ext}`
965
+ );
966
+ }
967
+ })
968
+ : images?.values?.forEach((e) => {
969
+ if (e.id) {
970
+ saveAs(
971
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
972
+ `${product.article.upc}_${e.name}.${e.ext}`
973
+ );
974
+ }
975
+ });
967
976
  };
968
977
 
969
978
  const deleteImages = () => {