contentoh-components-library 21.1.57 → 21.1.61
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/atoms/InputFormatter/index.js +3 -2
- package/dist/components/molecules/RetailerSelector/index.js +1 -2
- package/dist/components/organisms/ImageDataTable/index.js +3 -6
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +63 -53
- package/dist/components/pages/RetailerProductEdition/index.js +28 -24
- package/package.json +1 -1
- package/src/components/atoms/InputFormatter/index.js +6 -2
- package/src/components/molecules/RetailerSelector/index.js +0 -3
- package/src/components/organisms/ImageDataTable/index.js +2 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +65 -54
- package/src/components/pages/RetailerProductEdition/index.js +7 -8
|
@@ -62,7 +62,7 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
62
62
|
var maxLength = maxChar ? maxChar : 999;
|
|
63
63
|
|
|
64
64
|
var getValue = function getValue(value) {
|
|
65
|
-
var temp = value.replace(/\n/gm, "<br>");
|
|
65
|
+
var temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&");
|
|
66
66
|
return temp;
|
|
67
67
|
}; //const quillRef = useRef();
|
|
68
68
|
|
|
@@ -74,11 +74,12 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
var valueFormater = function valueFormater(value) {
|
|
77
|
-
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "");
|
|
77
|
+
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/&/gm, "&");
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
var _onChange = function onChange(valueInput, delta, user, h) {
|
|
81
81
|
var value = "";
|
|
82
|
+
console.log(valueInput, "valueInput");
|
|
82
83
|
|
|
83
84
|
try {
|
|
84
85
|
if (h.getLength() - 1 <= maxLength) {
|
|
@@ -49,13 +49,12 @@ var RetailerSelector = function RetailerSelector(_ref) {
|
|
|
49
49
|
while (1) {
|
|
50
50
|
switch (_context.prev = _context.next) {
|
|
51
51
|
case 0:
|
|
52
|
-
console.log("https://content-management-images.s3.amazonaws.com/retailers/".concat(activeRetailer.id, ".png"));
|
|
53
52
|
activeRetailer.image = "https://content-management-images.s3.amazonaws.com/retailers/".concat(activeRetailer.id, ".png");
|
|
54
53
|
retailers.forEach(function (retailer) {
|
|
55
54
|
return retailer.image = "https://content-management-images.s3.amazonaws.com/retailers/".concat(retailer.id, ".png");
|
|
56
55
|
});
|
|
57
56
|
|
|
58
|
-
case
|
|
57
|
+
case 2:
|
|
59
58
|
case "end":
|
|
60
59
|
return _context.stop();
|
|
61
60
|
}
|
|
@@ -20,7 +20,7 @@ var _LabelToInput = _interopRequireDefault(require("../../atoms/LabelToInput"));
|
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
22
22
|
var ImageDataTable = function ImageDataTable(_ref) {
|
|
23
|
-
var _lists$inputs, _lists$inputs$find, _lists$imagePackaging, _lists$imagePackaging2, _lists$imageType, _lists$imageType$find, _lists$attrForImgs$
|
|
23
|
+
var _lists$inputs, _lists$inputs$find, _lists$imagePackaging, _lists$imagePackaging2, _lists$imageType, _lists$imageType$find, _lists$attrForImgs, _lists$attrForImgs$ge;
|
|
24
24
|
|
|
25
25
|
var activeImage = _ref.activeImage,
|
|
26
26
|
darkMode = _ref.darkMode,
|
|
@@ -89,7 +89,7 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
89
89
|
headerType: "table-row-text",
|
|
90
90
|
text: activeImage !== null && activeImage !== void 0 && activeImage.width && activeImage.height ? "".concat(activeImage === null || activeImage === void 0 ? void 0 : activeImage.width, "x").concat(activeImage === null || activeImage === void 0 ? void 0 : activeImage.height, "px") : "-"
|
|
91
91
|
})]
|
|
92
|
-
}), retailerSelected && (lists === null || lists === void 0 ? void 0 : lists.attrForImgs) && (lists === null || lists === void 0 ? void 0 : (_lists$attrForImgs
|
|
92
|
+
}), retailerSelected && (lists === null || lists === void 0 ? void 0 : lists.attrForImgs) && (lists === null || lists === void 0 ? void 0 : (_lists$attrForImgs = lists.attrForImgs) === null || _lists$attrForImgs === void 0 ? void 0 : (_lists$attrForImgs$ge = _lists$attrForImgs.general) === null || _lists$attrForImgs$ge === void 0 ? void 0 : _lists$attrForImgs$ge.map(function (attr, index) {
|
|
93
93
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.Container, {
|
|
94
94
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
95
95
|
headerType: "table-row-text",
|
|
@@ -100,11 +100,8 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
100
100
|
onChange: function onChange(e) {
|
|
101
101
|
setImages({
|
|
102
102
|
action: "changeAttrValue",
|
|
103
|
-
retailer: retailerSelected,
|
|
104
|
-
index: index,
|
|
105
103
|
value: e.target.value || "-",
|
|
106
|
-
|
|
107
|
-
retailersId: Object.keys(lists.attrForImgs).slice(0, -1)
|
|
104
|
+
id: attr.id
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
107
|
})]
|
|
@@ -31,61 +31,71 @@ RetailerProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "
|
|
34
|
+
token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5ZDBjYzVjOC1hODllLTRiZGQtOWUyZC0zNThhMDFjYzlhNjIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiOWQwY2M1YzgtYTg5ZS00YmRkLTllMmQtMzU4YTAxY2M5YTYyIiwiYXVkIjoiNTJkOXNra2RjZzhxanA4OG9vazF1c2U2bWsiLCJldmVudF9pZCI6IjQyMGY5Y2NlLTA2YjAtNDZkMS1iYzIzLTZlMDkzYWMxNzhkNCIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjU4NDQ0NzY3LCJuYW1lIjoiSXNtYWVsIExvcGV6IiwicGhvbmVfbnVtYmVyIjoiKzUyMzExMTM2NjMzNiIsImV4cCI6MTY1ODQ0ODM2NywiaWF0IjoxNjU4NDQ0NzY3LCJlbWFpbCI6Imlsb3BlekBjb250ZW50b2guY29tIn0.tWAoYeUfaddnLMAqdIiprbAsq15l4By11WToXh_U7PcJGu1ym09ZjrcCjq4ZonVNAa1PHH8YT5o7ziRHOzn_HXtG2uvCaiwqZABZG_1DhbJEhUuH7zORWWcp9pbiE7bwJRfO1SWVE58rEETaAIxvq3aQKrUEjyXSZxPk1Aq9O1jaQnSBbDKVITEtPq9JU2vzCygWS3rAKx0PnjIBJwGwzqSJw5ToyNA2-0TvI_nbezPsVXXSrSM_WSsutZA54nnsS3HLnDukQLu1nRPD1IQhTbjfaLJr44OkTGq6G373LrZ6vrsquZeUiaOnVQdOT-ucSI1oJRGRq6CqLSQOb7fo1Q",
|
|
35
35
|
productSelected: {
|
|
36
36
|
services: {
|
|
37
|
-
datasheets:
|
|
38
|
-
descriptions:
|
|
37
|
+
datasheets: 0,
|
|
38
|
+
descriptions: 0,
|
|
39
39
|
images: 1
|
|
40
40
|
},
|
|
41
|
-
orderId:
|
|
42
|
-
status: "
|
|
43
|
-
datasheet_status: "
|
|
41
|
+
orderId: 1973,
|
|
42
|
+
status: "RECEIVED",
|
|
43
|
+
datasheet_status: "NS",
|
|
44
44
|
prio: "none",
|
|
45
|
-
version:
|
|
46
|
-
description_status: "
|
|
47
|
-
images_status:
|
|
45
|
+
version: 2,
|
|
46
|
+
description_status: "NS",
|
|
47
|
+
images_status: null,
|
|
48
48
|
article: {
|
|
49
|
-
id_article:
|
|
50
|
-
id_category: "
|
|
51
|
-
name: "
|
|
52
|
-
upc: "
|
|
53
|
-
timestamp: "2022-06-
|
|
54
|
-
id_user:
|
|
49
|
+
id_article: 48873,
|
|
50
|
+
id_category: "2095",
|
|
51
|
+
name: '710 DISCO CORTE METAL 4 1/2"',
|
|
52
|
+
upc: "436882",
|
|
53
|
+
timestamp: "2022-06-18T12:16:21.000Z",
|
|
54
|
+
id_user: 1239,
|
|
55
55
|
status: "NULL",
|
|
56
56
|
active: 1,
|
|
57
|
-
company_id:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
company_id: 308,
|
|
58
|
+
SKU: null,
|
|
59
|
+
Descripcion: null,
|
|
60
|
+
Proveedor: null,
|
|
61
|
+
id_proveedor: 0,
|
|
62
|
+
company_name: "The Home Depot",
|
|
63
|
+
country: null,
|
|
64
|
+
id_order: 1973,
|
|
65
|
+
id_datasheet_especialist: null,
|
|
66
|
+
id_datasheet_facilitator: null,
|
|
67
|
+
id_description_especialist: null,
|
|
68
|
+
id_description_facilitator: null,
|
|
69
|
+
id_images_especialist: null,
|
|
70
|
+
id_images_facilitator: null,
|
|
71
|
+
id_auditor: null,
|
|
68
72
|
id_recepcionist: null,
|
|
69
|
-
category: "
|
|
73
|
+
category: "Herramientas|Accesorios para Herramientas Eléctricas|Discos",
|
|
70
74
|
missingAttributes: null,
|
|
71
75
|
missingDescriptions: null,
|
|
72
76
|
missingImages: null
|
|
73
77
|
},
|
|
74
78
|
retailers: [{
|
|
75
|
-
id:
|
|
76
|
-
name: "
|
|
79
|
+
id: 58,
|
|
80
|
+
name: "The Home Depot Golden",
|
|
81
|
+
country: "México",
|
|
82
|
+
id_region: 1,
|
|
83
|
+
active: 1
|
|
84
|
+
}, {
|
|
85
|
+
id: 59,
|
|
86
|
+
name: "The Home Depot Platinum",
|
|
77
87
|
country: "México",
|
|
78
88
|
id_region: 1,
|
|
79
89
|
active: 1
|
|
80
90
|
}, {
|
|
81
|
-
id:
|
|
82
|
-
name: "
|
|
91
|
+
id: 61,
|
|
92
|
+
name: "Home Depot TAB",
|
|
83
93
|
country: "México",
|
|
84
94
|
id_region: 1,
|
|
85
95
|
active: 1
|
|
86
96
|
}],
|
|
87
|
-
country:
|
|
88
|
-
upc: "
|
|
97
|
+
country: null,
|
|
98
|
+
upc: "436882"
|
|
89
99
|
},
|
|
90
100
|
location: {
|
|
91
101
|
product: {
|
|
@@ -94,36 +104,36 @@ RetailerProductEditionDefault.args = {
|
|
|
94
104
|
}
|
|
95
105
|
},
|
|
96
106
|
user: {
|
|
97
|
-
id_user:
|
|
98
|
-
name: "
|
|
99
|
-
last_name: "
|
|
100
|
-
email: "
|
|
101
|
-
position: "
|
|
107
|
+
id_user: 460,
|
|
108
|
+
name: "Ismael",
|
|
109
|
+
last_name: "López",
|
|
110
|
+
email: "ilopez@contentoh.com",
|
|
111
|
+
position: "Desarrollador",
|
|
102
112
|
telephone: null,
|
|
103
113
|
country: "México",
|
|
104
|
-
id_company:
|
|
105
|
-
id_cognito: "
|
|
106
|
-
birth_Date:
|
|
114
|
+
id_company: 254,
|
|
115
|
+
id_cognito: "9d0cc5c8-a89e-4bdd-9e2d-358a01cc9a62",
|
|
116
|
+
birth_Date: "1997-08-15T00:00:00.000Z",
|
|
107
117
|
about_me: null,
|
|
108
118
|
zip_code: null,
|
|
109
119
|
address: null,
|
|
110
120
|
job: null,
|
|
111
121
|
id_stripe: null,
|
|
112
|
-
id_role:
|
|
122
|
+
id_role: 1,
|
|
113
123
|
active: 1,
|
|
114
124
|
is_retailer: 0,
|
|
115
|
-
email_notify:
|
|
125
|
+
email_notify: null,
|
|
116
126
|
membership: {
|
|
117
|
-
id:
|
|
118
|
-
start_date: "
|
|
119
|
-
end_date: "
|
|
120
|
-
planID:
|
|
121
|
-
plan: "
|
|
122
|
-
name: "Plan
|
|
123
|
-
user_limit: "
|
|
124
|
-
products_limit: "
|
|
125
|
-
type: "
|
|
127
|
+
id: 750,
|
|
128
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
129
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
130
|
+
planID: 6,
|
|
131
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
132
|
+
name: "Plan Small",
|
|
133
|
+
user_limit: "10",
|
|
134
|
+
products_limit: "1000",
|
|
135
|
+
type: "Enterprise"
|
|
126
136
|
},
|
|
127
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
137
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-460/460.png?1658444769519"
|
|
128
138
|
}
|
|
129
139
|
};
|
|
@@ -98,9 +98,14 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
case "changeAttrValue":
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
var index = attrForImgs.general.findIndex(function (f) {
|
|
102
|
+
return f.id = action.id;
|
|
103
103
|
});
|
|
104
|
+
|
|
105
|
+
if (index !== -1) {
|
|
106
|
+
attrForImgs.general[index].value = action.value;
|
|
107
|
+
}
|
|
108
|
+
|
|
104
109
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
105
110
|
attrForImgs: attrForImgs,
|
|
106
111
|
values: values
|
|
@@ -824,16 +829,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
824
829
|
duplicated = imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (image) {
|
|
825
830
|
return imagesListTemp[image === null || image === void 0 ? void 0 : image.image_id];
|
|
826
831
|
});
|
|
827
|
-
attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs);
|
|
828
|
-
attrForImgs.pop();
|
|
832
|
+
attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs).pop();
|
|
829
833
|
data = {
|
|
830
834
|
articleId: product === null || product === void 0 ? void 0 : (_product$article11 = product.article) === null || _product$article11 === void 0 ? void 0 : _product$article11.id_article,
|
|
831
835
|
attrReqImgs: attrForImgs === null || attrForImgs === void 0 ? void 0 : attrForImgs.map(function (e) {
|
|
832
|
-
var _e
|
|
836
|
+
var _e$value;
|
|
833
837
|
|
|
834
838
|
return {
|
|
835
|
-
attrId:
|
|
836
|
-
value: (_e$
|
|
839
|
+
attrId: e.id,
|
|
840
|
+
value: (_e$value = e.value) !== null && _e$value !== void 0 ? _e$value : "-"
|
|
837
841
|
};
|
|
838
842
|
}),
|
|
839
843
|
articleData: imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (e) {
|
|
@@ -863,19 +867,19 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
863
867
|
}
|
|
864
868
|
|
|
865
869
|
if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
|
|
866
|
-
_context7.next =
|
|
870
|
+
_context7.next = 32;
|
|
867
871
|
break;
|
|
868
872
|
}
|
|
869
873
|
|
|
870
874
|
setLoading(true);
|
|
871
|
-
_context7.prev =
|
|
875
|
+
_context7.prev = 10;
|
|
872
876
|
data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
|
|
873
877
|
e.uuid = (0, _uuid.v4)();
|
|
874
878
|
});
|
|
875
879
|
setDataImages(data);
|
|
876
880
|
|
|
877
881
|
if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
|
|
878
|
-
_context7.next =
|
|
882
|
+
_context7.next = 22;
|
|
879
883
|
break;
|
|
880
884
|
}
|
|
881
885
|
|
|
@@ -891,18 +895,18 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
891
895
|
};
|
|
892
896
|
promiseArray.push(myBucket.putObject(params).promise());
|
|
893
897
|
});
|
|
894
|
-
_context7.next =
|
|
898
|
+
_context7.next = 19;
|
|
895
899
|
return Promise.all(promiseArray);
|
|
896
900
|
|
|
897
|
-
case
|
|
901
|
+
case 19:
|
|
898
902
|
setImagesUploaded(true);
|
|
899
|
-
_context7.next =
|
|
903
|
+
_context7.next = 23;
|
|
900
904
|
break;
|
|
901
905
|
|
|
902
|
-
case
|
|
906
|
+
case 22:
|
|
903
907
|
setImagesUploaded(true);
|
|
904
908
|
|
|
905
|
-
case
|
|
909
|
+
case 23:
|
|
906
910
|
productTemp = product;
|
|
907
911
|
|
|
908
912
|
if (productTemp.status === "ASSIGNED") {
|
|
@@ -911,28 +915,28 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
911
915
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
912
916
|
}
|
|
913
917
|
|
|
914
|
-
_context7.next =
|
|
918
|
+
_context7.next = 30;
|
|
915
919
|
break;
|
|
916
920
|
|
|
917
|
-
case
|
|
918
|
-
_context7.prev =
|
|
919
|
-
_context7.t0 = _context7["catch"](
|
|
921
|
+
case 27:
|
|
922
|
+
_context7.prev = 27;
|
|
923
|
+
_context7.t0 = _context7["catch"](10);
|
|
920
924
|
console.log(_context7.t0); // setMainLoading(false);
|
|
921
925
|
|
|
922
|
-
case
|
|
923
|
-
_context7.next =
|
|
926
|
+
case 30:
|
|
927
|
+
_context7.next = 33;
|
|
924
928
|
break;
|
|
925
929
|
|
|
926
|
-
case
|
|
930
|
+
case 32:
|
|
927
931
|
// setMainLoading(false);
|
|
928
932
|
setMessage("Completa los campos que solicita cada una de la imágenes o hay imágenes con el mismo tipo de toma.\nRecuerda hay campos obligatorios y no podras avanzar si no estan completos.");
|
|
929
933
|
|
|
930
|
-
case
|
|
934
|
+
case 33:
|
|
931
935
|
case "end":
|
|
932
936
|
return _context7.stop();
|
|
933
937
|
}
|
|
934
938
|
}
|
|
935
|
-
}, _callee7, null, [[
|
|
939
|
+
}, _callee7, null, [[10, 27]]);
|
|
936
940
|
})), [images, imagesUploaded]);
|
|
937
941
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
938
942
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export const InputFormatter = ({
|
|
|
22
22
|
const maxLength = maxChar ? maxChar : 999;
|
|
23
23
|
|
|
24
24
|
const getValue = (value) => {
|
|
25
|
-
let temp = value.replace(/\n/gm, "<br>");
|
|
25
|
+
let temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&");
|
|
26
26
|
return temp;
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -34,11 +34,15 @@ export const InputFormatter = ({
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const valueFormater = (value) => {
|
|
37
|
-
return value
|
|
37
|
+
return value
|
|
38
|
+
.replace(/<\/p><p>/gm, "\n")
|
|
39
|
+
.replace(/<\/?br>|<\/?p>/gm, "")
|
|
40
|
+
.replace(/&/gm, "&");
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
const onChange = (valueInput, delta, user, h) => {
|
|
41
44
|
let value = "";
|
|
45
|
+
console.log(valueInput, "valueInput");
|
|
42
46
|
try {
|
|
43
47
|
if (h.getLength() - 1 <= maxLength) {
|
|
44
48
|
let unformattedText = valueInput
|
|
@@ -20,9 +20,6 @@ export const RetailerSelector = ({
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const getRetailerImage = async () => {
|
|
23
|
-
console.log(
|
|
24
|
-
`https://content-management-images.s3.amazonaws.com/retailers/${activeRetailer.id}.png`
|
|
25
|
-
);
|
|
26
23
|
activeRetailer.image = `https://content-management-images.s3.amazonaws.com/retailers/${activeRetailer.id}.png`;
|
|
27
24
|
retailers.forEach(
|
|
28
25
|
(retailer) =>
|
|
@@ -79,7 +79,7 @@ export const ImageDataTable = ({
|
|
|
79
79
|
</Row>
|
|
80
80
|
{retailerSelected &&
|
|
81
81
|
lists?.attrForImgs &&
|
|
82
|
-
lists?.attrForImgs
|
|
82
|
+
lists?.attrForImgs?.general?.map((attr, index) => (
|
|
83
83
|
<Row key={"row-" + index + "-" + attr?.name}>
|
|
84
84
|
<ScreenHeader
|
|
85
85
|
headerType={"table-row-text"}
|
|
@@ -91,11 +91,8 @@ export const ImageDataTable = ({
|
|
|
91
91
|
onChange={(e) => {
|
|
92
92
|
setImages({
|
|
93
93
|
action: "changeAttrValue",
|
|
94
|
-
retailer: retailerSelected,
|
|
95
|
-
index,
|
|
96
94
|
value: e.target.value || "-",
|
|
97
|
-
|
|
98
|
-
retailersId: Object.keys(lists.attrForImgs).slice(0, -1),
|
|
95
|
+
id: attr.id,
|
|
99
96
|
});
|
|
100
97
|
}}
|
|
101
98
|
/>
|
|
@@ -16,99 +16,110 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5ZDBjYzVjOC1hODllLTRiZGQtOWUyZC0zNThhMDFjYzlhNjIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiOWQwY2M1YzgtYTg5ZS00YmRkLTllMmQtMzU4YTAxY2M5YTYyIiwiYXVkIjoiNTJkOXNra2RjZzhxanA4OG9vazF1c2U2bWsiLCJldmVudF9pZCI6IjQyMGY5Y2NlLTA2YjAtNDZkMS1iYzIzLTZlMDkzYWMxNzhkNCIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjU4NDQ0NzY3LCJuYW1lIjoiSXNtYWVsIExvcGV6IiwicGhvbmVfbnVtYmVyIjoiKzUyMzExMTM2NjMzNiIsImV4cCI6MTY1ODQ0ODM2NywiaWF0IjoxNjU4NDQ0NzY3LCJlbWFpbCI6Imlsb3BlekBjb250ZW50b2guY29tIn0.tWAoYeUfaddnLMAqdIiprbAsq15l4By11WToXh_U7PcJGu1ym09ZjrcCjq4ZonVNAa1PHH8YT5o7ziRHOzn_HXtG2uvCaiwqZABZG_1DhbJEhUuH7zORWWcp9pbiE7bwJRfO1SWVE58rEETaAIxvq3aQKrUEjyXSZxPk1Aq9O1jaQnSBbDKVITEtPq9JU2vzCygWS3rAKx0PnjIBJwGwzqSJw5ToyNA2-0TvI_nbezPsVXXSrSM_WSsutZA54nnsS3HLnDukQLu1nRPD1IQhTbjfaLJr44OkTGq6G373LrZ6vrsquZeUiaOnVQdOT-ucSI1oJRGRq6CqLSQOb7fo1Q",
|
|
20
20
|
productSelected: {
|
|
21
21
|
services: {
|
|
22
|
-
datasheets:
|
|
23
|
-
descriptions:
|
|
22
|
+
datasheets: 0,
|
|
23
|
+
descriptions: 0,
|
|
24
24
|
images: 1,
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
27
|
-
status: "
|
|
28
|
-
datasheet_status: "
|
|
26
|
+
orderId: 1973,
|
|
27
|
+
status: "RECEIVED",
|
|
28
|
+
datasheet_status: "NS",
|
|
29
29
|
prio: "none",
|
|
30
|
-
version:
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status:
|
|
30
|
+
version: 2,
|
|
31
|
+
description_status: "NS",
|
|
32
|
+
images_status: null,
|
|
33
33
|
article: {
|
|
34
|
-
id_article:
|
|
35
|
-
id_category: "
|
|
36
|
-
name: "
|
|
37
|
-
upc: "
|
|
38
|
-
timestamp: "2022-06-
|
|
39
|
-
id_user:
|
|
34
|
+
id_article: 48873,
|
|
35
|
+
id_category: "2095",
|
|
36
|
+
name: '710 DISCO CORTE METAL 4 1/2"',
|
|
37
|
+
upc: "436882",
|
|
38
|
+
timestamp: "2022-06-18T12:16:21.000Z",
|
|
39
|
+
id_user: 1239,
|
|
40
40
|
status: "NULL",
|
|
41
41
|
active: 1,
|
|
42
|
-
company_id:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
company_id: 308,
|
|
43
|
+
SKU: null,
|
|
44
|
+
Descripcion: null,
|
|
45
|
+
Proveedor: null,
|
|
46
|
+
id_proveedor: 0,
|
|
47
|
+
company_name: "The Home Depot",
|
|
48
|
+
country: null,
|
|
49
|
+
id_order: 1973,
|
|
50
|
+
id_datasheet_especialist: null,
|
|
51
|
+
id_datasheet_facilitator: null,
|
|
52
|
+
id_description_especialist: null,
|
|
53
|
+
id_description_facilitator: null,
|
|
54
|
+
id_images_especialist: null,
|
|
55
|
+
id_images_facilitator: null,
|
|
56
|
+
id_auditor: null,
|
|
53
57
|
id_recepcionist: null,
|
|
54
|
-
category: "
|
|
58
|
+
category: "Herramientas|Accesorios para Herramientas Eléctricas|Discos",
|
|
55
59
|
missingAttributes: null,
|
|
56
60
|
missingDescriptions: null,
|
|
57
61
|
missingImages: null,
|
|
58
62
|
},
|
|
59
63
|
retailers: [
|
|
60
64
|
{
|
|
61
|
-
id:
|
|
62
|
-
name: "
|
|
65
|
+
id: 58,
|
|
66
|
+
name: "The Home Depot Golden",
|
|
63
67
|
country: "México",
|
|
64
68
|
id_region: 1,
|
|
65
69
|
active: 1,
|
|
66
70
|
},
|
|
67
71
|
{
|
|
68
|
-
id:
|
|
69
|
-
name: "
|
|
72
|
+
id: 59,
|
|
73
|
+
name: "The Home Depot Platinum",
|
|
74
|
+
country: "México",
|
|
75
|
+
id_region: 1,
|
|
76
|
+
active: 1,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 61,
|
|
80
|
+
name: "Home Depot TAB",
|
|
70
81
|
country: "México",
|
|
71
82
|
id_region: 1,
|
|
72
83
|
active: 1,
|
|
73
84
|
},
|
|
74
85
|
],
|
|
75
|
-
country:
|
|
76
|
-
upc: "
|
|
86
|
+
country: null,
|
|
87
|
+
upc: "436882",
|
|
77
88
|
},
|
|
78
89
|
location: {
|
|
79
90
|
product: { articleId: 109485, versionId: 3 },
|
|
80
91
|
},
|
|
81
92
|
user: {
|
|
82
|
-
id_user:
|
|
83
|
-
name: "
|
|
84
|
-
last_name: "
|
|
85
|
-
email: "
|
|
86
|
-
position: "
|
|
93
|
+
id_user: 460,
|
|
94
|
+
name: "Ismael",
|
|
95
|
+
last_name: "López",
|
|
96
|
+
email: "ilopez@contentoh.com",
|
|
97
|
+
position: "Desarrollador",
|
|
87
98
|
telephone: null,
|
|
88
99
|
country: "México",
|
|
89
|
-
id_company:
|
|
90
|
-
id_cognito: "
|
|
91
|
-
birth_Date:
|
|
100
|
+
id_company: 254,
|
|
101
|
+
id_cognito: "9d0cc5c8-a89e-4bdd-9e2d-358a01cc9a62",
|
|
102
|
+
birth_Date: "1997-08-15T00:00:00.000Z",
|
|
92
103
|
about_me: null,
|
|
93
104
|
zip_code: null,
|
|
94
105
|
address: null,
|
|
95
106
|
job: null,
|
|
96
107
|
id_stripe: null,
|
|
97
|
-
id_role:
|
|
108
|
+
id_role: 1,
|
|
98
109
|
active: 1,
|
|
99
110
|
is_retailer: 0,
|
|
100
|
-
email_notify:
|
|
111
|
+
email_notify: null,
|
|
101
112
|
membership: {
|
|
102
|
-
id:
|
|
103
|
-
start_date: "
|
|
104
|
-
end_date: "
|
|
105
|
-
planID:
|
|
106
|
-
plan: "
|
|
107
|
-
name: "Plan
|
|
108
|
-
user_limit: "
|
|
109
|
-
products_limit: "
|
|
110
|
-
type: "
|
|
113
|
+
id: 750,
|
|
114
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
115
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
116
|
+
planID: 6,
|
|
117
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
118
|
+
name: "Plan Small",
|
|
119
|
+
user_limit: "10",
|
|
120
|
+
products_limit: "1000",
|
|
121
|
+
type: "Enterprise",
|
|
111
122
|
},
|
|
112
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
123
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-460/460.png?1658444769519",
|
|
113
124
|
},
|
|
114
|
-
};
|
|
125
|
+
};
|
|
@@ -44,10 +44,10 @@ const reducerImages = (state, action) => {
|
|
|
44
44
|
values[action.index][action.attribute] = action.value;
|
|
45
45
|
return { ...state, values };
|
|
46
46
|
case "changeAttrValue":
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
47
|
+
const index = attrForImgs.general.findIndex((f) => (f.id = action.id));
|
|
48
|
+
if (index !== -1) {
|
|
49
|
+
attrForImgs.general[index].value = action.value;
|
|
50
|
+
}
|
|
51
51
|
|
|
52
52
|
return { ...state, attrForImgs, values };
|
|
53
53
|
case "deleteImage":
|
|
@@ -469,13 +469,12 @@ export const RetailerProductEdition = ({
|
|
|
469
469
|
return imagesListTemp[image?.image_id];
|
|
470
470
|
});
|
|
471
471
|
|
|
472
|
-
const attrForImgs = Object.values(images?.attrForImgs);
|
|
473
|
-
attrForImgs.pop();
|
|
472
|
+
const attrForImgs = Object.values(images?.attrForImgs).pop();
|
|
474
473
|
const data = {
|
|
475
474
|
articleId: product?.article?.id_article,
|
|
476
475
|
attrReqImgs: attrForImgs?.map((e) => ({
|
|
477
|
-
attrId: e
|
|
478
|
-
value: e
|
|
476
|
+
attrId: e.id,
|
|
477
|
+
value: e.value ?? "-",
|
|
479
478
|
})),
|
|
480
479
|
articleData: imagesList?.filter((e) => !e.id),
|
|
481
480
|
updateImages: imagesList?.filter((e) => e.id),
|