contentoh-components-library 21.3.14 → 21.3.16
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/fonts/{Roboto → roboto}/LICENSE.txt +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Black.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-BlackItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Bold.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-BoldItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Italic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Light.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-LightItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Medium.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-MediumItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Regular.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Thin.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-ThinItalic.ttf +0 -0
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- 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/organisms/RangeCalendar/index.js +3 -4
- 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 +86 -60
- package/dist/components/pages/RetailerProductEdition/index.js +72 -65
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/utils.js +2 -22
- 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/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 +7 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +85 -62
- package/src/components/pages/RetailerProductEdition/index.js +18 -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/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +0 -3
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +0 -1
- package/dist/assets/images/chatPopup/document.svg +0 -1
- package/dist/assets/images/chatPopup/iconChat.svg +0 -19
- package/dist/assets/images/chatPopup/iconPlus.svg +0 -3
- package/dist/assets/images/chatPopup/pdf.svg +0 -75
- package/dist/assets/images/chatPopup/remove.svg +0 -4
- package/dist/assets/images/chatPopup/send.svg +0 -3
- package/dist/assets/images/chatPopup/svgIcon.svg +0 -109
- package/dist/assets/images/chatPopup/upload_file.svg +0 -3
- package/dist/assets/images/chatPopup/xls.svg +0 -53
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +0 -28
- package/dist/components/atoms/ChatPopUp/index.js +0 -841
- package/dist/components/atoms/ChatPopUp/styles.js +0 -27
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +0 -182
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +0 -48
- package/dist/components/atoms/StatusTag/index.js +0 -58
- package/dist/components/atoms/StatusTag/styles.js +0 -20
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +0 -37
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +0 -269
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +0 -20
- 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,91 +28,117 @@ 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
|
+
datasheets: 1,
|
|
38
|
+
descriptions: 1,
|
|
39
|
+
images: 1
|
|
40
|
+
},
|
|
41
|
+
orderId: 123,
|
|
42
|
+
status: "PA",
|
|
43
|
+
datasheet_status: "PA",
|
|
44
|
+
prio: "none",
|
|
37
45
|
version: 3,
|
|
38
|
-
|
|
46
|
+
description_status: "PA",
|
|
47
|
+
images_status: "PA",
|
|
48
|
+
statusByRetailer: {
|
|
49
|
+
4: {
|
|
50
|
+
datasheet: "PA",
|
|
51
|
+
description: "PA",
|
|
52
|
+
images: "PA"
|
|
53
|
+
},
|
|
54
|
+
5: {
|
|
55
|
+
datasheet: "PA",
|
|
56
|
+
description: "PA",
|
|
57
|
+
images: "PA"
|
|
58
|
+
},
|
|
59
|
+
6: {
|
|
60
|
+
datasheet: "PA",
|
|
61
|
+
description: "PA",
|
|
62
|
+
images: "PA"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
39
65
|
article: {
|
|
40
|
-
|
|
41
|
-
|
|
66
|
+
id_article: 127,
|
|
67
|
+
id_category: "700",
|
|
68
|
+
name: "prueba prod flujo",
|
|
69
|
+
upc: "34234353324",
|
|
70
|
+
timestamp: "2022-11-23T23:12:30.000Z",
|
|
71
|
+
id_user: 28,
|
|
72
|
+
status: "NULL",
|
|
73
|
+
active: 1,
|
|
42
74
|
company_id: 1,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
75
|
+
company_name: "GRUPO BRAHMA",
|
|
76
|
+
country: "México",
|
|
77
|
+
id_order: 123,
|
|
78
|
+
id_datasheet_especialist: 54,
|
|
79
|
+
id_datasheet_facilitator: 52,
|
|
80
|
+
id_description_especialist: 54,
|
|
81
|
+
id_description_facilitator: 52,
|
|
82
|
+
id_images_especialist: 55,
|
|
83
|
+
id_images_facilitator: 53,
|
|
84
|
+
id_auditor: 37,
|
|
85
|
+
id_recepcionist: null,
|
|
86
|
+
category: "Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
|
|
87
|
+
missingAttributes: 0,
|
|
88
|
+
missingDescriptions: 0,
|
|
89
|
+
missingImages: 0
|
|
47
90
|
},
|
|
48
|
-
asignations: [],
|
|
49
91
|
retailers: [{
|
|
50
|
-
id:
|
|
51
|
-
name: "
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
name: "The Home Depot Platinum",
|
|
59
|
-
country: "México",
|
|
60
|
-
id_region: 1,
|
|
61
|
-
active: 1
|
|
92
|
+
id: 4,
|
|
93
|
+
name: "Walmart Super y Superama"
|
|
94
|
+
}, {
|
|
95
|
+
id: 5,
|
|
96
|
+
name: "Chedraui"
|
|
97
|
+
}, {
|
|
98
|
+
id: 6,
|
|
99
|
+
name: "HEB"
|
|
62
100
|
}],
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
categoryName: "Ventilación y Calefacción|Ventiladores de Techo|Ventiladores de Techo",
|
|
66
|
-
id_category: "2416",
|
|
67
|
-
id_article: 221,
|
|
68
|
-
services: [{
|
|
69
|
-
id_article: 221,
|
|
70
|
-
service: "datasheet",
|
|
71
|
-
quantity: 1,
|
|
72
|
-
price: 0,
|
|
73
|
-
id_user: 59,
|
|
74
|
-
datasheet_common: null,
|
|
75
|
-
discount: null
|
|
76
|
-
}]
|
|
101
|
+
country: "México",
|
|
102
|
+
upc: "34234353324"
|
|
77
103
|
},
|
|
78
104
|
location: {
|
|
79
105
|
product: {
|
|
80
|
-
articleId:
|
|
106
|
+
articleId: 109485,
|
|
81
107
|
versionId: 3
|
|
82
108
|
}
|
|
83
109
|
},
|
|
84
110
|
user: {
|
|
85
|
-
id_user:
|
|
86
|
-
name: "
|
|
87
|
-
last_name: "
|
|
88
|
-
email: "
|
|
89
|
-
position: "
|
|
90
|
-
telephone: "
|
|
91
|
-
country: "
|
|
92
|
-
id_company:
|
|
93
|
-
id_cognito: "
|
|
111
|
+
id_user: 51,
|
|
112
|
+
name: "ADMIN PRUEBA",
|
|
113
|
+
last_name: "",
|
|
114
|
+
email: "etc@contentoh.com",
|
|
115
|
+
position: "",
|
|
116
|
+
telephone: "",
|
|
117
|
+
country: "",
|
|
118
|
+
id_company: 2,
|
|
119
|
+
id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
|
|
94
120
|
birth_Date: null,
|
|
95
121
|
about_me: "",
|
|
96
122
|
zip_code: "",
|
|
97
123
|
address: "",
|
|
98
124
|
job: "",
|
|
99
125
|
id_stripe: "",
|
|
100
|
-
id_role:
|
|
126
|
+
id_role: 1,
|
|
101
127
|
active: 1,
|
|
102
|
-
is_retailer:
|
|
103
|
-
email_notify:
|
|
128
|
+
is_retailer: 0,
|
|
129
|
+
email_notify: 1,
|
|
104
130
|
is_user_tech: null,
|
|
105
131
|
membership: {
|
|
106
|
-
id:
|
|
107
|
-
start_date: "
|
|
108
|
-
end_date: "
|
|
109
|
-
planID:
|
|
110
|
-
plan: "
|
|
111
|
-
name: "Plan
|
|
112
|
-
user_limit: "
|
|
113
|
-
products_limit: "
|
|
132
|
+
id: 2,
|
|
133
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
134
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
135
|
+
planID: 1,
|
|
136
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
137
|
+
name: "Plan Free",
|
|
138
|
+
user_limit: "1",
|
|
139
|
+
products_limit: "3",
|
|
114
140
|
type: "PyMES"
|
|
115
141
|
},
|
|
116
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
142
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1669928511679"
|
|
117
143
|
}
|
|
118
144
|
};
|
|
@@ -200,7 +200,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
200
200
|
});
|
|
201
201
|
|
|
202
202
|
var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
203
|
-
var _product$retailers, _product$services2, _datasheets$, _datasheets$$data, _product$
|
|
203
|
+
var _product$retailers, _product$services2, _datasheets$, _datasheets$$data, _product$article15, _comment$message;
|
|
204
204
|
|
|
205
205
|
var tabsSections = _ref.tabsSections,
|
|
206
206
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -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
|
-
|
|
687
|
-
|
|
688
|
-
if (((_Object$keys = Object.keys((_percentages$retailer = percentages === null || percentages === void 0 ? void 0 : percentages.retailers) !== null && _percentages$retailer !== void 0 ? _percentages$retailer : {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
|
|
689
|
-
retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer) {
|
|
690
|
-
retailer["percentage"] = Number(percentages === null || percentages === void 0 ? void 0 : percentages.retailers[retailer.id].percentageRequired);
|
|
691
|
-
});
|
|
692
|
-
}
|
|
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$;
|
|
693
688
|
|
|
694
|
-
|
|
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) {
|
|
@@ -760,65 +759,69 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
760
759
|
|
|
761
760
|
var saveDescriptions = /*#__PURE__*/function () {
|
|
762
761
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
763
|
-
var _product$article9, productTemp,
|
|
762
|
+
var dataClean, _product$article9, productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
|
|
764
763
|
|
|
765
764
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
766
765
|
while (1) {
|
|
767
766
|
switch (_context5.prev = _context5.next) {
|
|
768
767
|
case 0:
|
|
769
|
-
|
|
770
|
-
|
|
768
|
+
dataClean = updatedDescriptions.filter(function (f) {
|
|
769
|
+
return f.value !== '';
|
|
770
|
+
});
|
|
771
|
+
|
|
772
|
+
if (!(dataClean.length > 0)) {
|
|
773
|
+
_context5.next = 25;
|
|
771
774
|
break;
|
|
772
775
|
}
|
|
773
776
|
|
|
774
777
|
setLoading(true);
|
|
775
778
|
productTemp = product;
|
|
776
|
-
|
|
779
|
+
articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
|
|
777
780
|
dataObject = {
|
|
778
|
-
articleId:
|
|
779
|
-
articleData:
|
|
781
|
+
articleId: articleId,
|
|
782
|
+
articleData: dataClean
|
|
780
783
|
};
|
|
781
784
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
782
|
-
_context5.prev =
|
|
783
|
-
_context5.next =
|
|
785
|
+
_context5.prev = 7;
|
|
786
|
+
_context5.next = 10;
|
|
784
787
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
|
|
785
788
|
headers: {
|
|
786
789
|
Authorization: token
|
|
787
790
|
}
|
|
788
791
|
});
|
|
789
792
|
|
|
790
|
-
case
|
|
793
|
+
case 10:
|
|
791
794
|
res = _context5.sent;
|
|
792
795
|
|
|
793
796
|
if (!(res.data.statusCode === 200)) {
|
|
794
|
-
_context5.next =
|
|
797
|
+
_context5.next = 20;
|
|
795
798
|
break;
|
|
796
799
|
}
|
|
797
800
|
|
|
798
801
|
_JSON$parse2 = JSON.parse(res.data.body), newStatus = _JSON$parse2.newStatus, newArticleStatus = _JSON$parse2.newArticleStatus;
|
|
799
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[
|
|
802
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
800
803
|
if (newStatus) productTemp.description_status = newStatus;
|
|
801
804
|
setProduct(productTemp);
|
|
802
805
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
803
806
|
setMessage("Descripciones guardadas con éxito");
|
|
804
|
-
_context5.next =
|
|
807
|
+
_context5.next = 20;
|
|
805
808
|
return loadData();
|
|
806
809
|
|
|
807
|
-
case
|
|
808
|
-
_context5.next =
|
|
810
|
+
case 20:
|
|
811
|
+
_context5.next = 25;
|
|
809
812
|
break;
|
|
810
813
|
|
|
811
|
-
case
|
|
812
|
-
_context5.prev =
|
|
813
|
-
_context5.t0 = _context5["catch"](
|
|
814
|
+
case 22:
|
|
815
|
+
_context5.prev = 22;
|
|
816
|
+
_context5.t0 = _context5["catch"](7);
|
|
814
817
|
console.log(_context5.t0);
|
|
815
818
|
|
|
816
|
-
case
|
|
819
|
+
case 25:
|
|
817
820
|
case "end":
|
|
818
821
|
return _context5.stop();
|
|
819
822
|
}
|
|
820
823
|
}
|
|
821
|
-
}, _callee5, null, [[
|
|
824
|
+
}, _callee5, null, [[7, 22]]);
|
|
822
825
|
}));
|
|
823
826
|
|
|
824
827
|
return function saveDescriptions() {
|
|
@@ -828,65 +831,69 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
828
831
|
|
|
829
832
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
830
833
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
831
|
-
var _product$article10, productTemp,
|
|
834
|
+
var dataClean, _product$article10, productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
|
|
832
835
|
|
|
833
836
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
834
837
|
while (1) {
|
|
835
838
|
switch (_context6.prev = _context6.next) {
|
|
836
839
|
case 0:
|
|
837
|
-
|
|
838
|
-
|
|
840
|
+
dataClean = updatedDatasheets.filter(function (f) {
|
|
841
|
+
return f.value !== '';
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
if (!(dataClean.length > 0)) {
|
|
845
|
+
_context6.next = 25;
|
|
839
846
|
break;
|
|
840
847
|
}
|
|
841
848
|
|
|
842
849
|
setLoading(true);
|
|
843
850
|
productTemp = product;
|
|
844
|
-
|
|
851
|
+
articleId = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
|
|
845
852
|
dataObject = {
|
|
846
|
-
articleId:
|
|
847
|
-
articleData:
|
|
853
|
+
articleId: articleId,
|
|
854
|
+
articleData: dataClean
|
|
848
855
|
};
|
|
849
856
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
850
|
-
_context6.prev =
|
|
851
|
-
_context6.next =
|
|
857
|
+
_context6.prev = 7;
|
|
858
|
+
_context6.next = 10;
|
|
852
859
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
853
860
|
headers: {
|
|
854
861
|
Authorization: token
|
|
855
862
|
}
|
|
856
863
|
});
|
|
857
864
|
|
|
858
|
-
case
|
|
865
|
+
case 10:
|
|
859
866
|
res = _context6.sent;
|
|
860
867
|
|
|
861
868
|
if (!(res.data.statusCode === 200)) {
|
|
862
|
-
_context6.next =
|
|
869
|
+
_context6.next = 20;
|
|
863
870
|
break;
|
|
864
871
|
}
|
|
865
872
|
|
|
866
873
|
_JSON$parse3 = JSON.parse(res.data.body), newStatus = _JSON$parse3.newStatus, newArticleStatus = _JSON$parse3.newArticleStatus;
|
|
867
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[
|
|
874
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
868
875
|
if (newStatus) productTemp.datasheet_status = newStatus;
|
|
869
876
|
setProduct(productTemp);
|
|
870
877
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
871
878
|
setMessage("Fichas técnicas guardadas");
|
|
872
|
-
_context6.next =
|
|
879
|
+
_context6.next = 20;
|
|
873
880
|
return loadData();
|
|
874
881
|
|
|
875
|
-
case
|
|
876
|
-
_context6.next =
|
|
882
|
+
case 20:
|
|
883
|
+
_context6.next = 25;
|
|
877
884
|
break;
|
|
878
885
|
|
|
879
|
-
case
|
|
880
|
-
_context6.prev =
|
|
881
|
-
_context6.t0 = _context6["catch"](
|
|
886
|
+
case 22:
|
|
887
|
+
_context6.prev = 22;
|
|
888
|
+
_context6.t0 = _context6["catch"](7);
|
|
882
889
|
console.log(_context6.t0);
|
|
883
890
|
|
|
884
|
-
case
|
|
891
|
+
case 25:
|
|
885
892
|
case "end":
|
|
886
893
|
return _context6.stop();
|
|
887
894
|
}
|
|
888
895
|
}
|
|
889
|
-
}, _callee6, null, [[
|
|
896
|
+
}, _callee6, null, [[7, 22]]);
|
|
890
897
|
}));
|
|
891
898
|
|
|
892
899
|
return function saveDatasheets() {
|
|
@@ -912,7 +919,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
912
919
|
setSocketType(imageInputs);
|
|
913
920
|
}, [images]);
|
|
914
921
|
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
915
|
-
var _images$values3, _product$article11, _data$articleData, _data$articleData2, _data$updateImages;
|
|
922
|
+
var _images$values3, _images$attrForImgs, _product$article11, _data$articleData, _data$articleData2, _data$updateImages;
|
|
916
923
|
|
|
917
924
|
var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
|
|
918
925
|
|
|
@@ -928,7 +935,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
928
935
|
duplicated = imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (image) {
|
|
929
936
|
return imagesListTemp[image === null || image === void 0 ? void 0 : image.image_id];
|
|
930
937
|
});
|
|
931
|
-
attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs).pop();
|
|
938
|
+
attrForImgs = Object.values((_images$attrForImgs = images === null || images === void 0 ? void 0 : images.attrForImgs) !== null && _images$attrForImgs !== void 0 ? _images$attrForImgs : {}).pop();
|
|
932
939
|
data = {
|
|
933
940
|
articleId: product === null || product === void 0 ? void 0 : (_product$article11 = product.article) === null || _product$article11 === void 0 ? void 0 : _product$article11.id_article,
|
|
934
941
|
attrReqImgs: attrForImgs === null || attrForImgs === void 0 ? void 0 : attrForImgs.map(function (e) {
|
|
@@ -1030,7 +1037,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1030
1037
|
}, _callee7, null, [[10, 25]]);
|
|
1031
1038
|
})), [images, imagesUploaded]);
|
|
1032
1039
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1033
|
-
var res, productTemp, _JSON$parse4, newStatus, newArticleStatus;
|
|
1040
|
+
var res, _product$article12, productTemp, _JSON$parse4, newStatus, newArticleStatus;
|
|
1034
1041
|
|
|
1035
1042
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1036
1043
|
while (1) {
|
|
@@ -1067,7 +1074,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1067
1074
|
|
|
1068
1075
|
productTemp = product;
|
|
1069
1076
|
_JSON$parse4 = JSON.parse(res.data.body), newStatus = _JSON$parse4.newStatus, newArticleStatus = _JSON$parse4.newArticleStatus;
|
|
1070
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[
|
|
1077
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[product === null || product === void 0 ? void 0 : (_product$article12 = product.article) === null || _product$article12 === void 0 ? void 0 : _product$article12.id_article];
|
|
1071
1078
|
if (newStatus) productTemp.images_status = newStatus;
|
|
1072
1079
|
setProduct(productTemp);
|
|
1073
1080
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
@@ -1215,7 +1222,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1215
1222
|
|
|
1216
1223
|
var sendToFacilitator = /*#__PURE__*/function () {
|
|
1217
1224
|
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
|
|
1218
|
-
var concept, productTemp, evalStatus,
|
|
1225
|
+
var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
|
|
1219
1226
|
|
|
1220
1227
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1221
1228
|
while (1) {
|
|
@@ -1226,10 +1233,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1226
1233
|
concept = getConcept(activeTab);
|
|
1227
1234
|
productTemp = (0, _objectSpread2.default)({}, product);
|
|
1228
1235
|
evalStatus = retailerStatus;
|
|
1229
|
-
|
|
1236
|
+
articleId = product.article.id_article;
|
|
1230
1237
|
orderId = product.orderId;
|
|
1231
1238
|
data = {
|
|
1232
|
-
articleId:
|
|
1239
|
+
articleId: articleId,
|
|
1233
1240
|
orderId: orderId,
|
|
1234
1241
|
concept: concept,
|
|
1235
1242
|
evalStatus: evalStatus,
|
|
@@ -1283,7 +1290,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1283
1290
|
}
|
|
1284
1291
|
|
|
1285
1292
|
_JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
|
|
1286
|
-
if (newOrderStatus) productTemp.status = newArticleStatus[
|
|
1293
|
+
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
1287
1294
|
productTemp["".concat(concept, "_status")] = newStatus;
|
|
1288
1295
|
_context9.next = 27;
|
|
1289
1296
|
return loadData();
|
|
@@ -1346,7 +1353,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1346
1353
|
|
|
1347
1354
|
var createComment = /*#__PURE__*/function () {
|
|
1348
1355
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, body, tab) {
|
|
1349
|
-
var _product$
|
|
1356
|
+
var _product$article13;
|
|
1350
1357
|
|
|
1351
1358
|
var concept, data;
|
|
1352
1359
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
@@ -1372,7 +1379,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1372
1379
|
|
|
1373
1380
|
case 10:
|
|
1374
1381
|
data = {
|
|
1375
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1382
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article13 = product.article) === null || _product$article13 === void 0 ? void 0 : _product$article13.id_article,
|
|
1376
1383
|
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1377
1384
|
message: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, ""),
|
|
1378
1385
|
concept: concept,
|
|
@@ -1516,7 +1523,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1516
1523
|
|
|
1517
1524
|
var setAssignation = /*#__PURE__*/function () {
|
|
1518
1525
|
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(assignationType, assignationId) {
|
|
1519
|
-
var _product$
|
|
1526
|
+
var _product$article14;
|
|
1520
1527
|
|
|
1521
1528
|
var concept, productTemp, data;
|
|
1522
1529
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
@@ -1546,7 +1553,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1546
1553
|
data = {
|
|
1547
1554
|
articleList: [{
|
|
1548
1555
|
orderId: product.orderId,
|
|
1549
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1556
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article14 = product.article) === null || _product$article14 === void 0 ? void 0 : _product$article14.id_article
|
|
1550
1557
|
}],
|
|
1551
1558
|
concept: concept,
|
|
1552
1559
|
userId: assignationId
|
|
@@ -1943,7 +1950,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1943
1950
|
inputGroup: descriptions[0],
|
|
1944
1951
|
updatedDescriptions: updatedDescriptions,
|
|
1945
1952
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
1946
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1953
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article15 = product.article) === null || _product$article15 === void 0 ? void 0 : _product$article15.id_article,
|
|
1947
1954
|
version: version,
|
|
1948
1955
|
dinamicHeight: true
|
|
1949
1956
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.isValidNaturalNumber = exports.isStringEmpty = exports.isObject = exports.isArrayEmpty = exports.getTime = exports.getResizeImgHeight = exports.getImageURL = exports.getImageSize = exports.getFullDate = exports.
|
|
8
|
+
exports.isValidNaturalNumber = exports.isStringEmpty = exports.isObject = exports.isArrayEmpty = exports.getTime = exports.getResizeImgHeight = exports.getImageURL = exports.getImageSize = exports.getFullDate = exports.getFileName = exports.getFileExtension = exports.getDataBuffer = exports.getDataBase64 = exports.getCustomDate = exports.getBase64 = exports.encodeUriJson = exports.decodeJSON = void 0;
|
|
9
9
|
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
11
|
|
|
@@ -342,26 +342,6 @@ var getFullDate = function getFullDate() {
|
|
|
342
342
|
/*------------------------
|
|
343
343
|
Obtener una fecha a partir de
|
|
344
344
|
un objeto Date() en formato:
|
|
345
|
-
'aaaa-MM-dd'
|
|
346
|
-
ejemplo: '2022-12-25'
|
|
347
|
-
--------------------------*/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
exports.getFullDate = getFullDate;
|
|
351
|
-
|
|
352
|
-
var getFormatedDate = function getFormatedDate() {
|
|
353
|
-
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
354
|
-
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "/";
|
|
355
|
-
if (isNaN(date)) return undefined;
|
|
356
|
-
var dateString = "";
|
|
357
|
-
dateString += date.getFullYear() + separator;
|
|
358
|
-
dateString += date.getMonth() + 1 + separator;
|
|
359
|
-
dateString += date.getDate();
|
|
360
|
-
return dateString;
|
|
361
|
-
};
|
|
362
|
-
/*------------------------
|
|
363
|
-
Obtener una fecha a partir de
|
|
364
|
-
un objeto Date() en formato:
|
|
365
345
|
'dd de MMMM del aaaa'
|
|
366
346
|
ejemplo: '12 de octubre del 2022'
|
|
367
347
|
=> si es la fecha del dia actual:
|
|
@@ -373,7 +353,7 @@ devolvera '12 de octubre'
|
|
|
373
353
|
--------------------------*/
|
|
374
354
|
|
|
375
355
|
|
|
376
|
-
exports.
|
|
356
|
+
exports.getFullDate = getFullDate;
|
|
377
357
|
|
|
378
358
|
var getCustomDate = function getCustomDate() {
|
|
379
359
|
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|