contentoh-components-library 21.3.29 → 21.3.30
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 -3
- package/.env.production +3 -2
- 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/GalleryElement/index.js +1 -1
- 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 -17
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -73
- package/dist/components/pages/RetailerProductEdition/index.js +14 -19
- package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
- 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 -13
- 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/GalleryElement/index.js +1 -1
- package/src/components/molecules/HeaderTop/styles.js +2 -5
- 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 +41 -78
- package/src/components/pages/RetailerProductEdition/index.js +20 -18
- package/src/components/pages/RetailerProductEdition/utils.js +1 -2
- 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/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/assets/sounds/newMessage.mp3 +0 -0
- 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 -60
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -149
- 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 -522
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -348
- 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 -922
- 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 -93
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -238
- 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,122 +28,90 @@ 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.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6IjllNTRjMDc0LWFjNzktNGEwNC1iOGEzLWNhOWU2ZmQxNDE3ZiIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjc3NTQ1NzA2LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjc3NTQ5MzA2LCJpYXQiOjE2Nzc1NDU3MDYsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.CS5zthG2PFlQIn5yCV64aadrBvh0ccEMlm8osN_BHTqqYARTiGJMnGUzD-FqmCB9JNeLn036eNHQ7TppqlvhBEe66-F7Aq3fSCMR2X31dWkASsg1E9kSmYS2V6NeG1G5WkfaIBOh7d7VH5Dnu6i5phne_BAu_fDbnBgsQUxQQMh-LMfv2heQ_MInJ6O2MrIzbYYMZYK7ioO5C7FvBnOCpDuk3DcgVFwuqBdVJAGkm-VYJbbnR6NYmYMnZfzrFJ8DjNE3O-L3ugVDOIfZOjuVBt2ZsfIB0-I7h_TBuIzwVE309f68AoDAujacOKvPORoN4ympPrAUSa7ZrM6ye2564g",
|
|
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: 130,
|
|
42
|
+
status: "PA",
|
|
43
|
+
datasheet_status: "PA",
|
|
44
44
|
prio: "none",
|
|
45
|
-
version:
|
|
46
|
-
description_status: "
|
|
47
|
-
images_status: "
|
|
45
|
+
version: 17,
|
|
46
|
+
description_status: "PA",
|
|
47
|
+
images_status: "PA",
|
|
48
48
|
statusByRetailer: {
|
|
49
|
-
|
|
50
|
-
datasheet: "
|
|
51
|
-
description: "
|
|
52
|
-
images: "
|
|
53
|
-
},
|
|
54
|
-
5: {
|
|
55
|
-
datasheet: "CA",
|
|
56
|
-
description: "CA",
|
|
57
|
-
images: "AS"
|
|
58
|
-
},
|
|
59
|
-
6: {
|
|
60
|
-
description: "CA",
|
|
61
|
-
images: "AS",
|
|
62
|
-
datasheet: "CA"
|
|
63
|
-
},
|
|
64
|
-
12: {
|
|
65
|
-
datasheet: "CA",
|
|
66
|
-
description: "CA",
|
|
67
|
-
images: "AS"
|
|
68
|
-
},
|
|
69
|
-
17: {
|
|
70
|
-
datasheet: "CA",
|
|
71
|
-
description: "AC",
|
|
72
|
-
images: "AS"
|
|
49
|
+
58: {
|
|
50
|
+
datasheet: "PA",
|
|
51
|
+
description: "PA",
|
|
52
|
+
images: "PA"
|
|
73
53
|
}
|
|
74
54
|
},
|
|
75
55
|
article: {
|
|
76
|
-
id_article:
|
|
77
|
-
id_category: "
|
|
78
|
-
name: "
|
|
79
|
-
upc: "
|
|
80
|
-
timestamp: "
|
|
56
|
+
id_article: 3,
|
|
57
|
+
id_category: "2032",
|
|
58
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
59
|
+
upc: "161157",
|
|
60
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
81
61
|
id_user: 28,
|
|
82
62
|
status: "NULL",
|
|
83
63
|
active: 1,
|
|
84
64
|
company_id: 1,
|
|
85
65
|
company_name: "GRUPO BRAHMA",
|
|
86
66
|
country: "México",
|
|
87
|
-
id_order:
|
|
88
|
-
id_datasheet_especialist:
|
|
89
|
-
id_datasheet_facilitator:
|
|
90
|
-
id_description_especialist:
|
|
91
|
-
id_description_facilitator:
|
|
92
|
-
id_images_especialist:
|
|
93
|
-
id_images_facilitator:
|
|
94
|
-
id_auditor:
|
|
67
|
+
id_order: 130,
|
|
68
|
+
id_datasheet_especialist: null,
|
|
69
|
+
id_datasheet_facilitator: null,
|
|
70
|
+
id_description_especialist: null,
|
|
71
|
+
id_description_facilitator: null,
|
|
72
|
+
id_images_especialist: null,
|
|
73
|
+
id_images_facilitator: null,
|
|
74
|
+
id_auditor: null,
|
|
95
75
|
id_recepcionist: null,
|
|
96
|
-
category: "
|
|
76
|
+
category: "Decoración|Cortinas y Persianas|Cortinas",
|
|
97
77
|
missingAttributes: 0,
|
|
98
78
|
missingDescriptions: 0,
|
|
99
79
|
missingImages: 0
|
|
100
80
|
},
|
|
101
81
|
retailers: [{
|
|
102
|
-
id:
|
|
103
|
-
name: "
|
|
104
|
-
}, {
|
|
105
|
-
id: 5,
|
|
106
|
-
name: "Chedraui"
|
|
107
|
-
}, {
|
|
108
|
-
id: 6,
|
|
109
|
-
name: "HEB"
|
|
110
|
-
}, {
|
|
111
|
-
id: 12,
|
|
112
|
-
name: "La Comer"
|
|
113
|
-
}, {
|
|
114
|
-
id: 17,
|
|
115
|
-
name: "Genérico"
|
|
82
|
+
id: 58,
|
|
83
|
+
name: "The Home Depot Golden"
|
|
116
84
|
}],
|
|
117
85
|
country: "México",
|
|
118
|
-
upc: "
|
|
86
|
+
upc: "161157"
|
|
119
87
|
},
|
|
120
88
|
location: {
|
|
121
89
|
product: {
|
|
122
|
-
articleId:
|
|
90
|
+
articleId: 109485,
|
|
123
91
|
versionId: 3
|
|
124
92
|
}
|
|
125
93
|
},
|
|
126
94
|
user: {
|
|
127
|
-
id_user:
|
|
128
|
-
name: "
|
|
129
|
-
last_name: "",
|
|
130
|
-
email: "
|
|
131
|
-
position: "",
|
|
95
|
+
id_user: 30,
|
|
96
|
+
name: "Admin",
|
|
97
|
+
last_name: "Ulises",
|
|
98
|
+
email: "salmeron.5@hotmail.com",
|
|
99
|
+
position: "Admin",
|
|
132
100
|
telephone: "",
|
|
133
|
-
country: "",
|
|
101
|
+
country: "México",
|
|
134
102
|
id_company: 2,
|
|
135
|
-
id_cognito: "
|
|
103
|
+
id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
|
|
136
104
|
birth_Date: null,
|
|
137
105
|
about_me: "",
|
|
138
106
|
zip_code: "",
|
|
139
107
|
address: "",
|
|
140
108
|
job: "",
|
|
141
109
|
id_stripe: "",
|
|
142
|
-
id_role:
|
|
110
|
+
id_role: 6,
|
|
143
111
|
active: 1,
|
|
144
112
|
is_retailer: 0,
|
|
145
113
|
email_notify: 1,
|
|
146
|
-
is_user_tech:
|
|
114
|
+
is_user_tech: "ADMIN-AS",
|
|
147
115
|
membership: {
|
|
148
116
|
id: 2,
|
|
149
117
|
start_date: "2021-11-05T02:35:12.000Z",
|
|
@@ -155,6 +123,6 @@ RetailerProductEditionDefault.args = {
|
|
|
155
123
|
products_limit: "3",
|
|
156
124
|
type: "PyMES"
|
|
157
125
|
},
|
|
158
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
126
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1676494961913"
|
|
159
127
|
}
|
|
160
128
|
};
|
|
@@ -320,8 +320,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
320
320
|
})),
|
|
321
321
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
322
322
|
percentages = _useState24[0],
|
|
323
|
-
setPercentages = _useState24[1];
|
|
324
|
-
|
|
323
|
+
setPercentages = _useState24[1];
|
|
325
324
|
|
|
326
325
|
var _useState25 = (0, _react.useState)(0),
|
|
327
326
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
@@ -537,9 +536,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
537
536
|
}();
|
|
538
537
|
|
|
539
538
|
(0, _react.useEffect)(function () {
|
|
540
|
-
|
|
541
|
-
loadAuditableData();
|
|
542
|
-
}
|
|
539
|
+
loadAuditableData();
|
|
543
540
|
}, [auditableVersion]);
|
|
544
541
|
(0, _react.useEffect)(function () {
|
|
545
542
|
checkAll && setSelectedImages(images.values);
|
|
@@ -566,7 +563,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
566
563
|
|
|
567
564
|
|
|
568
565
|
setServices(_services);
|
|
569
|
-
getServices();
|
|
566
|
+
getServices(); // setActiveRetailer(product?.retailers[0]);
|
|
567
|
+
|
|
570
568
|
setImages({
|
|
571
569
|
action: "init",
|
|
572
570
|
init: _services[2]
|
|
@@ -575,7 +573,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
575
573
|
(0, _data.getPercentage)({
|
|
576
574
|
data: [product]
|
|
577
575
|
}).then(function (res) {
|
|
578
|
-
return setPercentages(res
|
|
576
|
+
return setPercentages(res);
|
|
579
577
|
});
|
|
580
578
|
setLoading(false);
|
|
581
579
|
_context3.next = 16;
|
|
@@ -784,23 +782,20 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
784
782
|
loadAssignations(product);
|
|
785
783
|
}, [userGroups]);
|
|
786
784
|
(0, _react.useEffect)(function () {
|
|
787
|
-
var
|
|
788
|
-
|
|
789
|
-
var retailers = (product === null || product === void 0 ? void 0 : product.retailersAvailable) || (product === null || product === void 0 ? void 0 : product.retailers);
|
|
785
|
+
var _product$retailers2, _product$retailers$;
|
|
790
786
|
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
var _percentages$product$2;
|
|
787
|
+
product === null || product === void 0 ? void 0 : (_product$retailers2 = product.retailers) === null || _product$retailers2 === void 0 ? void 0 : _product$retailers2.forEach(function (retailer) {
|
|
788
|
+
var _percentages$filter$;
|
|
794
789
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
setActivePercentage((
|
|
790
|
+
retailer["percentage"] = percentages.length ? percentages === null || percentages === void 0 ? void 0 : (_percentages$filter$ = percentages.filter(function (percent) {
|
|
791
|
+
return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
|
|
792
|
+
})[0]) === null || _percentages$filter$ === void 0 ? void 0 : _percentages$filter$.percentage : 0;
|
|
793
|
+
});
|
|
794
|
+
setActivePercentage(product === null || product === void 0 ? void 0 : (_product$retailers$ = product.retailers[0]) === null || _product$retailers$ === void 0 ? void 0 : _product$retailers$.percentage);
|
|
800
795
|
}, [percentages]);
|
|
801
796
|
(0, _react.useEffect)(function () {
|
|
802
797
|
(0, _utils.getInputsData)(services, activeRetailer, setDatasheets, setDescriptions);
|
|
803
|
-
auditableVersion &&
|
|
798
|
+
auditableVersion && (0, _utils.getInputsData)(auditServices, activeRetailer, setAuditDatasheets, setAuditDescriptions);
|
|
804
799
|
setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
|
|
805
800
|
(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && setImages({
|
|
806
801
|
action: "orderImages",
|
|
@@ -31,7 +31,7 @@ var getAuditVersion = /*#__PURE__*/function () {
|
|
|
31
31
|
auditResponse = _context.sent;
|
|
32
32
|
|
|
33
33
|
if (auditResponse.status === 200) {
|
|
34
|
-
setState(JSON.parse(auditResponse.data.body).data
|
|
34
|
+
setState(JSON.parse(auditResponse.data.body).data);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
case 4:
|
|
@@ -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
|
}
|