contentoh-components-library 21.3.19 → 21.3.21
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 +5 -0
- package/.env.production +2 -2
- package/dist/assets/images/customSelect/starIcon.svg +14 -0
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +124 -0
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/assets/sounds/newMessage.mp3 +0 -0
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +72 -0
- package/dist/components/atoms/ButtonFileChooser/index.js +110 -0
- package/dist/components/atoms/ButtonFileChooser/styles.js +20 -0
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +66 -0
- package/dist/components/atoms/ButtonV2/index.js +110 -0
- package/dist/components/atoms/ButtonV2/styles.js +53 -0
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +50 -0
- package/dist/components/atoms/CustomIcon/index.js +40 -0
- package/dist/components/atoms/CustomIcon/styles.js +33 -0
- package/dist/components/atoms/IconFile/IconFile.stories.js +48 -0
- package/dist/components/atoms/IconFile/index.js +249 -0
- package/dist/components/atoms/IconFile/styles.js +23 -0
- package/dist/components/atoms/Image/Image.stories.js +73 -0
- package/dist/components/atoms/Image/index.js +76 -0
- package/dist/components/atoms/Image/styles.js +43 -0
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +63 -0
- package/dist/components/atoms/ImageLink/index.js +77 -0
- package/dist/components/atoms/ImageLink/styles.js +40 -0
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +70 -0
- package/dist/components/atoms/ImagePreview/index.js +208 -0
- package/dist/components/atoms/ImagePreview/styles.js +44 -0
- package/dist/components/atoms/InputText/InputText.stories.js +60 -0
- package/dist/components/atoms/InputText/index.js +66 -0
- package/dist/components/atoms/InputText/styles.js +32 -0
- package/dist/components/atoms/NotFound/NotFound.stories.js +36 -0
- package/dist/components/atoms/NotFound/index.js +75 -0
- package/dist/components/atoms/NotFound/styles.js +20 -0
- package/dist/components/atoms/ProgressBar/index.js +36 -6
- package/dist/components/atoms/ProgressBar/styles.js +11 -3
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +45 -0
- package/dist/components/atoms/SelectItemV2/index.js +57 -0
- package/dist/components/atoms/SelectItemV2/styles.js +30 -0
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +66 -0
- package/dist/components/atoms/Tooltip/index.js +72 -0
- package/dist/components/atoms/Tooltip/styles.js +20 -0
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +66 -0
- package/dist/components/molecules/ButtonDownloadFile/index.js +179 -0
- package/dist/components/molecules/ButtonDownloadFile/styles.js +23 -0
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
- package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
- package/dist/components/molecules/Dropdown/Dropdown.stories.js +98 -0
- package/dist/components/molecules/Dropdown/index.js +150 -0
- package/dist/components/molecules/Dropdown/styles.js +26 -0
- package/dist/components/molecules/HeaderTop/index.js +23 -6
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +82 -0
- package/dist/components/molecules/ImageTooltip/index.js +85 -0
- package/dist/components/molecules/ImageTooltip/styles.js +33 -0
- package/dist/components/molecules/ProductNameHeader/index.js +6 -4
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +120 -0
- package/dist/components/molecules/SelectV2/index.js +306 -0
- package/dist/components/molecules/SelectV2/styles.js +42 -0
- package/dist/components/molecules/SelectV2/test.js +94 -0
- package/dist/components/molecules/SelectV2/test.stories.js +27 -0
- package/dist/components/organisms/Chat/Chat.stories.js +160 -0
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +83 -0
- package/dist/components/organisms/Chat/ChatLists/index.js +160 -0
- package/dist/components/organisms/Chat/ChatLists/styles.js +29 -0
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +176 -0
- package/dist/components/organisms/Chat/ContainerItems/index.js +537 -0
- package/dist/components/organisms/Chat/ContainerItems/styles.js +20 -0
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +142 -0
- package/dist/components/organisms/Chat/ContentChat/index.js +1466 -0
- package/dist/components/organisms/Chat/ContentChat/styles.js +20 -0
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +43 -0
- package/dist/components/organisms/Chat/Footer/index.js +976 -0
- package/dist/components/organisms/Chat/Footer/styles.js +32 -0
- package/dist/components/organisms/Chat/Header/Header.stories.js +96 -0
- package/dist/components/organisms/Chat/Header/index.js +83 -0
- package/dist/components/organisms/Chat/Header/styles.js +20 -0
- package/dist/components/organisms/Chat/index.js +253 -0
- package/dist/components/organisms/Chat/styles.js +29 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
- package/dist/components/organisms/Modal/Modal.stories.js +66 -0
- package/dist/components/organisms/Modal/index.js +95 -0
- package/dist/components/organisms/Modal/styles.js +20 -0
- package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +33 -0
- package/dist/components/organisms/RangeCalendar/index.js +149 -0
- package/dist/components/organisms/RangeCalendar/styles.js +27 -0
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +65 -50
- package/dist/components/pages/ProviderProductEdition/index.js +15 -11
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +36 -44
- package/dist/components/pages/RetailerProductEdition/index.js +13 -12
- package/dist/global-files/data.js +18 -23
- package/dist/global-files/fonts.css +6 -0
- package/dist/global-files/handle_http.js +381 -0
- package/dist/global-files/handle_userTech.js +20 -0
- package/dist/global-files/utils.js +514 -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/HeaderTop/index.js +29 -8
- package/src/components/molecules/HeaderTop/styles.js +4 -0
- 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/organisms/Chat/Chat.stories.js +147 -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 +512 -0
- package/src/components/organisms/Chat/ContainerItems/styles.js +328 -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 +919 -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 +235 -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/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 +67 -49
- package/src/components/pages/ProviderProductEdition/index.js +16 -9
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +36 -46
- package/src/components/pages/RetailerProductEdition/index.js +14 -10
- 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,74 +16,76 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: true,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwM2ViMjZhMC1hYjU2LTQ3NjctYjY0Zi04NDkyNTgwNzcwMmEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjAzZWIyNmEwLWFiNTYtNDc2Ny1iNjRmLTg0OTI1ODA3NzAyYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJmNmNkMzA1My1iODE4LTQzYzgtOGZhMC0yNTZmMTBhMDYwNjciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY3NDU5OTgwNiwibmFtZSI6IlBydWViYSBNZXJjaGFudHMiLCJwaG9uZV9udW1iZXIiOiIrNTIxMjM0NTY3ODkxIiwiZXhwIjoxNjc0NjAzNDA2LCJpYXQiOjE2NzQ1OTk4MDYsImVtYWlsIjoibWVyY2hhbnRzMjRlbmVAYWxsZnJlZW1haWwubmV0In0.osGY8Rdr20hTwL86dZ_CzXxHLvPe-L0iaLtWVwJ78prdMlbDoEZWNePr-Di1rb8F2efV6FAsf9mELW6Tw3PETo_d5yeDEPVAGD0pXFvVntTlSrJGtfEDMnpNWTG2uaMlL1_zJ8BcFYmIUniZN8VvEKW6ezFOt01cK3We-Vrv92TqKa-ePQRkDnhKu52nnTgxs5aysGf-mYLxLumQ4TcOPXJ2x6OsszedJaujFDeCPN7JVGbg9HC68__WklpgocSasU6fQg4Glh1kXWQ-fy4XaFw6cBParJjkqic2Gg1iqwB5wGbrwD4E0crZyPkgwwPydTLLu6WguGWBuQHhcoG-xg",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
|
|
25
|
+
company_name: "merchants24ene@allfreemail.net",
|
|
26
|
+
company_id: 918,
|
|
27
|
+
id_category: "2028",
|
|
28
|
+
id_article: 432,
|
|
29
|
+
name: "VELA AROMA 18 OZ MAN/CAN",
|
|
30
|
+
upc: "102852",
|
|
30
31
|
version: 1,
|
|
31
32
|
retailersAvailable: [
|
|
32
33
|
{
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
id: 68,
|
|
35
|
+
name: "The Home Depot Merchants",
|
|
35
36
|
},
|
|
36
37
|
],
|
|
37
38
|
},
|
|
38
39
|
productToEdit: {
|
|
39
|
-
idCategory:
|
|
40
|
-
ArticleId:
|
|
40
|
+
idCategory: "2028",
|
|
41
|
+
ArticleId: 432,
|
|
41
42
|
product: [
|
|
42
43
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
|
|
45
|
+
company_name: "merchants24ene@allfreemail.net",
|
|
46
|
+
company_id: 918,
|
|
47
|
+
id_category: "2028",
|
|
48
|
+
id_article: 432,
|
|
49
|
+
name: "VELA AROMA 18 OZ MAN/CAN",
|
|
50
|
+
upc: "102852",
|
|
49
51
|
version: 1,
|
|
50
52
|
retailersAvailable: [
|
|
51
53
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
id: 68,
|
|
55
|
+
name: "The Home Depot Merchants",
|
|
54
56
|
},
|
|
55
57
|
],
|
|
56
58
|
},
|
|
57
59
|
],
|
|
58
60
|
},
|
|
59
61
|
location: {
|
|
60
|
-
state: { origin: "Contentoh" },
|
|
62
|
+
state: { origin: "Contentoh", withChat: true },
|
|
61
63
|
},
|
|
62
64
|
user: {
|
|
63
|
-
id_user:
|
|
64
|
-
name: "
|
|
65
|
-
last_name: "
|
|
66
|
-
email: "
|
|
67
|
-
position: "
|
|
68
|
-
telephone: "+
|
|
65
|
+
id_user: 140,
|
|
66
|
+
name: "Prueba",
|
|
67
|
+
last_name: "Merchants",
|
|
68
|
+
email: "merchants24ene@allfreemail.net",
|
|
69
|
+
position: "merchants24ene@allfreemail.net",
|
|
70
|
+
telephone: "+521234567891",
|
|
69
71
|
country: "México",
|
|
70
|
-
id_company:
|
|
71
|
-
id_cognito: "
|
|
72
|
+
id_company: 918,
|
|
73
|
+
id_cognito: "03eb26a0-ab56-4767-b64f-84925807702a",
|
|
72
74
|
birth_Date: null,
|
|
73
|
-
about_me:
|
|
74
|
-
zip_code:
|
|
75
|
-
address:
|
|
76
|
-
job:
|
|
77
|
-
id_stripe:
|
|
75
|
+
about_me: null,
|
|
76
|
+
zip_code: null,
|
|
77
|
+
address: null,
|
|
78
|
+
job: null,
|
|
79
|
+
id_stripe: null,
|
|
78
80
|
id_role: 0,
|
|
79
81
|
active: 1,
|
|
80
82
|
is_retailer: 0,
|
|
81
|
-
email_notify:
|
|
82
|
-
is_user_tech:
|
|
83
|
+
email_notify: 1,
|
|
84
|
+
is_user_tech: null,
|
|
83
85
|
membership: {
|
|
84
|
-
id:
|
|
85
|
-
start_date: "
|
|
86
|
-
end_date: "
|
|
86
|
+
id: 109,
|
|
87
|
+
start_date: "2023-01-24T22:07:34.000Z",
|
|
88
|
+
end_date: "2024-01-24T22:07:34.000Z",
|
|
87
89
|
planID: 8,
|
|
88
90
|
plan: "prod_KtlhECVSFG2iro",
|
|
89
91
|
name: "Plan Pro",
|
|
@@ -91,21 +93,37 @@ ProviderProductEditionDefault.args = {
|
|
|
91
93
|
products_limit: "5000",
|
|
92
94
|
type: "Enterprise",
|
|
93
95
|
},
|
|
94
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
96
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-140/140.png?1674599807427",
|
|
95
97
|
},
|
|
96
98
|
company: {
|
|
97
|
-
id_company:
|
|
98
|
-
trade_name: "
|
|
99
|
-
company_name: "
|
|
100
|
-
rfc: "
|
|
101
|
-
adress: "
|
|
102
|
-
about_company:
|
|
103
|
-
telephone:
|
|
104
|
-
web_site:
|
|
105
|
-
zip_code:
|
|
99
|
+
id_company: 918,
|
|
100
|
+
trade_name: "merchants24ene@allfreemail.net",
|
|
101
|
+
company_name: "merchants24ene@allfreemail.net",
|
|
102
|
+
rfc: "merchants24ene@allfreemail.net",
|
|
103
|
+
adress: "merchants24ene@allfreemail.net",
|
|
104
|
+
about_company: null,
|
|
105
|
+
telephone: null,
|
|
106
|
+
web_site: null,
|
|
107
|
+
zip_code: null,
|
|
106
108
|
email: null,
|
|
107
|
-
social_link:
|
|
109
|
+
social_link: null,
|
|
108
110
|
is_retailer: 0,
|
|
111
|
+
financedRetailers: [
|
|
112
|
+
{
|
|
113
|
+
id: 68,
|
|
114
|
+
name: "The Home Depot Merchants",
|
|
115
|
+
country: "México",
|
|
116
|
+
id_region: 1,
|
|
117
|
+
active: 1,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
retailers: [
|
|
121
|
+
{
|
|
122
|
+
id: null,
|
|
123
|
+
name: null,
|
|
124
|
+
country: null,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
109
127
|
},
|
|
110
128
|
showSurvey: (v) => v && alert("se muestra"),
|
|
111
129
|
};
|
|
@@ -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();
|
|
@@ -272,8 +274,7 @@ export const ProviderProductEdition = ({
|
|
|
272
274
|
|
|
273
275
|
setImages({ action: "init", init: services[2] });
|
|
274
276
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
275
|
-
|
|
276
|
-
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
277
|
+
getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
|
|
277
278
|
setLoading(false);
|
|
278
279
|
};
|
|
279
280
|
|
|
@@ -363,12 +364,13 @@ export const ProviderProductEdition = ({
|
|
|
363
364
|
useEffect(() => {
|
|
364
365
|
const productTemp = product;
|
|
365
366
|
const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
|
|
366
|
-
|
|
367
|
-
retailer
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
367
|
+
if (Object.keys(percentages[productTemp.id_article] ?? {})?.length > 0) {
|
|
368
|
+
retailers?.forEach((retailer, index) => {
|
|
369
|
+
retailer["percentage"] = Number(
|
|
370
|
+
percentages[productTemp.id_article][retailer.id].percentageRequired
|
|
371
|
+
);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
372
374
|
setProduct(productTemp);
|
|
373
375
|
setActivePercentage(retailers[0]?.percentage);
|
|
374
376
|
}, [percentages]);
|
|
@@ -1056,7 +1058,12 @@ export const ProviderProductEdition = ({
|
|
|
1056
1058
|
];
|
|
1057
1059
|
return (
|
|
1058
1060
|
<Container headerTop={headerTop}>
|
|
1059
|
-
<HeaderTop
|
|
1061
|
+
<HeaderTop
|
|
1062
|
+
setHeaderTop={setHeaderTop}
|
|
1063
|
+
withChat={location?.state?.withChat}
|
|
1064
|
+
productSelected={productSelected}
|
|
1065
|
+
token={token}
|
|
1066
|
+
/>
|
|
1060
1067
|
<div className="data-container">
|
|
1061
1068
|
<div className="image-data-panel">
|
|
1062
1069
|
<ImagePreviewer
|
|
@@ -12,54 +12,49 @@ export const RetailerProductEditionDefault = Template.bind({});
|
|
|
12
12
|
RetailerProductEditionDefault.args = {
|
|
13
13
|
tabsSections: {
|
|
14
14
|
Descripción: true,
|
|
15
|
-
"Ficha técnica":
|
|
16
|
-
Imágenes:
|
|
15
|
+
"Ficha técnica": true,
|
|
16
|
+
Imágenes: true,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJmMzY2YTdjYi02YjA0LTRiMzAtOTJmYy1iMzY0MmY3ZjEzNmEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY3MTc0MzE0OSwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjcxNzQ2NzQ5LCJpYXQiOjE2NzE3NDMxNDksImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.J8kTv1sEotxoicaRclaK1r0tjVbwHPDxIzdDfxYo9J4XwBYYfS180__KYYE0Dh1AfUK_K0mrk2_78_rhTNxCQT85W7XS3ZEcxIOUekqoxaKFl8LSVN_eWz3SlsGG0yRflhJGt6d4gBVByXZbdNiyp1rkjgMln6fhwlRUnuGRbG1WKQvdAPli3qfH8mLzgoTz-6HWs1Jf2Ujheavf3ipGMNtj-OSUdQsh04Ov7jehDWdnPNn2s2DAl4eubgjdXrwIiBPCRkbuFeYZZJpzj1wy__a0nCM7bzly5uTZ2aWujgEJvf9bJb-Y4gkS8TxyJaggJ01ZsMki36aEpIt8J1tJag",
|
|
20
20
|
productSelected: {
|
|
21
21
|
services: {
|
|
22
22
|
datasheets: 1,
|
|
23
23
|
descriptions: 1,
|
|
24
24
|
images: 1,
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
27
|
-
status: "
|
|
28
|
-
datasheet_status: "
|
|
26
|
+
orderId: 194,
|
|
27
|
+
status: "AC",
|
|
28
|
+
datasheet_status: "AC",
|
|
29
29
|
prio: "none",
|
|
30
30
|
version: 3,
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status: "
|
|
31
|
+
description_status: "AC",
|
|
32
|
+
images_status: "AC",
|
|
33
33
|
statusByRetailer: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
40: {
|
|
35
|
+
description: "AC",
|
|
36
|
+
images: "AC",
|
|
37
|
+
datasheet: "AC",
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
datasheet: "
|
|
41
|
-
description: "
|
|
42
|
-
images: "
|
|
43
|
-
},
|
|
44
|
-
6: {
|
|
45
|
-
datasheet: "PA",
|
|
46
|
-
description: "PA",
|
|
47
|
-
images: "PA",
|
|
39
|
+
43: {
|
|
40
|
+
datasheet: "AC",
|
|
41
|
+
description: "AC",
|
|
42
|
+
images: "AC",
|
|
48
43
|
},
|
|
49
44
|
},
|
|
50
45
|
article: {
|
|
51
|
-
id_article:
|
|
52
|
-
id_category: "
|
|
53
|
-
name: "
|
|
54
|
-
upc: "
|
|
55
|
-
timestamp: "
|
|
46
|
+
id_article: 354,
|
|
47
|
+
id_category: "684",
|
|
48
|
+
name: "Enjuague Bucal ",
|
|
49
|
+
upc: "22342342",
|
|
50
|
+
timestamp: "2023-01-03T16:19:49.000Z",
|
|
56
51
|
id_user: 28,
|
|
57
52
|
status: "NULL",
|
|
58
53
|
active: 1,
|
|
59
54
|
company_id: 1,
|
|
60
55
|
company_name: "GRUPO BRAHMA",
|
|
61
56
|
country: "México",
|
|
62
|
-
id_order:
|
|
57
|
+
id_order: 194,
|
|
63
58
|
id_datasheet_especialist: 54,
|
|
64
59
|
id_datasheet_facilitator: 52,
|
|
65
60
|
id_description_especialist: 54,
|
|
@@ -68,42 +63,37 @@ RetailerProductEditionDefault.args = {
|
|
|
68
63
|
id_images_facilitator: 53,
|
|
69
64
|
id_auditor: 37,
|
|
70
65
|
id_recepcionist: null,
|
|
71
|
-
category:
|
|
72
|
-
"Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
|
|
66
|
+
category: "Salud y Belleza|Cuidado Bucal|Pastas Dentales y Aseo Bucal",
|
|
73
67
|
missingAttributes: 0,
|
|
74
68
|
missingDescriptions: 0,
|
|
75
69
|
missingImages: 0,
|
|
76
70
|
},
|
|
77
71
|
retailers: [
|
|
78
72
|
{
|
|
79
|
-
id:
|
|
80
|
-
name: "
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
id: 5,
|
|
84
|
-
name: "Chedraui",
|
|
73
|
+
id: 40,
|
|
74
|
+
name: "Nadro",
|
|
85
75
|
},
|
|
86
76
|
{
|
|
87
|
-
id:
|
|
88
|
-
name: "
|
|
77
|
+
id: 43,
|
|
78
|
+
name: "City Club",
|
|
89
79
|
},
|
|
90
80
|
],
|
|
91
81
|
country: "México",
|
|
92
|
-
upc: "
|
|
82
|
+
upc: "22342342",
|
|
93
83
|
},
|
|
94
84
|
location: {
|
|
95
|
-
product: { articleId:
|
|
85
|
+
product: { articleId: 354, versionId: 3 },
|
|
96
86
|
},
|
|
97
87
|
user: {
|
|
98
|
-
id_user:
|
|
99
|
-
name: "
|
|
100
|
-
last_name: "",
|
|
101
|
-
email: "
|
|
88
|
+
id_user: 65,
|
|
89
|
+
name: "Oscar Alberto",
|
|
90
|
+
last_name: "Arenas",
|
|
91
|
+
email: "oarenas@contentoh.com",
|
|
102
92
|
position: "",
|
|
103
93
|
telephone: "",
|
|
104
94
|
country: "",
|
|
105
95
|
id_company: 2,
|
|
106
|
-
id_cognito: "
|
|
96
|
+
id_cognito: "73cc8d40-c841-422a-a2f2-e69d7fe26ebf",
|
|
107
97
|
birth_Date: null,
|
|
108
98
|
about_me: "",
|
|
109
99
|
zip_code: "",
|
|
@@ -114,7 +104,7 @@ RetailerProductEditionDefault.args = {
|
|
|
114
104
|
active: 1,
|
|
115
105
|
is_retailer: 0,
|
|
116
106
|
email_notify: 1,
|
|
117
|
-
is_user_tech:
|
|
107
|
+
is_user_tech: "AS",
|
|
118
108
|
membership: {
|
|
119
109
|
id: 2,
|
|
120
110
|
start_date: "2021-11-05T02:35:12.000Z",
|
|
@@ -126,6 +116,6 @@ RetailerProductEditionDefault.args = {
|
|
|
126
116
|
products_limit: "3",
|
|
127
117
|
type: "PyMES",
|
|
128
118
|
},
|
|
129
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
119
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-65/65.png?1675063399869",
|
|
130
120
|
},
|
|
131
121
|
};
|
|
@@ -175,6 +175,7 @@ export const RetailerProductEdition = ({
|
|
|
175
175
|
const [percentages, setPercentages] = useState(
|
|
176
176
|
new Array(product?.retailers?.length).fill({ percentage: 0 })
|
|
177
177
|
);
|
|
178
|
+
// const [percentages, setPercentages] = useState([{ retailers: {} }]);
|
|
178
179
|
const [activePercentage, setActivePercentage] = useState(0);
|
|
179
180
|
const [activeRetailer, setActiveRetailer] = useState({});
|
|
180
181
|
const [services, setServices] = useState([]);
|
|
@@ -225,12 +226,9 @@ export const RetailerProductEdition = ({
|
|
|
225
226
|
//Converts the data inside the datasheets object to array
|
|
226
227
|
setServices(services);
|
|
227
228
|
getServices();
|
|
228
|
-
|
|
229
|
-
// setActiveRetailer(product?.retailers[0]);
|
|
230
229
|
setImages({ action: "init", init: services[2] });
|
|
231
230
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
232
|
-
|
|
233
|
-
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
231
|
+
getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
|
|
234
232
|
setLoading(false);
|
|
235
233
|
} catch (error) {
|
|
236
234
|
console.log(error);
|
|
@@ -371,12 +369,18 @@ export const RetailerProductEdition = ({
|
|
|
371
369
|
}, [userGroups]);
|
|
372
370
|
|
|
373
371
|
useEffect(() => {
|
|
374
|
-
product?.
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
372
|
+
const retailers = product?.retailersAvailable || product?.retailers;
|
|
373
|
+
if (
|
|
374
|
+
Object.keys(percentages[product.article.id_article] ?? {})?.length > 0
|
|
375
|
+
) {
|
|
376
|
+
retailers?.forEach((retailer, index) => {
|
|
377
|
+
retailer["percentage"] = Number(
|
|
378
|
+
percentages[product.article.id_article][retailer.id]
|
|
379
|
+
.percentageRequired
|
|
380
|
+
);
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
setActivePercentage(retailers[0]?.percentage);
|
|
380
384
|
}, [percentages]);
|
|
381
385
|
|
|
382
386
|
useEffect(() => {
|
package/src/global-files/data.js
CHANGED
|
@@ -86,32 +86,27 @@ export const getImage = (imageGeneral, width = 250, height = 250) => {
|
|
|
86
86
|
export const getPercentage = async (params = {}) => {
|
|
87
87
|
const func = async () => {
|
|
88
88
|
const dataToSend = [];
|
|
89
|
+
const arrayRetailers = [];
|
|
89
90
|
let retailers =
|
|
90
91
|
params.data[0].retailers || params.data[0].retailersAvailable;
|
|
91
|
-
params.data.forEach((product) => {
|
|
92
|
+
params.data.forEach((product, i) => {
|
|
93
|
+
dataToSend.push(
|
|
94
|
+
product.article
|
|
95
|
+
? {
|
|
96
|
+
id_article: product.article.id_article,
|
|
97
|
+
id_category: product.article.id_category,
|
|
98
|
+
version: product.version,
|
|
99
|
+
}
|
|
100
|
+
: {
|
|
101
|
+
id_article: product.id_article,
|
|
102
|
+
id_category: product.id_category,
|
|
103
|
+
version: product.version,
|
|
104
|
+
}
|
|
105
|
+
);
|
|
92
106
|
retailers.forEach((retailer) => {
|
|
93
|
-
|
|
94
|
-
product.article
|
|
95
|
-
? {
|
|
96
|
-
id_article: product.article.id_article,
|
|
97
|
-
id_category: product.article.id_category,
|
|
98
|
-
id_retailer: retailer.id,
|
|
99
|
-
version: product.version,
|
|
100
|
-
upc: product.article.upc,
|
|
101
|
-
name: product.article.name,
|
|
102
|
-
retailerName: retailer.name,
|
|
103
|
-
}
|
|
104
|
-
: {
|
|
105
|
-
id_article: product.id_article,
|
|
106
|
-
id_category: product.id_category,
|
|
107
|
-
id_retailer: retailer.id,
|
|
108
|
-
version: product.version,
|
|
109
|
-
upc: product.upc,
|
|
110
|
-
name: product.name,
|
|
111
|
-
retailerName: retailer.name,
|
|
112
|
-
}
|
|
113
|
-
);
|
|
107
|
+
arrayRetailers.push(retailer.id);
|
|
114
108
|
});
|
|
109
|
+
dataToSend[i].id_retailer_array = arrayRetailers;
|
|
115
110
|
});
|
|
116
111
|
|
|
117
112
|
return await axios
|
|
@@ -125,7 +120,7 @@ export const getPercentage = async (params = {}) => {
|
|
|
125
120
|
}
|
|
126
121
|
)
|
|
127
122
|
.then((response) => {
|
|
128
|
-
return response.data;
|
|
123
|
+
return [response.data];
|
|
129
124
|
})
|
|
130
125
|
.catch((err) => console.log(err, "Errror"));
|
|
131
126
|
};
|