contentoh-components-library 21.2.66 → 21.2.68
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 +1 -4
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/HeaderTop/index.js +5 -10
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +17 -11
- package/dist/components/organisms/DashboardMetric/index.js +2 -2
- package/dist/components/organisms/DashboardMetric/styles.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +26 -26
- package/dist/components/pages/Dashboard/index.js +4 -4
- package/package.json +1 -6
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +11 -19
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +6 -10
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +15 -11
- package/src/components/organisms/DashboardMetric/index.js +4 -2
- package/src/components/organisms/DashboardMetric/styles.js +1 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +26 -26
- package/src/components/pages/Dashboard/index.js +3 -3
- package/src/assets/images/chatPopup/Spinner.gif +0 -0
- package/src/assets/images/chatPopup/close.svg +0 -3
- package/src/assets/images/chatPopup/defaultImage.png +0 -0
- package/src/assets/images/chatPopup/defaultProfile.png +0 -0
- package/src/assets/images/chatPopup/doc.svg +0 -1
- package/src/assets/images/chatPopup/document.svg +0 -1
- package/src/assets/images/chatPopup/iconChat.svg +0 -19
- package/src/assets/images/chatPopup/iconPlus.svg +0 -3
- package/src/assets/images/chatPopup/pdf.svg +0 -75
- package/src/assets/images/chatPopup/remove.svg +0 -4
- package/src/assets/images/chatPopup/send.svg +0 -3
- package/src/assets/images/chatPopup/svgIcon.svg +0 -109
- package/src/assets/images/chatPopup/upload_file.svg +0 -3
- package/src/assets/images/chatPopup/xls.svg +0 -53
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/components/atoms/ChatPopUp/ChatPopUp.stories.js +0 -11
- package/src/components/atoms/ChatPopUp/index.js +0 -541
- package/src/components/atoms/ChatPopUp/styles.js +0 -278
- package/src/components/atoms/ChatPopUp/utils/handlersChat.js +0 -104
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -15
- package/src/components/atoms/Tooltip/index.js +0 -35
- package/src/components/atoms/Tooltip/styles.js +0 -5
package/.env.development
CHANGED
|
@@ -21,11 +21,8 @@ REACT_APP_READ_REQUIRED_ORDERS=https://fc069ovhuk.execute-api.us-east-1.amazonaw
|
|
|
21
21
|
REACT_APP_CATEGORY_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/categories
|
|
22
22
|
REACT_APP_READ_PROVIDERS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/providers
|
|
23
23
|
REACT_APP_PENDING_INVITATIONS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/pending-invitations
|
|
24
|
-
REACT_APP_POST_MESSAGE=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat
|
|
25
|
-
REACT_APP_KEY_UPLOAD_TO_S3=AKIA5CPHLQTT46EQ5TIK
|
|
26
|
-
REACT_APP_ACCESS_KEY_UPLOAD_TO_S3=tZDdrmvwxM1cScspfxFM3XpU4HSYrCNPazyHd0BL
|
|
27
|
-
REACT_APP_IMAGES_BUCKET=content-management-images
|
|
28
24
|
|
|
25
|
+
REACT_APP_IMAGES_BUCKET=content-management-images
|
|
29
26
|
REACT_APP_KEY_UPLOAD_TO_S3=AKIA5CPHLQTT46EQ5TIK
|
|
30
27
|
REACT_APP_IMAGES_PROFILE_BUCKET=content-management-profile
|
|
31
28
|
REACT_APP_ACCESS_KEY_UPLOAD_TO_S3=tZDdrmvwxM1cScspfxFM3XpU4HSYrCNPazyHd0BL
|
|
@@ -11,8 +11,6 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/
|
|
|
11
11
|
|
|
12
12
|
var _index = require("./index");
|
|
13
13
|
|
|
14
|
-
var _starIcon = _interopRequireDefault(require("../../../assets/images/customSelect/starIcon.svg"));
|
|
15
|
-
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
15
|
|
|
18
16
|
var _default = {
|
|
@@ -28,26 +26,29 @@ var Template = function Template(args) {
|
|
|
28
26
|
var CustomSelectDefault = Template.bind({});
|
|
29
27
|
exports.CustomSelectDefault = CustomSelectDefault;
|
|
30
28
|
CustomSelectDefault.args = {
|
|
31
|
-
|
|
29
|
+
selectLabel: "Todos los departamentos",
|
|
32
30
|
defaultOption: "Todos los departamentos",
|
|
33
31
|
options: [{
|
|
34
|
-
id:
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
id: 1,
|
|
33
|
+
value: "Decoración",
|
|
34
|
+
subOptions: [{
|
|
35
|
+
id: 1,
|
|
36
|
+
value: "Espejos"
|
|
37
|
+
}, {
|
|
38
|
+
id: 2,
|
|
39
|
+
value: "Persianas"
|
|
40
|
+
}]
|
|
41
|
+
}, {
|
|
42
|
+
id: 2,
|
|
43
|
+
value: "Eléctrico"
|
|
44
|
+
}, {
|
|
45
|
+
id: 3,
|
|
46
|
+
value: "Ferretería"
|
|
47
|
+
}, {
|
|
48
|
+
id: 4,
|
|
49
|
+
value: "Herramientas"
|
|
37
50
|
}, {
|
|
38
|
-
id:
|
|
39
|
-
|
|
40
|
-
}]
|
|
41
|
-
onClickItem: function onClickItem(v, id) {
|
|
42
|
-
if (v) {
|
|
43
|
-
console.log("Agregar a la lista", id);
|
|
44
|
-
} else {
|
|
45
|
-
console.log("Eliminar a la lista", id);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
icon: _starIcon.default,
|
|
49
|
-
showSearchBar: true,
|
|
50
|
-
customOptions: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
51
|
-
children: "Esto es un customOptions"
|
|
52
|
-
})
|
|
51
|
+
id: 5,
|
|
52
|
+
value: "Iluminación"
|
|
53
|
+
}]
|
|
53
54
|
};
|
|
@@ -26,8 +26,7 @@ var SelecItem = function SelecItem(_ref) {
|
|
|
26
26
|
customSelectId = _ref.customSelectId,
|
|
27
27
|
setParameterArray = _ref.setParameterArray,
|
|
28
28
|
activeFilters = _ref.activeFilters,
|
|
29
|
-
setActiveFilters = _ref.setActiveFilters
|
|
30
|
-
onClickItem = _ref.onClickItem;
|
|
29
|
+
setActiveFilters = _ref.setActiveFilters;
|
|
31
30
|
|
|
32
31
|
var _useState = (0, _react.useState)(false),
|
|
33
32
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -47,10 +46,6 @@ var SelecItem = function SelecItem(_ref) {
|
|
|
47
46
|
id: "main-item-" + option.id,
|
|
48
47
|
label: option.name,
|
|
49
48
|
onChange: function onChange(e) {
|
|
50
|
-
if (onClickItem) {
|
|
51
|
-
onClickItem(e.target.checked, option.id);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
49
|
var subOptions = option.subOptions;
|
|
55
50
|
var filtersCopy = (0, _objectSpread2.default)({}, activeFilters);
|
|
56
51
|
|
|
@@ -113,10 +108,6 @@ var SelecItem = function SelecItem(_ref) {
|
|
|
113
108
|
label: sub.name,
|
|
114
109
|
defaultChecked: activeFilters[option.name] && activeFilters[option.name][sub.name],
|
|
115
110
|
onChange: function onChange(e) {
|
|
116
|
-
if (onClickItem) {
|
|
117
|
-
onClickItem(e.target.checked, sub.id);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
111
|
if (e.target.checked) {
|
|
121
112
|
setParameterArray(function (current) {
|
|
122
113
|
return [].concat((0, _toConsumableArray2.default)(current), [sub.id]).sort(function (a, b) {
|
|
@@ -13,8 +13,6 @@ var _index2 = require("../../atoms/GeneralButton/index");
|
|
|
13
13
|
|
|
14
14
|
var _react = require("react");
|
|
15
15
|
|
|
16
|
-
var _index3 = require("../../atoms/ChatPopUp/index");
|
|
17
|
-
|
|
18
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
17
|
|
|
20
18
|
var HeaderTop = function HeaderTop(_ref) {
|
|
@@ -27,14 +25,11 @@ var HeaderTop = function HeaderTop(_ref) {
|
|
|
27
25
|
ref: headerTop,
|
|
28
26
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
29
27
|
text: "Edici\xF3n de producto"
|
|
30
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
window.location.href = "/products";
|
|
36
|
-
}
|
|
37
|
-
})
|
|
28
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Button, {
|
|
29
|
+
buttonType: "close-button",
|
|
30
|
+
onClick: function onClick() {
|
|
31
|
+
window.location.href = "/products";
|
|
32
|
+
}
|
|
38
33
|
})]
|
|
39
34
|
});
|
|
40
35
|
};
|
|
@@ -13,6 +13,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
17
17
|
|
|
18
18
|
exports.Container = Container;
|
|
@@ -8,7 +8,7 @@ exports.removeOldStatus = exports.getStatusColor = exports.getFullStatus = void
|
|
|
8
8
|
var getFullStatus = function getFullStatus(status) {
|
|
9
9
|
switch (status) {
|
|
10
10
|
case "PA":
|
|
11
|
-
return "Por
|
|
11
|
+
return "Por asignar";
|
|
12
12
|
|
|
13
13
|
case "AS":
|
|
14
14
|
case "Assigned":
|
|
@@ -20,39 +20,42 @@ var getFullStatus = function getFullStatus(status) {
|
|
|
20
20
|
|
|
21
21
|
case "IE":
|
|
22
22
|
case "QF":
|
|
23
|
-
return "Información
|
|
23
|
+
return "Información enviada";
|
|
24
24
|
|
|
25
25
|
case "RC":
|
|
26
26
|
case "RF":
|
|
27
|
-
return "Rechazado
|
|
27
|
+
return "Rechazado coordinador";
|
|
28
28
|
|
|
29
29
|
case "AC":
|
|
30
30
|
case "AF":
|
|
31
|
-
return "Aprobado
|
|
31
|
+
return "Aprobado coordinador";
|
|
32
32
|
|
|
33
33
|
case "RA":
|
|
34
|
-
return "Rechazado
|
|
34
|
+
return "Rechazado auditor";
|
|
35
35
|
|
|
36
36
|
case "AA":
|
|
37
|
-
return "Aprobado
|
|
37
|
+
return "Aprobado auditor";
|
|
38
38
|
|
|
39
39
|
case "RP":
|
|
40
|
-
return "Rechazado
|
|
40
|
+
return "Rechazado proveedor";
|
|
41
41
|
|
|
42
42
|
case "AP":
|
|
43
|
-
return "Aprobado
|
|
43
|
+
return "Aprobado proveedor";
|
|
44
44
|
|
|
45
45
|
case "RCA":
|
|
46
|
-
return "Rechazado
|
|
46
|
+
return "Rechazado cadena";
|
|
47
47
|
|
|
48
48
|
case "ACA":
|
|
49
|
-
return "Aprobado
|
|
49
|
+
return "Aprobado cadena";
|
|
50
50
|
|
|
51
51
|
case "R":
|
|
52
|
-
return "Por
|
|
52
|
+
return "Por recibir/recibido";
|
|
53
53
|
|
|
54
54
|
case "Ex":
|
|
55
55
|
return "Exportado";
|
|
56
|
+
|
|
57
|
+
case "NS":
|
|
58
|
+
return "No solicitado";
|
|
56
59
|
}
|
|
57
60
|
};
|
|
58
61
|
|
|
@@ -104,6 +107,9 @@ var getStatusColor = function getStatusColor(status) {
|
|
|
104
107
|
case "R":
|
|
105
108
|
return "#D35400";
|
|
106
109
|
|
|
110
|
+
case "NS":
|
|
111
|
+
return "black";
|
|
112
|
+
|
|
107
113
|
case "Ex":
|
|
108
114
|
return "#09CAD8";
|
|
109
115
|
|
|
@@ -40,12 +40,12 @@ var DashboardMetric = function DashboardMetric(_ref) {
|
|
|
40
40
|
total = _ref.total,
|
|
41
41
|
totalFiltered = _ref.totalFiltered;
|
|
42
42
|
var labels = type === "doughnut" ? Object.keys(dataObject).map(function (key) {
|
|
43
|
-
return (0, _dashboardMetricUtils.getFullStatus)(key);
|
|
43
|
+
return key !== "NS" && (0, _dashboardMetricUtils.getFullStatus)(key);
|
|
44
44
|
}) : Object.keys(dataObject);
|
|
45
45
|
var newObject = type === "doughnut" ? (0, _dashboardMetricUtils.removeOldStatus)(dataObject) : dataObject;
|
|
46
46
|
var values = (_Object$values = Object.values(newObject)) !== null && _Object$values !== void 0 && _Object$values.length ? Object.values(newObject) : [0];
|
|
47
47
|
var colorsArray = Object.keys(newObject).map(function (key) {
|
|
48
|
-
return (0, _dashboardMetricUtils.getStatusColor)(key);
|
|
48
|
+
return key !== "NS" && (0, _dashboardMetricUtils.getStatusColor)(key);
|
|
49
49
|
});
|
|
50
50
|
var data = {
|
|
51
51
|
labels: labels,
|
|
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n border-radius: 5px;\n padding: 24px;\n position: relative;\n\n .text-container {\n p {\n font-family: ", ";\n color: ", ";\n font-size: 17px;\n\n &:last-of-type {\n font-size: 12px;\n color: ", ";\n }\n\n & + * {\n margin-top: 5px;\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n }\n\n .select-container {\n display: flex;\n\n .select {\n flex: 0.1 1 30%;\n\n select {\n width: 100%;\n }\n\n & + * {\n margin-left: 10px;\n }\n }\n\n & + * {\n margin-top: 10px;\n }\n }\n\n .graphic-cotainer {\n height:
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n border-radius: 5px;\n padding: 24px;\n position: relative;\n\n .text-container {\n p {\n font-family: ", ";\n color: ", ";\n font-size: 17px;\n\n &:last-of-type {\n font-size: 12px;\n color: ", ";\n }\n\n & + * {\n margin-top: 5px;\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n }\n\n .select-container {\n display: flex;\n\n .select {\n flex: 0.1 1 30%;\n\n select {\n width: 100%;\n }\n\n & + * {\n margin-left: 10px;\n }\n }\n\n & + * {\n margin-top: 10px;\n }\n }\n\n .graphic-cotainer {\n height: 350px;\n border: 1px solid ", ";\n padding: 10px;\n border-radius: 5px;\n\n div {\n height: fill-available;\n }\n }\n\n & > p {\n font-family: ", ";\n color: ", ";\n font-size: 17px;\n\n &.x-label {\n position: absolute;\n left: 50%;\n transform: translate(-50%);\n bottom: 4px;\n }\n\n &.y-label {\n position: absolute;\n transform: rotate(-90deg);\n left: -28px;\n top: 50%;\n }\n\n &.center-label {\n position: absolute;\n top: 52%;\n right: 58%;\n font-size: 28px;\n color: #000;\n font-feature-settings: \"pnum\", \"lnum\";\n font-family: ", ";\n }\n }\n"])), _variables.GlobalColors.s3, _variables.FontFamily.Raleway, _variables.GlobalColors.s5, _variables.GlobalColors.s4, _variables.GlobalColors.s3, _variables.FontFamily.Raleway, _variables.GlobalColors.s5, _variables.FontFamily.Raleway_600);
|
|
19
19
|
|
|
20
20
|
exports.Container = Container;
|
|
@@ -27,37 +27,37 @@ var DashboardDeafult = Template.bind({});
|
|
|
27
27
|
exports.DashboardDeafult = DashboardDeafult;
|
|
28
28
|
DashboardDeafult.args = {
|
|
29
29
|
user: {
|
|
30
|
-
id_user:
|
|
31
|
-
name: "
|
|
32
|
-
last_name: "
|
|
33
|
-
email: "
|
|
34
|
-
position: "
|
|
35
|
-
telephone:
|
|
36
|
-
country:
|
|
37
|
-
id_company:
|
|
38
|
-
id_cognito: "
|
|
30
|
+
id_user: 425,
|
|
31
|
+
name: "Auditor QA",
|
|
32
|
+
last_name: " ",
|
|
33
|
+
email: "ladiboh785@mi166.com",
|
|
34
|
+
position: "Tester",
|
|
35
|
+
telephone: null,
|
|
36
|
+
country: null,
|
|
37
|
+
id_company: 254,
|
|
38
|
+
id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
|
|
39
39
|
birth_Date: null,
|
|
40
|
-
about_me:
|
|
41
|
-
zip_code:
|
|
42
|
-
address:
|
|
43
|
-
job:
|
|
44
|
-
id_stripe:
|
|
40
|
+
about_me: null,
|
|
41
|
+
zip_code: null,
|
|
42
|
+
address: null,
|
|
43
|
+
job: null,
|
|
44
|
+
id_stripe: null,
|
|
45
45
|
id_role: 6,
|
|
46
46
|
active: 1,
|
|
47
47
|
is_retailer: 0,
|
|
48
|
-
email_notify:
|
|
48
|
+
email_notify: null,
|
|
49
49
|
membership: {
|
|
50
|
-
id:
|
|
51
|
-
start_date: "
|
|
52
|
-
end_date: "
|
|
53
|
-
planID:
|
|
54
|
-
plan: "
|
|
55
|
-
name: "Plan
|
|
56
|
-
user_limit: "
|
|
57
|
-
products_limit: "
|
|
58
|
-
type: "
|
|
50
|
+
id: 750,
|
|
51
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
52
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
53
|
+
planID: 6,
|
|
54
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
55
|
+
name: "Plan Small",
|
|
56
|
+
user_limit: "10",
|
|
57
|
+
products_limit: "1000",
|
|
58
|
+
type: "Enterprise"
|
|
59
59
|
},
|
|
60
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
60
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1666639556174"
|
|
61
61
|
},
|
|
62
|
-
jwt: "
|
|
62
|
+
jwt: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIyM2EzZjQ5Ni00ZTM4LTRlMTItOWJmNS03ZjkwYjc3YTJmMzUiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjIzYTNmNDk2LTRlMzgtNGUxMi05YmY1LTdmOTBiNzdhMmYzNSIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJiMTRhODNhNS05NDhjLTQyMDgtOTUzNi02NTBiZWFhYjI2MmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2NjYzOTU1NiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2NjY0MzE1NiwiaWF0IjoxNjY2NjM5NTU2LCJlbWFpbCI6ImxhZGlib2g3ODVAbWkxNjYuY29tIn0.orGhdg1rhoD52Y5hOfr1H2ZWcfx57O_xSu-i8rZaWqQG2FrdeaoNNZ4r207uhaZF-gyuQevMkb02b4GkpMX1WaPRoS6f0OR0zNrOMXiag262G6kog6YuwiAiRasgfpGOhvOMRpwnm9zV3avqaqEI7S1B4VUl688NmwiVd0Zv6U3yuU2uyOc8Sb0wFKaQAcREydK-xNEwDTXzbsAewl3dXMA6lROQDn5ZOumVbAcZVRw1_z8DwGlsLdho_WwXHiDR_fcnFKZAXm1Jf8wJmQgT6EnmRrOIBROLv0e1uaW78nnvLKL7aWUyLr_VUlOb66AiHw0WnDUbVsDKn1nemMF2_Q"
|
|
63
63
|
};
|
|
@@ -219,7 +219,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
219
219
|
|
|
220
220
|
var loadProductsByStatus = /*#__PURE__*/function () {
|
|
221
221
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus, filter) {
|
|
222
|
-
var _ref5, ordersBydate, ordersByStatus, _ordersByStatus$total, total, _ordersByStatus$R, R, _ordersByStatus$
|
|
222
|
+
var _ref5, ordersBydate, ordersByStatus, _ordersByStatus$total, total, _ordersByStatus$R, R, _ordersByStatus$PA, PA, _ordersByStatus$Ex, Ex, inProcess, metricsArray;
|
|
223
223
|
|
|
224
224
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
225
225
|
while (1) {
|
|
@@ -242,9 +242,9 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
242
242
|
_ref5 = _context3.t0;
|
|
243
243
|
ordersBydate = _ref5.ordersBydate;
|
|
244
244
|
ordersByStatus = _ref5.ordersByStatus;
|
|
245
|
-
_ordersByStatus$total = ordersByStatus.total, total = _ordersByStatus$total === void 0 ? 0 : _ordersByStatus$total, _ordersByStatus$R = ordersByStatus.R, R = _ordersByStatus$R === void 0 ? 0 : _ordersByStatus$R, _ordersByStatus$
|
|
245
|
+
_ordersByStatus$total = ordersByStatus.total, total = _ordersByStatus$total === void 0 ? 0 : _ordersByStatus$total, _ordersByStatus$R = ordersByStatus.R, R = _ordersByStatus$R === void 0 ? 0 : _ordersByStatus$R, _ordersByStatus$PA = ordersByStatus.PA, PA = _ordersByStatus$PA === void 0 ? 0 : _ordersByStatus$PA, _ordersByStatus$Ex = ordersByStatus.Ex, Ex = _ordersByStatus$Ex === void 0 ? 0 : _ordersByStatus$Ex;
|
|
246
246
|
inProcess = Object.keys(ordersByStatus).reduce(function (prev, curr) {
|
|
247
|
-
return !["total", "
|
|
247
|
+
return !["total", "PA", "R", "Ex"].includes(curr) ? prev + ordersByStatus[curr] : prev;
|
|
248
248
|
}, 0);
|
|
249
249
|
metricsArray = [metricsData[0] ? metricsData[0] : {
|
|
250
250
|
label: "Productos totales",
|
|
@@ -261,7 +261,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
261
261
|
value: inProcess
|
|
262
262
|
}, {
|
|
263
263
|
label: "Productos terminados",
|
|
264
|
-
value:
|
|
264
|
+
value: Ex
|
|
265
265
|
});
|
|
266
266
|
setMetricsData(metricsArray);
|
|
267
267
|
setTotalCount(total);
|
package/package.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentoh-components-library",
|
|
3
|
-
"version": "21.2.
|
|
3
|
+
"version": "21.2.68",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@aws-amplify/auth": "^4.5.3",
|
|
6
6
|
"@aws-amplify/datastore": "^3.11.0",
|
|
7
7
|
"@aws-amplify/ui-react": "^2.17.0",
|
|
8
8
|
"@babel/runtime": "^7.17.2",
|
|
9
|
-
"@emotion/react": "^11.10.4",
|
|
10
|
-
"@emotion/styled": "^11.10.4",
|
|
11
|
-
"@mui/material": "^5.10.8",
|
|
12
|
-
"@mui/styled-engine-sc": "^5.10.6",
|
|
13
9
|
"@storybook/addon-postcss": "^2.0.0",
|
|
14
10
|
"@testing-library/jest-dom": "^5.11.4",
|
|
15
11
|
"@testing-library/react": "^11.1.0",
|
|
@@ -23,7 +19,6 @@
|
|
|
23
19
|
"draft-js": "^0.11.7",
|
|
24
20
|
"file-saver": "^2.0.5",
|
|
25
21
|
"js-base64": "^3.7.2",
|
|
26
|
-
"moment": "^2.29.4",
|
|
27
22
|
"prop-types": "^15.7.2",
|
|
28
23
|
"react": "^17.0.2",
|
|
29
24
|
"react-chartjs-2": "^4.0.1",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CustomSelect } from "./index";
|
|
2
|
-
import iconStar from "../../../assets/images/customSelect/starIcon.svg";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
title: "Components/molecules/CustomSelect",
|
|
@@ -9,27 +8,20 @@ export default {
|
|
|
9
8
|
const Template = (args) => <CustomSelect {...args} />;
|
|
10
9
|
export const CustomSelectDefault = Template.bind({});
|
|
11
10
|
CustomSelectDefault.args = {
|
|
12
|
-
|
|
11
|
+
selectLabel: "Todos los departamentos",
|
|
13
12
|
defaultOption: "Todos los departamentos",
|
|
14
13
|
options: [
|
|
15
14
|
{
|
|
16
|
-
id:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
name: "Mis Favoritos",
|
|
15
|
+
id: 1,
|
|
16
|
+
value: "Decoración",
|
|
17
|
+
subOptions: [
|
|
18
|
+
{ id: 1, value: "Espejos" },
|
|
19
|
+
{ id: 2, value: "Persianas" },
|
|
20
|
+
],
|
|
23
21
|
},
|
|
22
|
+
{ id: 2, value: "Eléctrico" },
|
|
23
|
+
{ id: 3, value: "Ferretería" },
|
|
24
|
+
{ id: 4, value: "Herramientas" },
|
|
25
|
+
{ id: 5, value: "Iluminación" },
|
|
24
26
|
],
|
|
25
|
-
onClickItem: (v, id) => {
|
|
26
|
-
if (v) {
|
|
27
|
-
console.log("Agregar a la lista", id);
|
|
28
|
-
} else {
|
|
29
|
-
console.log("Eliminar a la lista", id);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
icon: iconStar,
|
|
33
|
-
showSearchBar: true,
|
|
34
|
-
customOptions: <p>Esto es un customOptions</p>
|
|
35
27
|
};
|
|
@@ -7,7 +7,6 @@ export const SelecItem = ({
|
|
|
7
7
|
setParameterArray,
|
|
8
8
|
activeFilters,
|
|
9
9
|
setActiveFilters,
|
|
10
|
-
onClickItem,
|
|
11
10
|
}) => {
|
|
12
11
|
const [showSubOptions, setShowSubOptions] = useState(false);
|
|
13
12
|
const [chkGlobal, setChkGlobal] = useState(false);
|
|
@@ -18,9 +17,6 @@ export const SelecItem = ({
|
|
|
18
17
|
id={"main-item-" + option.id}
|
|
19
18
|
label={option.name}
|
|
20
19
|
onChange={(e) => {
|
|
21
|
-
if (onClickItem) {
|
|
22
|
-
onClickItem(e.target.checked, option.id)
|
|
23
|
-
}
|
|
24
20
|
const subOptions = option.subOptions;
|
|
25
21
|
const filtersCopy = { ...activeFilters };
|
|
26
22
|
if (subOptions) {
|
|
@@ -81,9 +77,6 @@ export const SelecItem = ({
|
|
|
81
77
|
activeFilters[option.name][sub.name]
|
|
82
78
|
}
|
|
83
79
|
onChange={(e) => {
|
|
84
|
-
if (onClickItem) {
|
|
85
|
-
onClickItem(e.target.checked, sub.id)
|
|
86
|
-
}
|
|
87
80
|
if (e.target.checked) {
|
|
88
81
|
setParameterArray((current) =>
|
|
89
82
|
[...current, sub.id].sort((a, b) => a - b)
|
|
@@ -2,7 +2,6 @@ import { Container } from "./styles";
|
|
|
2
2
|
import { ScreenHeader } from "../../atoms/ScreenHeader/index";
|
|
3
3
|
import { Button } from "../../atoms/GeneralButton/index";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
|
-
import { ChatPopUp } from "../../atoms/ChatPopUp/index";
|
|
6
5
|
|
|
7
6
|
export const HeaderTop = ({ setHeaderTop }) => {
|
|
8
7
|
const headerTop = useRef();
|
|
@@ -14,15 +13,12 @@ export const HeaderTop = ({ setHeaderTop }) => {
|
|
|
14
13
|
return (
|
|
15
14
|
<Container ref={headerTop}>
|
|
16
15
|
<ScreenHeader text="Edición de producto" />
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}}
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
16
|
+
<Button
|
|
17
|
+
buttonType="close-button"
|
|
18
|
+
onClick={() => {
|
|
19
|
+
window.location.href = `/products`;
|
|
20
|
+
}}
|
|
21
|
+
/>
|
|
26
22
|
</Container>
|
|
27
23
|
);
|
|
28
24
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const getFullStatus = (status) => {
|
|
2
2
|
switch (status) {
|
|
3
3
|
case "PA":
|
|
4
|
-
return "Por
|
|
4
|
+
return "Por asignar";
|
|
5
5
|
case "AS":
|
|
6
6
|
case "Assigned":
|
|
7
7
|
return "Asignado";
|
|
@@ -10,29 +10,31 @@ export const getFullStatus = (status) => {
|
|
|
10
10
|
return "Capturando";
|
|
11
11
|
case "IE":
|
|
12
12
|
case "QF":
|
|
13
|
-
return "Información
|
|
13
|
+
return "Información enviada";
|
|
14
14
|
case "RC":
|
|
15
15
|
case "RF":
|
|
16
|
-
return "Rechazado
|
|
16
|
+
return "Rechazado coordinador";
|
|
17
17
|
case "AC":
|
|
18
18
|
case "AF":
|
|
19
|
-
return "Aprobado
|
|
19
|
+
return "Aprobado coordinador";
|
|
20
20
|
case "RA":
|
|
21
|
-
return "Rechazado
|
|
21
|
+
return "Rechazado auditor";
|
|
22
22
|
case "AA":
|
|
23
|
-
return "Aprobado
|
|
23
|
+
return "Aprobado auditor";
|
|
24
24
|
case "RP":
|
|
25
|
-
return "Rechazado
|
|
25
|
+
return "Rechazado proveedor";
|
|
26
26
|
case "AP":
|
|
27
|
-
return "Aprobado
|
|
27
|
+
return "Aprobado proveedor";
|
|
28
28
|
case "RCA":
|
|
29
|
-
return "Rechazado
|
|
29
|
+
return "Rechazado cadena";
|
|
30
30
|
case "ACA":
|
|
31
|
-
return "Aprobado
|
|
31
|
+
return "Aprobado cadena";
|
|
32
32
|
case "R":
|
|
33
|
-
return "Por
|
|
33
|
+
return "Por recibir/recibido";
|
|
34
34
|
case "Ex":
|
|
35
35
|
return "Exportado";
|
|
36
|
+
case "NS":
|
|
37
|
+
return "No solicitado";
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
|
|
@@ -69,6 +71,8 @@ export const getStatusColor = (status) => {
|
|
|
69
71
|
return "#839192";
|
|
70
72
|
case "R":
|
|
71
73
|
return "#D35400";
|
|
74
|
+
case "NS":
|
|
75
|
+
return "black";
|
|
72
76
|
case "Ex":
|
|
73
77
|
return "#09CAD8";
|
|
74
78
|
default:
|
|
@@ -22,14 +22,16 @@ export const DashboardMetric = ({
|
|
|
22
22
|
}) => {
|
|
23
23
|
const labels =
|
|
24
24
|
type === "doughnut"
|
|
25
|
-
? Object.keys(dataObject).map((key) => getFullStatus(key))
|
|
25
|
+
? Object.keys(dataObject).map((key) => key !== "NS" && getFullStatus(key))
|
|
26
26
|
: Object.keys(dataObject);
|
|
27
27
|
const newObject =
|
|
28
28
|
type === "doughnut" ? removeOldStatus(dataObject) : dataObject;
|
|
29
29
|
const values = Object.values(newObject)?.length
|
|
30
30
|
? Object.values(newObject)
|
|
31
31
|
: [0];
|
|
32
|
-
const colorsArray = Object.keys(newObject).map(
|
|
32
|
+
const colorsArray = Object.keys(newObject).map(
|
|
33
|
+
(key) => key !== "NS" && getStatusColor(key)
|
|
34
|
+
);
|
|
33
35
|
|
|
34
36
|
const data = {
|
|
35
37
|
labels,
|
|
@@ -9,37 +9,37 @@ const Template = (args) => <Dashboard {...args} />;
|
|
|
9
9
|
export const DashboardDeafult = Template.bind({});
|
|
10
10
|
DashboardDeafult.args = {
|
|
11
11
|
user: {
|
|
12
|
-
id_user:
|
|
13
|
-
name: "
|
|
14
|
-
last_name: "
|
|
15
|
-
email: "
|
|
16
|
-
position: "
|
|
17
|
-
telephone:
|
|
18
|
-
country:
|
|
19
|
-
id_company:
|
|
20
|
-
id_cognito: "
|
|
12
|
+
id_user: 425,
|
|
13
|
+
name: "Auditor QA",
|
|
14
|
+
last_name: " ",
|
|
15
|
+
email: "ladiboh785@mi166.com",
|
|
16
|
+
position: "Tester",
|
|
17
|
+
telephone: null,
|
|
18
|
+
country: null,
|
|
19
|
+
id_company: 254,
|
|
20
|
+
id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
|
|
21
21
|
birth_Date: null,
|
|
22
|
-
about_me:
|
|
23
|
-
zip_code:
|
|
24
|
-
address:
|
|
25
|
-
job:
|
|
26
|
-
id_stripe:
|
|
22
|
+
about_me: null,
|
|
23
|
+
zip_code: null,
|
|
24
|
+
address: null,
|
|
25
|
+
job: null,
|
|
26
|
+
id_stripe: null,
|
|
27
27
|
id_role: 6,
|
|
28
28
|
active: 1,
|
|
29
29
|
is_retailer: 0,
|
|
30
|
-
email_notify:
|
|
30
|
+
email_notify: null,
|
|
31
31
|
membership: {
|
|
32
|
-
id:
|
|
33
|
-
start_date: "
|
|
34
|
-
end_date: "
|
|
35
|
-
planID:
|
|
36
|
-
plan: "
|
|
37
|
-
name: "Plan
|
|
38
|
-
user_limit: "
|
|
39
|
-
products_limit: "
|
|
40
|
-
type: "
|
|
32
|
+
id: 750,
|
|
33
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
34
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
35
|
+
planID: 6,
|
|
36
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
37
|
+
name: "Plan Small",
|
|
38
|
+
user_limit: "10",
|
|
39
|
+
products_limit: "1000",
|
|
40
|
+
type: "Enterprise",
|
|
41
41
|
},
|
|
42
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
42
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1666639556174",
|
|
43
43
|
},
|
|
44
|
-
jwt: "
|
|
44
|
+
jwt: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIyM2EzZjQ5Ni00ZTM4LTRlMTItOWJmNS03ZjkwYjc3YTJmMzUiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjIzYTNmNDk2LTRlMzgtNGUxMi05YmY1LTdmOTBiNzdhMmYzNSIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJiMTRhODNhNS05NDhjLTQyMDgtOTUzNi02NTBiZWFhYjI2MmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2NjYzOTU1NiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2NjY0MzE1NiwiaWF0IjoxNjY2NjM5NTU2LCJlbWFpbCI6ImxhZGlib2g3ODVAbWkxNjYuY29tIn0.orGhdg1rhoD52Y5hOfr1H2ZWcfx57O_xSu-i8rZaWqQG2FrdeaoNNZ4r207uhaZF-gyuQevMkb02b4GkpMX1WaPRoS6f0OR0zNrOMXiag262G6kog6YuwiAiRasgfpGOhvOMRpwnm9zV3avqaqEI7S1B4VUl688NmwiVd0Zv6U3yuU2uyOc8Sb0wFKaQAcREydK-xNEwDTXzbsAewl3dXMA6lROQDn5ZOumVbAcZVRw1_z8DwGlsLdho_WwXHiDR_fcnFKZAXm1Jf8wJmQgT6EnmRrOIBROLv0e1uaW78nnvLKL7aWUyLr_VUlOb66AiHw0WnDUbVsDKn1nemMF2_Q",
|
|
45
45
|
};
|