contentoh-components-library 21.1.21 → 21.1.22
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.
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +81 -88
- package/dist/components/pages/ProviderProductEdition/index.js +33 -61
- package/dist/components/pages/RetailerProductEdition/index.js +16 -11
- package/package.json +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +82 -98
- package/src/components/pages/ProviderProductEdition/index.js +17 -40
- package/src/components/pages/RetailerProductEdition/index.js +17 -9
|
@@ -31,90 +31,83 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI3ZTU5YmI1Yy1mNjI1LTQ1NzMtYjMzYS00ZWM4YzFmMzMyNTIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjAwMTY4OCwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2NTYwMDUyODgsImlhdCI6MTY1NjAwMTY4OCwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.ZUKMejBG8qCT2bv-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:
|
|
40
|
-
id_category: "
|
|
41
|
-
name: "
|
|
42
|
-
upc: "
|
|
43
|
-
timestamp: "2022-06-
|
|
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: "
|
|
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:
|
|
51
|
-
name: "
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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,
|
|
@@ -123,35 +116,35 @@ ProviderProductEditionDefault.args = {
|
|
|
123
116
|
state: {}
|
|
124
117
|
},
|
|
125
118
|
user: {
|
|
126
|
-
id_user:
|
|
127
|
-
name: "
|
|
128
|
-
last_name: "
|
|
129
|
-
email: "
|
|
130
|
-
position: "
|
|
131
|
-
telephone: "+
|
|
119
|
+
id_user: 28,
|
|
120
|
+
name: "Proveedor",
|
|
121
|
+
last_name: "Colgate",
|
|
122
|
+
email: "ilopez@contentoh.com",
|
|
123
|
+
position: "Prueba Admin",
|
|
124
|
+
telephone: "+523111366336",
|
|
132
125
|
country: "México",
|
|
133
|
-
id_company:
|
|
134
|
-
id_cognito: "
|
|
126
|
+
id_company: 1,
|
|
127
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
135
128
|
birth_Date: null,
|
|
136
129
|
about_me: null,
|
|
137
130
|
zip_code: null,
|
|
138
131
|
address: null,
|
|
139
132
|
job: null,
|
|
140
|
-
id_stripe:
|
|
133
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
141
134
|
id_role: 0,
|
|
142
135
|
active: 1,
|
|
143
136
|
is_retailer: 0,
|
|
144
137
|
membership: {
|
|
145
|
-
id:
|
|
146
|
-
start_date: "2022-
|
|
147
|
-
end_date: "2023-
|
|
148
|
-
planID:
|
|
149
|
-
plan: "
|
|
150
|
-
name: "Plan
|
|
151
|
-
user_limit: "
|
|
152
|
-
products_limit: "
|
|
138
|
+
id: 38,
|
|
139
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
140
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
141
|
+
planID: 8,
|
|
142
|
+
plan: "prod_KtlhECVSFG2iro",
|
|
143
|
+
name: "Plan Pro",
|
|
144
|
+
user_limit: "20",
|
|
145
|
+
products_limit: "5000",
|
|
153
146
|
type: "Enterprise"
|
|
154
147
|
},
|
|
155
|
-
src: "https://content-management-profile
|
|
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
|
|
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 =
|
|
776
|
-
_context6.next =
|
|
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
|
|
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 =
|
|
785
|
+
_context6.next = 13;
|
|
793
786
|
break;
|
|
794
787
|
|
|
795
|
-
case
|
|
796
|
-
_context6.prev =
|
|
797
|
-
_context6.t0 = _context6["catch"](
|
|
788
|
+
case 10:
|
|
789
|
+
_context6.prev = 10;
|
|
790
|
+
_context6.t0 = _context6["catch"](3);
|
|
798
791
|
console.log(_context6.t0);
|
|
799
792
|
|
|
800
|
-
case
|
|
793
|
+
case 13:
|
|
801
794
|
case "end":
|
|
802
795
|
return _context6.stop();
|
|
803
796
|
}
|
|
804
797
|
}
|
|
805
|
-
}, _callee6, null, [[
|
|
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 =
|
|
830
|
+
_context7.next = 13;
|
|
845
831
|
break;
|
|
846
832
|
|
|
847
|
-
case
|
|
848
|
-
_context7.prev =
|
|
833
|
+
case 10:
|
|
834
|
+
_context7.prev = 10;
|
|
849
835
|
_context7.t0 = _context7["catch"](3);
|
|
850
836
|
console.log(_context7.t0);
|
|
851
837
|
|
|
852
|
-
case
|
|
838
|
+
case 13:
|
|
853
839
|
case "end":
|
|
854
840
|
return _context7.stop();
|
|
855
841
|
}
|
|
856
842
|
}
|
|
857
|
-
}, _callee7, null, [[3,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
1340
|
+
productTemp = product;
|
|
1369
1341
|
concept = getConcept(activeTab);
|
|
1370
|
-
|
|
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(
|
|
1356
|
+
setProduct(productTemp);
|
|
1385
1357
|
setProductEdit({
|
|
1386
|
-
ArticleId:
|
|
1387
|
-
idCategory:
|
|
1388
|
-
product:
|
|
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:
|
|
1392
|
-
idCategory:
|
|
1393
|
-
product:
|
|
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"));
|
|
@@ -753,17 +753,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
753
753
|
articleId: product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article,
|
|
754
754
|
articleData: updatedDatasheets
|
|
755
755
|
};
|
|
756
|
-
console.log(updatedDatasheets, "updatedDatasheets");
|
|
757
756
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
758
|
-
_context6.prev =
|
|
759
|
-
_context6.next =
|
|
757
|
+
_context6.prev = 4;
|
|
758
|
+
_context6.next = 7;
|
|
760
759
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
761
760
|
headers: {
|
|
762
761
|
Authorization: token
|
|
763
762
|
}
|
|
764
763
|
});
|
|
765
764
|
|
|
766
|
-
case
|
|
765
|
+
case 7:
|
|
767
766
|
setMessage("Fichas técnicas guardadas");
|
|
768
767
|
|
|
769
768
|
if (productTemp.status === "ASSIGNED") {
|
|
@@ -773,20 +772,20 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
773
772
|
}
|
|
774
773
|
|
|
775
774
|
loadData();
|
|
776
|
-
_context6.next =
|
|
775
|
+
_context6.next = 15;
|
|
777
776
|
break;
|
|
778
777
|
|
|
779
|
-
case
|
|
780
|
-
_context6.prev =
|
|
781
|
-
_context6.t0 = _context6["catch"](
|
|
778
|
+
case 12:
|
|
779
|
+
_context6.prev = 12;
|
|
780
|
+
_context6.t0 = _context6["catch"](4);
|
|
782
781
|
console.log(_context6.t0);
|
|
783
782
|
|
|
784
|
-
case
|
|
783
|
+
case 15:
|
|
785
784
|
case "end":
|
|
786
785
|
return _context6.stop();
|
|
787
786
|
}
|
|
788
787
|
}
|
|
789
|
-
}, _callee6, null, [[
|
|
788
|
+
}, _callee6, null, [[4, 12]]);
|
|
790
789
|
}));
|
|
791
790
|
|
|
792
791
|
return function saveDatasheets() {
|
|
@@ -1441,7 +1440,13 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1441
1440
|
}();
|
|
1442
1441
|
|
|
1443
1442
|
var downloadImages = function downloadImages() {
|
|
1444
|
-
|
|
1443
|
+
var _images$values3;
|
|
1444
|
+
|
|
1445
|
+
selectedImages.length > 0 ? selectedImages.forEach(function (e) {
|
|
1446
|
+
if (e.id) {
|
|
1447
|
+
(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));
|
|
1448
|
+
}
|
|
1449
|
+
}) : images === null || images === void 0 ? void 0 : (_images$values3 = images.values) === null || _images$values3 === void 0 ? void 0 : _images$values3.forEach(function (e) {
|
|
1445
1450
|
if (e.id) {
|
|
1446
1451
|
(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
1452
|
}
|
package/package.json
CHANGED
|
@@ -16,136 +16,120 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI3ZTU5YmI1Yy1mNjI1LTQ1NzMtYjMzYS00ZWM4YzFmMzMyNTIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjAwMTY4OCwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2NTYwMDUyODgsImlhdCI6MTY1NjAwMTY4OCwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.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:
|
|
25
|
-
id_category: "
|
|
26
|
-
name: "
|
|
27
|
-
upc: "
|
|
28
|
-
timestamp: "2022-06-
|
|
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:
|
|
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:
|
|
37
|
-
name: "
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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: {},
|
|
118
102
|
},
|
|
119
103
|
user: {
|
|
120
|
-
id_user:
|
|
121
|
-
name: "
|
|
122
|
-
last_name: "
|
|
123
|
-
email: "
|
|
124
|
-
position: "
|
|
125
|
-
telephone: "+
|
|
104
|
+
id_user: 28,
|
|
105
|
+
name: "Proveedor",
|
|
106
|
+
last_name: "Colgate",
|
|
107
|
+
email: "ilopez@contentoh.com",
|
|
108
|
+
position: "Prueba Admin",
|
|
109
|
+
telephone: "+523111366336",
|
|
126
110
|
country: "México",
|
|
127
|
-
id_company:
|
|
128
|
-
id_cognito: "
|
|
111
|
+
id_company: 1,
|
|
112
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
129
113
|
birth_Date: null,
|
|
130
114
|
about_me: null,
|
|
131
115
|
zip_code: null,
|
|
132
116
|
address: null,
|
|
133
117
|
job: null,
|
|
134
|
-
id_stripe:
|
|
118
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
135
119
|
id_role: 0,
|
|
136
120
|
active: 1,
|
|
137
121
|
is_retailer: 0,
|
|
138
122
|
membership: {
|
|
139
|
-
id:
|
|
140
|
-
start_date: "2022-
|
|
141
|
-
end_date: "2023-
|
|
142
|
-
planID:
|
|
143
|
-
plan: "
|
|
144
|
-
name: "Plan
|
|
145
|
-
user_limit: "
|
|
146
|
-
products_limit: "
|
|
123
|
+
id: 38,
|
|
124
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
125
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
126
|
+
planID: 8,
|
|
127
|
+
plan: "prod_KtlhECVSFG2iro",
|
|
128
|
+
name: "Plan Pro",
|
|
129
|
+
user_limit: "20",
|
|
130
|
+
products_limit: "5000",
|
|
147
131
|
type: "Enterprise",
|
|
148
132
|
},
|
|
149
|
-
src: "https://content-management-profile
|
|
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.
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
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 =
|
|
@@ -424,7 +424,6 @@ export const RetailerProductEdition = ({
|
|
|
424
424
|
articleId: product?.article?.id_article,
|
|
425
425
|
articleData: updatedDatasheets,
|
|
426
426
|
};
|
|
427
|
-
console.log(updatedDatasheets, "updatedDatasheets");
|
|
428
427
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
429
428
|
try {
|
|
430
429
|
await axios.put(
|
|
@@ -956,14 +955,23 @@ export const RetailerProductEdition = ({
|
|
|
956
955
|
};
|
|
957
956
|
|
|
958
957
|
const downloadImages = () => {
|
|
959
|
-
selectedImages.
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
958
|
+
selectedImages.length > 0
|
|
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
|
+
})
|
|
967
|
+
: images?.values?.forEach((e) => {
|
|
968
|
+
if (e.id) {
|
|
969
|
+
saveAs(
|
|
970
|
+
`https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
|
|
971
|
+
`${product.article.upc}_${e.name}.${e.ext}`
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
});
|
|
967
975
|
};
|
|
968
976
|
|
|
969
977
|
const deleteImages = () => {
|