contentoh-components-library 21.3.30 → 21.3.32

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 (128) hide show
  1. package/.env.development +3 -0
  2. package/.env.production +5 -2
  3. package/dist/assets/images/generalButton/closeIcon.svg +2 -2
  4. package/dist/components/atoms/ProgressBar/index.js +36 -6
  5. package/dist/components/atoms/ProgressBar/styles.js +11 -3
  6. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  7. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  8. package/dist/components/molecules/GalleryElement/index.js +1 -1
  9. package/dist/components/molecules/HeaderTop/index.js +15 -1
  10. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  11. package/dist/components/molecules/ProductNameHeader/index.js +6 -4
  12. package/dist/components/molecules/StatusAsignationInfo/index.js +1 -1
  13. package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
  14. package/dist/components/organisms/ProductImageModal/index.js +10 -3
  15. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +214 -30
  16. package/dist/components/pages/ProviderProductEdition/index.js +86 -65
  17. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +88 -52
  18. package/dist/components/pages/RetailerProductEdition/index.js +27 -18
  19. package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
  20. package/dist/global-files/data.js +18 -23
  21. package/dist/global-files/fonts.css +6 -0
  22. package/dist/global-files/variables.js +2 -0
  23. package/dist/index.js +267 -46
  24. package/package.json +14 -1
  25. package/src/assets/images/customSelect/starIcon.svg +14 -0
  26. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  27. package/src/assets/images/defaultImages/notFound.svg +124 -0
  28. package/src/assets/images/generalButton/closeIcon.svg +2 -2
  29. package/src/assets/sounds/newMessage.mp3 +0 -0
  30. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
  31. package/src/components/atoms/ButtonFileChooser/index.js +68 -0
  32. package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
  33. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
  34. package/src/components/atoms/ButtonV2/index.js +85 -0
  35. package/src/components/atoms/ButtonV2/styles.js +217 -0
  36. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
  37. package/src/components/atoms/CustomIcon/index.js +41 -0
  38. package/src/components/atoms/CustomIcon/styles.js +85 -0
  39. package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
  40. package/src/components/atoms/IconFile/index.js +119 -0
  41. package/src/components/atoms/IconFile/styles.js +67 -0
  42. package/src/components/atoms/Image/Image.stories.js +51 -0
  43. package/src/components/atoms/Image/index.js +55 -0
  44. package/src/components/atoms/Image/styles.js +34 -0
  45. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
  46. package/src/components/atoms/ImageLink/index.js +57 -0
  47. package/src/components/atoms/ImageLink/styles.js +30 -0
  48. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
  49. package/src/components/atoms/ImagePreview/index.js +178 -0
  50. package/src/components/atoms/ImagePreview/styles.js +77 -0
  51. package/src/components/atoms/InputText/InputText.stories.js +39 -0
  52. package/src/components/atoms/InputText/index.js +61 -0
  53. package/src/components/atoms/InputText/styles.js +89 -0
  54. package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
  55. package/src/components/atoms/NotFound/index.js +52 -0
  56. package/src/components/atoms/NotFound/styles.js +55 -0
  57. package/src/components/atoms/ProgressBar/index.js +40 -5
  58. package/src/components/atoms/ProgressBar/styles.js +24 -0
  59. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
  60. package/src/components/atoms/SelectItemV2/index.js +61 -0
  61. package/src/components/atoms/SelectItemV2/styles.js +90 -0
  62. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
  63. package/src/components/atoms/Tooltip/index.js +59 -0
  64. package/src/components/atoms/Tooltip/styles.js +42 -0
  65. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
  66. package/src/components/molecules/ButtonDownloadFile/index.js +109 -0
  67. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
  68. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  69. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  70. package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
  71. package/src/components/molecules/Dropdown/index.js +150 -0
  72. package/src/components/molecules/Dropdown/styles.js +75 -0
  73. package/src/components/molecules/GalleryElement/index.js +1 -1
  74. package/src/components/molecules/HeaderTop/index.js +17 -0
  75. package/src/components/molecules/HeaderTop/styles.js +5 -2
  76. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
  77. package/src/components/molecules/ImageTooltip/index.js +63 -0
  78. package/src/components/molecules/ImageTooltip/styles.js +18 -0
  79. package/src/components/molecules/ProductNameHeader/index.js +7 -2
  80. package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -0
  81. package/src/components/molecules/SelectV2/index.js +357 -0
  82. package/src/components/molecules/SelectV2/styles.js +105 -0
  83. package/src/components/molecules/SelectV2/test.js +60 -0
  84. package/src/components/molecules/SelectV2/test.stories.js +10 -0
  85. package/src/components/molecules/StatusAsignationInfo/index.js +11 -9
  86. package/src/components/organisms/Chat/Chat.stories.js +149 -0
  87. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
  88. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  89. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  90. package/src/components/organisms/Chat/ChatLists/index.js +141 -0
  91. package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
  92. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
  93. package/src/components/organisms/Chat/ContainerItems/index.js +522 -0
  94. package/src/components/organisms/Chat/ContainerItems/styles.js +348 -0
  95. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
  96. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  97. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  98. package/src/components/organisms/Chat/ContentChat/index.js +922 -0
  99. package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
  100. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
  101. package/src/components/organisms/Chat/Footer/index.js +661 -0
  102. package/src/components/organisms/Chat/Footer/styles.js +286 -0
  103. package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
  104. package/src/components/organisms/Chat/Header/index.js +93 -0
  105. package/src/components/organisms/Chat/Header/styles.js +49 -0
  106. package/src/components/organisms/Chat/index.js +238 -0
  107. package/src/components/organisms/Chat/styles.js +42 -0
  108. package/src/components/organisms/FullProductNameHeader/index.js +1 -0
  109. package/src/components/organisms/Modal/Modal.stories.js +55 -0
  110. package/src/components/organisms/Modal/index.js +97 -0
  111. package/src/components/organisms/Modal/styles.js +103 -0
  112. package/src/components/organisms/ProductImageModal/index.js +6 -3
  113. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
  114. package/src/components/organisms/RangeCalendar/index.js +121 -0
  115. package/src/components/organisms/RangeCalendar/styles.js +883 -0
  116. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +239 -32
  117. package/src/components/pages/ProviderProductEdition/index.js +87 -67
  118. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +93 -52
  119. package/src/components/pages/RetailerProductEdition/index.js +23 -21
  120. package/src/components/pages/RetailerProductEdition/utils.js +2 -1
  121. package/src/global-files/data.js +18 -23
  122. package/src/global-files/fonts.css +6 -0
  123. package/src/global-files/handle_http.js +225 -0
  124. package/src/global-files/handle_userTech.js +7 -0
  125. package/src/global-files/utils.js +330 -0
  126. package/src/global-files/variables.js +2 -0
  127. package/src/index.js +17 -0
  128. package/src/assets/fonts/roboto/LICENSE.txt +0 -202
