contentoh-components-library 21.3.65 → 21.3.67

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 (42) hide show
  1. package/.env.development +0 -2
  2. package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
  3. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  4. package/dist/components/molecules/HeaderTop/index.js +11 -68
  5. package/dist/components/organisms/Chat/Chat.stories.js +1 -21
  6. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  7. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  8. package/dist/components/organisms/Chat/ContentChat/index.js +191 -343
  9. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  10. package/dist/components/organisms/Chat/index.js +3 -48
  11. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  12. package/dist/components/organisms/SideModal/index.js +0 -13
  13. package/dist/components/organisms/SideModal/styles.js +1 -1
  14. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +127 -172
  15. package/dist/components/pages/ProviderProductEdition/index.js +129 -188
  16. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  17. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +28 -40
  18. package/dist/components/pages/RetailerProductEdition/index.js +273 -266
  19. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  20. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  21. package/dist/index.js +0 -13
  22. package/package.json +1 -1
  23. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  24. package/src/components/molecules/HeaderTop/index.js +6 -52
  25. package/src/components/organisms/Chat/Chat.stories.js +0 -21
  26. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  27. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  28. package/src/components/organisms/Chat/ContentChat/index.js +6 -81
  29. package/src/components/organisms/Chat/Footer/index.js +0 -11
  30. package/src/components/organisms/Chat/index.js +3 -47
  31. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  32. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +130 -177
  33. package/src/components/pages/ProviderProductEdition/index.js +55 -105
  34. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  35. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +26 -38
  36. package/src/components/pages/RetailerProductEdition/index.js +135 -110
  37. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  38. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  39. package/src/index.js +0 -1
  40. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  41. package/src/components/organisms/SideModal/index.js +0 -51
  42. package/src/components/organisms/SideModal/styles.js +0 -29
@@ -16,194 +16,120 @@ ProviderProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyM2Q1NTlmYi1jMzIwLTRhMjItYjJmNy1lOThhYTFhZGEyNmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MzkyNjgyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODM5MzA0MjEsImlhdCI6MTY4MzkyNjgyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.TvCoaKoctj5mypXWMz3NyV1Vm1ToBV0vJmpVyZSQw4-ikTChkxcZ5tFYvqhk1GdvNCFttfSQIqM-14dAYYBc28YwwKP86gqOuzB1fG41rN5x1Yx3tkJq6hiVRgiBbSHWtThA9c8VnxNQbrJiaRTvvkDiM5KNTEst1oxQHL5Ct9_iKQMJMRFie7Xv0xnyS0qZ6QHK4Q2A9OHsnDkAuumALZJcE19Zh6VgSitgWrZiz3x5Text4Q-U-R48NUAzUFirAzYZzJN_fCme5pGf1AnUaZjeUjPsmrV5TBVzPEYwXO0KG8lYjL8id80D7tbGs28ZIK6B4rf3-eqI_ngmBB4CjQ",
19
+ "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJjOWRjOWE1OS0xNTAxLTQyOTgtODRjMi03MDM4NzRhNzIxMTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MjQ2Mjc4NCwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjgyNDY2Mzg0LCJpYXQiOjE2ODI0NjI3ODQsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.ebKSsnTxKoNfWDoKGFJRlLWgNulGj4KrDe0EgsqLEIVx3Qu0lgmg43UY5tZ3FUlRE8XO2UGq0XxEgdbGOe_4nbTRYigdvxP3bh3cPQ0s68hlTDfhPRvxVJYlaO4s0rhk9rt_VVteTyLfhPHFCymrkFYYDB8bVvKnxUUCX_nJvqGQkl48JiYgvYVLpuus5FvRkGwi1u-jTtMoKiUK-jw9MxI18hD0FWXVnJr-q9ftf2d0bv4JRv4XJ_tRh1N6jps5n3c_KKZswqRfGLU-8MS2X3DU6pDqEP2BZAGXksiFYXYH_uHE6BKJAl7EEhkDTqZsx_jWtVSXTdDg_QDKrOw0Kg",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 15142,
25
- status: "AA",
26
- datasheet_status: "AA",
24
+ orderId: 15165,
25
+ article_status: "AAC",
26
+ datasheet_status: "AAC",
27
+ description_status: "FAP",
28
+ images_status: "FAP",
27
29
  prio: "none",
