contentoh-components-library 21.1.12 → 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/molecules/TableHeader/index.js +4 -2
- package/dist/components/organisms/ImageDataTable/index.js +7 -3
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +94 -104
- package/dist/components/pages/ProviderProductEdition/index.js +28 -275
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +34 -40
- package/dist/components/pages/RetailerProductEdition/index.js +104 -162
- package/package.json +1 -1
- package/src/components/atoms/GeneralInput/index.js +11 -6
- package/src/components/molecules/TableHeader/index.js +2 -0
- package/src/components/organisms/ImageDataTable/index.js +5 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +93 -106
- package/src/components/pages/ProviderProductEdition/index.js +13 -297
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +35 -41
- package/src/components/pages/RetailerProductEdition/index.js +105 -182
|
@@ -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", {
|
|
@@ -21,7 +21,8 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
21
21
|
assignationsImages = _ref.assignationsImages,
|
|
22
22
|
setAssignation = _ref.setAssignation,
|
|
23
23
|
isRetailer = _ref.isRetailer,
|
|
24
|
-
onClickSave = _ref.onClickSave
|
|
24
|
+
onClickSave = _ref.onClickSave,
|
|
25
|
+
showSaveButton = _ref.showSaveButton;
|
|
25
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
26
27
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
27
28
|
text: (activeImage === null || activeImage === void 0 ? void 0 : activeImage.name) || "-",
|
|
@@ -32,7 +33,8 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
32
33
|
assignationsImages: assignationsImages,
|
|
33
34
|
setAssignation: setAssignation,
|
|
34
35
|
isRetailer: isRetailer,
|
|
35
|
-
onClickSave: onClickSave
|
|
36
|
+
onClickSave: onClickSave,
|
|
37
|
+
showSaveButton: showSaveButton
|
|
36
38
|
})]
|
|
37
39
|
});
|
|
38
40
|
};
|
|
@@ -31,7 +31,8 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
31
31
|
imagesStatus = _ref.imagesStatus,
|
|
32
32
|
setAssignation = _ref.setAssignation,
|
|
33
33
|
isRetailer = _ref.isRetailer,
|
|
34
|
-
onClickSave = _ref.onClickSave
|
|
34
|
+
onClickSave = _ref.onClickSave,
|
|
35
|
+
showSaveButton = _ref.showSaveButton;
|
|
35
36
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
36
37
|
darkMode: darkMode,
|
|
37
38
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TableHeader.TableHeader, {
|
|
@@ -40,6 +41,7 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
40
41
|
assignationsImages: assignationsImages,
|
|
41
42
|
setAssignation: setAssignation,
|
|
42
43
|
isRetailer: isRetailer,
|
|
44
|
+
showSaveButton: showSaveButton,
|
|
43
45
|
onClickSave: onClickSave
|
|
44
46
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.Container, {
|
|
45
47
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
@@ -100,11 +102,13 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
100
102
|
action: "changeAttrValue",
|
|
101
103
|
retailer: retailerSelected,
|
|
102
104
|
index: index,
|
|
103
|
-
value: e.target.value || "-"
|
|
105
|
+
value: e.target.value || "-",
|
|
106
|
+
name: attr.name,
|
|
107
|
+
retailersId: Object.keys(lists.attrForImgs).slice(0, -1)
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
})]
|
|
107
|
-
}, "row-" + index);
|
|
111
|
+
}, "row-" + index + "-" + (attr === null || attr === void 0 ? void 0 : attr.name));
|
|
108
112
|
}))]
|
|
109
113
|
});
|
|
110
114
|
};
|
|
@@ -31,113 +31,105 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlw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wqe1MX4uE7Gbx14nEUXjdeRxnr3Nis7mad4miWxCUurl_RaoPd5JKvhwhvhnvG1RGlZTa0wOSW36Y4GjJ-MgG63akBwNCouDUlcOSe--Dy0gXpNVPgh5XRDr-mHVtz_iOarJ_mRGbY5jAlMmw1DzxcH0sD-ppFQzMMbguFxnH9g",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
article_status: "AP",
|
|
41
|
-
datasheet_status: "NS",
|
|
42
|
-
description_status: "NS",
|
|
43
|
-
images_status: "AP",
|
|
44
|
-
prio: "none",
|
|
45
|
-
version: 19,
|
|
39
|
+
version: 1,
|
|
46
40
|
brand: null,
|
|
41
|
+
missing: {
|
|
42
|
+
datasheet: null,
|
|
43
|
+
descriptions: null,
|
|
44
|
+
images: null
|
|
45
|
+
},
|
|
47
46
|
article: {
|
|
48
|
-
category: "
|
|
49
|
-
company_name: "
|
|
50
|
-
|
|
51
|
-
id_category: "
|
|
52
|
-
id_article:
|
|
53
|
-
name: "
|
|
54
|
-
upc: "
|
|
47
|
+
category: "MATERIALES DE CONSTRUCCIÓN|BÁSICOS DE CONSTRUCCIÓN|ADOQUINES",
|
|
48
|
+
company_name: "TABICEL DEL CENTRO",
|
|
49
|
+
company_id: 529,
|
|
50
|
+
id_category: "2578",
|
|
51
|
+
id_article: 24,
|
|
52
|
+
name: "ADOQUIN ROJO 20X 40 X 6",
|
|
53
|
+
upc: "85369"
|
|
55
54
|
},
|
|
55
|
+
asignations: [62],
|
|
56
56
|
retailers: [{
|
|
57
57
|
id: 58,
|
|
58
|
-
name: "The Home Depot Golden"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, {
|
|
63
|
-
id: 60,
|
|
64
|
-
name: "The Home Depot Resizing"
|
|
65
|
-
}, {
|
|
66
|
-
id: 61,
|
|
67
|
-
name: "Home Depot TAB"
|
|
58
|
+
name: "The Home Depot Golden",
|
|
59
|
+
country: "México",
|
|
60
|
+
id_region: 1,
|
|
61
|
+
active: 1
|
|
68
62
|
}],
|
|
69
|
-
services: {
|
|
70
|
-
datasheets: 0,
|
|
71
|
-
descriptions: 0,
|
|
72
|
-
images: 1
|
|
73
|
-
},
|
|
74
|
-
id_article: 55109,
|
|
75
63
|
retailersAvailable: [{
|
|
76
64
|
id: 58,
|
|
77
|
-
name: "The Home Depot Golden"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
65
|
+
name: "The Home Depot Golden",
|
|
66
|
+
country: "México",
|
|
67
|
+
id_region: 1,
|
|
68
|
+
active: 1
|
|
69
|
+
}],
|
|
70
|
+
upc: "85369",
|
|
71
|
+
name: "ADOQUIN ROJO 20X 40 X 6",
|
|
72
|
+
categoryName: "MATERIALES DE CONSTRUCCIÓN|BÁSICOS DE CONSTRUCCIÓN|ADOQUINES",
|
|
73
|
+
id_category: "2578",
|
|
74
|
+
id_article: 24,
|
|
75
|
+
services: [{
|
|
76
|
+
id_article: 24,
|
|
77
|
+
service: "datasheet",
|
|
78
|
+
quantity: 1,
|
|
79
|
+
price: 0,
|
|
80
|
+
id_user: 59,
|
|
81
|
+
datasheet_common: null,
|
|
82
|
+
discount: null
|
|
87
83
|
}]
|
|
88
84
|
},
|
|
89
85
|
productToEdit: {
|
|
90
|
-
ArticleId:
|
|
91
|
-
idCategory: "
|
|
86
|
+
ArticleId: 24,
|
|
87
|
+
idCategory: "2578",
|
|
92
88
|
product: {
|
|
93
|
-
|
|
94
|
-
article_status: "AP",
|
|
95
|
-
datasheet_status: "NS",
|
|
96
|
-
description_status: "NS",
|
|
97
|
-
images_status: "AP",
|
|
98
|
-
prio: "none",
|
|
99
|
-
version: 19,
|
|
89
|
+
version: 1,
|
|
100
90
|
brand: null,
|
|
91
|
+
missing: {
|
|
92
|
+
datasheet: null,
|
|
93
|
+
descriptions: null,
|
|
94
|
+
images: null
|
|
95
|
+
},
|
|
101
96
|
article: {
|
|
102
|
-
category: "
|
|
103
|
-
company_name: "
|
|
104
|
-
|
|
105
|
-
id_category: "
|
|
106
|
-
id_article:
|
|
107
|
-
name: "
|
|
108
|
-
upc: "
|
|
97
|
+
category: "MATERIALES DE CONSTRUCCIÓN|BÁSICOS DE CONSTRUCCIÓN|ADOQUINES",
|
|
98
|
+
company_name: "TABICEL DEL CENTRO",
|
|
99
|
+
company_id: 529,
|
|
100
|
+
id_category: "2578",
|
|
101
|
+
id_article: 24,
|
|
102
|
+
name: "ADOQUIN ROJO 20X 40 X 6",
|
|
103
|
+
upc: "85369"
|
|
109
104
|
},
|
|
105
|
+
asignations: [62],
|
|
110
106
|
retailers: [{
|
|
111
107
|
id: 58,
|
|
112
|
-
name: "The Home Depot Golden"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}, {
|
|
117
|
-
id: 60,
|
|
118
|
-
name: "The Home Depot Resizing"
|
|
119
|
-
}, {
|
|
120
|
-
id: 61,
|
|
121
|
-
name: "Home Depot TAB"
|
|
108
|
+
name: "The Home Depot Golden",
|
|
109
|
+
country: "México",
|
|
110
|
+
id_region: 1,
|
|
111
|
+
active: 1
|
|
122
112
|
}],
|
|
123
|
-
services: {
|
|
124
|
-
datasheets: 0,
|
|
125
|
-
descriptions: 0,
|
|
126
|
-
images: 1
|
|
127
|
-
},
|
|
128
|
-
id_article: 55109,
|
|
129
113
|
retailersAvailable: [{
|
|
130
114
|
id: 58,
|
|
131
|
-
name: "The Home Depot Golden"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
115
|
+
name: "The Home Depot Golden",
|
|
116
|
+
country: "México",
|
|
117
|
+
id_region: 1,
|
|
118
|
+
active: 1
|
|
119
|
+
}],
|
|
120
|
+
upc: "85369",
|
|
121
|
+
name: "ADOQUIN ROJO 20X 40 X 6",
|
|
122
|
+
categoryName: "MATERIALES DE CONSTRUCCIÓN|BÁSICOS DE CONSTRUCCIÓN|ADOQUINES",
|
|
123
|
+
id_category: "2578",
|
|
124
|
+
id_article: 24,
|
|
125
|
+
services: [{
|
|
126
|
+
id_article: 24,
|
|
127
|
+
service: "datasheet",
|
|
128
|
+
quantity: 1,
|
|
129
|
+
price: 0,
|
|
130
|
+
id_user: 59,
|
|
131
|
+
datasheet_common: null,
|
|
132
|
+
discount: null
|
|
141
133
|
}]
|
|
142
134
|
}
|
|
143
135
|
},
|
|
@@ -146,40 +138,38 @@ ProviderProductEditionDefault.args = {
|
|
|
146
138
|
articleId: 109485,
|
|
147
139
|
versionId: 3
|
|
148
140
|
},
|
|
149
|
-
state: {
|
|
150
|
-
origin: "RequestWithContentoh"
|
|
151
|
-
}
|
|
141
|
+
state: {}
|
|
152
142
|
},
|
|
153
143
|
user: {
|
|
154
|
-
id_user:
|
|
155
|
-
name: "
|
|
156
|
-
last_name: "
|
|
157
|
-
email: "
|
|
158
|
-
position: "
|
|
144
|
+
id_user: 59,
|
|
145
|
+
name: "The Home",
|
|
146
|
+
last_name: "Depot",
|
|
147
|
+
email: "cadena.ismael@allfreemail.net",
|
|
148
|
+
position: "Admin",
|
|
159
149
|
telephone: "+523111366336",
|
|
160
150
|
country: "México",
|
|
161
|
-
id_company:
|
|
162
|
-
id_cognito: "
|
|
151
|
+
id_company: 7,
|
|
152
|
+
id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
|
|
163
153
|
birth_Date: null,
|
|
164
154
|
about_me: null,
|
|
165
155
|
zip_code: null,
|
|
166
156
|
address: null,
|
|
167
157
|
job: null,
|
|
168
|
-
id_stripe: "
|
|
158
|
+
id_stripe: "",
|
|
169
159
|
id_role: 0,
|
|
170
160
|
active: 1,
|
|
171
|
-
is_retailer:
|
|
161
|
+
is_retailer: 1,
|
|
172
162
|
membership: {
|
|
173
|
-
id:
|
|
174
|
-
start_date: "
|
|
175
|
-
end_date: "
|
|
176
|
-
planID:
|
|
177
|
-
plan: "
|
|
178
|
-
name: "Plan
|
|
179
|
-
user_limit: "
|
|
180
|
-
products_limit: "
|
|
163
|
+
id: 24,
|
|
164
|
+
start_date: "2021-11-23T03:35:50.000Z",
|
|
165
|
+
end_date: "2022-11-23T03:35:50.000Z",
|
|
166
|
+
planID: 9,
|
|
167
|
+
plan: "prod_KtlkzZVGq6bRTO",
|
|
168
|
+
name: "Plan Enterprise Full",
|
|
169
|
+
user_limit: "30",
|
|
170
|
+
products_limit: "10000",
|
|
181
171
|
type: "Enterprise"
|
|
182
172
|
},
|
|
183
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
173
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655750711586"
|
|
184
174
|
}
|
|
185
175
|
};
|