@@ -16,48 +16,248 @@ ProviderProductEditionDefault.args = {
16
16
  Imágenes: true,
17
17
  },
18
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VudG9oLmNvbSJ9.HcyeyeK54av0Fnzto54OA_5FfdlUy50CuuXObgxBJswJLvMMZK13jWE06xnpmQCn5a_T20-xSLllgYDPzpEs5c40nm9sA3dJs9YWZGUOXg4SAZUqHVi_LTeCWv3dy3yjewlmGmcS-uTkuEI6GrT3559PcgYn1KTgGuPgqL9t4cb8A89-8n3o-ihhRfdSpUuYgqspurQXARjLlkESw2Z1gzFqJBd4u3BXMtusANta9G9TsBaQ9zTfMW79ksrQeiMXpKDmap_cdM7pSrykHf180GOHj0MZpWGC9U-32wpiNQ_DBeAyIWiIKCyh7mU8WHA_3Nm27lkL2LwioGCz9rHPqg",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- id_article: 3,
25
- id_category: 2032,
26
- name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
27
- upc: "161157",
28
- timestamp: "2022-11-14T16:02:47.000Z",
29
- categoryName: "Decoración|Cortinas y Persianas|Cortinas",
30
- version: 1,
24
+ orderId: 14606,
25
+ status: "AA",
26
+ datasheet_status: "AA",
27
+ prio: "none",
28
+ version: 3,
29
+ description_status: "AA",
30
+ images_status: "AA",
31
+ brand: "Axion",
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:
45
+ "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
46
+ company_name: "GRUPO BRAHMA",
47
+ country: "México",
48
+ id_category: "157",
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_order: 14606,
56
+ id_article: 37317,
57
+ id_auditor: 37,
58
+ name: "Detergente lavatrastres líquido Axion Complete tricloro 1.1 l",
59
+ timestamp: "2023-03-10T20:19:46.000Z",
60
+ upc: "7509546078915",
61
+ },
62
+ retailers: [
63
+ {
64
+ id: 4,
65
+ name: "Walmart Super y Superama",
66
+ },
67
+ {
68
+ id: 5,
69
+ name: "Chedraui",
70
+ },
71
+ {
72
+ id: 6,
73
+ name: "HEB",
74
+ },
75
+ {
76
+ id: 12,
77
+ name: "La Comer",
78
+ },
79
+ {
80
+ id: 17,
81
+ name: "Genérico",
82
+ },
83
+ ],
84
+ statusByRetailer: {
85
+ 4: {
86
+ datasheet: "AA",
87
+ description: "AA",
88
+ images: "AA",
89
+ },
90
+ 5: {
91
+ datasheet: "AA",
92
+ description: "AA",
93
+ images: "AA",
94
+ },
95
+ 6: {
96
+ datasheet: "AA",
97
+ description: "AA",
98
+ images: "AA",
99
+ },
100
+ 12: {
101
+ datasheet: "AA",
102
+ description: "AA",
103
+ images: "AA",
104
+ },
105
+ 17: {
106
+ datasheet: "AA",
107
+ description: "AA",
108
+ images: "AA",
109
+ },
110
+ },
31
111
  retailersAvailable: [
32
112
  {
33
- name: "The Home Depot Golden",
34
- id: 58,
113
+ id: 4,
114
+ name: "Walmart Super y Superama",
115
+ },
116
+ {
117
+ id: 5,
118
+ name: "Chedraui",
119
+ },
120
+ {
121
+ id: 6,
122
+ name: "HEB",
123
+ },
124
+ {
125
+ id: 12,
126
+ name: "La Comer",
127
+ },
128
+ {
129
+ id: 17,
130
+ name: "Genérico",
35
131
  },
36
132
  ],
