contentoh-components-library 21.5.98 → 21.5.99

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.
Files changed (63) hide show
  1. package/dist/components/atoms/GeneralButton/styles.js +1 -1
  2. package/dist/components/atoms/GeneralInput/index.js +54 -249
  3. package/dist/components/atoms/GeneralInput/styles.js +3 -7
  4. package/dist/components/atoms/InputFormatter/index.js +68 -223
  5. package/dist/components/atoms/InputFormatter/styles.js +4 -20
  6. package/dist/components/molecules/StatusAsignationInfo/index.js +1 -11
  7. package/dist/components/molecules/TabsMenu/index.js +1 -13
  8. package/dist/components/molecules/TagAndInput/index.js +24 -364
  9. package/dist/components/molecules/TagAndInput/styles.js +2 -2
  10. package/dist/components/organisms/FullProductNameHeader/index.js +22 -6
  11. package/dist/components/organisms/InputGroup/index.js +18 -22
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +337 -150
  13. package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
  14. package/dist/components/pages/ProviderProductEdition/index.js +377 -413
  15. package/dist/components/pages/ProviderProductEdition/utils.js +0 -1
  16. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +211 -125
  17. package/dist/components/pages/RetailerProductEdition/index.js +2236 -1738
  18. package/dist/components/pages/RetailerProductEdition/styles.js +2 -4
  19. package/dist/components/pages/RetailerProductEdition/utils.js +2 -251
  20. package/package.json +2 -4
  21. package/src/components/atoms/GeneralButton/styles.js +0 -4
  22. package/src/components/atoms/GeneralInput/index.js +60 -241
  23. package/src/components/atoms/GeneralInput/styles.js +0 -81
  24. package/src/components/atoms/InputFormatter/index.js +51 -200
  25. package/src/components/atoms/InputFormatter/styles.js +0 -284
  26. package/src/components/molecules/StatusAsignationInfo/index.js +1 -9
  27. package/src/components/molecules/TabsMenu/index.js +0 -12
  28. package/src/components/molecules/TagAndInput/index.js +21 -294
  29. package/src/components/molecules/TagAndInput/styles.js +17 -59
  30. package/src/components/organisms/FullProductNameHeader/index.js +28 -4
  31. package/src/components/organisms/FullTabsMenu/index.js +1 -1
  32. package/src/components/organisms/InputGroup/index.js +4 -12
  33. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +202 -174
  34. package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
  35. package/src/components/pages/ProviderProductEdition/index.js +418 -486
  36. package/src/components/pages/ProviderProductEdition/utils.js +2 -2
  37. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +243 -136
  38. package/src/components/pages/RetailerProductEdition/index.js +1717 -1563
  39. package/src/components/pages/RetailerProductEdition/styles.js +2 -67
  40. package/src/components/pages/RetailerProductEdition/utils.js +0 -240
  41. package/src/ai/utils/compare-strings.js +0 -45
  42. package/src/assets/images/Icons/arrow.png +0 -0
  43. package/src/assets/images/Icons/cancel.png +0 -0
  44. package/src/assets/images/Icons/ia-icon.png +0 -0
  45. package/src/assets/images/Icons/loading.svg +0 -5
  46. package/src/assets/images/Icons/reload.png +0 -0
  47. package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +0 -10
  48. package/src/components/atoms/RetailerSelector/index.js +0 -3
  49. package/src/components/atoms/RetailerSelector/styles.js +0 -0
  50. package/src/components/organisms/ChangeStatusModal/index.jsx +0 -488
  51. package/src/components/organisms/ChangeStatusModal/styles.js +0 -333
  52. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -575
  53. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -62
  54. package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +0 -344
  55. package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +0 -155
  56. package/src/components/pages/RetailerProductEdition/context/reducers/product.js +0 -114
  57. package/src/components/pages/RetailerProductEdition/context/reducers/system.js +0 -60
  58. package/src/components/pages/RetailerProductEdition/index_old.js +0 -1979
  59. package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +0 -101
  60. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -115
  61. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +0 -174
  62. package/src/contexts/AiProductEdition.jsx +0 -347
  63. package/src/global-files/statusDictionary.js +0 -103
