contentoh-components-library 21.2.7 → 21.2.8
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/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/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/RetailerProductEdition/RetailerProductEdition.stories.js +58 -58
- package/src/components/pages/RetailerProductEdition/index.js +3 -2
- package/src/index.js +1 -0
|
@@ -31,59 +31,59 @@ RetailerProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIzNmIxMmUwMy0xOWJhLTRiMDktYWJiYS1kZjk3ZTFkNThjZTQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDE4MjgzNywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDE4NjQzNywiaWF0IjoxNjYwMTgyODM3LCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.MM9nIHkrRIS2o8_s4BR6VTLgyw3ryvPrr-mf6RtnQ4smng2Q3fmtK07zInNcvcrv8EXO5J9z47_NZ5MOJDo1Pz1CV2cOYM7PT5tEn3F-W4SitqDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
|
|
35
35
|
productSelected: {
|
|
36
|
-
services: {
|
|
37
|
-
datasheets:
|
|
38
|
-
descriptions:
|
|
39
|
-
images: 1
|
|
36
|
+
"services": {
|
|
37
|
+
"datasheets": 1,
|
|
38
|
+
"descriptions": 1,
|
|
39
|
+
"images": 1
|
|
40
40
|
},
|
|
41
|
-
orderId:
|
|
42
|
-
status: "
|
|
43
|
-
datasheet_status: "
|
|
44
|
-
prio: "none",
|
|
45
|
-
version: 2,
|
|
46
|
-
description_status: "
|
|
47
|
-
images_status: "
|
|
48
|
-
article: {
|
|
49
|
-
id_article:
|
|
50
|
-
id_category: "
|
|
51
|
-
name: "
|
|
52
|
-
upc: "
|
|
53
|
-
timestamp: "2022-06-
|
|
54
|
-
id_user:
|
|
55
|
-
status: "NULL",
|
|
56
|
-
active:
|
|
57
|
-
company_id:
|
|
58
|
-
SKU: null,
|
|
59
|
-
Descripcion: null,
|
|
60
|
-
Proveedor: null,
|
|
61
|
-
id_proveedor: 0,
|
|
62
|
-
company_name: "
|
|
63
|
-
country:
|
|
64
|
-
id_order:
|
|
65
|
-
id_datasheet_especialist:
|
|
66
|
-
id_datasheet_facilitator:
|
|
67
|
-
id_description_especialist:
|
|
68
|
-
id_description_facilitator:
|
|
69
|
-
id_images_especialist:
|
|
70
|
-
id_images_facilitator:
|
|
71
|
-
id_auditor:
|
|
72
|
-
id_recepcionist: null,
|
|
73
|
-
category: "
|
|
74
|
-
missingAttributes: null,
|
|
75
|
-
missingDescriptions: null,
|
|
76
|
-
missingImages: null
|
|
41
|
+
"orderId": 1810,
|
|
42
|
+
"status": "RP",
|
|
43
|
+
"datasheet_status": "RP",
|
|
44
|
+
"prio": "none",
|
|
45
|
+
"version": 2,
|
|
46
|
+
"description_status": "RP",
|
|
47
|
+
"images_status": "RP",
|
|
48
|
+
"article": {
|
|
49
|
+
"id_article": 68934,
|
|
50
|
+
"id_category": "2290",
|
|
51
|
+
"name": "SCOTCHBLUE 3PACK MASKING TAPE 24MMX55M",
|
|
52
|
+
"upc": "167907",
|
|
53
|
+
"timestamp": "2022-06-22T15:44:57.000Z",
|
|
54
|
+
"id_user": 704,
|
|
55
|
+
"status": "NULL",
|
|
56
|
+
"active": 1,
|
|
57
|
+
"company_id": 437,
|
|
58
|
+
"SKU": null,
|
|
59
|
+
"Descripcion": null,
|
|
60
|
+
"Proveedor": null,
|
|
61
|
+
"id_proveedor": 0,
|
|
62
|
+
"company_name": "",
|
|
63
|
+
"country": null,
|
|
64
|
+
"id_order": 1810,
|
|
65
|
+
"id_datasheet_especialist": 1248,
|
|
66
|
+
"id_datasheet_facilitator": 1252,
|
|
67
|
+
"id_description_especialist": 1248,
|
|
68
|
+
"id_description_facilitator": 1252,
|
|
69
|
+
"id_images_especialist": 1251,
|
|
70
|
+
"id_images_facilitator": 1286,
|
|
71
|
+
"id_auditor": 514,
|
|
72
|
+
"id_recepcionist": null,
|
|
73
|
+
"category": "Pinturas|Herramientas y accesorios para pintar|Cintas",
|
|
74
|
+
"missingAttributes": null,
|
|
75
|
+
"missingDescriptions": null,
|
|
76
|
+
"missingImages": null
|
|
77
77
|
},
|
|
78
|
-
retailers: [{
|
|
79
|
-
id:
|
|
80
|
-
name: "The Home Depot
|
|
81
|
-
country: "México",
|
|
82
|
-
id_region: 1,
|
|
83
|
-
active: 1
|
|
78
|
+
"retailers": [{
|
|
79
|
+
"id": 58,
|
|
80
|
+
"name": "The Home Depot Golden",
|
|
81
|
+
"country": "México",
|
|
82
|
+
"id_region": 1,
|
|
83
|
+
"active": 1
|
|
84
84
|
}],
|
|
85
|
-
country:
|
|
86
|
-
upc: "
|
|
85
|
+
"country": null,
|
|
86
|
+
"upc": "167907"
|
|
87
87
|
},
|
|
88
88
|
location: {
|
|
89
89
|
product: {
|
|
@@ -92,22 +92,22 @@ RetailerProductEditionDefault.args = {
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
user: {
|
|
95
|
-
id_user:
|
|
96
|
-
name: "
|
|
95
|
+
id_user: 1248,
|
|
96
|
+
name: "Facilitador Textos",
|
|
97
97
|
last_name: " ",
|
|
98
|
-
email: "
|
|
98
|
+
email: "bayadi1538@mnqlm.com",
|
|
99
99
|
position: "Tester",
|
|
100
100
|
telephone: null,
|
|
101
101
|
country: null,
|
|
102
102
|
id_company: 254,
|
|
103
|
-
id_cognito: "
|
|
103
|
+
id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
|
|
104
104
|
birth_Date: null,
|
|
105
105
|
about_me: null,
|
|
106
106
|
zip_code: null,
|
|
107
107
|
address: null,
|
|
108
108
|
job: null,
|
|
109
109
|
id_stripe: null,
|
|
110
|
-
id_role:
|
|
110
|
+
id_role: 7,
|
|
111
111
|
active: 1,
|
|
112
112
|
is_retailer: 0,
|
|
113
113
|
email_notify: null,
|
|
@@ -122,6 +122,6 @@ RetailerProductEditionDefault.args = {
|
|
|
122
122
|
products_limit: "1000",
|
|
123
123
|
type: "Enterprise"
|
|
124
124
|
},
|
|
125
|
-
src: "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
125
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373"
|
|
126
126
|
}
|
|
127
127
|
};
|
|
@@ -118,7 +118,7 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
118
118
|
|
|
119
119
|
case "changeAttrValue":
|
|
120
120
|
var index = attrForImgs.general.findIndex(function (f) {
|
|
121
|
-
return f.id
|
|
121
|
+
return f.id === action.id;
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
if (index !== -1) {
|
|
@@ -1101,7 +1101,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1101
1101
|
return statusArray.includes(srvActive) && (["RA", "RC"].includes(product === null || product === void 0 ? void 0 : product.status) || srv.filter(function (serv) {
|
|
1102
1102
|
var _serv$status;
|
|
1103
1103
|
|
|
1104
|
-
return
|
|
1104
|
+
return ["CA"].includes((_serv$status = serv.status) === null || _serv$status === void 0 ? void 0 : _serv$status.replace(/.*\//, ""));
|
|
1105
1105
|
}).length === srv.length);
|
|
1106
1106
|
|
|
1107
1107
|
case 4:
|
|
@@ -1897,7 +1897,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1897
1897
|
headerType: "input-name-header"
|
|
1898
1898
|
}))]
|
|
1899
1899
|
})
|
|
1900
|
-
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1900
|
+
}), console.log(userAssigned(activeTab), auditorAssigned()), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1901
1901
|
className: "commentary-box",
|
|
1902
1902
|
children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1903
1903
|
className: "commentary",
|
package/dist/index.js
CHANGED
|
@@ -758,6 +758,19 @@ Object.keys(_CustomerType).forEach(function (key) {
|
|
|
758
758
|
});
|
|
759
759
|
});
|
|
760
760
|
|
|
761
|
+
var _Dashboard = require("./components/pages/Dashboard");
|
|
762
|
+
|
|
763
|
+
Object.keys(_Dashboard).forEach(function (key) {
|
|
764
|
+
if (key === "default" || key === "__esModule") return;
|
|
765
|
+
if (key in exports && exports[key] === _Dashboard[key]) return;
|
|
766
|
+
Object.defineProperty(exports, key, {
|
|
767
|
+
enumerable: true,
|
|
768
|
+
get: function get() {
|
|
769
|
+
return _Dashboard[key];
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
});
|
|
773
|
+
|
|
761
774
|
var _EmailResetPassword = require("./components/pages/EmailResetPassword");
|
|
762
775
|
|
|
763
776
|
Object.keys(_EmailResetPassword).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentoh-components-library",
|
|
3
|
-
"version": "21.2.
|
|
3
|
+
"version": "21.2.8",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@aws-amplify/auth": "^4.5.3",
|
|
6
6
|
"@aws-amplify/datastore": "^3.11.0",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"prop-types": "^15.7.2",
|
|
23
23
|
"react": "^17.0.2",
|
|
24
24
|
"react-chartjs-2": "^4.0.1",
|
|
25
|
+
"react-datepicker": "^4.8.0",
|
|
25
26
|
"react-dom": "^17.0.2",
|
|
26
27
|
"react-draft-wysiwyg": "^1.14.7",
|
|
27
28
|
"react-dropzone": "^12.0.4",
|
|
@@ -2,17 +2,11 @@ import { Container } from "./styles";
|
|
|
2
2
|
import { Chart } from "react-chartjs-2";
|
|
3
3
|
import "chart.js/auto";
|
|
4
4
|
|
|
5
|
-
export const Graphic = ({ data }) => {
|
|
6
|
-
|
|
7
|
-
plugins: {
|
|
8
|
-
legend: {
|
|
9
|
-
position: "left",
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
5
|
+
export const Graphic = ({ data, type, options }) => {
|
|
6
|
+
|
|
13
7
|
return (
|
|
14
8
|
<Container>
|
|
15
|
-
<Chart type=
|
|
9
|
+
<Chart type={type} data={data} options={options} />
|
|
16
10
|
</Container>
|
|
17
11
|
);
|
|
18
12
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricCard } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/atoms/MetricCard",
|
|
5
|
+
component: MetricCard,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <MetricCard {...args} />;
|
|
9
|
+
export const MetricCardDefault = Template.bind({});
|
|
10
|
+
|
|
11
|
+
MetricCardDefault.args = {
|
|
12
|
+
label: "Productos Totales",
|
|
13
|
+
number: 2367,
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
padding: 10px 20px;
|
|
6
|
+
border: 1px solid ${GlobalColors.s3};
|
|
7
|
+
width: fit-content;
|
|
8
|
+
text-align: center;
|
|
9
|
+
border-radius: 10px;
|
|
10
|
+
|
|
11
|
+
p {
|
|
12
|
+
color: #000;
|
|
13
|
+
font-size: 25px;
|
|
14
|
+
font-family: ${FontFamily.Raleway_600};
|
|
15
|
+
font-size: 25px;
|
|
16
|
+
font-feature-settings: "pnum", "lnum";
|
|
17
|
+
|
|
18
|
+
&:first-of-type {
|
|
19
|
+
color: ${GlobalColors.s3};
|
|
20
|
+
font-family: ${FontFamily.Raleway};
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
font-size: 13px;
|
|
23
|
+
line-height: 13px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
& + * {
|
|
27
|
+
margin-top: 3px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { MetricSelect } from ".";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/atoms/MetricSelect",
|
|
6
|
+
component: MetricSelect,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args) => {
|
|
10
|
+
const [optionSelected, setSelectedOption] = useState("Semana actual");
|
|
11
|
+
const onChange = (e) => {
|
|
12
|
+
setSelectedOption(e.target.value);
|
|
13
|
+
};
|
|
14
|
+
return (
|
|
15
|
+
<MetricSelect
|
|
16
|
+
{...args}
|
|
17
|
+
optionSelected={optionSelected}
|
|
18
|
+
onChange={onChange}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export const MetricSelectDefault = Template.bind({});
|
|
23
|
+
MetricSelectDefault.args = {
|
|
24
|
+
options: [
|
|
25
|
+
"12/12/12",
|
|
26
|
+
"12/12/13",
|
|
27
|
+
"12/12/14",
|
|
28
|
+
"12/12/15",
|
|
29
|
+
"12/12/16",
|
|
30
|
+
"12/12/17",
|
|
31
|
+
"12/12/18",
|
|
32
|
+
"12/12/19",
|
|
33
|
+
"12/12/20",
|
|
34
|
+
"12/12/21",
|
|
35
|
+
"12/12/22",
|
|
36
|
+
],
|
|
37
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
|
|
3
|
+
export const MetricSelect = ({
|
|
4
|
+
options,
|
|
5
|
+
optionSelected,
|
|
6
|
+
onChange,
|
|
7
|
+
label,
|
|
8
|
+
className,
|
|
9
|
+
}) => {
|
|
10
|
+
return (
|
|
11
|
+
<Container className={className}>
|
|
12
|
+
<select value={optionSelected} onChange={onChange}>
|
|
13
|
+
<option value="" disabled>{label}</option>
|
|
14
|
+
{options?.map((option) => (
|
|
15
|
+
<option key={option.name} value={option.id}>
|
|
16
|
+
{option.name}
|
|
17
|
+
</option>
|
|
18
|
+
))}
|
|
19
|
+
</select>
|
|
20
|
+
</Container>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
background-color: ${GlobalColors.s2};
|
|
6
|
+
width: fit-content;
|
|
7
|
+
display: block;
|
|
8
|
+
padding-right: 10px;
|
|
9
|
+
border-radius: 5px;
|
|
10
|
+
|
|
11
|
+
select {
|
|
12
|
+
color: ${GlobalColors.s4};
|
|
13
|
+
outline: none;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
border: none;
|
|
17
|
+
option:first-of-type {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import DatePicker from "react-datepicker";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
export const Calendar = ({ onChange, startDate, endDate }) => {
|
|
6
|
+
return (
|
|
7
|
+
<Container>
|
|
8
|
+
<DatePicker
|
|
9
|
+
selected={startDate}
|
|
10
|
+
onChange={onChange}
|
|
11
|
+
startDate={startDate}
|
|
12
|
+
endDate={endDate}
|
|
13
|
+
selectsRange
|
|
14
|
+
/>
|
|
15
|
+
</Container>
|
|
16
|
+
);
|
|
17
|
+
};
|