133
+ categoryName:
134
+ "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
135
+ upc: "7509546078915",
136
+ id_article: 37317,
137
+ id_order: 14606,
37
138
  },
38
139
  productToEdit: {
39
- idCategory: 2032,
40
- ArticleId: 3,
41
- product: [
42
- {
43
- id_article: 3,
44
- id_category: 2032,
45
- name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
46
- upc: "161157",
47
- timestamp: "2022-11-14T16:02:47.000Z",
48
- categoryName: "Decoración|Cortinas y Persianas|Cortinas",
49
- version: 1,
50
- retailersAvailable: [
51
- {
52
- name: "The Home Depot Golden",
53
- id: 58,
54
- },
55
- ],
140
+ ArticleId: 37317,
141
+ idCategory: "157",
142
+ product: {
143
+ orderId: 14606,
144
+ status: "AA",
145
+ datasheet_status: "AA",
146
+ prio: "none",
147
+ version: 3,
148
+ description_status: "AA",
149
+ images_status: "AA",
150
+ brand: "Axion",
151
+ retailerOrder: 0,
152
+ missing: {
153
+ datasheet: null,
154
+ descriptions: null,
155
+ images: null,
56
156
  },
57
- ],
157
+ services: {
158
+ datasheets: 1,
159
+ descriptions: 1,
160
+ images: 1,
161
+ },
162
+ article: {
163
+ category:
164
+ "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
165
+ company_name: "GRUPO BRAHMA",
166
+ country: "México",
167
+ id_category: "157",
168
+ id_datasheet_especialist: 54,
169
+ id_datasheet_facilitator: 52,
170
+ id_description_especialist: 54,
171
+ id_description_facilitator: 52,
172
+ id_images_especialist: 55,
173
+ id_images_facilitator: 53,
174
+ id_order: 14606,
175
+ id_article: 37317,
176
+ id_auditor: 37,
177
+ name: "Detergente lavatrastres líquido Axion Complete tricloro 1.1 l",
178
+ timestamp: "2023-03-10T20:19:46.000Z",
179
+ upc: "7509546078915",
180
+ },
181
+ retailers: [
182
+ {
183
+ id: 4,
184
+ name: "Walmart Super y Superama",
185
+ },
186
+ {
187
+ id: 5,
188
+ name: "Chedraui",
189
+ },
190
+ {
191
+ id: 6,
192
+ name: "HEB",
193
+ },
194
+ {
195
+ id: 12,
196
+ name: "La Comer",
197
+ },
198
+ {
199
+ id: 17,
200
+ name: "Genérico",
201
+ },
202
+ ],
203
+ statusByRetailer: {
204
+ 4: {
205
+ datasheet: "AA",
206
+ description: "AA",
207
+ images: "AA",
208
+ },
209
+ 5: {
210
+ datasheet: "AA",
211
+ description: "AA",
212
+ images: "AA",
213
+ },
214
+ 6: {
215
+ datasheet: "AA",
216
+ description: "AA",
217
+ images: "AA",
218
+ },
219
+ 12: {
220
+ datasheet: "AA",
221
+ description: "AA",
222
+ images: "AA",
223
+ },
224
+ 17: {
225
+ datasheet: "AA",
226
+ description: "AA",
227
+ images: "AA",
228
+ },
229
+ },
230
+ retailersAvailable: [
231
+ {
232
+ id: 4,
233
+ name: "Walmart Super y Superama",
234
+ },
235
+ {
236
+ id: 5,
237
+ name: "Chedraui",
238
+ },
239
+ {
240
+ id: 6,
241
+ name: "HEB",
242
+ },
243
+ {
244
+ id: 12,
245
+ name: "La Comer",
246
+ },
247
+ {
248
+ id: 17,
249
+ name: "Genérico",
250
+ },
251
+ ],
252
+ categoryName:
253
+ "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
254
+ upc: "7509546078915",
255
+ id_article: 37317,
256
+ id_order: 14606,
257
+ },
58
258
  },
59
259
  location: {
60
- state: { origin: "Contentoh" },
260
+ state: { origin: "Contentoh", withChat: true },
61
261
  },
62
262
  user: {
63
263
  id_user: 28,
@@ -78,8 +278,8 @@ ProviderProductEditionDefault.args = {
78
278
  id_role: 0,
79
279
  active: 1,
80
280
  is_retailer: 0,
81
- email_notify: 0,
82
- is_user_tech: "AS",
281
+ email_notify: 1,
282
+ is_user_tech: "ADMIN-AS",
83
283
  membership: {
84
284
  id: 76,
85
285
  start_date: "2022-01-18T17:25:35.000Z",
@@ -91,7 +291,7 @@ ProviderProductEditionDefault.args = {
91
291
  products_limit: "5000",
92
292
  type: "Enterprise",
93
293
  },
94
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1669927021851",
294
+ src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1679610888753",
95
295
  },
96
296
  company: {
97
297
  id_company: 1,
@@ -106,6 +306,13 @@ ProviderProductEditionDefault.args = {
106
306
  email: null,
107
307
  social_link: "",
108
308
  is_retailer: 0,
309
+ retailers: [
310
+ {
311
+ id: null,
312
+ name: null,
313
+ country: null,
314
+ },
315
+ ],
109
316
  },
110
317
  showSurvey: (v) => v && alert("se muestra"),
111
318
  };
@@ -42,6 +42,7 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
42
42
  import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
43
43
  import { VersionSelector } from "../../organisms/VersionSelector";
44
44
  import { useCloseModal } from "../../../global-files/customHooks";
45
+ import { number } from "prop-types";
45
46
 
46
47
  const reducerImages = (state, action) => {
47
48
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -258,6 +259,12 @@ export const ProviderProductEdition = ({
258
259
  checkAll && setSelectedImages(images.values);
259
260
  }, [checkAll]);
260
261
 
262
+ useEffect(() => {
263
+ if (showModal) {
264
+ setActiveTab("Imágenes");
265
+ }
266
+ }, [showModal]);
267
+
261
268
  const loadData = async () => {
262
269
  const services = await getRetailerServices(
263
270
  product?.id_article || product?.article?.id_article,
@@ -272,8 +279,7 @@ export const ProviderProductEdition = ({
272
279
 
273
280
  setImages({ action: "init", init: services[2] });
274
281
  if (services[2]?.values?.length > 0) setActiveImage(0);
275
-
276
- getPercentage({ data: [product] }).then((res) => setPercentages(res));
282
+ getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
277
283
  setLoading(false);
278
284
  };
279
285
 
@@ -363,12 +369,13 @@ export const ProviderProductEdition = ({
363
369
  useEffect(() => {
364
370
  const productTemp = product;
365
371
  const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
366
- retailers?.forEach((retailer) => {
367
- retailer["percentage"] = percentages?.find(
368
- (percent) => retailer?.id === percent?.id_retailer
369
- )?.percentage;
370
- });
371
-
372
+ if (Object.keys(percentages[productTemp.id_article] ?? {})?.length > 0) {
373
+ retailers?.forEach((retailer, index) => {
374
+ retailer["percentage"] = Number(
375
+ percentages[productTemp.id_article][retailer.id]?.percentageRequired
376
+ );
377
+ });
378
+ }
372
379
  setProduct(productTemp);
373
380
  setActivePercentage(retailers[0]?.percentage);
374
381
  }, [percentages]);
@@ -1054,9 +1061,72 @@ export const ProviderProductEdition = ({
1054
1061
  "Finalmente elige la forma de pago que más te guste, procede con el pago y listo.",
1055
1062
  },
1056
1063
  ];
1064
+ const sendToEvaluation = (result) => {
1065
+ if (result === "A") {
1066
+ if (
1067
+ origin[activeTab] === "RequestWithoutContentoh" &&
1068
+ !user.is_retailer &&
1069
+ (!product.id_order || !product.orderId)
1070
+ ) {
1071
+ setDataGenericModal((prev) => ({
1072
+ ...prev,
1073
+ button2: {
1074
+ name: "Continuar",
1075
+ action: () => evaluationToRetailer("A"),
1076
+ },
1077
+ }));
1078
+ setShowGenericModal(true);
1079
+ } else if (user.is_retailer) {
1080
+ if (product.id_order || product.orderId) {
1081
+ sendEvaluation("A");
1082
+ } else {
1083
+ setDataGenericModal((prev) => ({
1084
+ ...prev,
1085
+ button2: {
1086
+ name: "Continuar",
1087
+ action: () => evaluationToRetailer("A"),
1088
+ },
1089
+ }));
1090
+ setShowGenericModal(true);
1091
+ }
1092
+ } else {
1093
+ sendEvaluation("A");
1094
+ }
1095
+ } else {
1096
+ if (
1097
+ originProp === "RequestWithoutContentoh" &&
1098
+ !user.is_retailer &&
1099
+ (!product.id_order || !product.orderId)
1100
+ ) {
1101
+ return;
1102
+ } else if (user.is_retailer) {
1103
+ if (product.id_order || product.orderId) {
1104
+ setValidatedAll(true);
1105
+ setModalViewError(true);
1106
+ } else {
1107
+ setDataGenericModal((prev) => ({
1108
+ ...prev,
1109
+ button2: {
1110
+ name: "Continuar",
1111
+ action: () => evaluationToRetailer("R"),
1112
+ },
1113
+ }));
1114
+ setShowGenericModal(true);
1115
+ }
1116
+ } else {
1117
+ setValidatedAll(true);
1118
+ setModalViewError(true);
1119
+ }
1120
+ }
1121
+ };
1057
1122
  return (
1058
1123
  <Container headerTop={headerTop}>
1059
- <HeaderTop setHeaderTop={setHeaderTop} />
1124
+ <HeaderTop
1125
+ setHeaderTop={setHeaderTop}
1126
+ withChat={location?.state?.withChat}
1127
+ productSelected={productSelected}
1128
+ token={token}
1129
+ />
1060
1130
  <div className="data-container">
1061
1131
  <div className="image-data-panel">
1062
1132
  <ImagePreviewer
@@ -1147,63 +1217,8 @@ export const ProviderProductEdition = ({
1147
1217
  setModalViewError(true);
1148
1218
  }
1149
1219
  }}
1150
- approve={() => {
1151
- if (
1152
- origin[activeTab] === "RequestWithoutContentoh" &&
1153
- !user.is_retailer &&
1154
- (!product.id_order || !product.orderId)
1155
- ) {
1156
- setDataGenericModal((prev) => ({
1157
- ...prev,
1158
- button2: {
1159
- name: "Continuar",
1160
- action: () => evaluationToRetailer("A"),
1161
- },
1162
- }));
1163
- setShowGenericModal(true);
1164
- } else if (user.is_retailer) {
1165
- if (product.id_order || product.orderId) {
1166
- sendEvaluation("A");
1167
- } else {
1168
- setDataGenericModal((prev) => ({
1169
- ...prev,
1170
- button2: {
1171
- name: "Continuar",
1172
- action: () => evaluationToRetailer("A"),
1173
- },
1174
- }));
1175
- setShowGenericModal(true);
1176
- }
1177
- } else {
1178
- sendEvaluation("A");
1179
- }
1180
- }}
1181
- reject={() => {
1182
- if (
1183
- origin[activeTab] === "RequestWithoutContentoh" &&
1184
- !user.is_retailer &&
1185
- (!product.id_order || !product.orderId)
1186
- ) {
1187
- return;
1188
- } else if (user.is_retailer) {
1189
- if (product.id_order || product.orderId) {
1190
- setValidatedAll(false);
1191
- setModalViewError(true);
1192
- } else {
1193
- setDataGenericModal((prev) => ({
1194
- ...prev,
1195
- button2: {
1196
- name: "Continuar",
1197
- action: () => evaluationToRetailer("R"),
1198
- },
1199
- }));
1200
- setShowGenericModal(true);
1201
- }
1202
- } else {
1203
- setValidatedAll(false);
1204
- setModalViewError(true);
1205
- }
1206
- }}
1220
+ approve={() => sendToEvaluation("A")}
1221
+ reject={() => sendToEvaluation("R")}
1207
1222
  />
1208
1223
  <FullTabsMenu
1209
1224
  tabsSections={tabsSections}
@@ -1400,7 +1415,12 @@ export const ProviderProductEdition = ({
1400
1415
  </div>
1401
1416
  </div>
1402
1417
  {showModal && (
1403
- <ProductImageModal images={images} setShowModal={setShowModal} />
1418
+ <ProductImageModal
1419
+ images={images}
1420
+ setShowModal={setShowModal}
1421
+ approveRejectButtons={isRevision() && getSectionStatus()}
1422
+ sendToFacilitator={sendToEvaluation}
1423
+ />
1404
1424
  )}
1405
1425
  {message.length > 0 && !showSurvey && (
1406
1426
  <GenericModal