28
30
  version: 3,
29
- description_status: "AA",
30
- images_status: "AA",
31
- brand: "Garnier",
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
- },
31
+ brand: null,
43
32
  article: {
44
- category:
45
- "Salud y Belleza|Cuidado del Cabello|Shampoos y Acondicionadores",
46
- company_name: "GRUPO BRAHMA",
33
+ category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
34
+ company_name: "Demo",
35
+ id_company: 923,
47
36
  country: "México",
48
- id_category: "697",
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: 15142,
56
- id_article: 39270,
57
- id_auditor: 37,
58
- name: "Acondicionador Garnier Fructis 650 ml",
59
- timestamp: "2023-03-27T18:37:48.000Z",
60
- upc: "750955287656712",
37
+ id_category: "2366",
38
+ id_article: 39336,
39
+ name: "Prueba Auditoria",
40
+ upc: "100030124",
61
41
  },
62
42
  retailers: [
63
43
  {
64
- id: 12,
65
- name: "La Comer",
44
+ id: 58,
45
+ name: "The Home Depot Golden",
66
46
  },
67
47
  {
68
- id: 29,
69
- name: "Farmacias del Ahorro",
70
- },
71
- {
72
- id: 63,
73
- name: "DAX",
48
+ id: 68,
49
+ name: "The Home Depot Dropship",
74
50
  },
75
51
  ],
52
+ services: {
53
+ datasheets: 1,
54
+ descriptions: 1,
55
+ images: 1,
56
+ },
76
57
  statusByRetailer: {
77
- 12: {
78
- datasheet: "AA",
79
- description: "AA",
80
- images: "AA",
81
- },
82
- 29: {
83
- datasheet: "AA",
84
- description: "AA",
85
- images: "AA",
86
- },
87
- 63: {
88
- datasheet: "AA",
89
- description: "AA",
90
- images: "AA",
58
+ 58: {
59
+ datasheet: "AAC",
60
+ description: "FAP",
61
+ images: "FAP",
91
62
  },
92
63
  },
93
- checked: false,
64
+ retailersWithService: ["58"],
65
+ id_article: 39336,
94
66
  retailersAvailable: [
95
67
  {
96
- id: 12,
97
- name: "La Comer",
98
- },
99
- {
100
- id: 29,
101
- name: "Farmacias del Ahorro",
68
+ id: 58,
69
+ name: "The Home Depot Golden",
102
70
  },
103
71
  {
104
- id: 63,
105
- name: "DAX",
72
+ id: 68,
73
+ name: "The Home Depot Dropship",
106
74
  },
107
75
  ],
108
- categoryName:
109
- "Salud y Belleza|Cuidado del Cabello|Shampoos y Acondicionadores",
110
- upc: "750955287656712",
111
- id_article: 39270,
112
- id_order: 15142,
113
76
  },
