contentoh-components-library 21.2.7 → 21.2.10
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 +3 -1
- package/.env.production +3 -1
- package/dist/components/atoms/FeatureTag/styles.js +1 -1
- package/dist/components/atoms/Graphic/Graphic.stories.js +9 -1
- package/dist/components/atoms/Graphic/index.js +4 -9
- package/dist/components/atoms/Graphic/styles.js +1 -1
- package/dist/components/atoms/MetricCard/MetricCard.stories.js +31 -0
- package/dist/components/atoms/MetricCard/index.js +24 -0
- package/dist/components/atoms/MetricCard/styles.js +20 -0
- package/dist/components/atoms/MetricSelect/MetricSelect.stories.js +46 -0
- package/dist/components/atoms/MetricSelect/index.js +37 -0
- package/dist/components/atoms/MetricSelect/styles.js +20 -0
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/organisms/Calendar/Calendar.stories.js +28 -0
- package/dist/components/organisms/Calendar/index.js +33 -0
- package/dist/components/organisms/Calendar/styles.js +20 -0
- package/dist/components/organisms/DashboardMetric/DashboardMetric.stories.js +45 -0
- package/dist/components/organisms/DashboardMetric/index.js +168 -0
- package/dist/components/organisms/DashboardMetric/styles.js +20 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +28 -0
- package/dist/components/pages/Dashboard/index.js +292 -0
- package/dist/components/pages/Dashboard/styles.js +18 -0
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +73 -121
- package/dist/components/pages/ProviderProductEdition/index.js +30 -27
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +55 -55
- package/dist/components/pages/RetailerProductEdition/index.js +3 -3
- package/dist/index.js +13 -0
- package/package.json +2 -1
- package/src/components/atoms/FeatureTag/styles.js +6 -0
- package/src/components/atoms/Graphic/Graphic.stories.js +8 -0
- package/src/components/atoms/Graphic/index.js +3 -9
- package/src/components/atoms/Graphic/styles.js +1 -2
- package/src/components/atoms/MetricCard/MetricCard.stories.js +14 -0
- package/src/components/atoms/MetricCard/index.js +10 -0
- package/src/components/atoms/MetricCard/styles.js +30 -0
- package/src/components/atoms/MetricSelect/MetricSelect.stories.js +37 -0
- package/src/components/atoms/MetricSelect/index.js +22 -0
- package/src/components/atoms/MetricSelect/styles.js +20 -0
- package/src/components/organisms/Calendar/Calendar.stories.js +10 -0
- package/src/components/organisms/Calendar/index.js +17 -0
- package/src/components/organisms/Calendar/styles.js +851 -0
- package/src/components/organisms/DashboardMetric/DashboardMetric.stories.js +28 -0
- package/src/components/organisms/DashboardMetric/index.js +128 -0
- package/src/components/organisms/DashboardMetric/styles.js +60 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +10 -0
- package/src/components/pages/Dashboard/index.js +146 -0
- package/src/components/pages/Dashboard/styles.js +24 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +80 -146
- package/src/components/pages/ProviderProductEdition/index.js +12 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +58 -58
- package/src/components/pages/RetailerProductEdition/index.js +3 -2
- package/src/index.js +1 -0
|
@@ -913,16 +913,17 @@ export const ProviderProductEdition = ({
|
|
|
913
913
|
try {
|
|
914
914
|
setLoading(true);
|
|
915
915
|
const evaluationArray = [];
|
|
916
|
-
const sendAll = [];
|
|
917
916
|
const conceptArray = ["description", "datasheet", "images"];
|
|
918
917
|
const dataGeneral = {
|
|
919
918
|
articleId: product.id_article,
|
|
920
919
|
orderId: product.id_order ?? product.orderId,
|
|
921
920
|
result,
|
|
921
|
+
isAproved: result === "A",
|
|
922
922
|
};
|
|
923
923
|
servicesData?.forEach((ret) => {
|
|
924
924
|
const { service, id_retailer } = ret;
|
|
925
|
-
|
|
925
|
+
let data = {};
|
|
926
|
+
data = {
|
|
926
927
|
...dataGeneral,
|
|
927
928
|
concept: service,
|
|
928
929
|
retailerId: id_retailer,
|
|
@@ -935,31 +936,25 @@ export const ProviderProductEdition = ({
|
|
|
935
936
|
},
|
|
936
937
|
})
|
|
937
938
|
);
|
|
938
|
-
sendAll.push(
|
|
939
|
-
axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
940
|
-
headers: {
|
|
941
|
-
Authorization: token,
|
|
942
|
-
},
|
|
943
|
-
})
|
|
944
|
-
);
|
|
945
939
|
});
|
|
946
|
-
|
|
947
|
-
|
|
940
|
+
const evalResponse = await Promise.all(evaluationArray);
|
|
941
|
+
console.log(evalResponse.map(({ data }) => JSON.parse(data.body)));
|
|
942
|
+
const userType = user.is_retailer === 1 ? "CA" : "P";
|
|
948
943
|
|
|
949
944
|
const productTemp = product;
|
|
950
|
-
productTemp.article_status = `${result}
|
|
945
|
+
productTemp.article_status = `${result}${userType}`;
|
|
951
946
|
productTemp.datasheet_status =
|
|
952
|
-
productTemp.datasheet_status === "NA" ? "NA" : `${result}
|
|
947
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}${userType}`;
|
|
953
948
|
productTemp.description_status =
|
|
954
|
-
productTemp.description_status === "NA" ? "NA" : `${result}
|
|
949
|
+
productTemp.description_status === "NA" ? "NA" : `${result}${userType}`;
|
|
955
950
|
productTemp.images_status =
|
|
956
|
-
productTemp.images_status === "NA" ? "NA" : `${result}
|
|
951
|
+
productTemp.images_status === "NA" ? "NA" : `${result}${userType}`;
|
|
957
952
|
|
|
958
953
|
const retailerStatusCopy = { ...retailerStatus };
|
|
959
954
|
Object.keys(retailerStatusCopy).forEach((key) => {
|
|
960
955
|
conceptArray.forEach((concept) => {
|
|
961
956
|
if (retailerStatusCopy[key][concept]) {
|
|
962
|
-
retailerStatusCopy[key][concept] = `${result}
|
|
957
|
+
retailerStatusCopy[key][concept] = `${result}${userType}`;
|
|
963
958
|
}
|
|
964
959
|
});
|
|
965
960
|
});
|
|
@@ -1494,6 +1489,7 @@ export const ProviderProductEdition = ({
|
|
|
1494
1489
|
companyName={company.company_name}
|
|
1495
1490
|
currentVersion={version}
|
|
1496
1491
|
setShowCreateVersion={setShowCreateVersion}
|
|
1492
|
+
setShowVersionSelector={setShowVersionSelector}
|
|
1497
1493
|
/>
|
|
1498
1494
|
)}
|
|
1499
1495
|
{showCreateVersion && (
|
|
@@ -16,82 +16,82 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIzNmIxMmUwMy0xOWJhLTRiMDktYWJiYS1kZjk3ZTFkNThjZTQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDE4MjgzNywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDE4NjQzNywiaWF0IjoxNjYwMTgyODM3LCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.MM9nIHkrRIS2o8_s4BR6VTLgyw3ryvPrr-mf6RtnQ4smng2Q3fmtK07zInNcvcrv8EXO5J9z47_NZ5MOJDo1Pz1CV2cOYM7PT5tEn3F-W4SitqDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
|
|
20
20
|
productSelected: {
|
|
21
|
-
services: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
"services": {
|
|
22
|
+
"datasheets": 1,
|
|
23
|
+
"descriptions": 1,
|
|
24
|
+
"images": 1
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
27
|
-
status: "
|
|
28
|
-
datasheet_status: "
|
|
29
|
-
prio: "none",
|
|
30
|
-
version: 2,
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status: "
|
|
33
|
-
article: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
26
|
+
"orderId": 1810,
|
|
27
|
+
"status": "RP",
|
|
28
|
+
"datasheet_status": "RP",
|
|
29
|
+
"prio": "none",
|
|
30
|
+
"version": 2,
|
|
31
|
+
"description_status": "RP",
|
|
32
|
+
"images_status": "RP",
|
|
33
|
+
"article": {
|
|
34
|
+
"id_article": 68934,
|
|
35
|
+
"id_category": "2290",
|
|
36
|
+
"name": "SCOTCHBLUE 3PACK MASKING TAPE 24MMX55M",
|
|
37
|
+
"upc": "167907",
|
|
38
|
+
"timestamp": "2022-06-22T15:44:57.000Z",
|
|
39
|
+
"id_user": 704,
|
|
40
|
+
"status": "NULL",
|
|
41
|
+
"active": 1,
|
|
42
|
+
"company_id": 437,
|
|
43
|
+
"SKU": null,
|
|
44
|
+
"Descripcion": null,
|
|
45
|
+
"Proveedor": null,
|
|
46
|
+
"id_proveedor": 0,
|
|
47
|
+
"company_name": "",
|
|
48
|
+
"country": null,
|
|
49
|
+
"id_order": 1810,
|
|
50
|
+
"id_datasheet_especialist": 1248,
|
|
51
|
+
"id_datasheet_facilitator": 1252,
|
|
52
|
+
"id_description_especialist": 1248,
|
|
53
|
+
"id_description_facilitator": 1252,
|
|
54
|
+
"id_images_especialist": 1251,
|
|
55
|
+
"id_images_facilitator": 1286,
|
|
56
|
+
"id_auditor": 514,
|
|
57
|
+
"id_recepcionist": null,
|
|
58
|
+
"category": "Pinturas|Herramientas y accesorios para pintar|Cintas",
|
|
59
|
+
"missingAttributes": null,
|
|
60
|
+
"missingDescriptions": null,
|
|
61
|
+
"missingImages": null
|
|
62
62
|
},
|
|
63
|
-
retailers: [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
"retailers": [
|
|
64
|
+
{
|
|
65
|
+
"id": 58,
|
|
66
|
+
"name": "The Home Depot Golden",
|
|
67
|
+
"country": "México",
|
|
68
|
+
"id_region": 1,
|
|
69
|
+
"active": 1
|
|
70
|
+
}
|
|
71
71
|
],
|
|
72
|
-
country:
|
|
73
|
-
upc: "
|
|
74
|
-
|
|
72
|
+
"country": null,
|
|
73
|
+
"upc": "167907"
|
|
74
|
+
},
|
|
75
75
|
location: {
|
|
76
76
|
product: { articleId: 109485, versionId: 3 },
|
|
77
77
|
},
|
|
78
78
|
user: {
|
|
79
|
-
id_user:
|
|
80
|
-
name: "
|
|
79
|
+
id_user: 1248,
|
|
80
|
+
name: "Facilitador Textos",
|
|
81
81
|
last_name: " ",
|
|
82
|
-
email: "
|
|
82
|
+
email: "bayadi1538@mnqlm.com",
|
|
83
83
|
position: "Tester",
|
|
84
84
|
telephone: null,
|
|
85
85
|
country: null,
|
|
86
86
|
id_company: 254,
|
|
87
|
-
id_cognito: "
|
|
87
|
+
id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
|
|
88
88
|
birth_Date: null,
|
|
89
89
|
about_me: null,
|
|
90
90
|
zip_code: null,
|
|
91
91
|
address: null,
|
|
92
92
|
job: null,
|
|
93
93
|
id_stripe: null,
|
|
94
|
-
id_role:
|
|
94
|
+
id_role: 7,
|
|
95
95
|
active: 1,
|
|
96
96
|
is_retailer: 0,
|
|
97
97
|
email_notify: null,
|
|
@@ -106,6 +106,6 @@ RetailerProductEditionDefault.args = {
|
|
|
106
106
|
products_limit: "1000",
|
|
107
107
|
type: "Enterprise",
|
|
108
108
|
},
|
|
109
|
-
src: "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
109
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373",
|
|
110
110
|
},
|
|
111
111
|
};
|
|
@@ -60,7 +60,7 @@ const reducerImages = (state, action) => {
|
|
|
60
60
|
values[action.index][action.attribute] = action.value;
|
|
61
61
|
return { ...state, values };
|
|
62
62
|
case "changeAttrValue":
|
|
63
|
-
const index = attrForImgs.general.findIndex((f) =>
|
|
63
|
+
const index = attrForImgs.general.findIndex((f) => f.id === action.id);
|
|
64
64
|
if (index !== -1) {
|
|
65
65
|
attrForImgs.general[index].value = action.value;
|
|
66
66
|
}
|
|
@@ -648,7 +648,7 @@ export const RetailerProductEdition = ({
|
|
|
648
648
|
statusArray.includes(srvActive) &&
|
|
649
649
|
(["RA", "RC"].includes(product?.status) ||
|
|
650
650
|
srv.filter((serv) =>
|
|
651
|
-
|
|
651
|
+
["CA"].includes(serv.status?.replace(/.*\//, ""))
|
|
652
652
|
).length === srv.length)
|
|
653
653
|
);
|
|
654
654
|
case 4:
|
|
@@ -1387,6 +1387,7 @@ export const RetailerProductEdition = ({
|
|
|
1387
1387
|
</>
|
|
1388
1388
|
)}
|
|
1389
1389
|
</div>
|
|
1390
|
+
{console.log(userAssigned(activeTab), auditorAssigned())}
|
|
1390
1391
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1391
1392
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1392
1393
|
<div className="commentary-box">
|
package/src/index.js
CHANGED
|
@@ -63,6 +63,7 @@ export * from "./components/organisms/ProductImageModal/index";
|
|
|
63
63
|
export * from "./components/pages/ChangePasswordLogin";
|
|
64
64
|
export * from "./components/pages/CustomerLogin";
|
|
65
65
|
export * from "./components/pages/CustomerType";
|
|
66
|
+
export * from "./components/pages/Dashboard";
|
|
66
67
|
export * from "./components/pages/EmailResetPassword";
|
|
67
68
|
export * from "./components/pages/OnboardPlan";
|
|
68
69
|
export * from "./components/pages/RegistrationLoginSecondStep";
|