@@ -21,189 +21,217 @@ ProviderProductEditionFromProducts.args = {
21
21
  category: 102,
22
22
  version: 3,
23
23
  productSelected: {
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
- }
24
+ id_article: 84864,
25
+ upc: "295900788",
26
+ sku: null,
27
+ name: "FUNDA MÓVIL COLGANTE T FUNNY ROJO",
28
+ timestamp: "2022-10-24T22:43:39.000Z",
29
+ id_user: 533,
30
+ categoryName: "Ropa, Accesorios, Fragancias y Joyería|Accesorios|Bolsas",
31
+ id_category: 610,
32
+ version: 2,
33
+ retailersAvailable: [
34
+ { name: "Liverpool", id: 10 },
35
+ { name: "Palacio de Hierro", id: 47 },
36
+ ],
37
+ categoryRetailer: [
38
+ {
39
+ id_category: 6821,
40
+ retailer_id: 10,
41
+ categoryName:
42
+ "Ropa, Accesorios, Fragancias y Joyería|Accesorios|Bolsas",
43
+ retailerName: "Liverpool",
44
+ },
45
+ {
46
+ id_category: 6968,
47
+ retailer_id: 47,
48
+ categoryName:
49
+ "Ropa, Accesorios, Fragancias y Joyería|Accesorios|Bolsas",
50
+ retailerName: "Palacio de Hierro",
51
+ },
85
52
  ],
86
- "statusByRetailer": {
87
- "9": {
88
- "datasheet": "AA",
89
- "description": "AA",
90
- "images": "AA"
53
+ percentages: [
54
+ {
55
+ id_retailer: 10,
56
+ id_category: 6821,
57
+ datasheet: { required: 100, general: 79.72 },
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
+ },
91
67
  },
92
- "70": {
93
- "datasheet": "AA",
94
- "description": "AA",
95
- "images": "AA"
96
- }
97
- },
98
- "retailersAvailable": [
99
- {
100
- "id": 9,
101
- "name": "Amazon"
68
+ percentagesGeneral: { required: 100, general: 63.6 },
69
+ },
70
+ {
71
+ id_retailer: 47,
72
+ id_category: 6968,
73
+ datasheet: { required: 100, general: 98.46 },
74
+ descriptions: { required: 100, general: 100 },
75
+ images: {
76
+ required: 100,
77
+ general: 80.01,
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
+ },
102
83
  },
103
- {
104
- "id": 70,
105
- "name": "Bodega Aurrera"
106
- }
84
+ percentagesGeneral: { required: 100, general: 69.85 },
85
+ },
107
86
  ],
108
- "categoryName": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
109
- "upc": "897654352",
110
- "id_article": 145207,
111
- "id_order": 10458
112
- },
87
+ summary: { totalRelations: 2, averageRequired: 100, averageGeneral: 66.72 },
88
+ article: { id_article: 84864 },
89
+ },
113
90
  productToEdit: {
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"
173
- },
174
- {
175
- "id": 70,
176
- "name": "Bodega Aurrera"
177
- }
91
+ idCategory: 1719,
92
+ ArticleId: 142443,
93
+ product: [
94
+ {
95
+ id_article: 142443,
96
+ upc: "1235125",
97
+ sku: "8849443",
98
+ name: "Migración instancia 2",
99
+ timestamp: "2025-08-07T04:47:06.000Z",
100
+ id_user: 1989,
101
+ categoryName: "Supermercado|Bebidas|Agua",
102
+ id_category: 1719,
103
+ version: 6,
104
+ retailersAvailable: [
105
+ { name: "Walmart Super y Superama", id: 4 },
106
+ { name: "Chedraui", id: 5 },
107
+ { name: "HEB", id: 6 },
108
+ { name: "La Comer", id: 12 },
109
+ { name: "Soriana", id: 13 },
178
110
  ],
179
- "statusByRetailer": {
180
- "9": {
181
- "datasheet": "AA",
182
- "description": "AA",
183
- "images": "AA"
111
+ categoryRetailer: [
112
+ {
113
+ id_category: 3430,
114
+ retailer_id: 12,
115
+ categoryName:
116
+ "Departamento General La Comer|Departamento General|Departamento General",
117
+ retailerName: "La Comer",
118
+ },
119
+ {
120
+ id_category: 4767,
121
+ retailer_id: 6,
122
+ categoryName: "Supermercado|Bebidas|Agua",
123
+ retailerName: "HEB",
124
+ },
125
+ {
126
+ id_category: 4941,
127
+ retailer_id: 13,
128
+ categoryName: "Supermercado Soriana|Supermercado|Supermercado",
129
+ retailerName: "Soriana",
130
+ },
131
+ {
132
+ id_category: 6098,
133
+ retailer_id: 4,
134
+ categoryName: "Supermercado|Bebidas|Agua",
135
+ retailerName: "Walmart Super y Superama",
136
+ },
137
+ {
138
+ id_category: 6788,
139
+ retailer_id: 5,
140
+ categoryName:
141
+ "Categoría Supermercado|Categoría Supermercado|Categoría Supermercado",
142
+ retailerName: "Chedraui",
143
+ },
144
+ ],
145
+ percentages: [
146
+ {
147
+ id_retailer: 12,
148
+ id_category: 3430,
149
+ datasheet: { required: 20, general: 10 },
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
+ },
184
159
  },
185
- "70": {
186
- "datasheet": "AA",
187
- "description": "AA",
188
- "images": "AA"
189
- }
190
- },
191
- "retailersAvailable": [
192
- {
193
- "id": 9,
194
- "name": "Amazon"
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
+ },
195
175
  },
196
- {
197
- "id": 70,
198
- "name": "Bodega Aurrera"
199
- }
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
+ },
191
+ },
192
+ percentagesGeneral: { required: 38.09, general: 3.91 },
193
+ },
194
+ {
195
+ id_retailer: 4,
196
+ id_category: 6098,
197
+ datasheet: { required: 20, general: 4.54 },
198
+ descriptions: { required: 0, general: 0 },
199
+ images: {
200
+ required: 100,
201
+ general: 80.01,
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
+ },
207
+ },
208
+ percentagesGeneral: { required: 40, general: 5.02 },
209
+ },
210
+ {
211
+ id_retailer: 5,
212
+ id_category: 6788,
213
+ datasheet: { required: 7.14, general: 2.63 },
214
+ descriptions: { required: 0, general: 0 },
215
+ images: {
216
+ required: 100,
217
+ general: 80,
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
+ },
223
+ },
224
+ percentagesGeneral: { required: 35.71, general: 2.78 },
225
+ },
200
226
  ],
201
- "categoryName": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
202
- "upc": "897654352",
203
- "id_article": 145207,
204
- "id_order": 10458
205
- }
206
- },
227
+ summary: {
228
+ totalRelations: 5,
229
+ averageRequired: 35.76,
230
+ averageGeneral: 5.21,
231
+ },
232
+ },
233
+ ],
234
+ },
207
235
  location: {
208
236
  pathname: "/EditProducts",
209
237
  search: "",
@@ -31,19 +31,6 @@ 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
-
47
34
  // Provider component
48
35
  export const ProviderProductEditionProvider = ({ children }) => {
49
36
  const [state, dispatch] = useReducer(productEditionReducer, initialState);
@@ -417,4 +404,17 @@ export const ProviderProductEditionProvider = ({ children }) => {
417
404
 
418
405
  ProviderProductEditionProvider.propTypes = {
419
406
  children: PropTypes.node.isRequired,
420
- };
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
+ };