114
77
  productToEdit: {
115
- ArticleId: 39270,
116
- idCategory: "697",
78
+ ArticleId: 39336,
79
+ idCategory: "2366",
117
80
  product: {
118
- orderId: 15142,
119
- status: "AA",
120
- datasheet_status: "AA",
81
+ orderId: 15165,
82
+ article_status: "AAC",
83
+ datasheet_status: "AAC",
84
+ description_status: "FAP",
85
+ images_status: "FAP",
121
86
  prio: "none",
122
87
  version: 3,
123
- description_status: "AA",
124
- images_status: "AA",
125
- brand: "Garnier",
126
- retailerOrder: 0,
127
- missing: {
128
- datasheet: null,
129
- descriptions: null,
130
- images: null,
131
- },
132
- services: {
133
- datasheets: 1,
134
- descriptions: 1,
135
- images: 1,
136
- },
88
+ brand: null,
137
89
  article: {
138
- category:
139
- "Salud y Belleza|Cuidado del Cabello|Shampoos y Acondicionadores",
140
- company_name: "GRUPO BRAHMA",
90
+ category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
91
+ company_name: "Demo",
92
+ id_company: 923,
141
93
  country: "México",
142
- id_category: "697",
143
- id_datasheet_especialist: 54,
144
- id_datasheet_facilitator: 52,
145
- id_description_especialist: 54,
146
- id_description_facilitator: 52,
147
- id_images_especialist: 55,
148
- id_images_facilitator: 53,
149
- id_order: 15142,
150
- id_article: 39270,
151
- id_auditor: 37,
152
- name: "Acondicionador Garnier Fructis 650 ml",
153
- timestamp: "2023-03-27T18:37:48.000Z",
154
- upc: "750955287656712",
94
+ id_category: "2366",
95
+ id_article: 39336,
96
+ name: "Prueba Auditoria",
97
+ upc: "100030124",
155
98
  },
156
99
  retailers: [
157
100
  {
158
- id: 12,
159
- name: "La Comer",
101
+ id: 58,
102
+ name: "The Home Depot Golden",
160
103
  },
161
104
  {
162
- id: 29,
163
- name: "Farmacias del Ahorro",
164
- },
165
- {
166
- id: 63,
167
- name: "DAX",
105
+ id: 68,
106
+ name: "The Home Depot Dropship",
168
107
  },
169
108
  ],
109
+ services: {
110
+ datasheets: 1,
111
+ descriptions: 1,
112
+ images: 1,
113
+ },
170
114
  statusByRetailer: {
171
- 12: {
172
- datasheet: "AA",
173
- description: "AA",
174
- images: "AA",
175
- },
176
- 29: {
177
- datasheet: "AA",
178
- description: "AA",
179
- images: "AA",
180
- },
181
- 63: {
182
- datasheet: "AA",
183
- description: "AA",
184
- images: "AA",
115
+ 58: {
116
+ datasheet: "AAC",
117
+ description: "FAP",
118
+ images: "FAP",
185
119
  },
186
120
  },
187
- checked: false,
121
+ retailersWithService: ["58"],
122
+ id_article: 39336,
188
123
  retailersAvailable: [
189
124
  {
190
- id: 12,
191
- name: "La Comer",
125
+ id: 58,
126
+ name: "The Home Depot Golden",
192
127
  },
193
128
  {
194
- id: 29,
195
- name: "Farmacias del Ahorro",
196
- },
197
- {
198
- id: 63,
199
- name: "DAX",
129
+ id: 68,
130
+ name: "The Home Depot Dropship",
200
131
  },
201
132
  ],
202
- categoryName:
203
- "Salud y Belleza|Cuidado del Cabello|Shampoos y Acondicionadores",
204
- upc: "750955287656712",
205
- id_article: 39270,
206
- id_order: 15142,
207
133
  },
208
134
  },
209
135
  location: {
@@ -212,63 +138,90 @@ ProviderProductEditionDefault.args = {
212
138
  hash: "",
213
139
  state: {
214
140
  withChat: true,
215
- chatType: "product_status",
216
- origin: "RequestWithContentoh",
217
141
  },
218
142
  key: "24vwut",
219
143
  },
220
144
  user: {
221
- id_user: 28,
222
- name: "Ismael",
223
- last_name: "López",
224
- email: "ilopez@contentoh.com",
225
- position: "Test States",
145
+ id_user: 59,
146
+ name: "Cadena",
147
+ last_name: "Comercial",
148
+ email: "cadena.ismael@allfreemail.net",
149
+ position: "Admin",
226
150
  telephone: "+523111366336",
227
151
  country: "México",
228
- id_company: 1,
229
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
152
+ id_company: 817,
153
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
230
154
  birth_Date: null,
231
155
  about_me: "",
232
156
  zip_code: "",
233
157
  address: "",
234
158
  job: "",
235
- id_stripe: "cus_KuEt6R6vwmN09f",
159
+ id_stripe: "",
236
160
  id_role: 0,
237
161
  active: 1,
238
- is_retailer: 0,
239
- email_notify: 1,
240
- is_user_tech: "ADMIN-AS",
162
+ is_retailer: 1,
163
+ email_notify: 0,
164
+ is_user_tech: null,
241
165
  membership: {
242
- id: 76,
243
- start_date: "2022-01-18T17:25:35.000Z",
244
- end_date: "2023-01-18T17:25:35.000Z",
245
- planID: 8,
246
- plan: "prod_KtlhECVSFG2iro",
166
+ id: 47,
167
+ start_date: "2022-05-25T14:31:12.000Z",
168
+ end_date: "2023-05-25T14:31:12.000Z",
169
+ planID: 5,
170
+ plan: "prod_Ktl6B5Ou2gqTB2",
247
171
  name: "Plan Pro",
248
- user_limit: "20",
249
- products_limit: "5000",
250
- type: "Enterprise",
172
+ user_limit: "5",
173
+ products_limit: "500",
174
+ type: "PyMES",
251
175
  },
252
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1683926822779",
176
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1682462786497",
253
177
  },
254
178
  company: {
255
- id_company: 1,
256
- trade_name: "GRUPO BRAHMA",
257
- company_name: "GRUPO BRAHMA",
258
- rfc: "XAXX010101000",
259
- adress: "AA",
260
- about_company: "",
261
- telephone: "",
262
- web_site: "",
263
- zip_code: "",
179
+ id_company: 817,
180
+ trade_name: "Retailer acc",
181
+ company_name: "Retailer acc",
182
+ rfc: "ASER12345",
183
+ adress: "Av. Insurgentes",
184
+ about_company: null,
185
+ telephone: null,
186
+ web_site: null,
187
+ zip_code: null,
264
188
  email: null,
265
- social_link: "",
266
- is_retailer: 0,
189
+ social_link: null,
190
+ is_retailer: 1,
191
+ financedRetailers: [
192
+ {
193
+ id: 68,
194
+ name: "The Home Depot Dropship",
195
+ country: "México",
196
+ id_region: 1,
197
+ active: 1,
198
+ },
199
+ ],
267
200
  retailers: [
268
201
  {
269
- id: null,
270
- name: null,
271
- country: null,
202
+ id: 59,
203
+ name: "The Home Depot Platinum",
204
+ country: "México",
205
+ },
206
+ {
207
+ id: 60,
208
+ name: "The Home Depot Resizing",
209
+ country: "México",
210
+ },
211
+ {
212
+ id: 61,
213
+ name: "Home Depot TAB",
214
+ country: "México",
215
+ },
216
+ {
217
+ id: 68,
218
+ name: "The Home Depot Dropship",
219
+ country: "México",
220
+ },
221
+ {
222
+ id: 58,
223
+ name: "The Home Depot Golden",
224
+ country: "México",
272
225
  },
273
226
  ],
274
227
  },
@@ -39,9 +39,6 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
39
39
  import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
40
40
  import { VersionSelector } from "../../organisms/VersionSelector";
41
41
  import { useCloseModal } from "../../../global-files/customHooks";
42
- import { createMessage, sendMessage } from "../RetailerProductEdition/utils";
43
- import { Modal } from "../../organisms/Modal";
44
- import { ButtonV2 } from "../../atoms/ButtonV2";
45
42
 
46
43
  const reducerImages = (state, action) => {
47
44
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -217,7 +214,6 @@ export const ProviderProductEdition = ({
217
214
  const isRetailer = user?.is_retailer;
218
215
  const [loading, setLoading] = useState(true);
219
216
  const [validatedAll, setValidatedAll] = useState(false);
220
- const [showRejectModal, setShowRejectModal] = useState(false);
221
217
 
222
218
  const [origin, setOrigin] = useState({
223
219
  "Ficha técnica": null,
@@ -346,6 +342,28 @@ export const ProviderProductEdition = ({
346
342
  (type) => {
347
343
  const formatter = new Intl.ListFormat("es", { type: "conjunction" });
348
344
  switch (type) {
345
+ case "error":
346
+ setGlobalModal({
347
+ message: `${activeTab} rechazada`,
348
+ detail: "Agrega tu comentarios para enviar el rechazo",
349
+ img: errorModal,
350
+ textArea: true,
351
+ button1: {
352
+ name: "Enviar",
353
+ action: (e) => {
354
+ const textArea = document.querySelector("#area");
355
+ if (textArea.value) {
356
+ textArea.style.border = "none";
357
+ createComment(e, textArea.value);
358
+ showGlobalModal("commentsSent");
359
+ validatedAll ? validateAll("R") : sendEvaluation("R");
360
+ } else {
361
+ textArea.style.border = "2px solid red";
362
+ }
363
+ },
364
+ },
365
+ });
366
+ break;
349
367
  case "generic":
350
368
  setGlobalModal(dataGenericModal);
351
369
  break;
@@ -505,9 +523,7 @@ export const ProviderProductEdition = ({
505
523
  );
506
524
  setServicesData(parsedResponse);
507
525
  }
508
- retailers &&
509
- !activeRetailer.id &&
510
- setActiveRetailer(active ? active : retailers[0]);
526
+ !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
511
527
  };
512
528
 
513
529
  const isRevision = () => {
@@ -583,7 +599,7 @@ export const ProviderProductEdition = ({
583
599
  });
584
600
  }
585
601
  setProduct(productTemp);
586
- retailers && setActivePercentage(retailers[0]?.percentage);
602
+ setActivePercentage(retailers[0]?.percentage);
587
603
  }, [percentages]);
588
604
 
589
605
  const loadInputs = () => {
@@ -824,19 +840,32 @@ export const ProviderProductEdition = ({
824
840
  }
825
841
  };
826
842
 
827
- const createComment = async (messages = [], retailerId) => {
843
+ const createComment = async (e, body, tab) => {
844
+ let concept = "";
845
+ switch (activeTab) {
846
+ case "Ficha técnica":
847
+ concept = "datasheet";
848
+ break;
849
+ case "Imágenes":
850
+ concept = "images";
851
+ break;
852
+
853
+ default:
854
+ concept = "description";
855
+ break;
856
+ }
828
857
  const data = {
829
- paramsBody: {
830
- id: product.article.id_article || productEdit.ArticleId,
831
- version: version,
832
- items: messages,
833
- retailerId: retailerId,
834
- status: product.status || productEdit.product.status,
835
- },
836
- paramsHeader: { Authorization: token },
858
+ articleId: product?.id_article,
859
+ orderId: product?.orderId,
860
+ message: body,
861
+ concept: concept,
862
+ version: version,
837
863
  };
838
- setMessage("");
839
- return sendMessage(data);
864
+ await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
865
+ headers: {
866
+ Authorization: token,
867
+ },
868
+ });
840
869
  };
841
870
 
842
871
  useEffect(() => {
@@ -1036,27 +1065,6 @@ export const ProviderProductEdition = ({
1036
1065
  const { newArticleStatus, newServiceStatus, newStatus } = JSON.parse(
1037
1066
  res.data.body
1038
1067
  );
1039
-
1040
- const message = createMessage(
1041
- product.retailers || product.retailersAvailable,
1042
- activeRetailer.id,
1043
- product[sectionStatusKey],
1044
- newStatus,
1045
- activeTab
1046
- );
1047
-
1048
- const messageData = {
1049
- paramsBody: {
1050
- id: product.article.id_article || productEdit.ArticleId,
1051
- version: version,
1052
- items: [{ type: "status", value: message }],
1053
- retailerId: activeRetailer.id,
1054
- status: product.status || productEdit.product.status,
1055
- },
1056
- paramsHeader: { Authorization: token },
1057
- };
1058
- await sendMessage(messageData);
1059
-
1060
1068
  if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
1061
1069
  const retailerStatusCopy = { ...retailerStatus };
1062
1070
  retailerStatusCopy[activeRetailer.id][concept] = newStatus;
@@ -1088,7 +1096,6 @@ export const ProviderProductEdition = ({
1088
1096
  result,
1089
1097
  isAproved: result === "A",
1090
1098
  };
1091
- const messages = [];
1092
1099
  servicesData?.forEach((ret) => {
1093
1100
  const { service, id_retailer } = ret;
1094
1101
  let data = {};
@@ -1105,18 +1112,6 @@ export const ProviderProductEdition = ({
1105
1112
  },
1106
1113
  })
1107
1114
  );
1108
- if (product[`${ret.service}_status`] !== "NS") {
1109
- const message = createMessage(
1110
- product.retailers,
1111
- ret.id_retailer,
1112
- product[`${ret.service}_status`],
1113
- `${result}A`,
1114
- ret.service
1115
- );
1116
- messages.push(
1117
- createComment([{ type: "status", value: message }], ret.id_retailer)
1118
- );
1119
- }
1120
1115
  });
1121
1116
  await Promise.all(evaluationArray);
1122
1117
  const userType = user.is_retailer === 1 ? "CA" : "P";
@@ -1156,7 +1151,6 @@ export const ProviderProductEdition = ({
1156
1151
  product: productTemp,
1157
1152
  })
1158
1153
  );
1159
- await Promise.all(messages);
1160
1154
 
1161
1155
  await loadData();
1162
1156
  } catch (error) {
@@ -1284,7 +1278,8 @@ export const ProviderProductEdition = ({
1284
1278
  return;
1285
1279
  } else if (user.is_retailer) {
1286
1280
  if (product.id_order || product.orderId) {
1287
- sendEvaluation("R");
1281
+ setValidatedAll(true);
1282
+ showGlobalModal("error");
1288
1283
  } else {
1289
1284
  setDataGenericModal((prev) => ({
1290
1285
  ...prev,
@@ -1296,7 +1291,8 @@ export const ProviderProductEdition = ({
1296
1291
  showGlobalModal("generic");
1297
1292
  }
1298
1293
  } else {
1299
- sendEvaluation("R");
1294
+ setValidatedAll(true);
1295
+ showGlobalModal("error");
1300
1296
  }
1301
1297
  }
1302
1298
  };
@@ -1305,7 +1301,6 @@ export const ProviderProductEdition = ({
1305
1301
  <HeaderTop
1306
1302
  setHeaderTop={setHeaderTop}
1307
1303
  withChat={location?.state?.withChat}
1308
- chatType={location?.state?.chatType}
1309
1304
  productSelected={productSelected}
1310
1305
  token={token}
1311
1306
  activeRetailer={activeRetailer}
@@ -1384,7 +1379,7 @@ export const ProviderProductEdition = ({
1384
1379
  } else if (user.is_retailer) {
1385
1380
  if (product.id_order || product.orderId) {
1386
1381
  setValidatedAll(true);
1387
- setShowRejectModal(true);
1382
+ showGlobalModal("error");
1388
1383
  } else {
1389
1384
  setDataGenericModal((prev) => ({
1390
1385
  ...prev,
@@ -1396,14 +1391,12 @@ export const ProviderProductEdition = ({
1396
1391
  showGlobalModal("generic");
1397
1392
  }
1398
1393
  } else {
1399
- setShowRejectModal(true);
1400
1394
  setValidatedAll(true);
1395
+ showGlobalModal("error");
1401
1396
  }
1402
1397
  }}
1403
1398
  approve={() => sendToEvaluation("A")}
1404
- reject={() => {
1405
- setShowRejectModal(true);
1406
- }}
1399
+ reject={() => sendToEvaluation("R")}
1407
1400
  />
1408
1401
  <FullTabsMenu
1409
1402
  tabsSections={tabsSections}
@@ -1638,49 +1631,6 @@ export const ProviderProductEdition = ({
1638
1631
  jwt={token}
1639
1632
  />
1640
1633
  )}
1641
- {showRejectModal && (
1642
- <Modal
1643
- title={"Agregar mensaje de rechazo"}
1644
- show={showRejectModal}
1645
- customComponent={
1646
- <TagAndInput
1647
- label={"Caja de Comentario"}
1648
- inputType={"textarea"}
1649
- inputId={"modal-message-box"}
1650
- index={0}
1651
- color={"white"}
1652
- />
1653
- }
1654
- buttons={[
1655
- <ButtonV2
1656
- key={"btn-Cancelar"}
1657
- type={"white"}
1658
- label={"Cancelar"}
1659
- size={12}
1660
- onClick={() => {
1661
- setShowRejectModal(false);
1662
- }}
1663
- />,
1664
- <ButtonV2
1665
- key={"btn-Aceptar"}
1666
- type={"pink"}
1667
- label={"Aceptar"}
1668
- size={12}
1669
- onClick={async () => {
1670
- const body = document.querySelector(
1671
- "#modal-message-box .ql-container .ql-editor > p"
1672
- ).innerHTML;
1673
- const messages = [
1674
- { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1675
- ];
1676
- await createComment(messages, activeRetailer.id);
1677
- validatedAll ? validateAll("R") : sendToEvaluation("R");
1678
- setShowRejectModal(false);
1679
- }}
1680
- />,
1681
- ]}
1682
- />
1683
- )}
1684
1634
  </Container>
1685
1635
  );
1686
1636
  };
@@ -107,10 +107,6 @@ export const Container = styled.div`
107
107
  }
108
108
  }
109
109
  }
110
- #modal-message-box {
111
- width: 400px;
112
- height: 100px;
113
- }
114
110
  .container {
115
111
  width: 100%;
116
112
  height: 100%;
@@ -119,4 +115,4 @@ export const Container = styled.div`
119
115
  width: 100%;
120
116
  }
121
117
  }
122
- `;
118
+ `;