contentoh-components-library 21.3.17 → 21.3.19
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 +0 -5
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/GeneralInput/index.js +14 -1
- package/dist/components/atoms/ProgressBar/index.js +6 -36
- package/dist/components/atoms/ProgressBar/styles.js +3 -11
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/HeaderTop/index.js +6 -23
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +4 -6
- package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
- package/dist/components/pages/ProviderProductEdition/index.js +11 -15
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +44 -36
- package/dist/components/pages/RetailerProductEdition/index.js +12 -13
- package/dist/global-files/data.js +23 -18
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -12
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/atoms/GeneralInput/index.js +10 -0
- package/src/components/atoms/ProgressBar/index.js +5 -40
- package/src/components/atoms/ProgressBar/styles.js +0 -24
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +8 -29
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/molecules/ProductNameHeader/index.js +2 -7
- package/src/components/organisms/FullProductNameHeader/index.js +0 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
- package/src/components/pages/ProviderProductEdition/index.js +9 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +46 -36
- package/src/components/pages/RetailerProductEdition/index.js +10 -14
- package/src/global-files/data.js +23 -18
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- package/dist/assets/images/customSelect/starIcon.svg +0 -14
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +0 -124
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -72
- package/dist/components/atoms/ButtonFileChooser/index.js +0 -110
- package/dist/components/atoms/ButtonFileChooser/styles.js +0 -20
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +0 -66
- package/dist/components/atoms/ButtonV2/index.js +0 -110
- package/dist/components/atoms/ButtonV2/styles.js +0 -53
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +0 -50
- package/dist/components/atoms/CustomIcon/index.js +0 -40
- package/dist/components/atoms/CustomIcon/styles.js +0 -33
- package/dist/components/atoms/IconFile/IconFile.stories.js +0 -48
- package/dist/components/atoms/IconFile/index.js +0 -249
- package/dist/components/atoms/IconFile/styles.js +0 -23
- package/dist/components/atoms/Image/Image.stories.js +0 -73
- package/dist/components/atoms/Image/index.js +0 -76
- package/dist/components/atoms/Image/styles.js +0 -43
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +0 -63
- package/dist/components/atoms/ImageLink/index.js +0 -77
- package/dist/components/atoms/ImageLink/styles.js +0 -40
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +0 -70
- package/dist/components/atoms/ImagePreview/index.js +0 -208
- package/dist/components/atoms/ImagePreview/styles.js +0 -44
- package/dist/components/atoms/InputText/InputText.stories.js +0 -60
- package/dist/components/atoms/InputText/index.js +0 -66
- package/dist/components/atoms/InputText/styles.js +0 -32
- package/dist/components/atoms/NotFound/NotFound.stories.js +0 -36
- package/dist/components/atoms/NotFound/index.js +0 -75
- package/dist/components/atoms/NotFound/styles.js +0 -20
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -45
- package/dist/components/atoms/SelectItemV2/index.js +0 -57
- package/dist/components/atoms/SelectItemV2/styles.js +0 -30
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +0 -66
- package/dist/components/atoms/Tooltip/index.js +0 -72
- package/dist/components/atoms/Tooltip/styles.js +0 -20
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -66
- package/dist/components/molecules/ButtonDownloadFile/index.js +0 -179
- package/dist/components/molecules/ButtonDownloadFile/styles.js +0 -23
- package/dist/components/molecules/Dropdown/Dropdown.stories.js +0 -98
- package/dist/components/molecules/Dropdown/index.js +0 -150
- package/dist/components/molecules/Dropdown/styles.js +0 -26
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -82
- package/dist/components/molecules/ImageTooltip/index.js +0 -85
- package/dist/components/molecules/ImageTooltip/styles.js +0 -33
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +0 -120
- package/dist/components/molecules/SelectV2/index.js +0 -306
- package/dist/components/molecules/SelectV2/styles.js +0 -42
- package/dist/components/molecules/SelectV2/test.js +0 -95
- package/dist/components/molecules/SelectV2/test.stories.js +0 -27
- package/dist/components/organisms/Chat/Chat.stories.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -83
- package/dist/components/organisms/Chat/ChatLists/index.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/styles.js +0 -29
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -176
- package/dist/components/organisms/Chat/ContainerItems/index.js +0 -537
- package/dist/components/organisms/Chat/ContainerItems/styles.js +0 -20
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -142
- package/dist/components/organisms/Chat/ContentChat/index.js +0 -1429
- package/dist/components/organisms/Chat/ContentChat/styles.js +0 -20
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +0 -43
- package/dist/components/organisms/Chat/Footer/index.js +0 -976
- package/dist/components/organisms/Chat/Footer/styles.js +0 -32
- package/dist/components/organisms/Chat/Header/Header.stories.js +0 -96
- package/dist/components/organisms/Chat/Header/index.js +0 -84
- package/dist/components/organisms/Chat/Header/styles.js +0 -20
- package/dist/components/organisms/Chat/index.js +0 -253
- package/dist/components/organisms/Chat/styles.js +0 -29
- package/dist/components/organisms/Modal/Modal.stories.js +0 -66
- package/dist/components/organisms/Modal/index.js +0 -95
- package/dist/components/organisms/Modal/styles.js +0 -20
- package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -33
- package/dist/components/organisms/RangeCalendar/index.js +0 -149
- package/dist/components/organisms/RangeCalendar/styles.js +0 -27
- package/dist/global-files/handle_http.js +0 -381
- package/dist/global-files/handle_userTech.js +0 -20
- package/dist/global-files/utils.js +0 -514
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -68
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -178
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -109
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
- package/src/components/molecules/SelectV2/index.js +0 -357
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -61
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -147
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- 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 +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -512
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- 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 +0 -897
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -661
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -94
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -235
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -225
- package/src/global-files/handle_userTech.js +0 -7
- package/src/global-files/utils.js +0 -330
|
@@ -28,48 +28,53 @@ exports.RetailerProductEditionDefault = RetailerProductEditionDefault;
|
|
|
28
28
|
RetailerProductEditionDefault.args = {
|
|
29
29
|
tabsSections: {
|
|
30
30
|
Descripción: true,
|
|
31
|
-
"Ficha técnica":
|
|
32
|
-
Imágenes:
|
|
31
|
+
"Ficha técnica": false,
|
|
32
|
+
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI0MmE2OWE4My02OGY0LTRmZjktOGU4Zi1jYzgxODQ5MDU5NGYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2OTkyODUxMSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2OTkzMjExMSwiaWF0IjoxNjY5OTI4NTExLCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.Mv1hFVjkF2y__7XP0bXzU2Yq8YMc0go9OgB7all5F4HvfK62I0l9rNRqddlaLjDSCmjvyYI-M8WFwHtdlOL1-liazZr8hhu7_9SciapRzkuuHlWwu0g3EEK54NuHR3-YYRax85hKyN9YoV1MY_fTzT9WUVXWoqf4UPj2SH79g_A0l0lm18ODzzdhXFSpubuI8-Ml7MbXUh8klzl7T55S16sj8zPONpesrA01WsG1PWGqfRZI2g37edj_en2_fIcfi49tQjbSjnQOVOPnkO5TPiyoMtZdS53Rx75iSI8-fP-Z7kD-5TI_KK6vK35PHoG1B-N3EzDUjXek4MowNswnGA",
|
|
35
35
|
productSelected: {
|
|
36
36
|
services: {
|
|
37
37
|
datasheets: 1,
|
|
38
38
|
descriptions: 1,
|
|
39
39
|
images: 1
|
|
40
40
|
},
|
|
41
|
-
orderId:
|
|
42
|
-
status: "
|
|
43
|
-
datasheet_status: "
|
|
41
|
+
orderId: 123,
|
|
42
|
+
status: "PA",
|
|
43
|
+
datasheet_status: "PA",
|
|
44
44
|
prio: "none",
|
|
45
45
|
version: 3,
|
|
46
|
-
description_status: "
|
|
47
|
-
images_status: "
|
|
46
|
+
description_status: "PA",
|
|
47
|
+
images_status: "PA",
|
|
48
48
|
statusByRetailer: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
4: {
|
|
50
|
+
datasheet: "PA",
|
|
51
|
+
description: "PA",
|
|
52
|
+
images: "PA"
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
datasheet: "
|
|
56
|
-
description: "
|
|
57
|
-
images: "
|
|
54
|
+
5: {
|
|
55
|
+
datasheet: "PA",
|
|
56
|
+
description: "PA",
|
|
57
|
+
images: "PA"
|
|
58
|
+
},
|
|
59
|
+
6: {
|
|
60
|
+
datasheet: "PA",
|
|
61
|
+
description: "PA",
|
|
62
|
+
images: "PA"
|
|
58
63
|
}
|
|
59
64
|
},
|
|
60
65
|
article: {
|
|
61
|
-
id_article:
|
|
62
|
-
id_category: "
|
|
63
|
-
name: "
|
|
64
|
-
upc: "
|
|
65
|
-
timestamp: "
|
|
66
|
+
id_article: 127,
|
|
67
|
+
id_category: "700",
|
|
68
|
+
name: "prueba prod flujo",
|
|
69
|
+
upc: "34234353324",
|
|
70
|
+
timestamp: "2022-11-23T23:12:30.000Z",
|
|
66
71
|
id_user: 28,
|
|
67
72
|
status: "NULL",
|
|
68
73
|
active: 1,
|
|
69
74
|
company_id: 1,
|
|
70
75
|
company_name: "GRUPO BRAHMA",
|
|
71
76
|
country: "México",
|
|
72
|
-
id_order:
|
|
77
|
+
id_order: 123,
|
|
73
78
|
id_datasheet_especialist: 54,
|
|
74
79
|
id_datasheet_facilitator: 52,
|
|
75
80
|
id_description_especialist: 54,
|
|
@@ -78,37 +83,40 @@ RetailerProductEditionDefault.args = {
|
|
|
78
83
|
id_images_facilitator: 53,
|
|
79
84
|
id_auditor: 37,
|
|
80
85
|
id_recepcionist: null,
|
|
81
|
-
category: "Salud y Belleza|Cuidado
|
|
86
|
+
category: "Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
|
|
82
87
|
missingAttributes: 0,
|
|
83
88
|
missingDescriptions: 0,
|
|
84
89
|
missingImages: 0
|
|
85
90
|
},
|
|
86
91
|
retailers: [{
|
|
87
|
-
id:
|
|
88
|
-
name: "
|
|
92
|
+
id: 4,
|
|
93
|
+
name: "Walmart Super y Superama"
|
|
94
|
+
}, {
|
|
95
|
+
id: 5,
|
|
96
|
+
name: "Chedraui"
|
|
89
97
|
}, {
|
|
90
|
-
id:
|
|
91
|
-
name: "
|
|
98
|
+
id: 6,
|
|
99
|
+
name: "HEB"
|
|
92
100
|
}],
|
|
93
101
|
country: "México",
|
|
94
|
-
upc: "
|
|
102
|
+
upc: "34234353324"
|
|
95
103
|
},
|
|
96
104
|
location: {
|
|
97
105
|
product: {
|
|
98
|
-
articleId:
|
|
106
|
+
articleId: 109485,
|
|
99
107
|
versionId: 3
|
|
100
108
|
}
|
|
101
109
|
},
|
|
102
110
|
user: {
|
|
103
|
-
id_user:
|
|
104
|
-
name: "
|
|
105
|
-
last_name: "
|
|
106
|
-
email: "
|
|
111
|
+
id_user: 51,
|
|
112
|
+
name: "ADMIN PRUEBA",
|
|
113
|
+
last_name: "",
|
|
114
|
+
email: "etc@contentoh.com",
|
|
107
115
|
position: "",
|
|
108
116
|
telephone: "",
|
|
109
117
|
country: "",
|
|
110
118
|
id_company: 2,
|
|
111
|
-
id_cognito: "
|
|
119
|
+
id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
|
|
112
120
|
birth_Date: null,
|
|
113
121
|
about_me: "",
|
|
114
122
|
zip_code: "",
|
|
@@ -119,7 +127,7 @@ RetailerProductEditionDefault.args = {
|
|
|
119
127
|
active: 1,
|
|
120
128
|
is_retailer: 0,
|
|
121
129
|
email_notify: 1,
|
|
122
|
-
is_user_tech:
|
|
130
|
+
is_user_tech: null,
|
|
123
131
|
membership: {
|
|
124
132
|
id: 2,
|
|
125
133
|
start_date: "2021-11-05T02:35:12.000Z",
|
|
@@ -131,6 +139,6 @@ RetailerProductEditionDefault.args = {
|
|
|
131
139
|
products_limit: "3",
|
|
132
140
|
type: "PyMES"
|
|
133
141
|
},
|
|
134
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
142
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1669928511679"
|
|
135
143
|
}
|
|
136
144
|
};
|
|
@@ -318,8 +318,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
318
318
|
})),
|
|
319
319
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
320
320
|
percentages = _useState24[0],
|
|
321
|
-
setPercentages = _useState24[1];
|
|
322
|
-
|
|
321
|
+
setPercentages = _useState24[1];
|
|
323
322
|
|
|
324
323
|
var _useState25 = (0, _react.useState)(0),
|
|
325
324
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
@@ -463,7 +462,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
463
462
|
_services = _context.sent;
|
|
464
463
|
//Converts the data inside the datasheets object to array
|
|
465
464
|
setServices(_services);
|
|
466
|
-
getServices();
|
|
465
|
+
getServices(); // setActiveRetailer(product?.retailers[0]);
|
|
466
|
+
|
|
467
467
|
setImages({
|
|
468
468
|
action: "init",
|
|
469
469
|
init: _services[2]
|
|
@@ -472,7 +472,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
472
472
|
(0, _data.getPercentage)({
|
|
473
473
|
data: [product]
|
|
474
474
|
}).then(function (res) {
|
|
475
|
-
return setPercentages(res
|
|
475
|
+
return setPercentages(res);
|
|
476
476
|
});
|
|
477
477
|
setLoading(false);
|
|
478
478
|
_context.next = 15;
|
|
@@ -681,17 +681,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
681
681
|
loadAssignations(product);
|
|
682
682
|
}, [userGroups]);
|
|
683
683
|
(0, _react.useEffect)(function () {
|
|
684
|
-
var
|
|
684
|
+
var _product$retailers2, _product$retailers$;
|
|
685
685
|
|
|
686
|
-
|
|
686
|
+
product === null || product === void 0 ? void 0 : (_product$retailers2 = product.retailers) === null || _product$retailers2 === void 0 ? void 0 : _product$retailers2.forEach(function (retailer) {
|
|
687
|
+
var _percentages$filter$;
|
|
687
688
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
689
|
+
retailer["percentage"] = percentages === null || percentages === void 0 ? void 0 : (_percentages$filter$ = percentages.filter(function (percent) {
|
|
690
|
+
return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
|
|
691
|
+
})[0]) === null || _percentages$filter$ === void 0 ? void 0 : _percentages$filter$.percentage;
|
|
692
|
+
});
|
|
693
|
+
setActivePercentage(product === null || product === void 0 ? void 0 : (_product$retailers$ = product.retailers[0]) === null || _product$retailers$ === void 0 ? void 0 : _product$retailers$.percentage);
|
|
695
694
|
}, [percentages]);
|
|
696
695
|
(0, _react.useEffect)(function () {
|
|
697
696
|
if (services.length > 0) {
|
|
@@ -122,30 +122,35 @@ var getPercentage = /*#__PURE__*/function () {
|
|
|
122
122
|
|
|
123
123
|
func = /*#__PURE__*/function () {
|
|
124
124
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
125
|
-
var dataToSend,
|
|
125
|
+
var dataToSend, retailers;
|
|
126
126
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
127
127
|
while (1) {
|
|
128
128
|
switch (_context2.prev = _context2.next) {
|
|
129
129
|
case 0:
|
|
130
130
|
dataToSend = [];
|
|
131
|
-
arrayRetailers = [];
|
|
132
131
|
retailers = params.data[0].retailers || params.data[0].retailersAvailable;
|
|
133
|
-
params.data.forEach(function (product
|
|
134
|
-
dataToSend.push(product.article ? {
|
|
135
|
-
id_article: product.article.id_article,
|
|
136
|
-
id_category: product.article.id_category,
|
|
137
|
-
version: product.version
|
|
138
|
-
} : {
|
|
139
|
-
id_article: product.id_article,
|
|
140
|
-
id_category: product.id_category,
|
|
141
|
-
version: product.version
|
|
142
|
-
});
|
|
132
|
+
params.data.forEach(function (product) {
|
|
143
133
|
retailers.forEach(function (retailer) {
|
|
144
|
-
|
|
134
|
+
dataToSend.push(product.article ? {
|
|
135
|
+
id_article: product.article.id_article,
|
|
136
|
+
id_category: product.article.id_category,
|
|
137
|
+
id_retailer: retailer.id,
|
|
138
|
+
version: product.version,
|
|
139
|
+
upc: product.article.upc,
|
|
140
|
+
name: product.article.name,
|
|
141
|
+
retailerName: retailer.name
|
|
142
|
+
} : {
|
|
143
|
+
id_article: product.id_article,
|
|
144
|
+
id_category: product.id_category,
|
|
145
|
+
id_retailer: retailer.id,
|
|
146
|
+
version: product.version,
|
|
147
|
+
upc: product.upc,
|
|
148
|
+
name: product.name,
|
|
149
|
+
retailerName: retailer.name
|
|
150
|
+
});
|
|
145
151
|
});
|
|
146
|
-
dataToSend[i].id_retailer_array = arrayRetailers;
|
|
147
152
|
});
|
|
148
|
-
_context2.next =
|
|
153
|
+
_context2.next = 5;
|
|
149
154
|
return _axios.default.post(process.env.REACT_APP_VALID_EXPORT_ENDPOINT, {
|
|
150
155
|
data: dataToSend
|
|
151
156
|
}, {
|
|
@@ -153,15 +158,15 @@ var getPercentage = /*#__PURE__*/function () {
|
|
|
153
158
|
Authorization: sessionStorage.getItem("jwt")
|
|
154
159
|
}
|
|
155
160
|
}).then(function (response) {
|
|
156
|
-
return
|
|
161
|
+
return response.data;
|
|
157
162
|
}).catch(function (err) {
|
|
158
163
|
return console.log(err, "Errror");
|
|
159
164
|
});
|
|
160
165
|
|
|
161
|
-
case
|
|
166
|
+
case 5:
|
|
162
167
|
return _context2.abrupt("return", _context2.sent);
|
|
163
168
|
|
|
164
|
-
case
|
|
169
|
+
case 6:
|
|
165
170
|
case "end":
|
|
166
171
|
return _context2.stop();
|
|
167
172
|
}
|