contentoh-components-library 21.2.59 → 21.2.61
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 +22 -22
- package/dist/components/atoms/ChatPopUp/index.js +4 -6
- package/dist/components/atoms/Graphic/index.js +2 -1
- package/dist/components/molecules/CustomSelect/index.js +4 -1
- package/dist/components/molecules/CustomSelect/styles.js +4 -1
- package/dist/components/molecules/HeaderTop/index.js +4 -12
- package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +6 -0
- package/dist/components/organisms/DashboardMetric/index.js +3 -4
- package/dist/components/pages/Dashboard/Dashboard.stories.js +25 -25
- package/dist/components/pages/Dashboard/dashboardUtils.js +1 -1
- package/dist/components/pages/Dashboard/index.js +65 -103
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +0 -1
- package/dist/components/pages/ProviderProductEdition/index.js +2 -7
- package/package.json +1 -1
- package/src/components/atoms/ChatPopUp/index.js +4 -8
- package/src/components/atoms/Graphic/index.js +4 -1
- package/src/components/molecules/CustomSelect/index.js +11 -2
- package/src/components/molecules/CustomSelect/styles.js +3 -1
- package/src/components/molecules/HeaderTop/index.js +2 -14
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +4 -0
- package/src/components/organisms/DashboardMetric/index.js +2 -2
- package/src/components/pages/Dashboard/Dashboard.stories.js +25 -25
- package/src/components/pages/Dashboard/dashboardUtils.js +1 -1
- package/src/components/pages/Dashboard/index.js +34 -40
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +0 -1
- package/src/components/pages/ProviderProductEdition/index.js +1 -8
- package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
- package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
- package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
- package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
- package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
- package/dist/components/atoms/MenuCommercialRetailers/styles.js +0 -20
- package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
- package/dist/components/atoms/MenuProductImage/index.js +0 -88
- package/dist/components/atoms/MenuProductImage/styles.js +0 -20
- package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
- package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
- package/dist/components/molecules/ApproveRejetPanel/styles.js +0 -18
- package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +0 -28
- package/dist/components/molecules/SignInLoginCreationApp/index.js +0 -270
- package/dist/components/molecules/SignInLoginCreationApp/styles.js +0 -20
package/.env.development
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
REACT_APP_ARTICLE_DATA_ENDPOINT=https://
|
|
2
|
-
REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT=https://
|
|
3
|
-
REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT=https://
|
|
4
|
-
REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT=https://
|
|
5
|
-
REACT_APP_ARTICLE_DATA_ENDPOINT=https://
|
|
6
|
-
REACT_APP_VALID_EXPORT_ENDPOINT = https://
|
|
7
|
-
REACT_APP_SERVICES_ENDPOINT = https://
|
|
8
|
-
REACT_APP_EVALUATION_ENDPOINT = https://
|
|
9
|
-
REACT_APP_SEND_EVAL = https://
|
|
10
|
-
REACT_APP_COMMENTS_ENDPOINT = https://
|
|
11
|
-
REACT_APP_USER_ENDPOINT=https://
|
|
12
|
-
REACT_APP_ASSIGNATIONS_ENDPOINT = https://
|
|
13
|
-
REACT_APP_TASKS_ENDPOINT = https://
|
|
14
|
-
REACT_APP_USER_TASKS_ENDPOINT = https://
|
|
15
|
-
REACT_APP_CART = https://
|
|
16
|
-
REACT_APP_RETAILER_REQUEST = https://
|
|
17
|
-
REACT_APP_VERSIONS_ENDPOINT = https://
|
|
18
|
-
REACT_APP_RETAILER_ENDPOINT=https://
|
|
19
|
-
REACT_APP_READ_ORDERS_BY_STATUS=https://
|
|
20
|
-
REACT_APP_READ_REQUIRED_ORDERS=https://
|
|
21
|
-
REACT_APP_CATEGORY_ENDPOINT=https://
|
|
22
|
-
REACT_APP_READ_PROVIDERS=https://
|
|
1
|
+
REACT_APP_ARTICLE_DATA_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data
|
|
2
|
+
REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data/datasheets
|
|
3
|
+
REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data/descriptions
|
|
4
|
+
REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data/images
|
|
5
|
+
REACT_APP_ARTICLE_DATA_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data
|
|
6
|
+
REACT_APP_VALID_EXPORT_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/valid-export
|
|
7
|
+
REACT_APP_SERVICES_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/services
|
|
8
|
+
REACT_APP_EVALUATION_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/evaluations
|
|
9
|
+
REACT_APP_SEND_EVAL = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/eval-status
|
|
10
|
+
REACT_APP_COMMENTS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/comments
|
|
11
|
+
REACT_APP_USER_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/users
|
|
12
|
+
REACT_APP_ASSIGNATIONS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/assignations
|
|
13
|
+
REACT_APP_TASKS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/tasks
|
|
14
|
+
REACT_APP_USER_TASKS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/user-tasks
|
|
15
|
+
REACT_APP_CART = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/cart
|
|
16
|
+
REACT_APP_RETAILER_REQUEST = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/retailers-request
|
|
17
|
+
REACT_APP_VERSIONS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/versions
|
|
18
|
+
REACT_APP_RETAILER_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/retailers
|
|
19
|
+
REACT_APP_READ_ORDERS_BY_STATUS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/read-orders-by-status
|
|
20
|
+
REACT_APP_READ_REQUIRED_ORDERS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/read-required-orders
|
|
21
|
+
REACT_APP_CATEGORY_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/categories
|
|
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
24
|
REACT_APP_POST_MESSAGE=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat
|
|
25
25
|
REACT_APP_KEY_UPLOAD_TO_S3=AKIA5CPHLQTT46EQ5TIK
|
|
@@ -77,9 +77,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
var ChatPopUp = function ChatPopUp(_ref) {
|
|
80
|
-
var
|
|
81
|
-
chat_id_article = _ref.chat_id_article,
|
|
82
|
-
chat_version_article = _ref.chat_version_article;
|
|
80
|
+
var props = _ref.props;
|
|
83
81
|
|
|
84
82
|
var _useState = (0, _react.useState)(false),
|
|
85
83
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -124,9 +122,9 @@ var ChatPopUp = function ChatPopUp(_ref) {
|
|
|
124
122
|
nameFile: []
|
|
125
123
|
}
|
|
126
124
|
};
|
|
127
|
-
var Authorization = chat_authorization;
|
|
128
|
-
var prop_id_article = chat_id_article;
|
|
129
|
-
var prop_version_article = chat_version_article;
|
|
125
|
+
var Authorization = props.chat_authorization;
|
|
126
|
+
var prop_id_article = props.chat_id_article;
|
|
127
|
+
var prop_version_article = props.chat_version_article;
|
|
130
128
|
(0, _react.useEffect)(function () {
|
|
131
129
|
//setItems([])
|
|
132
130
|
getInitial();
|
|
@@ -32,6 +32,7 @@ var Graphic = function Graphic(_ref) {
|
|
|
32
32
|
height = _chart$chartArea.height;
|
|
33
33
|
var x = width / 2;
|
|
34
34
|
var y = height / 2 + options.fontSize * 0.68 / 2;
|
|
35
|
+
var percent = options.value.toString().includes(".") ? options.value.toFixed(2) : options.value;
|
|
35
36
|
ctx.save();
|
|
36
37
|
ctx.beginPath();
|
|
37
38
|
ctx.arc(x, height / 2, 60, 0, 2 * Math.PI);
|
|
@@ -42,7 +43,7 @@ var Graphic = function Graphic(_ref) {
|
|
|
42
43
|
ctx.font = "".concat(options.fontSize, "px ").concat(options.fontFamily);
|
|
43
44
|
ctx.textAlign = options.textAlign;
|
|
44
45
|
ctx.fillStyle = options.fontColor;
|
|
45
|
-
ctx.fillText(
|
|
46
|
+
ctx.fillText(percent + "%", x, y);
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
@@ -23,6 +23,8 @@ var _SelectItem = require("./SelectItem");
|
|
|
23
23
|
|
|
24
24
|
var _Calendar = require("../../organisms/Calendar");
|
|
25
25
|
|
|
26
|
+
var _dashboardUtils = require("../../pages/Dashboard/dashboardUtils");
|
|
27
|
+
|
|
26
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
29
|
|
|
28
30
|
var CustomSelect = function CustomSelect(_ref) {
|
|
@@ -152,12 +154,13 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
152
154
|
counter++;
|
|
153
155
|
}
|
|
154
156
|
});
|
|
155
|
-
|
|
157
|
+
setFiltersCounter(counter);
|
|
156
158
|
setFiltersString(newFiltersString);
|
|
157
159
|
}, [activeFilters]);
|
|
158
160
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
159
161
|
id: customSelectId,
|
|
160
162
|
selectLabel: selectLabel,
|
|
163
|
+
filterActive: Object.keys(activeFilters).length > 0 || customSelectId === "dates-select" && filtersString !== "Todo el tiempo",
|
|
161
164
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
162
165
|
className: "button-list",
|
|
163
166
|
onClick: function onClick() {
|
|
@@ -15,8 +15,11 @@ 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 width: fit-content;\n position: relative;\n min-width: 150px;\n\n .button-list {\n font-family: ", ";\n font-size: 13px;\n display: flex;\n padding: ", ";\n //padding: 10px 15px;\n //padding: 5px 5px;\n justify-content: space-between;\n border-radius: 50px;\n background-color:
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: fit-content;\n position: relative;\n min-width: 150px;\n\n .button-list {\n font-family: ", ";\n font-size: 13px;\n display: flex;\n padding: ", ";\n //padding: 10px 15px;\n //padding: 5px 5px;\n justify-content: space-between;\n border-radius: 50px;\n background-color: ", ";\n border: 1px solid #f0f0f0;\n cursor: pointer;\n\n & > p {\n max-width: 140px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n .arrow-item {\n transform: rotate(-90deg);\n cursor: pointer;\n font-size: 10px;\n margin-left: 10px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n\n .select-container {\n box-shadow: 0px 2px 4px #00000040;\n border-radius: 5px;\n background-color: #fff;\n padding-bottom: 10px;\n position: absolute;\n z-index: 10;\n .search-bar-filter {\n display: flex;\n align-items: center;\n border: 1px solid #f0f0f0;\n padding-left: 10px;\n\n img {\n width: 15px;\n height: 15px;\n }\n\n input {\n background-color: transparent;\n padding: 10px 10px;\n outline: none;\n border: none;\n }\n }\n .default-option {\n padding-top: 5px;\n cursor: pointer;\n padding: 5px 10px;\n color: #817393;\n font-family: Avenir Next;\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n &:hover {\n background-color: #f0f0f0;\n }\n }\n .filters-container {\n overflow: auto;\n max-height: 500px;\n .option-container,\n .default-option {\n cursor: pointer;\n padding: 5px 10px;\n .main-item {\n display: flex;\n justify-content: space-between;\n\n .arrow-item {\n transform: rotate(-90deg);\n cursor: pointer;\n font-size: 10px;\n }\n }\n .sub-menu {\n margin-top: 10px;\n padding-left: 20px;\n .sub-filter {\n & + * {\n margin-top: 10px;\n }\n }\n }\n\n &:hover {\n background-color: #f0f0f0;\n }\n label {\n white-space: nowrap;\n }\n }\n\n .dates-select-item {\n cursor: pointer;\n padding: 5px 10px;\n color: #817393;\n font-family: Avenir Next;\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n &:hover {\n background-color: #f0f0f0;\n }\n }\n }\n }\n"])), _variables.FontFamily.Raleway, function (props) {
|
|
19
19
|
return props.selectLabel !== "" ? "10px 15px" : "5px 5px";
|
|
20
|
+
}, function (_ref) {
|
|
21
|
+
var filterActive = _ref.filterActive;
|
|
22
|
+
return filterActive ? "#F7F7FC" : "#fff";
|
|
20
23
|
});
|
|
21
24
|
|
|
22
25
|
exports.Container = Container;
|
|
@@ -18,11 +18,7 @@ var _index3 = require("../../atoms/ChatPopUp/index");
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
20
20
|
var HeaderTop = function HeaderTop(_ref) {
|
|
21
|
-
var setHeaderTop = _ref.setHeaderTop
|
|
22
|
-
chat_authorization = _ref.chat_authorization,
|
|
23
|
-
chat_id_article = _ref.chat_id_article,
|
|
24
|
-
chat_version_article = _ref.chat_version_article,
|
|
25
|
-
trueTHD = _ref.trueTHD;
|
|
21
|
+
var setHeaderTop = _ref.setHeaderTop;
|
|
26
22
|
var headerTop = (0, _react.useRef)();
|
|
27
23
|
(0, _react.useEffect)(function () {
|
|
28
24
|
setHeaderTop && setHeaderTop(headerTop.current.clientHeight);
|
|
@@ -31,18 +27,14 @@ var HeaderTop = function HeaderTop(_ref) {
|
|
|
31
27
|
ref: headerTop,
|
|
32
28
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
33
29
|
text: "Edici\xF3n de producto"
|
|
34
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
35
31
|
className: "buttons-top",
|
|
36
|
-
children:
|
|
37
|
-
chat_authorization: chat_authorization,
|
|
38
|
-
chat_id_article: chat_id_article,
|
|
39
|
-
chat_version_article: chat_version_article
|
|
40
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Button, {
|
|
32
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Button, {
|
|
41
33
|
buttonType: "close-button",
|
|
42
34
|
onClick: function onClick() {
|
|
43
35
|
window.location.href = "/products";
|
|
44
36
|
}
|
|
45
|
-
})
|
|
37
|
+
})
|
|
46
38
|
})]
|
|
47
39
|
});
|
|
48
40
|
};
|
|
@@ -50,6 +50,9 @@ var getFullStatus = function getFullStatus(status) {
|
|
|
50
50
|
|
|
51
51
|
case "R":
|
|
52
52
|
return "Por Recibir/Recibido";
|
|
53
|
+
|
|
54
|
+
case "Ex":
|
|
55
|
+
return "Exportado";
|
|
53
56
|
}
|
|
54
57
|
};
|
|
55
58
|
|
|
@@ -101,6 +104,9 @@ var getStatusColor = function getStatusColor(status) {
|
|
|
101
104
|
case "R":
|
|
102
105
|
return "#D35400";
|
|
103
106
|
|
|
107
|
+
case "Ex":
|
|
108
|
+
return "#09CAD8";
|
|
109
|
+
|
|
104
110
|
default:
|
|
105
111
|
return "white";
|
|
106
112
|
}
|
|
@@ -15,8 +15,6 @@ var _Graphic = require("../../atoms/Graphic");
|
|
|
15
15
|
|
|
16
16
|
var _dashboardMetricUtils = require("./dashboardMetricUtils");
|
|
17
17
|
|
|
18
|
-
var _variables = require("../../../global-files/variables");
|
|
19
|
-
|
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
19
|
|
|
22
20
|
var DashboardMetric = function DashboardMetric(_ref) {
|
|
@@ -39,7 +37,8 @@ var DashboardMetric = function DashboardMetric(_ref) {
|
|
|
39
37
|
_ref$showPercent = _ref.showPercent,
|
|
40
38
|
showPercent = _ref$showPercent === void 0 ? false : _ref$showPercent,
|
|
41
39
|
borderColor = _ref.borderColor,
|
|
42
|
-
total = _ref.total
|
|
40
|
+
total = _ref.total,
|
|
41
|
+
totalFiltered = _ref.totalFiltered;
|
|
43
42
|
var labels = type === "doughnut" ? Object.keys(dataObject).map(function (key) {
|
|
44
43
|
return (0, _dashboardMetricUtils.getFullStatus)(key);
|
|
45
44
|
}) : Object.keys(dataObject);
|
|
@@ -97,7 +96,7 @@ var DashboardMetric = function DashboardMetric(_ref) {
|
|
|
97
96
|
fontSize: 25,
|
|
98
97
|
fontColor: "#707070",
|
|
99
98
|
textAlign: "center",
|
|
100
|
-
value: total || 0
|
|
99
|
+
value: totalFiltered / total * 100 || 0
|
|
101
100
|
}
|
|
102
101
|
},
|
|
103
102
|
scales: (0, _defineProperty2.default)({}, scale, {
|
|
@@ -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: "
|
|
30
|
+
id_user: 30,
|
|
31
|
+
name: "Admin",
|
|
32
|
+
last_name: "Ulises",
|
|
33
|
+
email: "salmeron.5@hotmail.com",
|
|
34
|
+
position: "Admin",
|
|
35
|
+
telephone: "",
|
|
36
36
|
country: "México",
|
|
37
|
-
id_company:
|
|
38
|
-
id_cognito: "
|
|
37
|
+
id_company: 2,
|
|
38
|
+
id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
|
|
39
39
|
birth_Date: null,
|
|
40
|
-
about_me:
|
|
41
|
-
zip_code:
|
|
42
|
-
address:
|
|
43
|
-
job:
|
|
44
|
-
id_stripe: "
|
|
45
|
-
id_role:
|
|
40
|
+
about_me: "",
|
|
41
|
+
zip_code: "",
|
|
42
|
+
address: "",
|
|
43
|
+
job: "",
|
|
44
|
+
id_stripe: "",
|
|
45
|
+
id_role: 6,
|
|
46
46
|
active: 1,
|
|
47
47
|
is_retailer: 0,
|
|
48
48
|
email_notify: 1,
|
|
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: 2,
|
|
51
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
52
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
53
|
+
planID: 1,
|
|
54
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
55
|
+
name: "Plan Free",
|
|
56
|
+
user_limit: "1",
|
|
57
|
+
products_limit: "3",
|
|
58
|
+
type: "PyMES"
|
|
59
59
|
},
|
|
60
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
60
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1666294798400"
|
|
61
61
|
},
|
|
62
|
-
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
62
|
+
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6ImJmODBhZmM4LTVjMWMtNDJmNi1hY2RhLTg0M2I1NDg3OWExZSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjY2Mjk0Nzk2LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjY2Mjk4Mzk2LCJpYXQiOjE2NjYyOTQ3OTYsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.RHigufdS172zrKNRuSKB9AALBvpHW2_xkHKMIVl5o4UtwiLOFyCI2gtdHDb7pgXxJH1Lk5n4OyNIiD6rta40o-eq7oY5unlUI38UVO0f8VXvjkvoi2CQ3J6JdNCZVzSzpT29vk0qvT39HFKVKfru4UxjTbPvVX77yZZ_QYoQvZ6gTjhzcvQslBSlQHh-RDAIwI9jbcePBDLIExbt_fq7Q6T5WdhnXkam8xBavF-3c3tVK9SjCAD_Y2gQhVmnAO5Co2Mqh59XfdT6uwNLTtwWd3aK5YX1thWW_oACfKBWAvLMSoYO3mjiXGWzKKLe7uNSvv92VhpLUeoYnVfrtafXAg"
|
|
63
63
|
};
|
|
@@ -136,7 +136,7 @@ var formatDate = function formatDate(date) {
|
|
|
136
136
|
var year = newDate.getFullYear();
|
|
137
137
|
var month = newDate.getMonth() + 1;
|
|
138
138
|
var day = newDate.getDate();
|
|
139
|
-
return "".concat(year, "
|
|
139
|
+
return "".concat(year, "/").concat(month, "/").concat(day);
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
exports.formatDate = formatDate;
|
|
@@ -32,6 +32,8 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
32
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
33
|
|
|
34
34
|
var Dashboard = function Dashboard(_ref) {
|
|
35
|
+
var _metricsData$;
|
|
36
|
+
|
|
35
37
|
var jwt = _ref.jwt,
|
|
36
38
|
user = _ref.user,
|
|
37
39
|
company = _ref.company;
|
|
@@ -105,8 +107,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
105
107
|
setCompanyId = _useState24[1];
|
|
106
108
|
|
|
107
109
|
var _useState25 = (0, _react.useState)({
|
|
108
|
-
startDate: new Date("1900-01-01"),
|
|
109
|
-
endDate: new Date()
|
|
110
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date("1900-01-01")),
|
|
111
|
+
endDate: (0, _dashboardUtils.formatDate)(new Date())
|
|
110
112
|
}),
|
|
111
113
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
112
114
|
datesRange = _useState26[0],
|
|
@@ -137,48 +139,41 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
137
139
|
|
|
138
140
|
var loadProductVersions = /*#__PURE__*/function () {
|
|
139
141
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(queryObject) {
|
|
140
|
-
var
|
|
141
|
-
keys,
|
|
142
|
-
string,
|
|
143
|
-
query,
|
|
144
|
-
endpoint,
|
|
145
|
-
response,
|
|
146
|
-
_args = arguments;
|
|
142
|
+
var keys, string, query, endpoint, response;
|
|
147
143
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
148
144
|
while (1) {
|
|
149
145
|
switch (_context.prev = _context.next) {
|
|
150
146
|
case 0:
|
|
151
|
-
byStatus = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
|
|
152
147
|
keys = Object.keys(queryObject);
|
|
153
148
|
string = [];
|
|
154
149
|
keys.forEach(function (key) {
|
|
155
150
|
return string.push("".concat(key, "=").concat(queryObject[key]));
|
|
156
151
|
});
|
|
157
152
|
query = string.join("&");
|
|
158
|
-
endpoint =
|
|
159
|
-
_context.prev =
|
|
160
|
-
_context.next =
|
|
153
|
+
endpoint = process.env.REACT_APP_READ_ORDERS_BY_STATUS;
|
|
154
|
+
_context.prev = 5;
|
|
155
|
+
_context.next = 8;
|
|
161
156
|
return _axios.default.get("".concat(endpoint, "?").concat(query), {
|
|
162
157
|
headers: {
|
|
163
158
|
Authorization: jwt
|
|
164
159
|
}
|
|
165
160
|
});
|
|
166
161
|
|
|
167
|
-
case
|
|
162
|
+
case 8:
|
|
168
163
|
response = _context.sent;
|
|
169
|
-
return _context.abrupt("return", JSON.parse(response.data.body));
|
|
164
|
+
return _context.abrupt("return", JSON.parse(response.data.body).data);
|
|
170
165
|
|
|
171
|
-
case
|
|
172
|
-
_context.prev =
|
|
173
|
-
_context.t0 = _context["catch"](
|
|
166
|
+
case 12:
|
|
167
|
+
_context.prev = 12;
|
|
168
|
+
_context.t0 = _context["catch"](5);
|
|
174
169
|
console.log(_context.t0);
|
|
175
170
|
|
|
176
|
-
case
|
|
171
|
+
case 15:
|
|
177
172
|
case "end":
|
|
178
173
|
return _context.stop();
|
|
179
174
|
}
|
|
180
175
|
}
|
|
181
|
-
}, _callee, null, [[
|
|
176
|
+
}, _callee, null, [[5, 12]]);
|
|
182
177
|
}));
|
|
183
178
|
|
|
184
179
|
return function loadProductVersions(_x) {
|
|
@@ -223,15 +218,15 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
223
218
|
}();
|
|
224
219
|
|
|
225
220
|
var loadProductsByStatus = /*#__PURE__*/function () {
|
|
226
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus) {
|
|
227
|
-
var _ref5,
|
|
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$ACA, ACA, _ordersByStatus$PA, PA, inProcess, metricsArray;
|
|
228
223
|
|
|
229
224
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
230
225
|
while (1) {
|
|
231
226
|
switch (_context3.prev = _context3.next) {
|
|
232
227
|
case 0:
|
|
233
228
|
_context3.next = 2;
|
|
234
|
-
return loadProductVersions(orderByStatus
|
|
229
|
+
return loadProductVersions(orderByStatus);
|
|
235
230
|
|
|
236
231
|
case 2:
|
|
237
232
|
_context3.t0 = _context3.sent;
|
|
@@ -245,20 +240,19 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
245
240
|
|
|
246
241
|
case 5:
|
|
247
242
|
_ref5 = _context3.t0;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
_orders$total = orders.total, total = _orders$total === void 0 ? 0 : _orders$total, _orders$R = orders.R, R = _orders$R === void 0 ? 0 : _orders$R, _orders$ACA = orders.ACA, ACA = _orders$ACA === void 0 ? 0 : _orders$ACA, _orders$PA = orders.PA, PA = _orders$PA === void 0 ? 0 : _orders$PA;
|
|
256
|
-
inProcess = Object.keys(orders).reduce(function (prev, curr) {
|
|
257
|
-
return !["total", "ACA", "PA", "R"].includes(curr) ? prev + orders[curr] : prev;
|
|
243
|
+
ordersBydate = _ref5.ordersBydate;
|
|
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$ACA = ordersByStatus.ACA, ACA = _ordersByStatus$ACA === void 0 ? 0 : _ordersByStatus$ACA, _ordersByStatus$PA = ordersByStatus.PA, PA = _ordersByStatus$PA === void 0 ? 0 : _ordersByStatus$PA;
|
|
246
|
+
inProcess = Object.keys(ordersByStatus).reduce(function (prev, curr) {
|
|
247
|
+
return !["total", "ACA", "PA", "R"].includes(curr) ? prev + ordersByStatus[curr] : prev;
|
|
258
248
|
}, 0);
|
|
259
|
-
|
|
249
|
+
metricsArray = [metricsData[0] ? metricsData[0] : {
|
|
260
250
|
label: "Productos totales",
|
|
261
251
|
value: total
|
|
252
|
+
}];
|
|
253
|
+
metricsArray.push({
|
|
254
|
+
label: "Productos filtrados",
|
|
255
|
+
value: total
|
|
262
256
|
}, {
|
|
263
257
|
label: "Productos sin asignar",
|
|
264
258
|
value: PA + R
|
|
@@ -268,12 +262,14 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
268
262
|
}, {
|
|
269
263
|
label: "Productos terminados",
|
|
270
264
|
value: ACA
|
|
271
|
-
}
|
|
265
|
+
});
|
|
266
|
+
setMetricsData(metricsArray);
|
|
272
267
|
setTotalCount(total);
|
|
273
|
-
delete
|
|
274
|
-
|
|
268
|
+
delete ordersByStatus.total;
|
|
269
|
+
setRequiredProducts(ordersBydate);
|
|
270
|
+
setProductsByStatus(ordersByStatus);
|
|
275
271
|
|
|
276
|
-
case
|
|
272
|
+
case 17:
|
|
277
273
|
case "end":
|
|
278
274
|
return _context3.stop();
|
|
279
275
|
}
|
|
@@ -281,40 +277,11 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
281
277
|
}, _callee3);
|
|
282
278
|
}));
|
|
283
279
|
|
|
284
|
-
return function loadProductsByStatus(_x2) {
|
|
280
|
+
return function loadProductsByStatus(_x2, _x3) {
|
|
285
281
|
return _ref4.apply(this, arguments);
|
|
286
282
|
};
|
|
287
283
|
}();
|
|
288
284
|
|
|
289
|
-
var loadRequiredProducts = /*#__PURE__*/function () {
|
|
290
|
-
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(orderByRequired) {
|
|
291
|
-
var _yield$loadProductVer, dates;
|
|
292
|
-
|
|
293
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
294
|
-
while (1) {
|
|
295
|
-
switch (_context4.prev = _context4.next) {
|
|
296
|
-
case 0:
|
|
297
|
-
_context4.next = 2;
|
|
298
|
-
return loadProductVersions(orderByRequired);
|
|
299
|
-
|
|
300
|
-
case 2:
|
|
301
|
-
_yield$loadProductVer = _context4.sent;
|
|
302
|
-
dates = _yield$loadProductVer.dates;
|
|
303
|
-
setRequiredProducts(dates);
|
|
304
|
-
|
|
305
|
-
case 5:
|
|
306
|
-
case "end":
|
|
307
|
-
return _context4.stop();
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}, _callee4);
|
|
311
|
-
}));
|
|
312
|
-
|
|
313
|
-
return function loadRequiredProducts(_x3) {
|
|
314
|
-
return _ref6.apply(this, arguments);
|
|
315
|
-
};
|
|
316
|
-
}();
|
|
317
|
-
|
|
318
285
|
var datesSelect = function datesSelect() {
|
|
319
286
|
var today = new Date();
|
|
320
287
|
setDateOptions([{
|
|
@@ -325,8 +292,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
325
292
|
name: "Todo el tiempo",
|
|
326
293
|
function: function _function() {
|
|
327
294
|
return setDatesRange({
|
|
328
|
-
startDate: new Date("1900-01-01"),
|
|
329
|
-
endDate: new Date()
|
|
295
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date("1900-01-01")),
|
|
296
|
+
endDate: (0, _dashboardUtils.formatDate)(new Date())
|
|
330
297
|
});
|
|
331
298
|
}
|
|
332
299
|
}, {
|
|
@@ -386,34 +353,34 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
386
353
|
}]);
|
|
387
354
|
};
|
|
388
355
|
|
|
389
|
-
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
356
|
+
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
390
357
|
var today, startDate, endDate, queryObject;
|
|
391
|
-
return _regenerator.default.wrap(function
|
|
358
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
392
359
|
while (1) {
|
|
393
|
-
switch (
|
|
360
|
+
switch (_context4.prev = _context4.next) {
|
|
394
361
|
case 0:
|
|
395
|
-
|
|
396
|
-
|
|
362
|
+
_context4.t0 = setProviders;
|
|
363
|
+
_context4.next = 3;
|
|
397
364
|
return (0, _dashboardUtils.getProviders)(jwt, user);
|
|
398
365
|
|
|
399
366
|
case 3:
|
|
400
|
-
|
|
401
|
-
(0,
|
|
402
|
-
|
|
403
|
-
|
|
367
|
+
_context4.t1 = _context4.sent;
|
|
368
|
+
(0, _context4.t0)(_context4.t1);
|
|
369
|
+
_context4.t2 = setCategories;
|
|
370
|
+
_context4.next = 8;
|
|
404
371
|
return (0, _dashboardUtils.getCategories)(user, company);
|
|
405
372
|
|
|
406
373
|
case 8:
|
|
407
|
-
|
|
408
|
-
(0,
|
|
409
|
-
|
|
374
|
+
_context4.t3 = _context4.sent;
|
|
375
|
+
(0, _context4.t2)(_context4.t3);
|
|
376
|
+
_context4.next = 12;
|
|
410
377
|
return getRetailers();
|
|
411
378
|
|
|
412
379
|
case 12:
|
|
413
380
|
datesSelect();
|
|
414
381
|
today = new Date();
|
|
415
|
-
startDate = "1900-01-01";
|
|
416
|
-
endDate =
|
|
382
|
+
startDate = (0, _dashboardUtils.formatDate)("1900-01-01");
|
|
383
|
+
endDate = (0, _dashboardUtils.formatDate)(today);
|
|
417
384
|
queryObject = {
|
|
418
385
|
startDate: startDate,
|
|
419
386
|
endDate: endDate
|
|
@@ -425,46 +392,41 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
425
392
|
setOrderByStatus(queryObject);
|
|
426
393
|
setOrderByRequired(queryObject);
|
|
427
394
|
loadProductsByStatus(queryObject);
|
|
428
|
-
loadRequiredProducts(queryObject);
|
|
429
395
|
|
|
430
|
-
case
|
|
396
|
+
case 21:
|
|
431
397
|
case "end":
|
|
432
|
-
return
|
|
398
|
+
return _context4.stop();
|
|
433
399
|
}
|
|
434
400
|
}
|
|
435
|
-
},
|
|
401
|
+
}, _callee4);
|
|
436
402
|
})), []);
|
|
437
403
|
(0, _react.useEffect)(function () {
|
|
438
404
|
(orderByRequired === null || orderByRequired === void 0 ? void 0 : orderByRequired.startDate) && (orderByStatus === null || orderByStatus === void 0 ? void 0 : orderByStatus.endDate) && metricsData.length > 0 && setLoading(false);
|
|
439
405
|
}, [orderByRequired, orderByStatus, metricsData]);
|
|
440
|
-
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
406
|
+
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
441
407
|
var startDate, endDate, queryObject;
|
|
442
|
-
return _regenerator.default.wrap(function
|
|
408
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
443
409
|
while (1) {
|
|
444
|
-
switch (
|
|
410
|
+
switch (_context5.prev = _context5.next) {
|
|
445
411
|
case 0:
|
|
446
412
|
startDate = datesRange.startDate, endDate = datesRange.endDate;
|
|
447
413
|
queryObject = {
|
|
448
|
-
startDate:
|
|
449
|
-
endDate:
|
|
414
|
+
startDate: startDate,
|
|
415
|
+
endDate: endDate
|
|
450
416
|
};
|
|
451
417
|
companyId.length > 0 && (queryObject["companyId"] = companyId.join(","));
|
|
452
418
|
retailerId.length > 0 && (queryObject["retailerId"] = retailerId.join(","));
|
|
453
419
|
categoryId.length > 0 && (queryObject["categoryId"] = categoryId.join(","));
|
|
454
420
|
applicantsFilter.length > 0 && (queryObject["requestedBy"] = applicantsFilter.join(","));
|
|
455
|
-
|
|
456
|
-
return loadProductsByStatus(queryObject);
|
|
421
|
+
_context5.next = 8;
|
|
422
|
+
return loadProductsByStatus(queryObject, true);
|
|
457
423
|
|
|
458
424
|
case 8:
|
|
459
|
-
_context6.next = 10;
|
|
460
|
-
return loadRequiredProducts(queryObject);
|
|
461
|
-
|
|
462
|
-
case 10:
|
|
463
425
|
case "end":
|
|
464
|
-
return
|
|
426
|
+
return _context5.stop();
|
|
465
427
|
}
|
|
466
428
|
}
|
|
467
|
-
},
|
|
429
|
+
}, _callee5);
|
|
468
430
|
})), [companyId, retailerId, categoryId, datesRange, applicantsFilter]);
|
|
469
431
|
return loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
470
432
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -540,7 +502,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
540
502
|
displayLegend: true,
|
|
541
503
|
showPercent: true,
|
|
542
504
|
displayScale: false,
|
|
543
|
-
|
|
505
|
+
totalFiltered: totalCount,
|
|
506
|
+
total: (_metricsData$ = metricsData[0]) === null || _metricsData$ === void 0 ? void 0 : _metricsData$.value
|
|
544
507
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DashboardMetric.DashboardMetric, {
|
|
545
508
|
label: "Productos solicitados",
|
|
546
509
|
description: "Filtra los productos solicitados por fecha y alcance para revisar rápidamente el flujo de trabajo.",
|
|
@@ -551,7 +514,6 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
551
514
|
retailerSelected: orderByRequired.retailerId,
|
|
552
515
|
queryObject: orderByRequired,
|
|
553
516
|
setQueryObject: function setQueryObject(evt) {
|
|
554
|
-
loadRequiredProducts(evt);
|
|
555
517
|
setOrderByRequired(evt);
|
|
556
518
|
},
|
|
557
519
|
borderColor: "#3B1366"
|
|
@@ -26,7 +26,6 @@ var Template = function Template(args) {
|
|
|
26
26
|
var ProviderProductEditionDefault = Template.bind({});
|
|
27
27
|
exports.ProviderProductEditionDefault = ProviderProductEditionDefault;
|
|
28
28
|
ProviderProductEditionDefault.args = {
|
|
29
|
-
trueTHD: true,
|
|
30
29
|
tabsSections: {
|
|
31
30
|
Descripción: true,
|
|
32
31
|
"Ficha técnica": true,
|