contentoh-components-library 21.5.99 → 21.6.1
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/GeneralButton/styles.js +1 -1
- package/dist/components/atoms/GeneralInput/index.js +249 -54
- package/dist/components/atoms/GeneralInput/styles.js +7 -3
- package/dist/components/atoms/InputFormatter/index.js +223 -68
- package/dist/components/atoms/InputFormatter/styles.js +20 -4
- package/dist/components/molecules/StatusAsignationInfo/index.js +11 -1
- package/dist/components/molecules/TabsMenu/index.js +13 -1
- package/dist/components/molecules/TagAndInput/index.js +364 -24
- package/dist/components/molecules/TagAndInput/styles.js +2 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +6 -22
- package/dist/components/organisms/InputGroup/index.js +22 -18
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +150 -337
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
- package/dist/components/pages/ProviderProductEdition/index.js +393 -352
- package/dist/components/pages/ProviderProductEdition/utils.js +1 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +125 -211
- package/dist/components/pages/RetailerProductEdition/index.js +1743 -2239
- package/dist/components/pages/RetailerProductEdition/styles.js +4 -2
- package/dist/components/pages/RetailerProductEdition/utils.js +251 -2
- package/dist/contexts/AiProductEdition.js +34 -22
- package/package.json +4 -2
- package/src/ai/utils/compare-strings.js +45 -0
- package/src/assets/images/Icons/arrow.png +0 -0
- package/src/assets/images/Icons/cancel.png +0 -0
- package/src/assets/images/Icons/ia-icon.png +0 -0
- package/src/assets/images/Icons/loading.svg +5 -0
- package/src/assets/images/Icons/reload.png +0 -0
- package/src/components/atoms/GeneralButton/styles.js +4 -0
- package/src/components/atoms/GeneralInput/index.js +241 -60
- package/src/components/atoms/GeneralInput/styles.js +81 -0
- package/src/components/atoms/InputFormatter/index.js +200 -51
- package/src/components/atoms/InputFormatter/styles.js +284 -0
- package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +10 -0
- package/src/components/atoms/RetailerSelector/index.js +3 -0
- package/src/components/atoms/RetailerSelector/styles.js +0 -0
- package/src/components/molecules/StatusAsignationInfo/index.js +9 -1
- package/src/components/molecules/TabsMenu/index.js +12 -0
- package/src/components/molecules/TagAndInput/index.js +294 -21
- package/src/components/molecules/TagAndInput/styles.js +59 -17
- package/src/components/organisms/ChangeStatusModal/index.jsx +488 -0
- package/src/components/organisms/ChangeStatusModal/styles.js +333 -0
- package/src/components/organisms/FullProductNameHeader/index.js +4 -28
- package/src/components/organisms/FullTabsMenu/index.js +1 -1
- package/src/components/organisms/InputGroup/index.js +12 -4
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +174 -202
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
- package/src/components/pages/ProviderProductEdition/index.js +486 -417
- package/src/components/pages/ProviderProductEdition/utils.js +2 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +136 -243
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +575 -0
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +62 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +344 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +155 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/product.js +114 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/system.js +60 -0
- package/src/components/pages/RetailerProductEdition/index.js +1580 -1719
- package/src/components/pages/RetailerProductEdition/index_old.js +1979 -0
- package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +101 -0
- package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +115 -0
- package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +174 -0
- package/src/components/pages/RetailerProductEdition/styles.js +67 -2
- package/src/components/pages/RetailerProductEdition/utils.js +240 -0
- package/src/contexts/AiProductEdition.jsx +356 -0
- package/src/global-files/statusDictionary.js +103 -0
|
@@ -21,217 +21,189 @@ ProviderProductEditionFromProducts.args = {
|
|
|
21
21
|
category: 102,
|
|
22
22
|
version: 3,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
"orderId": 10458,
|
|
25
|
+
"status": "AA",
|
|
26
|
+
"datasheet_status": "AA",
|
|
27
|
+
"prio": "none",
|
|
28
|
+
"version": 3,
|
|
29
|
+
"description_status": "AA",
|
|
30
|
+
"images_status": "AA",
|
|
31
|
+
"brand": "Generico",
|
|
32
|
+
"retailerOrder": 0,
|
|
33
|
+
"missing": {
|
|
34
|
+
"datasheet": null,
|
|
35
|
+
"descriptions": null,
|
|
36
|
+
"images": null
|
|
37
|
+
},
|
|
38
|
+
"services": {
|
|
39
|
+
"datasheets": 1,
|
|
40
|
+
"descriptions": 1,
|
|
41
|
+
"images": 1
|
|
42
|
+
},
|
|
43
|
+
"article": {
|
|
44
|
+
"category": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
45
|
+
"company_name": "LATAM LOGISTICS",
|
|
46
|
+
"country": "México",
|
|
47
|
+
"id_category": "6186",
|
|
48
|
+
"id_datasheet_especialist": 426,
|
|
49
|
+
"id_datasheet_facilitator": null,
|
|
50
|
+
"id_description_especialist": 426,
|
|
51
|
+
"id_description_facilitator": null,
|
|
52
|
+
"id_images_especialist": 427,
|
|
53
|
+
"id_images_facilitator": null,
|
|
54
|
+
"id_order": 10458,
|
|
55
|
+
"id_article": 145207,
|
|
56
|
+
"id_auditor": 425,
|
|
57
|
+
"name": "Serna Status Bug 5",
|
|
58
|
+
"timestamp": "2026-05-07T15:00:25.000Z",
|
|
59
|
+
"upc": "897654352",
|
|
60
|
+
"sku": "764535242",
|
|
61
|
+
"categoryRetailer": [
|
|
62
|
+
{
|
|
63
|
+
"id_category": 4010,
|
|
64
|
+
"id_retailer": 70,
|
|
65
|
+
"category_name": "Accesorios de Bebés|Cuarto del Bebé Niño|Cuarto del Bebé Niño",
|
|
66
|
+
"retailer_name": "Bodega Aurrera"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id_category": 6186,
|
|
70
|
+
"id_retailer": 9,
|
|
71
|
+
"category_name": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
72
|
+
"retailer_name": "Amazon"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"retailers": [
|
|
77
|
+
{
|
|
78
|
+
"id": 9,
|
|
79
|
+
"name": "Amazon"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": 70,
|
|
83
|
+
"name": "Bodega Aurrera"
|
|
84
|
+
}
|
|
52
85
|
],
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
descriptions: { required: 100, general: 100 },
|
|
59
|
-
images: {
|
|
60
|
-
required: 100,
|
|
61
|
-
general: 80.01,
|
|
62
|
-
details: {
|
|
63
|
-
mandatoryShots: { total: 1, completed: 1, percentage: 100 },
|
|
64
|
-
optionalShots: { total: 35, completed: 3, percentage: 8.57 },
|
|
65
|
-
namingAttributes: { total: 1, completed: 1, percentage: 100 },
|
|
66
|
-
},
|
|
86
|
+
"statusByRetailer": {
|
|
87
|
+
"9": {
|
|
88
|
+
"datasheet": "AA",
|
|
89
|
+
"description": "AA",
|
|
90
|
+
"images": "AA"
|
|
67
91
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
details: {
|
|
79
|
-
mandatoryShots: { total: 1, completed: 1, percentage: 100 },
|
|
80
|
-
optionalShots: { total: 35, completed: 3, percentage: 8.57 },
|
|
81
|
-
namingAttributes: { total: 1, completed: 1, percentage: 100 },
|
|
82
|
-
},
|
|
92
|
+
"70": {
|
|
93
|
+
"datasheet": "AA",
|
|
94
|
+
"description": "AA",
|
|
95
|
+
"images": "AA"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"retailersAvailable": [
|
|
99
|
+
{
|
|
100
|
+
"id": 9,
|
|
101
|
+
"name": "Amazon"
|
|
83
102
|
},
|
|
84
|
-
|
|
85
|
-
|
|
103
|
+
{
|
|
104
|
+
"id": 70,
|
|
105
|
+
"name": "Bodega Aurrera"
|
|
106
|
+
}
|
|
86
107
|
],
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
108
|
+
"categoryName": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
109
|
+
"upc": "897654352",
|
|
110
|
+
"id_article": 145207,
|
|
111
|
+
"id_order": 10458
|
|
112
|
+
},
|
|
90
113
|
productToEdit: {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
product:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
descriptions: { required: 0, general: 0 },
|
|
151
|
-
images: {
|
|
152
|
-
required: 64.99,
|
|
153
|
-
general: 51.99,
|
|
154
|
-
details: {
|
|
155
|
-
mandatoryShots: { total: 2, completed: 1, percentage: 50 },
|
|
156
|
-
optionalShots: { total: 10, completed: 0, percentage: 0 },
|
|
157
|
-
namingAttributes: { total: 1, completed: 1, percentage: 100 },
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
percentagesGeneral: { required: 23.33, general: 6.11 },
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
id_retailer: 6,
|
|
164
|
-
id_category: 4767,
|
|
165
|
-
datasheet: { required: 25, general: 16.66 },
|
|
166
|
-
descriptions: { required: 0, general: 0 },
|
|
167
|
-
images: {
|
|
168
|
-
required: 100,
|
|
169
|
-
general: 80.01,
|
|
170
|
-
details: {
|
|
171
|
-
mandatoryShots: { total: 1, completed: 1, percentage: 100 },
|
|
172
|
-
optionalShots: { total: 36, completed: 2, percentage: 5.55 },
|
|
173
|
-
namingAttributes: { total: 1, completed: 1, percentage: 100 },
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
percentagesGeneral: { required: 41.67, general: 8.25 },
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
id_retailer: 13,
|
|
180
|
-
id_category: 4941,
|
|
181
|
-
datasheet: { required: 14.28, general: 3.84 },
|
|
182
|
-
descriptions: { required: 0, general: 0 },
|
|
183
|
-
images: {
|
|
184
|
-
required: 100,
|
|
185
|
-
general: 80.01,
|
|
186
|
-
details: {
|
|
187
|
-
mandatoryShots: { total: 1, completed: 1, percentage: 100 },
|
|
188
|
-
optionalShots: { total: 37, completed: 2, percentage: 5.4 },
|
|
189
|
-
namingAttributes: { total: 1, completed: 1, percentage: 100 },
|
|
190
|
-
},
|
|
114
|
+
"ArticleId": 145207,
|
|
115
|
+
"idCategory": "6186",
|
|
116
|
+
"product": {
|
|
117
|
+
"orderId": 10458,
|
|
118
|
+
"status": "AA",
|
|
119
|
+
"datasheet_status": "AA",
|
|
120
|
+
"prio": "none",
|
|
121
|
+
"version": 3,
|
|
122
|
+
"description_status": "AA",
|
|
123
|
+
"images_status": "AA",
|
|
124
|
+
"brand": "Generico",
|
|
125
|
+
"retailerOrder": 0,
|
|
126
|
+
"missing": {
|
|
127
|
+
"datasheet": null,
|
|
128
|
+
"descriptions": null,
|
|
129
|
+
"images": null
|
|
130
|
+
},
|
|
131
|
+
"services": {
|
|
132
|
+
"datasheets": 1,
|
|
133
|
+
"descriptions": 1,
|
|
134
|
+
"images": 1
|
|
135
|
+
},
|
|
136
|
+
"article": {
|
|
137
|
+
"category": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
138
|
+
"company_name": "LATAM LOGISTICS",
|
|
139
|
+
"country": "México",
|
|
140
|
+
"id_category": "6186",
|
|
141
|
+
"id_datasheet_especialist": 426,
|
|
142
|
+
"id_datasheet_facilitator": null,
|
|
143
|
+
"id_description_especialist": 426,
|
|
144
|
+
"id_description_facilitator": null,
|
|
145
|
+
"id_images_especialist": 427,
|
|
146
|
+
"id_images_facilitator": null,
|
|
147
|
+
"id_order": 10458,
|
|
148
|
+
"id_article": 145207,
|
|
149
|
+
"id_auditor": 425,
|
|
150
|
+
"name": "Serna Status Bug 5",
|
|
151
|
+
"timestamp": "2026-05-07T15:00:25.000Z",
|
|
152
|
+
"upc": "897654352",
|
|
153
|
+
"sku": "764535242",
|
|
154
|
+
"categoryRetailer": [
|
|
155
|
+
{
|
|
156
|
+
"id_category": 4010,
|
|
157
|
+
"id_retailer": 70,
|
|
158
|
+
"category_name": "Accesorios de Bebés|Cuarto del Bebé Niño|Cuarto del Bebé Niño",
|
|
159
|
+
"retailer_name": "Bodega Aurrera"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id_category": 6186,
|
|
163
|
+
"id_retailer": 9,
|
|
164
|
+
"category_name": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
165
|
+
"retailer_name": "Amazon"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"retailers": [
|
|
170
|
+
{
|
|
171
|
+
"id": 9,
|
|
172
|
+
"name": "Amazon"
|
|
191
173
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
details: {
|
|
203
|
-
mandatoryShots: { total: 1, completed: 1, percentage: 100 },
|
|
204
|
-
optionalShots: { total: 37, completed: 3, percentage: 8.1 },
|
|
205
|
-
namingAttributes: { total: 1, completed: 1, percentage: 100 },
|
|
206
|
-
},
|
|
174
|
+
{
|
|
175
|
+
"id": 70,
|
|
176
|
+
"name": "Bodega Aurrera"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"statusByRetailer": {
|
|
180
|
+
"9": {
|
|
181
|
+
"datasheet": "AA",
|
|
182
|
+
"description": "AA",
|
|
183
|
+
"images": "AA"
|
|
207
184
|
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
details: {
|
|
219
|
-
mandatoryShots: { total: 1, completed: 1, percentage: 100 },
|
|
220
|
-
optionalShots: { total: 34, completed: 1, percentage: 2.94 },
|
|
221
|
-
namingAttributes: { total: 1, completed: 1, percentage: 100 },
|
|
222
|
-
},
|
|
185
|
+
"70": {
|
|
186
|
+
"datasheet": "AA",
|
|
187
|
+
"description": "AA",
|
|
188
|
+
"images": "AA"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"retailersAvailable": [
|
|
192
|
+
{
|
|
193
|
+
"id": 9,
|
|
194
|
+
"name": "Amazon"
|
|
223
195
|
},
|
|
224
|
-
|
|
225
|
-
|
|
196
|
+
{
|
|
197
|
+
"id": 70,
|
|
198
|
+
"name": "Bodega Aurrera"
|
|
199
|
+
}
|
|
226
200
|
],
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
],
|
|
234
|
-
},
|
|
201
|
+
"categoryName": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
202
|
+
"upc": "897654352",
|
|
203
|
+
"id_article": 145207,
|
|
204
|
+
"id_order": 10458
|
|
205
|
+
}
|
|
206
|
+
},
|
|
235
207
|
location: {
|
|
236
208
|
pathname: "/EditProducts",
|
|
237
209
|
search: "",
|
package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx
CHANGED
|
@@ -31,6 +31,19 @@ export { ACTIONS };
|
|
|
31
31
|
// Create context
|
|
32
32
|
const ProductEditionContext = createContext();
|
|
33
33
|
|
|
34
|
+
// Custom hook to use the context
|
|
35
|
+
export const useProviderProductEdition = () => {
|
|
36
|
+
const context = useContext(ProductEditionContext);
|
|
37
|
+
|
|
38
|
+
if (!context) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
"useProviderProductEdition must be used within a ProviderProductEditionProvider"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return context;
|
|
45
|
+
};
|
|
46
|
+
|
|
34
47
|
// Provider component
|
|
35
48
|
export const ProviderProductEditionProvider = ({ children }) => {
|
|
36
49
|
const [state, dispatch] = useReducer(productEditionReducer, initialState);
|
|
@@ -404,17 +417,4 @@ export const ProviderProductEditionProvider = ({ children }) => {
|
|
|
404
417
|
|
|
405
418
|
ProviderProductEditionProvider.propTypes = {
|
|
406
419
|
children: PropTypes.node.isRequired,
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
// Custom hook to use the context
|
|
410
|
-
export const useProviderProductEdition = () => {
|
|
411
|
-
const context = useContext(ProductEditionContext);
|
|
412
|
-
|
|
413
|
-
if (!context) {
|
|
414
|
-
throw new Error(
|
|
415
|
-
"useProviderProductEdition must be used within a ProviderProductEditionProvider"
|
|
416
|
-
);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
return context;
|
|
420
|
-
};
|
|
420
|
+
};
|