contentoh-components-library 21.3.30 → 21.3.31
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/.env.development +3 -0
- package/.env.production +2 -3
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/ProgressBar/index.js +36 -6
- package/dist/components/atoms/ProgressBar/styles.js +11 -3
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
- package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
- package/dist/components/molecules/GalleryElement/index.js +1 -1
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +6 -4
- package/dist/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
- package/dist/components/organisms/ProductImageModal/index.js +10 -3
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +214 -30
- package/dist/components/pages/ProviderProductEdition/index.js +88 -66
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +73 -41
- package/dist/components/pages/RetailerProductEdition/index.js +20 -15
- package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
- package/dist/global-files/data.js +18 -23
- package/dist/global-files/fonts.css +6 -0
- package/dist/global-files/variables.js +2 -0
- package/dist/index.js +267 -46
- package/package.json +13 -1
- package/src/assets/images/customSelect/starIcon.svg +14 -0
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +124 -0
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/assets/sounds/newMessage.mp3 +0 -0
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
- package/src/components/atoms/ButtonFileChooser/index.js +68 -0
- package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
- package/src/components/atoms/ButtonV2/index.js +85 -0
- package/src/components/atoms/ButtonV2/styles.js +217 -0
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
- package/src/components/atoms/CustomIcon/index.js +41 -0
- package/src/components/atoms/CustomIcon/styles.js +85 -0
- package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
- package/src/components/atoms/IconFile/index.js +119 -0
- package/src/components/atoms/IconFile/styles.js +67 -0
- package/src/components/atoms/Image/Image.stories.js +51 -0
- package/src/components/atoms/Image/index.js +55 -0
- package/src/components/atoms/Image/styles.js +34 -0
- package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
- package/src/components/atoms/ImageLink/index.js +57 -0
- package/src/components/atoms/ImageLink/styles.js +30 -0
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
- package/src/components/atoms/ImagePreview/index.js +178 -0
- package/src/components/atoms/ImagePreview/styles.js +77 -0
- package/src/components/atoms/InputText/InputText.stories.js +39 -0
- package/src/components/atoms/InputText/index.js +61 -0
- package/src/components/atoms/InputText/styles.js +89 -0
- package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
- package/src/components/atoms/NotFound/index.js +52 -0
- package/src/components/atoms/NotFound/styles.js +55 -0
- package/src/components/atoms/ProgressBar/index.js +40 -5
- package/src/components/atoms/ProgressBar/styles.js +24 -0
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
- package/src/components/atoms/SelectItemV2/index.js +61 -0
- package/src/components/atoms/SelectItemV2/styles.js +90 -0
- package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
- package/src/components/atoms/Tooltip/index.js +59 -0
- package/src/components/atoms/Tooltip/styles.js +42 -0
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
- package/src/components/molecules/ButtonDownloadFile/index.js +109 -0
- package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
- package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
- package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
- package/src/components/molecules/Dropdown/index.js +150 -0
- package/src/components/molecules/Dropdown/styles.js +75 -0
- package/src/components/molecules/GalleryElement/index.js +1 -1
- package/src/components/molecules/HeaderTop/styles.js +5 -2
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
- package/src/components/molecules/ImageTooltip/index.js +63 -0
- package/src/components/molecules/ImageTooltip/styles.js +18 -0
- package/src/components/molecules/ProductNameHeader/index.js +7 -2
- package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -0
- package/src/components/molecules/SelectV2/index.js +357 -0
- package/src/components/molecules/SelectV2/styles.js +105 -0
- package/src/components/molecules/SelectV2/test.js +60 -0
- package/src/components/molecules/SelectV2/test.stories.js +10 -0
- package/src/components/molecules/StatusAsignationInfo/index.js +11 -9
- package/src/components/organisms/Chat/Chat.stories.js +149 -0
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +141 -0
- package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
- package/src/components/organisms/Chat/ContainerItems/index.js +522 -0
- package/src/components/organisms/Chat/ContainerItems/styles.js +348 -0
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +922 -0
- package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
- package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
- package/src/components/organisms/Chat/Footer/index.js +661 -0
- package/src/components/organisms/Chat/Footer/styles.js +286 -0
- package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
- package/src/components/organisms/Chat/Header/index.js +93 -0
- package/src/components/organisms/Chat/Header/styles.js +49 -0
- package/src/components/organisms/Chat/index.js +238 -0
- package/src/components/organisms/Chat/styles.js +42 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -0
- package/src/components/organisms/Modal/Modal.stories.js +55 -0
- package/src/components/organisms/Modal/index.js +97 -0
- package/src/components/organisms/Modal/styles.js +103 -0
- package/src/components/organisms/ProductImageModal/index.js +6 -3
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
- package/src/components/organisms/RangeCalendar/index.js +121 -0
- package/src/components/organisms/RangeCalendar/styles.js +883 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +239 -32
- package/src/components/pages/ProviderProductEdition/index.js +88 -67
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +78 -41
- package/src/components/pages/RetailerProductEdition/index.js +19 -21
- package/src/components/pages/RetailerProductEdition/utils.js +2 -1
- package/src/global-files/data.js +18 -23
- package/src/global-files/fonts.css +6 -0
- package/src/global-files/handle_http.js +225 -0
- package/src/global-files/handle_userTech.js +7 -0
- package/src/global-files/utils.js +330 -0
- package/src/global-files/variables.js +2 -0
- package/src/index.js +17 -0
|
@@ -16,48 +16,248 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: true,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIzZTNmZTBhOS1kY2U2LTRjYjAtYTg3MS02YzljNTBiMmRmZmQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY3OTYxMDg4NywibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2Nzk2MTQ0ODYsImlhdCI6MTY3OTYxMDg4NywiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
product:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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:
|
|
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?
|
|
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;
|
|
@@ -133,6 +134,7 @@ export const ProviderProductEdition = ({
|
|
|
133
134
|
setShowContentohRequestModal,
|
|
134
135
|
showSurvey,
|
|
135
136
|
company,
|
|
137
|
+
withChat,
|
|
136
138
|
}) => {
|
|
137
139
|
const [activeTab, setActiveTab] = useState("Descripción");
|
|
138
140
|
const [activeImage, setActiveImage] = useState();
|
|
@@ -258,6 +260,12 @@ export const ProviderProductEdition = ({
|
|
|
258
260
|
checkAll && setSelectedImages(images.values);
|
|
259
261
|
}, [checkAll]);
|
|
260
262
|
|
|
263
|
+
useEffect(() => {
|
|
264
|
+
if (showModal) {
|
|
265
|
+
setActiveTab("Imágenes");
|
|
266
|
+
}
|
|
267
|
+
}, [showModal]);
|
|
268
|
+
|
|
261
269
|
const loadData = async () => {
|
|
262
270
|
const services = await getRetailerServices(
|
|
263
271
|
product?.id_article || product?.article?.id_article,
|
|
@@ -272,8 +280,7 @@ export const ProviderProductEdition = ({
|
|
|
272
280
|
|
|
273
281
|
setImages({ action: "init", init: services[2] });
|
|
274
282
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
275
|
-
|
|
276
|
-
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
283
|
+
getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
|
|
277
284
|
setLoading(false);
|
|
278
285
|
};
|
|
279
286
|
|
|
@@ -363,12 +370,13 @@ export const ProviderProductEdition = ({
|
|
|
363
370
|
useEffect(() => {
|
|
364
371
|
const productTemp = product;
|
|
365
372
|
const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
|
|
366
|
-
|
|
367
|
-
retailer
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
373
|
+
if (Object.keys(percentages[productTemp.id_article] ?? {})?.length > 0) {
|
|
374
|
+
retailers?.forEach((retailer, index) => {
|
|
375
|
+
retailer["percentage"] = Number(
|
|
376
|
+
percentages[productTemp.id_article][retailer.id]?.percentageRequired
|
|
377
|
+
);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
372
380
|
setProduct(productTemp);
|
|
373
381
|
setActivePercentage(retailers[0]?.percentage);
|
|
374
382
|
}, [percentages]);
|
|
@@ -1054,9 +1062,72 @@ export const ProviderProductEdition = ({
|
|
|
1054
1062
|
"Finalmente elige la forma de pago que más te guste, procede con el pago y listo.",
|
|
1055
1063
|
},
|
|
1056
1064
|
];
|
|
1065
|
+
const sendToEvaluation = (result) => {
|
|
1066
|
+
if (result === "A") {
|
|
1067
|
+
if (
|
|
1068
|
+
origin[activeTab] === "RequestWithoutContentoh" &&
|
|
1069
|
+
!user.is_retailer &&
|
|
1070
|
+
(!product.id_order || !product.orderId)
|
|
1071
|
+
) {
|
|
1072
|
+
setDataGenericModal((prev) => ({
|
|
1073
|
+
...prev,
|
|
1074
|
+
button2: {
|
|
1075
|
+
name: "Continuar",
|
|
1076
|
+
action: () => evaluationToRetailer("A"),
|
|
1077
|
+
},
|
|
1078
|
+
}));
|
|
1079
|
+
setShowGenericModal(true);
|
|
1080
|
+
} else if (user.is_retailer) {
|
|
1081
|
+
if (product.id_order || product.orderId) {
|
|
1082
|
+
sendEvaluation("A");
|
|
1083
|
+
} else {
|
|
1084
|
+
setDataGenericModal((prev) => ({
|
|
1085
|
+
...prev,
|
|
1086
|
+
button2: {
|
|
1087
|
+
name: "Continuar",
|
|
1088
|
+
action: () => evaluationToRetailer("A"),
|
|
1089
|
+
},
|
|
1090
|
+
}));
|
|
1091
|
+
setShowGenericModal(true);
|
|
1092
|
+
}
|
|
1093
|
+
} else {
|
|
1094
|
+
sendEvaluation("A");
|
|
1095
|
+
}
|
|
1096
|
+
} else {
|
|
1097
|
+
if (
|
|
1098
|
+
originProp === "RequestWithoutContentoh" &&
|
|
1099
|
+
!user.is_retailer &&
|
|
1100
|
+
(!product.id_order || !product.orderId)
|
|
1101
|
+
) {
|
|
1102
|
+
return;
|
|
1103
|
+
} else if (user.is_retailer) {
|
|
1104
|
+
if (product.id_order || product.orderId) {
|
|
1105
|
+
setValidatedAll(true);
|
|
1106
|
+
setModalViewError(true);
|
|
1107
|
+
} else {
|
|
1108
|
+
setDataGenericModal((prev) => ({
|
|
1109
|
+
...prev,
|
|
1110
|
+
button2: {
|
|
1111
|
+
name: "Continuar",
|
|
1112
|
+
action: () => evaluationToRetailer("R"),
|
|
1113
|
+
},
|
|
1114
|
+
}));
|
|
1115
|
+
setShowGenericModal(true);
|
|
1116
|
+
}
|
|
1117
|
+
} else {
|
|
1118
|
+
setValidatedAll(true);
|
|
1119
|
+
setModalViewError(true);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
};
|
|
1057
1123
|
return (
|
|
1058
1124
|
<Container headerTop={headerTop}>
|
|
1059
|
-
<HeaderTop
|
|
1125
|
+
<HeaderTop
|
|
1126
|
+
setHeaderTop={setHeaderTop}
|
|
1127
|
+
withChat={location?.state?.withChat}
|
|
1128
|
+
productSelected={productSelected}
|
|
1129
|
+
token={token}
|
|
1130
|
+
/>
|
|
1060
1131
|
<div className="data-container">
|
|
1061
1132
|
<div className="image-data-panel">
|
|
1062
1133
|
<ImagePreviewer
|
|
@@ -1147,63 +1218,8 @@ export const ProviderProductEdition = ({
|
|
|
1147
1218
|
setModalViewError(true);
|
|
1148
1219
|
}
|
|
1149
1220
|
}}
|
|
1150
|
-
approve={() =>
|
|
1151
|
-
|
|
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
|
-
}}
|
|
1221
|
+
approve={() => sendToEvaluation("A")}
|
|
1222
|
+
reject={() => sendToEvaluation("R")}
|
|
1207
1223
|
/>
|
|
1208
1224
|
<FullTabsMenu
|
|
1209
1225
|
tabsSections={tabsSections}
|
|
@@ -1400,7 +1416,12 @@ export const ProviderProductEdition = ({
|
|
|
1400
1416
|
</div>
|
|
1401
1417
|
</div>
|
|
1402
1418
|
{showModal && (
|
|
1403
|
-
<ProductImageModal
|
|
1419
|
+
<ProductImageModal
|
|
1420
|
+
images={images}
|
|
1421
|
+
setShowModal={setShowModal}
|
|
1422
|
+
approveRejectButtons={isRevision() && getSectionStatus()}
|
|
1423
|
+
sendToFacilitator={sendToEvaluation}
|
|
1424
|
+
/>
|
|
1404
1425
|
)}
|
|
1405
1426
|
{message.length > 0 && !showSurvey && (
|
|
1406
1427
|
<GenericModal
|