contentoh-components-library 21.1.13 → 21.1.14
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/organisms/ImageDataTable/index.js +4 -2
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +27 -33
- package/dist/components/pages/RetailerProductEdition/index.js +5 -2
- package/package.json +1 -1
- package/src/components/organisms/ImageDataTable/index.js +3 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +27 -34
- package/src/components/pages/RetailerProductEdition/index.js +6 -1
|
@@ -102,11 +102,13 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
102
102
|
action: "changeAttrValue",
|
|
103
103
|
retailer: retailerSelected,
|
|
104
104
|
index: index,
|
|
105
|
-
value: e.target.value || "-"
|
|
105
|
+
value: e.target.value || "-",
|
|
106
|
+
name: attr.name,
|
|
107
|
+
retailersId: Object.keys(lists.attrForImgs).slice(0, -1)
|
|
106
108
|
});
|
|
107
109
|
}
|
|
108
110
|
})]
|
|
109
|
-
}, "row-" + index);
|
|
111
|
+
}, "row-" + index + "-" + (attr === null || attr === void 0 ? void 0 : attr.name));
|
|
110
112
|
}))]
|
|
111
113
|
});
|
|
112
114
|
};
|
|
@@ -37,30 +37,30 @@ RetailerProductEditionDefault.args = {
|
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
39
|
services: {
|
|
40
|
-
datasheets:
|
|
41
|
-
descriptions:
|
|
40
|
+
datasheets: 0,
|
|
41
|
+
descriptions: 0,
|
|
42
42
|
images: 1
|
|
43
43
|
},
|
|
44
|
-
orderId:
|
|
45
|
-
status: "
|
|
44
|
+
orderId: 69,
|
|
45
|
+
status: "IN_PROGRESS",
|
|
46
46
|
datasheet_status: null,
|
|
47
47
|
prio: "none",
|
|
48
|
-
version:
|
|
48
|
+
version: 12,
|
|
49
49
|
description_status: null,
|
|
50
50
|
images_status: null,
|
|
51
51
|
article: {
|
|
52
|
-
id_article:
|
|
53
|
-
id_category: "
|
|
54
|
-
name: "
|
|
55
|
-
upc: "
|
|
56
|
-
timestamp: "2022-06-
|
|
57
|
-
id_user:
|
|
52
|
+
id_article: 55109,
|
|
53
|
+
id_category: "2999",
|
|
54
|
+
name: "Resize Ismael",
|
|
55
|
+
upc: "ResizeIsmael",
|
|
56
|
+
timestamp: "2022-06-18T03:32:56.000Z",
|
|
57
|
+
id_user: 110,
|
|
58
58
|
status: "NULL",
|
|
59
59
|
active: 1,
|
|
60
|
-
company_id:
|
|
61
|
-
company_name: "
|
|
62
|
-
country:
|
|
63
|
-
id_order:
|
|
60
|
+
company_id: 834,
|
|
61
|
+
company_name: "THD Resize Proveedor",
|
|
62
|
+
country: null,
|
|
63
|
+
id_order: 69,
|
|
64
64
|
id_datasheet_especialist: null,
|
|
65
65
|
id_datasheet_facilitator: null,
|
|
66
66
|
id_description_especialist: null,
|
|
@@ -69,38 +69,32 @@ RetailerProductEditionDefault.args = {
|
|
|
69
69
|
id_images_facilitator: null,
|
|
70
70
|
id_auditor: null,
|
|
71
71
|
id_recepcionist: null,
|
|
72
|
-
category: "
|
|
73
|
-
missingAttributes:
|
|
74
|
-
missingDescriptions:
|
|
75
|
-
missingImages:
|
|
72
|
+
category: "RESIZING|RESIZING|RESIZING",
|
|
73
|
+
missingAttributes: null,
|
|
74
|
+
missingDescriptions: null,
|
|
75
|
+
missingImages: null
|
|
76
76
|
},
|
|
77
77
|
retailers: [{
|
|
78
|
-
id:
|
|
79
|
-
name: "
|
|
80
|
-
country: "México",
|
|
81
|
-
id_region: 1,
|
|
82
|
-
active: 1
|
|
83
|
-
}, {
|
|
84
|
-
id: 5,
|
|
85
|
-
name: "Chedraui",
|
|
78
|
+
id: 58,
|
|
79
|
+
name: "The Home Depot Golden",
|
|
86
80
|
country: "México",
|
|
87
81
|
id_region: 1,
|
|
88
82
|
active: 1
|
|
89
83
|
}, {
|
|
90
|
-
id:
|
|
91
|
-
name: "
|
|
84
|
+
id: 59,
|
|
85
|
+
name: "The Home Depot Platinum",
|
|
92
86
|
country: "México",
|
|
93
87
|
id_region: 1,
|
|
94
88
|
active: 1
|
|
95
89
|
}, {
|
|
96
|
-
id:
|
|
97
|
-
name: "
|
|
90
|
+
id: 60,
|
|
91
|
+
name: "The Home Depot Resizing",
|
|
98
92
|
country: "México",
|
|
99
93
|
id_region: 1,
|
|
100
94
|
active: 1
|
|
101
95
|
}],
|
|
102
|
-
country:
|
|
103
|
-
upc: "
|
|
96
|
+
country: null,
|
|
97
|
+
upc: "ResizeIsmael"
|
|
104
98
|
},
|
|
105
99
|
location: {
|
|
106
100
|
product: {
|
|
@@ -98,7 +98,9 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
case "changeAttrValue":
|
|
101
|
-
|
|
101
|
+
action.retailersId.forEach(function (ret) {
|
|
102
|
+
attrForImgs[ret][action.index].name === action.name && (attrForImgs[ret][action.index].value = action.value);
|
|
103
|
+
});
|
|
102
104
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
103
105
|
attrForImgs: attrForImgs,
|
|
104
106
|
values: values
|
|
@@ -1459,7 +1461,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1459
1461
|
if (imgsInBack.length > 0) {
|
|
1460
1462
|
var data = {
|
|
1461
1463
|
articleId: product.article.id_article,
|
|
1462
|
-
deleteImages: imgsInBack
|
|
1464
|
+
deleteImages: imgsInBack,
|
|
1465
|
+
orderId: product.orderId
|
|
1463
1466
|
};
|
|
1464
1467
|
|
|
1465
1468
|
try {
|
package/package.json
CHANGED
|
@@ -80,7 +80,7 @@ export const ImageDataTable = ({
|
|
|
80
80
|
{retailerSelected &&
|
|
81
81
|
lists?.attrForImgs &&
|
|
82
82
|
lists?.attrForImgs[retailerSelected]?.map((attr, index) => (
|
|
83
|
-
<Row key={"row-" + index}>
|
|
83
|
+
<Row key={"row-" + index + "-" + attr?.name}>
|
|
84
84
|
<ScreenHeader
|
|
85
85
|
headerType={"table-row-text"}
|
|
86
86
|
text={attr?.name || "-"}
|
|
@@ -94,6 +94,8 @@ export const ImageDataTable = ({
|
|
|
94
94
|
retailer: retailerSelected,
|
|
95
95
|
index,
|
|
96
96
|
value: e.target.value || "-",
|
|
97
|
+
name: attr.name,
|
|
98
|
+
retailersId: Object.keys(lists.attrForImgs).slice(0, -1),
|
|
97
99
|
});
|
|
98
100
|
}}
|
|
99
101
|
/>
|
|
@@ -22,30 +22,30 @@ RetailerProductEditionDefault.args = {
|
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
24
|
services: {
|
|
25
|
-
datasheets:
|
|
26
|
-
descriptions:
|
|
25
|
+
datasheets: 0,
|
|
26
|
+
descriptions: 0,
|
|
27
27
|
images: 1,
|
|
28
28
|
},
|
|
29
|
-
orderId:
|
|
30
|
-
status: "
|
|
29
|
+
orderId: 69,
|
|
30
|
+
status: "IN_PROGRESS",
|
|
31
31
|
datasheet_status: null,
|
|
32
32
|
prio: "none",
|
|
33
|
-
version:
|
|
33
|
+
version: 12,
|
|
34
34
|
description_status: null,
|
|
35
35
|
images_status: null,
|
|
36
36
|
article: {
|
|
37
|
-
id_article:
|
|
38
|
-
id_category: "
|
|
39
|
-
name: "
|
|
40
|
-
upc: "
|
|
41
|
-
timestamp: "2022-06-
|
|
42
|
-
id_user:
|
|
37
|
+
id_article: 55109,
|
|
38
|
+
id_category: "2999",
|
|
39
|
+
name: "Resize Ismael",
|
|
40
|
+
upc: "ResizeIsmael",
|
|
41
|
+
timestamp: "2022-06-18T03:32:56.000Z",
|
|
42
|
+
id_user: 110,
|
|
43
43
|
status: "NULL",
|
|
44
44
|
active: 1,
|
|
45
|
-
company_id:
|
|
46
|
-
company_name: "
|
|
47
|
-
country:
|
|
48
|
-
id_order:
|
|
45
|
+
company_id: 834,
|
|
46
|
+
company_name: "THD Resize Proveedor",
|
|
47
|
+
country: null,
|
|
48
|
+
id_order: 69,
|
|
49
49
|
id_datasheet_especialist: null,
|
|
50
50
|
id_datasheet_facilitator: null,
|
|
51
51
|
id_description_especialist: null,
|
|
@@ -54,43 +54,36 @@ RetailerProductEditionDefault.args = {
|
|
|
54
54
|
id_images_facilitator: null,
|
|
55
55
|
id_auditor: null,
|
|
56
56
|
id_recepcionist: null,
|
|
57
|
-
category: "
|
|
58
|
-
missingAttributes:
|
|
59
|
-
missingDescriptions:
|
|
60
|
-
missingImages:
|
|
57
|
+
category: "RESIZING|RESIZING|RESIZING",
|
|
58
|
+
missingAttributes: null,
|
|
59
|
+
missingDescriptions: null,
|
|
60
|
+
missingImages: null,
|
|
61
61
|
},
|
|
62
62
|
retailers: [
|
|
63
63
|
{
|
|
64
|
-
id:
|
|
65
|
-
name: "
|
|
64
|
+
id: 58,
|
|
65
|
+
name: "The Home Depot Golden",
|
|
66
66
|
country: "México",
|
|
67
67
|
id_region: 1,
|
|
68
68
|
active: 1,
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
id:
|
|
72
|
-
name: "
|
|
71
|
+
id: 59,
|
|
72
|
+
name: "The Home Depot Platinum",
|
|
73
73
|
country: "México",
|
|
74
74
|
id_region: 1,
|
|
75
75
|
active: 1,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
id:
|
|
79
|
-
name: "
|
|
80
|
-
country: "México",
|
|
81
|
-
id_region: 1,
|
|
82
|
-
active: 1,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 13,
|
|
86
|
-
name: "Soriana",
|
|
78
|
+
id: 60,
|
|
79
|
+
name: "The Home Depot Resizing",
|
|
87
80
|
country: "México",
|
|
88
81
|
id_region: 1,
|
|
89
82
|
active: 1,
|
|
90
83
|
},
|
|
91
84
|
],
|
|
92
|
-
country:
|
|
93
|
-
upc: "
|
|
85
|
+
country: null,
|
|
86
|
+
upc: "ResizeIsmael",
|
|
94
87
|
},
|
|
95
88
|
location: {
|
|
96
89
|
product: { articleId: 109485, versionId: 3 },
|
|
@@ -44,7 +44,11 @@ const reducerImages = (state, action) => {
|
|
|
44
44
|
values[action.index][action.attribute] = action.value;
|
|
45
45
|
return { ...state, values };
|
|
46
46
|
case "changeAttrValue":
|
|
47
|
-
|
|
47
|
+
action.retailersId.forEach((ret) => {
|
|
48
|
+
attrForImgs[ret][action.index].name === action.name &&
|
|
49
|
+
(attrForImgs[ret][action.index].value = action.value);
|
|
50
|
+
});
|
|
51
|
+
|
|
48
52
|
return { ...state, attrForImgs, values };
|
|
49
53
|
case "deleteImage":
|
|
50
54
|
values = values.filter(
|
|
@@ -978,6 +982,7 @@ export const RetailerProductEdition = ({
|
|
|
978
982
|
const data = {
|
|
979
983
|
articleId: product.article.id_article,
|
|
980
984
|
deleteImages: imgsInBack,
|
|
985
|
+
orderId: product.orderId,
|
|
981
986
|
};
|
|
982
987
|
try {
|
|
983
988
|
axios.put(
|