contentoh-components-library 21.1.14 → 21.1.15
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/GeneralInput/index.js +12 -4
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +35 -41
- package/package.json +1 -1
- package/src/components/atoms/GeneralInput/index.js +11 -6
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +36 -42
|
@@ -60,9 +60,18 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
60
60
|
value: validateInput(evt, position, inputsArray)
|
|
61
61
|
});
|
|
62
62
|
} else if (updatedDatasheets || updatedDescriptions || inputType === "textarea") {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
if ((optionList === null || optionList === void 0 ? void 0 : optionList.length) > 0) {
|
|
64
|
+
var index = evt.target.selectedIndex;
|
|
65
|
+
var valueSelected = evt.target.value;
|
|
66
|
+
setTextValue({
|
|
67
|
+
value: index > 0 ? valueSelected : undefined
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
setTextValue({
|
|
71
|
+
value: inputType === "checkbox" ? evt.target.checked : evt.target.value
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
66
75
|
var dataSave = updatedDatasheets === null || updatedDatasheets === void 0 ? void 0 : updatedDatasheets.slice();
|
|
67
76
|
if (dataSave.length === 0) dataSave.push({
|
|
68
77
|
articleId: articleId,
|
|
@@ -109,7 +118,6 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
109
118
|
},
|
|
110
119
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
111
120
|
value: "",
|
|
112
|
-
disabled: true,
|
|
113
121
|
children: description
|
|
114
122
|
}), JSON.parse(optionList || "[]").map(function (element, index) {
|
|
115
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
@@ -37,64 +37,58 @@ RetailerProductEditionDefault.args = {
|
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
39
|
services: {
|
|
40
|
-
datasheets:
|
|
41
|
-
descriptions:
|
|
40
|
+
datasheets: 1,
|
|
41
|
+
descriptions: 1,
|
|
42
42
|
images: 1
|
|
43
43
|
},
|
|
44
|
-
orderId:
|
|
45
|
-
status: "
|
|
46
|
-
datasheet_status:
|
|
44
|
+
orderId: 83,
|
|
45
|
+
status: "ASSIGNED",
|
|
46
|
+
datasheet_status: "IN_PROGRESS",
|
|
47
47
|
prio: "none",
|
|
48
|
-
version:
|
|
49
|
-
description_status:
|
|
50
|
-
images_status:
|
|
48
|
+
version: 2,
|
|
49
|
+
description_status: "IN_PROGRESS",
|
|
50
|
+
images_status: "IN_PROGRESS",
|
|
51
51
|
article: {
|
|
52
|
-
id_article:
|
|
53
|
-
id_category: "
|
|
54
|
-
name: "
|
|
55
|
-
upc: "
|
|
56
|
-
timestamp: "2022-06-
|
|
57
|
-
id_user:
|
|
52
|
+
id_article: 55150,
|
|
53
|
+
id_category: "697",
|
|
54
|
+
name: "Shampoo hidratante",
|
|
55
|
+
upc: "4116665",
|
|
56
|
+
timestamp: "2022-06-21T19:47:57.000Z",
|
|
57
|
+
id_user: 28,
|
|
58
58
|
status: "NULL",
|
|
59
59
|
active: 1,
|
|
60
|
-
company_id:
|
|
61
|
-
company_name: "
|
|
62
|
-
country:
|
|
63
|
-
id_order:
|
|
64
|
-
id_datasheet_especialist:
|
|
65
|
-
id_datasheet_facilitator:
|
|
66
|
-
id_description_especialist:
|
|
67
|
-
id_description_facilitator:
|
|
68
|
-
id_images_especialist:
|
|
69
|
-
id_images_facilitator:
|
|
70
|
-
id_auditor:
|
|
60
|
+
company_id: 1,
|
|
61
|
+
company_name: "COMPANY DEV",
|
|
62
|
+
country: "México",
|
|
63
|
+
id_order: 83,
|
|
64
|
+
id_datasheet_especialist: 54,
|
|
65
|
+
id_datasheet_facilitator: 52,
|
|
66
|
+
id_description_especialist: 54,
|
|
67
|
+
id_description_facilitator: 52,
|
|
68
|
+
id_images_especialist: 55,
|
|
69
|
+
id_images_facilitator: 53,
|
|
70
|
+
id_auditor: 30,
|
|
71
71
|
id_recepcionist: null,
|
|
72
|
-
category: "
|
|
73
|
-
missingAttributes:
|
|
74
|
-
missingDescriptions:
|
|
75
|
-
missingImages:
|
|
72
|
+
category: "SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
|
|
73
|
+
missingAttributes: 31,
|
|
74
|
+
missingDescriptions: 6,
|
|
75
|
+
missingImages: 3
|
|
76
76
|
},
|
|
77
77
|
retailers: [{
|
|
78
|
-
id:
|
|
79
|
-
name: "
|
|
80
|
-
country: "México",
|
|
81
|
-
id_region: 1,
|
|
82
|
-
active: 1
|
|
83
|
-
}, {
|
|
84
|
-
id: 59,
|
|
85
|
-
name: "The Home Depot Platinum",
|
|
78
|
+
id: 4,
|
|
79
|
+
name: "Walmart Super y Superama",
|
|
86
80
|
country: "México",
|
|
87
81
|
id_region: 1,
|
|
88
82
|
active: 1
|
|
89
83
|
}, {
|
|
90
|
-
id:
|
|
91
|
-
name: "
|
|
84
|
+
id: 26,
|
|
85
|
+
name: "Mercado Libre",
|
|
92
86
|
country: "México",
|
|
93
87
|
id_region: 1,
|
|
94
88
|
active: 1
|
|
95
89
|
}],
|
|
96
|
-
country:
|
|
97
|
-
upc: "
|
|
90
|
+
country: "México",
|
|
91
|
+
upc: "4116665"
|
|
98
92
|
},
|
|
99
93
|
location: {
|
|
100
94
|
product: {
|
package/package.json
CHANGED
|
@@ -38,9 +38,16 @@ export const GeneralInput = ({
|
|
|
38
38
|
updatedDescriptions ||
|
|
39
39
|
inputType === "textarea"
|
|
40
40
|
) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
if (optionList?.length > 0) {
|
|
42
|
+
let index = evt.target.selectedIndex;
|
|
43
|
+
let valueSelected = evt.target.value;
|
|
44
|
+
setTextValue({ value: index > 0 ? valueSelected : undefined });
|
|
45
|
+
} else {
|
|
46
|
+
setTextValue({
|
|
47
|
+
value:
|
|
48
|
+
inputType === "checkbox" ? evt.target.checked : evt.target.value,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
44
51
|
let dataSave = updatedDatasheets?.slice();
|
|
45
52
|
if (dataSave.length === 0)
|
|
46
53
|
dataSave.push({
|
|
@@ -89,9 +96,7 @@ export const GeneralInput = ({
|
|
|
89
96
|
//disabled={!enableInputs}
|
|
90
97
|
onChange={(e) => onHandleChange(e)}
|
|
91
98
|
>
|
|
92
|
-
<option value=""
|
|
93
|
-
{description}
|
|
94
|
-
</option>
|
|
99
|
+
<option value="">{description}</option>
|
|
95
100
|
{JSON.parse(optionList || "[]").map((element, index) => (
|
|
96
101
|
<option
|
|
97
102
|
key={element + "-" + index}
|
|
@@ -22,68 +22,62 @@ RetailerProductEditionDefault.args = {
|
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
24
|
services: {
|
|
25
|
-
datasheets:
|
|
26
|
-
descriptions:
|
|
25
|
+
datasheets: 1,
|
|
26
|
+
descriptions: 1,
|
|
27
27
|
images: 1,
|
|
28
28
|
},
|
|
29
|
-
orderId:
|
|
30
|
-
status: "
|
|
31
|
-
datasheet_status:
|
|
29
|
+
orderId: 83,
|
|
30
|
+
status: "ASSIGNED",
|
|
31
|
+
datasheet_status: "IN_PROGRESS",
|
|
32
32
|
prio: "none",
|
|
33
|
-
version:
|
|
34
|
-
description_status:
|
|
35
|
-
images_status:
|
|
33
|
+
version: 2,
|
|
34
|
+
description_status: "IN_PROGRESS",
|
|
35
|
+
images_status: "IN_PROGRESS",
|
|
36
36
|
article: {
|
|
37
|
-
id_article:
|
|
38
|
-
id_category: "
|
|
39
|
-
name: "
|
|
40
|
-
upc: "
|
|
41
|
-
timestamp: "2022-06-
|
|
42
|
-
id_user:
|
|
37
|
+
id_article: 55150,
|
|
38
|
+
id_category: "697",
|
|
39
|
+
name: "Shampoo hidratante",
|
|
40
|
+
upc: "4116665",
|
|
41
|
+
timestamp: "2022-06-21T19:47:57.000Z",
|
|
42
|
+
id_user: 28,
|
|
43
43
|
status: "NULL",
|
|
44
44
|
active: 1,
|
|
45
|
-
company_id:
|
|
46
|
-
company_name: "
|
|
47
|
-
country:
|
|
48
|
-
id_order:
|
|
49
|
-
id_datasheet_especialist:
|
|
50
|
-
id_datasheet_facilitator:
|
|
51
|
-
id_description_especialist:
|
|
52
|
-
id_description_facilitator:
|
|
53
|
-
id_images_especialist:
|
|
54
|
-
id_images_facilitator:
|
|
55
|
-
id_auditor:
|
|
45
|
+
company_id: 1,
|
|
46
|
+
company_name: "COMPANY DEV",
|
|
47
|
+
country: "México",
|
|
48
|
+
id_order: 83,
|
|
49
|
+
id_datasheet_especialist: 54,
|
|
50
|
+
id_datasheet_facilitator: 52,
|
|
51
|
+
id_description_especialist: 54,
|
|
52
|
+
id_description_facilitator: 52,
|
|
53
|
+
id_images_especialist: 55,
|
|
54
|
+
id_images_facilitator: 53,
|
|
55
|
+
id_auditor: 30,
|
|
56
56
|
id_recepcionist: null,
|
|
57
|
-
category:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
category:
|
|
58
|
+
"SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
|
|
59
|
+
missingAttributes: 31,
|
|
60
|
+
missingDescriptions: 6,
|
|
61
|
+
missingImages: 3,
|
|
61
62
|
},
|
|
62
63
|
retailers: [
|
|
63
64
|
{
|
|
64
|
-
id:
|
|
65
|
-
name: "
|
|
65
|
+
id: 4,
|
|
66
|
+
name: "Walmart Super y Superama",
|
|
66
67
|
country: "México",
|
|
67
68
|
id_region: 1,
|
|
68
69
|
active: 1,
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
|
-
id:
|
|
72
|
-
name: "
|
|
73
|
-
country: "México",
|
|
74
|
-
id_region: 1,
|
|
75
|
-
active: 1,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: 60,
|
|
79
|
-
name: "The Home Depot Resizing",
|
|
72
|
+
id: 26,
|
|
73
|
+
name: "Mercado Libre",
|
|
80
74
|
country: "México",
|
|
81
75
|
id_region: 1,
|
|
82
76
|
active: 1,
|
|
83
77
|
},
|
|
84
78
|
],
|
|
85
|
-
country:
|
|
86
|
-
upc: "
|
|
79
|
+
country: "México",
|
|
80
|
+
upc: "4116665",
|
|
87
81
|
},
|
|
88
82
|
location: {
|
|
89
83
|
product: { articleId: 109485, versionId: 3 },
|