contentoh-components-library 21.1.22 → 21.1.25
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/atoms/ValidationPanel/index.js +26 -17
- package/dist/components/atoms/ValidationPanel/styles.js +1 -1
- package/dist/components/molecules/AvatarAndValidation/index.js +4 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +3 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +118 -72
- package/dist/components/pages/ProviderProductEdition/index.js +82 -14
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +58 -51
- package/dist/components/pages/RetailerProductEdition/index.js +18 -18
- package/dist/global-files/data.js +21 -12
- package/package.json +1 -1
- package/src/components/atoms/ValidationPanel/index.js +24 -14
- package/src/components/atoms/ValidationPanel/styles.js +6 -2
- package/src/components/molecules/AvatarAndValidation/index.js +2 -0
- package/src/components/organisms/FullProductNameHeader/index.js +2 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +126 -73
- package/src/components/pages/ProviderProductEdition/index.js +62 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +59 -51
- package/src/components/pages/RetailerProductEdition/index.js +1 -0
- package/src/global-files/data.js +32 -20
|
@@ -819,7 +819,6 @@ export const ProviderProductEdition = ({
|
|
|
819
819
|
articleId: product.id_article,
|
|
820
820
|
orderId: product.id_order ?? product.orderId,
|
|
821
821
|
concept,
|
|
822
|
-
retailerId,
|
|
823
822
|
};
|
|
824
823
|
axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
825
824
|
headers: {
|
|
@@ -846,6 +845,52 @@ export const ProviderProductEdition = ({
|
|
|
846
845
|
showSurvey && showSurvey(confirmStatusComplete());
|
|
847
846
|
};
|
|
848
847
|
|
|
848
|
+
const validateAll = async (result) => {
|
|
849
|
+
try {
|
|
850
|
+
const evaluationArray = [];
|
|
851
|
+
const sendAll = [];
|
|
852
|
+
const conceptArray = ["description", "datasheet", "images"];
|
|
853
|
+
console.log(servicesData);
|
|
854
|
+
|
|
855
|
+
servicesData?.forEach((ret) => {
|
|
856
|
+
let data = {
|
|
857
|
+
articleId: product.id_article,
|
|
858
|
+
orderId: product.id_order ?? product.orderId,
|
|
859
|
+
concept: ret.service,
|
|
860
|
+
result: result,
|
|
861
|
+
retailerId: ret.id_retailer,
|
|
862
|
+
};
|
|
863
|
+
evaluationArray.push(
|
|
864
|
+
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
865
|
+
headers: {
|
|
866
|
+
Authorization: token,
|
|
867
|
+
},
|
|
868
|
+
})
|
|
869
|
+
);
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
conceptArray.forEach((concept) => {
|
|
873
|
+
let data = {
|
|
874
|
+
articleId: product.id_article,
|
|
875
|
+
orderId: product.id_order ?? product.orderId,
|
|
876
|
+
concept,
|
|
877
|
+
};
|
|
878
|
+
sendAll.push(
|
|
879
|
+
axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
880
|
+
headers: {
|
|
881
|
+
Authorization: token,
|
|
882
|
+
},
|
|
883
|
+
})
|
|
884
|
+
);
|
|
885
|
+
});
|
|
886
|
+
|
|
887
|
+
Promise.all(conceptArray);
|
|
888
|
+
Promise.all(sendAll);
|
|
889
|
+
} catch (error) {
|
|
890
|
+
console.log(error);
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
|
|
849
894
|
const evaluationToRetailer = async (result) => {
|
|
850
895
|
const data = {
|
|
851
896
|
articleId: product.id_article,
|
|
@@ -900,6 +945,14 @@ export const ProviderProductEdition = ({
|
|
|
900
945
|
setSaving(loading);
|
|
901
946
|
}, [loading]);
|
|
902
947
|
|
|
948
|
+
console.log(
|
|
949
|
+
user.is_retailer === 1,
|
|
950
|
+
product.id_order || product.orderId,
|
|
951
|
+
isRevision(),
|
|
952
|
+
getSectionStatus(),
|
|
953
|
+
"XD"
|
|
954
|
+
);
|
|
955
|
+
|
|
903
956
|
return (
|
|
904
957
|
<Container headerTop={headerTop}>
|
|
905
958
|
<HeaderTop setHeaderTop={setHeaderTop} />
|
|
@@ -933,6 +986,14 @@ export const ProviderProductEdition = ({
|
|
|
933
986
|
setActiveRetailer={setActiveRetailer}
|
|
934
987
|
showValidationButtons={isRevision() && getSectionStatus()}
|
|
935
988
|
servicesData={servicesData ? servicesData : null}
|
|
989
|
+
showApproveRejectAll={
|
|
990
|
+
user.is_retailer === 1 &&
|
|
991
|
+
(product.id_order || product.orderId) &&
|
|
992
|
+
isRevision() &&
|
|
993
|
+
getSectionStatus()
|
|
994
|
+
}
|
|
995
|
+
approveAll={() => validateAll("A")}
|
|
996
|
+
rejectAll={() => validateAll("R")}
|
|
936
997
|
approve={() => {
|
|
937
998
|
if (
|
|
938
999
|
origin[activeTab] === "RequestWithoutContentoh" &&
|
|
@@ -16,7 +16,7 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJkMjc2ZGUwMy01YmM3LTRkZjEtYTk4MC1jYmYwYjkyOGU3MDEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjEwMDM2MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1NjEwMzk2MSwiaWF0IjoxNjU2MTAwMzYxLCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.WmbNT419c79ZIIZIxT8bW6YjSAvlGW_36cehBQWtdPPIeeRWO1ZVOkJeimGNm9dKwIVzdieg13mUPmJOcFZMQGtNoj4yOYOhSrQBEOg4Gr3Rv94RAEa-AcoFNns55Cl98krqF42qoYYeFRV9nH1iZrMU2sEML6kxwWgxAza5eXFie_MioMphXxMsWj3BT5Fmzk8SSHsAuf8jIjUTdGtFsNv2TOOU8YjTlljYij9cvLpu9Udlaj6tVnnElCcGskQk-U7QXqjHYDpOgeEkdWZU-Cy-vm4bT6qYCQHNtMxVCu_RZPpNm_p3vSWgkhj__baJsffhsb-PAETQKPTLuT690w",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
@@ -26,39 +26,39 @@ RetailerProductEditionDefault.args = {
|
|
|
26
26
|
descriptions: 1,
|
|
27
27
|
images: 1,
|
|
28
28
|
},
|
|
29
|
-
orderId:
|
|
30
|
-
status: "
|
|
31
|
-
datasheet_status: "
|
|
32
|
-
prio: "
|
|
29
|
+
orderId: 1213,
|
|
30
|
+
status: "AA",
|
|
31
|
+
datasheet_status: "AA",
|
|
32
|
+
prio: "low",
|
|
33
33
|
version: 2,
|
|
34
|
-
description_status: "
|
|
35
|
-
images_status: "
|
|
34
|
+
description_status: "AA",
|
|
35
|
+
images_status: "AA",
|
|
36
36
|
article: {
|
|
37
|
-
id_article:
|
|
38
|
-
id_category: "
|
|
39
|
-
name: "
|
|
40
|
-
upc: "
|
|
41
|
-
timestamp: "
|
|
42
|
-
id_user:
|
|
43
|
-
status: "
|
|
37
|
+
id_article: 17517,
|
|
38
|
+
id_category: "691",
|
|
39
|
+
name: "Antitranspirante Lady Speed Stick Clinical Complete en Barra para Dama 45 g",
|
|
40
|
+
upc: "7509546066172",
|
|
41
|
+
timestamp: "2021-10-09T16:33:17.000Z",
|
|
42
|
+
id_user: 203,
|
|
43
|
+
status: "RECEPTION",
|
|
44
44
|
active: 1,
|
|
45
|
-
company_id:
|
|
46
|
-
company_name: "
|
|
47
|
-
country: "
|
|
48
|
-
id_order:
|
|
49
|
-
id_datasheet_especialist:
|
|
50
|
-
id_datasheet_facilitator:
|
|
51
|
-
id_description_especialist:
|
|
52
|
-
id_description_facilitator:
|
|
53
|
-
id_images_especialist:
|
|
54
|
-
id_images_facilitator:
|
|
55
|
-
id_auditor:
|
|
45
|
+
company_id: 226,
|
|
46
|
+
company_name: "Prueba Test S.A de C.V.",
|
|
47
|
+
country: "null",
|
|
48
|
+
id_order: 1213,
|
|
49
|
+
id_datasheet_especialist: 334,
|
|
50
|
+
id_datasheet_facilitator: 158,
|
|
51
|
+
id_description_especialist: 334,
|
|
52
|
+
id_description_facilitator: 158,
|
|
53
|
+
id_images_especialist: 366,
|
|
54
|
+
id_images_facilitator: 14,
|
|
55
|
+
id_auditor: 94,
|
|
56
56
|
id_recepcionist: null,
|
|
57
57
|
category:
|
|
58
|
-
"SALUD Y BELLEZA|CUIDADO
|
|
59
|
-
missingAttributes:
|
|
60
|
-
missingDescriptions:
|
|
61
|
-
missingImages:
|
|
58
|
+
"SALUD Y BELLEZA|CUIDADO CORPORAL|DESODORANTES CABALLERO Y DAMA",
|
|
59
|
+
missingAttributes: 1,
|
|
60
|
+
missingDescriptions: 0,
|
|
61
|
+
missingImages: -4,
|
|
62
62
|
},
|
|
63
63
|
retailers: [
|
|
64
64
|
{
|
|
@@ -69,49 +69,57 @@ RetailerProductEditionDefault.args = {
|
|
|
69
69
|
active: 1,
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
id:
|
|
73
|
-
name: "
|
|
72
|
+
id: 6,
|
|
73
|
+
name: "HEB",
|
|
74
|
+
country: "México",
|
|
75
|
+
id_region: 1,
|
|
76
|
+
active: 1,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 29,
|
|
80
|
+
name: "Farmacias del Ahorro",
|
|
74
81
|
country: "México",
|
|
75
82
|
id_region: 1,
|
|
76
83
|
active: 1,
|
|
77
84
|
},
|
|
78
85
|
],
|
|
79
|
-
country: "
|
|
80
|
-
upc: "
|
|
86
|
+
country: "null",
|
|
87
|
+
upc: "7509546066172",
|
|
81
88
|
},
|
|
82
89
|
location: {
|
|
83
90
|
product: { articleId: 109485, versionId: 3 },
|
|
84
91
|
},
|
|
85
92
|
user: {
|
|
86
|
-
id_user:
|
|
87
|
-
name: "
|
|
88
|
-
last_name: "",
|
|
89
|
-
email: "
|
|
90
|
-
position:
|
|
93
|
+
id_user: 423,
|
|
94
|
+
name: "Facilitador Textos",
|
|
95
|
+
last_name: " ",
|
|
96
|
+
email: "bayadi1538@mnqlm.com",
|
|
97
|
+
position: "Tester",
|
|
91
98
|
telephone: null,
|
|
92
99
|
country: null,
|
|
93
|
-
id_company:
|
|
94
|
-
id_cognito: "
|
|
100
|
+
id_company: 254,
|
|
101
|
+
id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
|
|
95
102
|
birth_Date: null,
|
|
96
103
|
about_me: null,
|
|
97
104
|
zip_code: null,
|
|
98
105
|
address: null,
|
|
99
106
|
job: null,
|
|
100
107
|
id_stripe: null,
|
|
101
|
-
id_role:
|
|
108
|
+
id_role: 4,
|
|
102
109
|
active: 1,
|
|
103
110
|
is_retailer: 0,
|
|
111
|
+
email_notify: null,
|
|
104
112
|
membership: {
|
|
105
|
-
id:
|
|
106
|
-
start_date: "
|
|
107
|
-
end_date: "
|
|
108
|
-
planID:
|
|
109
|
-
plan: "
|
|
110
|
-
name: "Plan
|
|
111
|
-
user_limit: "
|
|
112
|
-
products_limit: "
|
|
113
|
-
type: "
|
|
113
|
+
id: 750,
|
|
114
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
115
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
116
|
+
planID: 6,
|
|
117
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
118
|
+
name: "Plan Small",
|
|
119
|
+
user_limit: "10",
|
|
120
|
+
products_limit: "1000",
|
|
121
|
+
type: "Enterprise",
|
|
114
122
|
},
|
|
115
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
123
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1656100361978",
|
|
116
124
|
},
|
|
117
125
|
};
|
package/src/global-files/data.js
CHANGED
|
@@ -2,29 +2,41 @@ import axios from "axios";
|
|
|
2
2
|
import { Base64 } from "js-base64";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
4
|
|
|
5
|
-
export const getRetailerServices = async (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
export const getRetailerServices = async (
|
|
6
|
+
articleId,
|
|
7
|
+
category,
|
|
8
|
+
categoryId,
|
|
9
|
+
version
|
|
10
|
+
) => {
|
|
11
|
+
try {
|
|
12
|
+
const responseArray = await Promise.all([
|
|
13
|
+
axios.post(
|
|
14
|
+
`${process.env.REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`
|
|
15
|
+
),
|
|
16
|
+
axios.get(
|
|
17
|
+
`${process.env.REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`
|
|
18
|
+
),
|
|
19
|
+
axios.post(
|
|
20
|
+
`${process.env.REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT}?articleId=${articleId}&version=${version}`,
|
|
21
|
+
{
|
|
22
|
+
category,
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
]);
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
const datasheets = JSON.parse(responseArray[0].data.body).data;
|
|
28
|
+
const descriptions = JSON.parse(responseArray[1].data.body).data;
|
|
29
|
+
const images = JSON.parse(responseArray[2].data.body).data;
|
|
21
30
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
images.values = images?.values?.map((value) => {
|
|
32
|
+
value.name = images.inputs.find((e) => e.id === value.image_id)?.name;
|
|
33
|
+
return getImage(value);
|
|
34
|
+
});
|
|
26
35
|
|
|
27
|
-
|
|
36
|
+
return [datasheets, descriptions, images];
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.log(error);
|
|
39
|
+
}
|
|
28
40
|
};
|
|
29
41
|
|
|
30
42
|
export const getImage = (imageGeneral, width = 250, height = 250) => {
|