contentoh-components-library 21.4.60 → 21.4.62
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/dist/components/molecules/BoxAttribute/styles.js +1 -1
- package/dist/components/molecules/BoxButtons/index.js +1 -0
- package/dist/components/molecules/TagAndInput/index.js +64 -3
- package/dist/components/organisms/InputGroup/index.js +153 -48
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +82 -146
- package/dist/components/pages/ProviderProductEdition/index.js +231 -203
- package/dist/components/pages/RetailerProductEdition/index.js +5 -5
- package/dist/global-files/data.js +8 -4
- package/package.json +1 -1
- package/src/assets/images/Icons/info.svg +8 -0
- package/src/components/atoms/TabSection/styles.js +23 -0
- package/src/components/molecules/BoxAttribute/BoxAttribute.stories.js +16 -0
- package/src/components/molecules/BoxAttribute/index.js +71 -0
- package/src/components/molecules/BoxAttribute/styles.js +38 -0
- package/src/components/molecules/BoxButtons/BoxButtons.stories.js +15 -0
- package/src/components/molecules/BoxButtons/index.js +28 -0
- package/src/components/molecules/BoxButtons/styles.js +43 -0
- package/src/components/molecules/TagAndInput/index.js +52 -8
- package/src/components/organisms/Box/Box.stories.js +17 -0
- package/src/components/organisms/Box/index.js +103 -0
- package/src/components/organisms/Box/styles.js +48 -0
- package/src/components/organisms/BoxOnboarding/BoxOnboarding.stories.js +17 -0
- package/src/components/organisms/BoxOnboarding/index.js +60 -0
- package/src/components/organisms/BoxOnboarding/styles.js +44 -0
- package/src/components/organisms/InputGroup/index.js +233 -87
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +86 -175
- package/src/components/pages/ProviderProductEdition/index.js +97 -73
- package/src/components/pages/ProviderProductEdition/out.json +0 -0
- package/src/components/pages/RetailerProductEdition/index.js +7 -5
- package/src/global-files/data.js +11 -2
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
- package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
- package/dist/components/atoms/ImageCarousel/index.js +0 -120
- package/dist/components/atoms/ImageCarousel/styles.js +0 -18
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
- package/dist/components/atoms/PercentTag/index.js +0 -23
- package/dist/components/atoms/PercentTag/styles.js +0 -22
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
- package/dist/components/atoms/RatingStars/index.js +0 -53
- package/dist/components/atoms/RatingStars/styles.js +0 -18
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
- package/dist/components/atoms/RetailerCatalog/index.js +0 -69
- package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
- package/dist/components/atoms/RetailerOption/index.js +0 -62
- package/dist/components/atoms/RetailerOption/styles.js +0 -20
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
- package/dist/components/atoms/RetailersList/index.js +0 -46
- package/dist/components/atoms/RetailersList/styles.js +0 -18
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -73
- package/dist/components/atoms/UserCatalog/index.js +0 -101
- package/dist/components/atoms/UserCatalog/styles.js +0 -18
- package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
- package/dist/components/atoms/UserOption/index.js +0 -130
- package/dist/components/atoms/UserOption/styles.js +0 -20
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
- package/dist/components/atoms/UserSelector/index.js +0 -98
- package/dist/components/atoms/UserSelector/styles.js +0 -32
- package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
- package/dist/components/molecules/GridItem/index.js +0 -152
- package/dist/components/molecules/GridItem/styles.js +0 -20
- package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
- package/dist/components/molecules/HeaderItem/index.js +0 -42
- package/dist/components/molecules/HeaderItem/styles.js +0 -30
- package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
- package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
- package/dist/components/molecules/RowItem/index.js +0 -58
- package/dist/components/molecules/RowItem/styles.js +0 -30
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5097
- package/dist/components/organisms/GridProducts/index.js +0 -63
- package/dist/components/organisms/GridProducts/styles.js +0 -18
- package/dist/components/organisms/GridProducts/utils.js +0 -149
|
@@ -16,196 +16,107 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
20
|
-
articleId:
|
|
21
|
-
category:
|
|
22
|
-
version:
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyM2Q1NTlmYi1jMzIwLTRhMjItYjJmNy1lOThhYTFhZGEyNmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MzkyNjgyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODM5MzA0MjEsImlhdCI6MTY4MzkyNjgyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.TvCoaKoctj5mypXWMz3NyV1Vm1ToBV0vJmpVyZSQw4-ikTChkxcZ5tFYvqhk1GdvNCFttfSQIqM-14dAYYBc28YwwKP86gqOuzB1fG41rN5x1Yx3tkJq6hiVRgiBbSHWtThA9c8VnxNQbrJiaRTvvkDiM5KNTEst1oxQHL5Ct9_iKQMJMRFie7Xv0xnyS0qZ6QHK4Q2A9OHsnDkAuumALZJcE19Zh6VgSitgWrZiz3x5Text4Q-U-R48NUAzUFirAzYZzJN_fCme5pGf1AnUaZjeUjPsmrV5TBVzPEYwXO0KG8lYjL8id80D7tbGs28ZIK6B4rf3-eqI_ngmBB4CjQ",
|
|
20
|
+
articleId: 39550,
|
|
21
|
+
category: 287,
|
|
22
|
+
version: 1,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
descriptions: null,
|
|
36
|
-
images: null,
|
|
24
|
+
id_article:39550,
|
|
25
|
+
upc:43654697,
|
|
26
|
+
name:"Campana de Cocina",
|
|
27
|
+
timestamp:"2023-08-04T22:23:40.000Z",
|
|
28
|
+
categoryName:"Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
|
|
29
|
+
id_category:287,
|
|
30
|
+
version:1,
|
|
31
|
+
retailersAvailable:[
|
|
32
|
+
{name:"The Home Depot Golden","id":58},
|
|
33
|
+
{name:"The Home Depot Onboarding","id":68}],
|
|
34
|
+
percentage:"89"
|
|
37
35
|
},
|
|
38
|
-
services: {
|
|
39
|
-
datasheets: 1,
|
|
40
|
-
descriptions: 1,
|
|
41
|
-
images: 1,
|
|
42
|
-
},
|
|
43
|
-
article: {
|
|
44
|
-
category: "Abarrotes|Abarrotes Secos|Frutos Secos",
|
|
45
|
-
company_name: "GRUPO BRAHMA",
|
|
46
|
-
country: "México",
|
|
47
|
-
id_category: "11",
|
|
48
|
-
id_datasheet_especialist: 54,
|
|
49
|
-
id_datasheet_facilitator: 52,
|
|
50
|
-
id_description_especialist: 54,
|
|
51
|
-
id_description_facilitator: 52,
|
|
52
|
-
id_images_especialist: 55,
|
|
53
|
-
id_images_facilitator: 53,
|
|
54
|
-
id_order: 15275,
|
|
55
|
-
id_article: 39485,
|
|
56
|
-
id_auditor: 37,
|
|
57
|
-
name: "Mix de nueces",
|
|
58
|
-
timestamp: "2023-07-14T21:03:19.000Z",
|
|
59
|
-
upc: "7543453453",
|
|
60
|
-
},
|
|
61
|
-
retailers: [
|
|
62
|
-
{
|
|
63
|
-
id: 34,
|
|
64
|
-
name: "San Pablo",
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
statusByRetailer: {
|
|
68
|
-
34: {
|
|
69
|
-
datasheet: "AA",
|
|
70
|
-
description: "AA",
|
|
71
|
-
images: "AA",
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
retailersAvailable: [
|
|
75
|
-
{
|
|
76
|
-
id: 34,
|
|
77
|
-
name: "San Pablo",
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
categoryName: "Abarrotes|Abarrotes Secos|Frutos Secos",
|
|
81
|
-
upc: "7543453453",
|
|
82
|
-
id_article: 39485,
|
|
83
|
-
id_order: 15275,
|
|
84
|
-
},
|
|
85
36
|
productToEdit: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
product:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
services: {
|
|
104
|
-
datasheets: 1,
|
|
105
|
-
descriptions: 1,
|
|
106
|
-
images: 1,
|
|
107
|
-
},
|
|
108
|
-
article: {
|
|
109
|
-
category: "Abarrotes|Abarrotes Secos|Frutos Secos",
|
|
110
|
-
company_name: "GRUPO BRAHMA",
|
|
111
|
-
country: "México",
|
|
112
|
-
id_category: "11",
|
|
113
|
-
id_datasheet_especialist: 54,
|
|
114
|
-
id_datasheet_facilitator: 52,
|
|
115
|
-
id_description_especialist: 54,
|
|
116
|
-
id_description_facilitator: 52,
|
|
117
|
-
id_images_especialist: 55,
|
|
118
|
-
id_images_facilitator: 53,
|
|
119
|
-
id_order: 15275,
|
|
120
|
-
id_article: 39485,
|
|
121
|
-
id_auditor: 37,
|
|
122
|
-
name: "Mix de nueces",
|
|
123
|
-
timestamp: "2023-07-14T21:03:19.000Z",
|
|
124
|
-
upc: "7543453453",
|
|
125
|
-
},
|
|
126
|
-
retailers: [
|
|
127
|
-
{
|
|
128
|
-
id: 34,
|
|
129
|
-
name: "San Pablo",
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
statusByRetailer: {
|
|
133
|
-
34: {
|
|
134
|
-
datasheet: "AA",
|
|
135
|
-
description: "AA",
|
|
136
|
-
images: "AA",
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
retailersAvailable: [
|
|
140
|
-
{
|
|
141
|
-
id: 34,
|
|
142
|
-
name: "San Pablo",
|
|
143
|
-
},
|
|
37
|
+
idCategory:287,
|
|
38
|
+
ArticleId:39550,
|
|
39
|
+
product:[{
|
|
40
|
+
id_article:39550,
|
|
41
|
+
upc:43654697,
|
|
42
|
+
name:"Campana de Cocina",
|
|
43
|
+
timestamp:"2023-08-04T22:23:40.000Z",
|
|
44
|
+
categoryName:"Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
|
|
45
|
+
id_category:287,
|
|
46
|
+
version:1,
|
|
47
|
+
retailersAvailable:[
|
|
48
|
+
{name:"The Home Depot Golden",
|
|
49
|
+
id:58,
|
|
50
|
+
percentage:100},
|
|
51
|
+
{name:"The Home Depot Onboarding",
|
|
52
|
+
id:68,
|
|
53
|
+
percentage:78}
|
|
144
54
|
],
|
|
145
|
-
|
|
146
|
-
upc: "7543453453",
|
|
147
|
-
id_article: 39485,
|
|
148
|
-
id_order: 15275,
|
|
55
|
+
percentage:"89"}]
|
|
149
56
|
},
|
|
150
|
-
},
|
|
151
57
|
location: {
|
|
152
58
|
pathname: "/EditProducts",
|
|
153
59
|
search: "",
|
|
154
60
|
hash: "",
|
|
155
61
|
state: {
|
|
62
|
+
withChat: true,
|
|
63
|
+
chatType: "product_status",
|
|
156
64
|
origin: "RequestWithContentoh",
|
|
157
65
|
},
|
|
158
66
|
key: "24vwut",
|
|
159
67
|
},
|
|
160
68
|
user: {
|
|
161
|
-
id_user:
|
|
162
|
-
name:
|
|
163
|
-
last_name:
|
|
164
|
-
email:
|
|
165
|
-
position:
|
|
166
|
-
telephone:
|
|
167
|
-
country:
|
|
168
|
-
id_company:
|
|
169
|
-
id_cognito:
|
|
170
|
-
birth_Date:
|
|
171
|
-
about_me:
|
|
172
|
-
zip_code:
|
|
173
|
-
address:
|
|
174
|
-
job:
|
|
175
|
-
id_stripe:
|
|
176
|
-
id_role:
|
|
177
|
-
active:
|
|
178
|
-
is_retailer:
|
|
179
|
-
email_notify:
|
|
180
|
-
is_user_tech:
|
|
181
|
-
membership:
|
|
182
|
-
|
|
183
|
-
start_date:
|
|
184
|
-
end_date:
|
|
185
|
-
planID:
|
|
186
|
-
plan:
|
|
187
|
-
name:
|
|
188
|
-
user_limit:
|
|
189
|
-
products_limit:
|
|
190
|
-
type:
|
|
191
|
-
|
|
192
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1693338334183",
|
|
193
|
-
},
|
|
69
|
+
id_user:191,
|
|
70
|
+
name:"Demo",
|
|
71
|
+
last_name:"Demo",
|
|
72
|
+
email:"merchants24feb@allfreemail.net",
|
|
73
|
+
position:"Test",
|
|
74
|
+
telephone:"+52123456789",
|
|
75
|
+
country:"México",
|
|
76
|
+
id_company:923,
|
|
77
|
+
id_cognito:"c3cd160c-76c2-497c-9357-5ef949307e1e",
|
|
78
|
+
birth_Date:null,
|
|
79
|
+
about_me:null,
|
|
80
|
+
zip_code:null,
|
|
81
|
+
address:null,
|
|
82
|
+
job:null,
|
|
83
|
+
id_stripe:null,
|
|
84
|
+
id_role:0,
|
|
85
|
+
active:1,
|
|
86
|
+
is_retailer:0,
|
|
87
|
+
email_notify:1,
|
|
88
|
+
is_user_tech:null,
|
|
89
|
+
membership:
|
|
90
|
+
{id:114,
|
|
91
|
+
start_date:"2023-02-24T18:14:43.000Z",
|
|
92
|
+
end_date:"2024-02-24T18:14:43.000Z",
|
|
93
|
+
planID:8,
|
|
94
|
+
plan:"prod_KtlhECVSFG2iro",
|
|
95
|
+
name:"Plan Pro",
|
|
96
|
+
user_limit:"50",
|
|
97
|
+
products_limit:"5000",
|
|
98
|
+
type:"Enterprise"},
|
|
99
|
+
src:"https://content-management-profile.s3.amazonaws.com/id-191/191.png?1697171804447"},
|
|
194
100
|
company: {
|
|
195
|
-
id_company:
|
|
196
|
-
trade_name:
|
|
197
|
-
company_name:
|
|
198
|
-
rfc:
|
|
199
|
-
adress:
|
|
200
|
-
about_company:
|
|
201
|
-
telephone:
|
|
202
|
-
web_site:
|
|
203
|
-
zip_code:
|
|
204
|
-
email:
|
|
205
|
-
social_link:
|
|
206
|
-
is_retailer:
|
|
207
|
-
financedRetailers:
|
|
208
|
-
|
|
209
|
-
|
|
101
|
+
id_company:923,
|
|
102
|
+
trade_name:"Demo",
|
|
103
|
+
company_name:"Demo",
|
|
104
|
+
rfc:"Demo",
|
|
105
|
+
adress:"Demo",
|
|
106
|
+
about_company:null,
|
|
107
|
+
telephone:null,
|
|
108
|
+
web_site:null,
|
|
109
|
+
zip_code:null,
|
|
110
|
+
email:null,
|
|
111
|
+
social_link:null,
|
|
112
|
+
is_retailer:0,
|
|
113
|
+
financedRetailers:
|
|
114
|
+
[{id:68,
|
|
115
|
+
name:"The Home Depot Onboarding",
|
|
116
|
+
country:"México",
|
|
117
|
+
id_region:1,
|
|
118
|
+
active:1,
|
|
119
|
+
flow:1}],
|
|
120
|
+
retailers:[{id:68,name:"The Home Depot Onboarding",country:"México",id_region:1,"active":1,flow:1}]},
|
|
210
121
|
showSurvey: (v) => v && alert("se muestra"),
|
|
211
122
|
};
|
|
@@ -140,6 +140,7 @@ export const ProviderProductEdition = ({
|
|
|
140
140
|
const [datasheets, setDatasheets] = useState([]);
|
|
141
141
|
const [images, setImages] = useReducer(reducerImages, {});
|
|
142
142
|
const [showModal, setShowModal] = useState(false);
|
|
143
|
+
const [boxData, setBoxData] = useState();
|
|
143
144
|
const { getRootProps, getInputProps } = useDropzone({
|
|
144
145
|
accept: "image/*",
|
|
145
146
|
noKeyboard: true,
|
|
@@ -491,7 +492,8 @@ export const ProviderProductEdition = ({
|
|
|
491
492
|
product?.id_article || product?.article?.id_article,
|
|
492
493
|
product?.article?.company_name || product?.categoryName,
|
|
493
494
|
parseInt(product?.article?.id_category || product?.id_category),
|
|
494
|
-
version
|
|
495
|
+
version,
|
|
496
|
+
token
|
|
495
497
|
);
|
|
496
498
|
|
|
497
499
|
//Converts the data inside the datasheets object to array
|
|
@@ -694,11 +696,27 @@ export const ProviderProductEdition = ({
|
|
|
694
696
|
};
|
|
695
697
|
|
|
696
698
|
const saveDatasheets = async () => {
|
|
697
|
-
|
|
699
|
+
const parseBoxData = [];
|
|
700
|
+
Object.entries(boxData).forEach(([, box], index) => {
|
|
701
|
+
const { value } = box;
|
|
702
|
+
const attributesIds = Object.keys(value);
|
|
703
|
+
attributesIds.forEach((attributeId) => {
|
|
704
|
+
const boxId = index + 1;
|
|
705
|
+
const valueOfAtribute = value[attributeId];
|
|
706
|
+
parseBoxData.push({
|
|
707
|
+
attributeId,
|
|
708
|
+
value: valueOfAtribute,
|
|
709
|
+
boxId,
|
|
710
|
+
})
|
|
711
|
+
});
|
|
712
|
+
});
|
|
713
|
+
|
|
698
714
|
const dataObject = {
|
|
699
715
|
articleId: product?.id_article,
|
|
700
716
|
articleData: updatedDatasheets,
|
|
701
|
-
|
|
717
|
+
...(parseBoxData.length > 0 && { boxData: parseBoxData }),
|
|
718
|
+
};
|
|
719
|
+
|
|
702
720
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
703
721
|
try {
|
|
704
722
|
const res = await axios.put(
|
|
@@ -717,7 +735,8 @@ export const ProviderProductEdition = ({
|
|
|
717
735
|
}
|
|
718
736
|
} catch (error) {
|
|
719
737
|
console.log(error);
|
|
720
|
-
}
|
|
738
|
+
}
|
|
739
|
+
console.log(dataObject)
|
|
721
740
|
};
|
|
722
741
|
|
|
723
742
|
const updateImages = useCallback(async () => {
|
|
@@ -1031,62 +1050,54 @@ export const ProviderProductEdition = ({
|
|
|
1031
1050
|
const retailerId = activeRetailer?.id;
|
|
1032
1051
|
let res;
|
|
1033
1052
|
try {
|
|
1034
|
-
const body = {
|
|
1035
|
-
orderArticleRetailers: [
|
|
1036
|
-
{ orderId, articleId, retailersIds: [activeRetailer.id] },
|
|
1037
|
-
],
|
|
1038
|
-
isAproved: false,
|
|
1039
|
-
service: concept,
|
|
1040
|
-
};
|
|
1041
1053
|
if (result) {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1054
|
+
data.result = result;
|
|
1055
|
+
data.retailerId = retailerId;
|
|
1056
|
+
res = await axios.put(
|
|
1057
|
+
`${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
1058
|
+
data,
|
|
1046
1059
|
{
|
|
1047
1060
|
headers: {
|
|
1048
1061
|
Authorization: token,
|
|
1049
1062
|
},
|
|
1050
1063
|
}
|
|
1051
1064
|
);
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
const serviceStatus = newStatuses[`${getConcept(activeTab)}Status`];
|
|
1065
|
+
const newStatuses = JSON.parse(res.data.body);
|
|
1066
|
+
const orderStatus = newStatuses.newOrderStatus;
|
|
1067
|
+
const serviceStatus =
|
|
1068
|
+
newStatuses.newServiceStatus[articleId][
|
|
1069
|
+
`${getConcept(activeTab)}Status`
|
|
1070
|
+
];
|
|
1059
1071
|
|
|
1060
1072
|
const newProductEdit = productEdit;
|
|
1061
1073
|
newProductEdit.product[sectionStatusKey] = serviceStatus;
|
|
1062
1074
|
setProductEdit(newProductEdit);
|
|
1063
|
-
const showSurveyByProvider =
|
|
1064
|
-
|
|
1075
|
+
const showSurveyByProvider =
|
|
1076
|
+
!user.is_retailer && orderStatus[orderId] === "AP";
|
|
1077
|
+
const showSurveyByRetailer =
|
|
1078
|
+
user.is_retailer && orderStatus[orderId] === "ACA";
|
|
1065
1079
|
showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
|
|
1066
1080
|
} else {
|
|
1067
|
-
res = await axios.
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
Authorization: token,
|
|
1073
|
-
},
|
|
1074
|
-
}
|
|
1075
|
-
);
|
|
1081
|
+
res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
1082
|
+
headers: {
|
|
1083
|
+
Authorization: token,
|
|
1084
|
+
},
|
|
1085
|
+
});
|
|
1076
1086
|
}
|
|
1077
1087
|
if (res.data.statusCode === 200) {
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
productTemp.status =
|
|
1088
|
+
const { newArticleStatus, newServiceStatus, newStatus } = JSON.parse(
|
|
1089
|
+
res.data.body
|
|
1090
|
+
);
|
|
1091
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1082
1092
|
const retailerStatusCopy = { ...retailerStatus };
|
|
1083
|
-
retailerStatusCopy[activeRetailer.id][concept] =
|
|
1084
|
-
statusObject[`${concept}Status`];
|
|
1093
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1085
1094
|
setRetailerStatus(retailerStatusCopy);
|
|
1086
1095
|
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1087
1096
|
let status;
|
|
1088
|
-
|
|
1089
|
-
|
|
1097
|
+
if (newServiceStatus) {
|
|
1098
|
+
status = newServiceStatus[articleId][`${concept}Status`];
|
|
1099
|
+
productTemp[`${concept}_status`] = status;
|
|
1100
|
+
}
|
|
1090
1101
|
setProduct(productTemp);
|
|
1091
1102
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1092
1103
|
setOrigin((prev) => ({ ...prev, [concept]: status }));
|
|
@@ -1102,26 +1113,23 @@ export const ProviderProductEdition = ({
|
|
|
1102
1113
|
setLoading(true);
|
|
1103
1114
|
const evaluationArray = [];
|
|
1104
1115
|
const conceptArray = ["description", "datasheet", "images"];
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
});
|
|
1111
|
-
const body = {
|
|
1112
|
-
orderArticleRetailers: [
|
|
1113
|
-
{
|
|
1114
|
-
orderId: product.id_order ?? product.orderId,
|
|
1115
|
-
articleId: product.article.id_article,
|
|
1116
|
-
retailersIds,
|
|
1117
|
-
},
|
|
1118
|
-
],
|
|
1119
|
-
isAproved,
|
|
1116
|
+
const dataGeneral = {
|
|
1117
|
+
articleId: product.id_article,
|
|
1118
|
+
orderId: product.id_order ?? product.orderId,
|
|
1119
|
+
result,
|
|
1120
|
+
isAproved: result === "A",
|
|
1120
1121
|
};
|
|
1121
|
-
|
|
1122
|
-
|
|
1122
|
+
servicesData?.forEach((ret) => {
|
|
1123
|
+
const { service, id_retailer } = ret;
|
|
1124
|
+
let data = {};
|
|
1125
|
+
data = {
|
|
1126
|
+
...dataGeneral,
|
|
1127
|
+
concept: service,
|
|
1128
|
+
retailerId: id_retailer,
|
|
1129
|
+
evalStatus: retailerStatus[id_retailer][service],
|
|
1130
|
+
};
|
|
1123
1131
|
evaluationArray.push(
|
|
1124
|
-
axios.
|
|
1132
|
+
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1125
1133
|
headers: {
|
|
1126
1134
|
Authorization: token,
|
|
1127
1135
|
},
|
|
@@ -1133,7 +1141,7 @@ export const ProviderProductEdition = ({
|
|
|
1133
1141
|
|
|
1134
1142
|
const productTemp = product;
|
|
1135
1143
|
const status = `${result}${userType}`;
|
|
1136
|
-
productTemp.
|
|
1144
|
+
productTemp.article_status = status;
|
|
1137
1145
|
productTemp.datasheet_status =
|
|
1138
1146
|
productTemp.datasheet_status === "NA" ? "NA" : status;
|
|
1139
1147
|
productTemp.description_status =
|
|
@@ -1173,6 +1181,13 @@ export const ProviderProductEdition = ({
|
|
|
1173
1181
|
}
|
|
1174
1182
|
};
|
|
1175
1183
|
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
|
|
1176
1191
|
const evaluationToRetailer = async (result) => {
|
|
1177
1192
|
const data = {
|
|
1178
1193
|
articleId: product.id_article,
|
|
@@ -1479,19 +1494,28 @@ export const ProviderProductEdition = ({
|
|
|
1479
1494
|
)}
|
|
1480
1495
|
{activeTab === "Ficha técnica" &&
|
|
1481
1496
|
(product?.datasheet_status !== "NS" ? (
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1497
|
+
<div>
|
|
1498
|
+
{datasheets[0]?.data?.map((dataGroup, index) => (
|
|
1499
|
+
<InputGroup
|
|
1500
|
+
key={index + "-" + activeRetailer.name}
|
|
1501
|
+
articleId={product.id_article}
|
|
1502
|
+
version={version}
|
|
1503
|
+
activeSection={activeTab}
|
|
1504
|
+
inputGroup={dataGroup}
|
|
1505
|
+
dataInputs={datasheets[1]}
|
|
1506
|
+
updatedDatasheets={updatedDatasheets}
|
|
1507
|
+
setUpdatedDatasheets={setUpdatedDatasheets}
|
|
1508
|
+
isShowbox={true}
|
|
1509
|
+
activeRetailer={services[0][activeRetailer.id]}
|
|
1510
|
+
groupData={services[0][activeRetailer.id].data}
|
|
1511
|
+
setUpdatedBoxData={(e) => {
|
|
1512
|
+
setBoxData(e);
|
|
1513
|
+
}}
|
|
1514
|
+
index={index}
|
|
1515
|
+
//enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
|
|
1516
|
+
></InputGroup>
|
|
1517
|
+
))}
|
|
1518
|
+
</div>
|
|
1495
1519
|
) : (
|
|
1496
1520
|
<ScreenHeader
|
|
1497
1521
|
text={"No cuentas con este servicio"}
|
|
File without changes
|
|
@@ -231,7 +231,8 @@ export const RetailerProductEdition = ({
|
|
|
231
231
|
product?.article?.id_article,
|
|
232
232
|
product?.article?.category,
|
|
233
233
|
parseInt(product?.article?.id_category),
|
|
234
|
-
auditableVersion.version
|
|
234
|
+
auditableVersion.version,
|
|
235
|
+
token
|
|
235
236
|
);
|
|
236
237
|
getInputsData(
|
|
237
238
|
auditServices,
|
|
@@ -260,7 +261,8 @@ export const RetailerProductEdition = ({
|
|
|
260
261
|
product?.article?.id_article,
|
|
261
262
|
product?.article?.category,
|
|
262
263
|
parseInt(product?.article?.id_category),
|
|
263
|
-
version
|
|
264
|
+
version,
|
|
265
|
+
token
|
|
264
266
|
);
|
|
265
267
|
if (auditableVersion) {
|
|
266
268
|
loadAuditableData();
|
|
@@ -828,7 +830,7 @@ export const RetailerProductEdition = ({
|
|
|
828
830
|
if (result) {
|
|
829
831
|
body.isAproved = result === "A";
|
|
830
832
|
res = await axios.post(
|
|
831
|
-
`${process.env.
|
|
833
|
+
`${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
832
834
|
body,
|
|
833
835
|
{
|
|
834
836
|
headers: {
|
|
@@ -849,7 +851,7 @@ export const RetailerProductEdition = ({
|
|
|
849
851
|
getSectionIcon();
|
|
850
852
|
}
|
|
851
853
|
res = await axios.post(
|
|
852
|
-
`${process.env.
|
|
854
|
+
`${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
853
855
|
body,
|
|
854
856
|
{
|
|
855
857
|
headers: {
|
|
@@ -1233,7 +1235,7 @@ export const RetailerProductEdition = ({
|
|
|
1233
1235
|
conceptArray.forEach((concept) => {
|
|
1234
1236
|
body.service = concept;
|
|
1235
1237
|
evaluationArray.push(
|
|
1236
|
-
axios.post(`${process.env.
|
|
1238
|
+
axios.post(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, body, {
|
|
1237
1239
|
headers: {
|
|
1238
1240
|
Authorization: token,
|
|
1239
1241
|
},
|
package/src/global-files/data.js
CHANGED
|
@@ -6,12 +6,21 @@ export const getRetailerServices = async (
|
|
|
6
6
|
articleId,
|
|
7
7
|
category,
|
|
8
8
|
categoryId,
|
|
9
|
-
version
|
|
9
|
+
version,
|
|
10
|
+
token
|
|
10
11
|
) => {
|
|
11
12
|
try {
|
|
12
13
|
const responseArray = await Promise.all([
|
|
13
14
|
axios.post(
|
|
14
|
-
`${process.env.REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}
|
|
15
|
+
`${process.env.REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`,
|
|
16
|
+
{
|
|
17
|
+
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
headers: {
|
|
21
|
+
Authorization: token,
|
|
22
|
+
},
|
|
23
|
+
}
|
|
15
24
|
),
|
|
16
25
|
axios.get(
|
|
17
26
|
`${process.env.REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`
|