contentoh-components-library 21.2.60 → 21.2.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/molecules/HeaderTop/index.js +3 -3
- package/dist/components/organisms/DashboardMetric/index.js +4 -4
- package/dist/components/pages/Dashboard/index.js +12 -12
- package/package.json +1 -1
- package/src/components/molecules/HeaderTop/index.js +1 -1
- package/src/components/organisms/DashboardMetric/index.js +4 -2
- package/src/components/pages/Dashboard/index.js +18 -18
|
@@ -27,14 +27,14 @@ var HeaderTop = function HeaderTop(_ref) {
|
|
|
27
27
|
ref: headerTop,
|
|
28
28
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
29
29
|
text: "Edici\xF3n de producto"
|
|
30
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
31
31
|
className: "buttons-top",
|
|
32
|
-
children:
|
|
32
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Button, {
|
|
33
33
|
buttonType: "close-button",
|
|
34
34
|
onClick: function onClick() {
|
|
35
35
|
window.location.href = "/products";
|
|
36
36
|
}
|
|
37
|
-
})
|
|
37
|
+
})
|
|
38
38
|
})]
|
|
39
39
|
});
|
|
40
40
|
};
|
|
@@ -18,12 +18,12 @@ var _dashboardMetricUtils = require("./dashboardMetricUtils");
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
20
20
|
var DashboardMetric = function DashboardMetric(_ref) {
|
|
21
|
+
var _Object$values;
|
|
22
|
+
|
|
21
23
|
var label = _ref.label,
|
|
22
24
|
description = _ref.description,
|
|
23
25
|
_ref$dataObject = _ref.dataObject,
|
|
24
|
-
dataObject = _ref$dataObject === void 0 ? {
|
|
25
|
-
AA: 89
|
|
26
|
-
} : _ref$dataObject,
|
|
26
|
+
dataObject = _ref$dataObject === void 0 ? {} : _ref$dataObject,
|
|
27
27
|
_ref$indexAxis = _ref.indexAxis,
|
|
28
28
|
indexAxis = _ref$indexAxis === void 0 ? "y" : _ref$indexAxis,
|
|
29
29
|
_ref$type = _ref.type,
|
|
@@ -43,7 +43,7 @@ var DashboardMetric = function DashboardMetric(_ref) {
|
|
|
43
43
|
return (0, _dashboardMetricUtils.getFullStatus)(key);
|
|
44
44
|
}) : Object.keys(dataObject);
|
|
45
45
|
var newObject = type === "doughnut" ? (0, _dashboardMetricUtils.removeOldStatus)(dataObject) : dataObject;
|
|
46
|
-
var values = Object.values(newObject)
|
|
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
48
|
return (0, _dashboardMetricUtils.getStatusColor)(key);
|
|
49
49
|
});
|
|
@@ -301,8 +301,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
301
301
|
name: "Hoy",
|
|
302
302
|
function: function _function() {
|
|
303
303
|
return setDatesRange({
|
|
304
|
-
startDate: new Date(),
|
|
305
|
-
endDate: new Date()
|
|
304
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date()),
|
|
305
|
+
endDate: (0, _dashboardUtils.formatDate)(new Date())
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
}, {
|
|
@@ -310,8 +310,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
310
310
|
name: "Ayer",
|
|
311
311
|
function: function _function() {
|
|
312
312
|
return setDatesRange({
|
|
313
|
-
startDate: new Date(today.setDate(today.getDate() - 1)),
|
|
314
|
-
endDate: new Date()
|
|
313
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date(today.setDate(today.getDate() - 1))),
|
|
314
|
+
endDate: (0, _dashboardUtils.formatDate)(new Date())
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
}, {
|
|
@@ -319,8 +319,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
319
319
|
name: "Esta semana",
|
|
320
320
|
function: function _function() {
|
|
321
321
|
return setDatesRange({
|
|
322
|
-
startDate: new Date(today.setDate(today.getDate() - today.getDay())),
|
|
323
|
-
endDate: new Date()
|
|
322
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date(today.setDate(today.getDate() - today.getDay()))),
|
|
323
|
+
endDate: (0, _dashboardUtils.formatDate)(new Date())
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
}, {
|
|
@@ -328,8 +328,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
328
328
|
name: "La semana pasada",
|
|
329
329
|
function: function _function() {
|
|
330
330
|
return setDatesRange({
|
|
331
|
-
startDate: new Date(today.setDate(today.getDate() - today.getDay() - 7)),
|
|
332
|
-
endDate: new Date(today.setDate(today.getDate() - today.getDay() + 7))
|
|
331
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date(today.setDate(today.getDate() - today.getDay() - 7))),
|
|
332
|
+
endDate: (0, _dashboardUtils.formatDate)(new Date(today.setDate(today.getDate() - today.getDay() + 7)))
|
|
333
333
|
});
|
|
334
334
|
}
|
|
335
335
|
}, {
|
|
@@ -337,8 +337,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
337
337
|
name: "Este mes",
|
|
338
338
|
function: function _function() {
|
|
339
339
|
return setDatesRange({
|
|
340
|
-
startDate: new Date("".concat(today.getFullYear(), "-").concat(today.getMonth() + 1, "-01")),
|
|
341
|
-
endDate: today
|
|
340
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date("".concat(today.getFullYear(), "-").concat(today.getMonth() + 1, "-01"))),
|
|
341
|
+
endDate: (0, _dashboardUtils.formatDate)(today)
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
}, {
|
|
@@ -346,8 +346,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
346
346
|
name: "El mes pasado",
|
|
347
347
|
function: function _function() {
|
|
348
348
|
return setDatesRange({
|
|
349
|
-
startDate: new Date("".concat(today.getFullYear(), "-").concat(today.getMonth(), "-01")),
|
|
350
|
-
endDate: new Date("".concat(today.getFullYear(), "-").concat(today.getMonth() + 1, "-01"))
|
|
349
|
+
startDate: (0, _dashboardUtils.formatDate)(new Date("".concat(today.getFullYear(), "-").concat(today.getMonth(), "-01"))),
|
|
350
|
+
endDate: (0, _dashboardUtils.formatDate)(new Date("".concat(today.getFullYear(), "-").concat(today.getMonth() + 1, "-01")))
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
353
|
}]);
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ export const HeaderTop = ({ setHeaderTop }) => {
|
|
|
15
15
|
<Container ref={headerTop}>
|
|
16
16
|
<ScreenHeader text="Edición de producto" />
|
|
17
17
|
<div className="buttons-top">
|
|
18
|
-
<ChatPopUp />
|
|
18
|
+
{/* <ChatPopUp /> */}
|
|
19
19
|
<Button
|
|
20
20
|
buttonType="close-button"
|
|
21
21
|
onClick={() => {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
export const DashboardMetric = ({
|
|
10
10
|
label,
|
|
11
11
|
description,
|
|
12
|
-
dataObject = {
|
|
12
|
+
dataObject = {},
|
|
13
13
|
indexAxis = "y",
|
|
14
14
|
type = "bar",
|
|
15
15
|
scale = "x",
|
|
@@ -26,7 +26,9 @@ export const DashboardMetric = ({
|
|
|
26
26
|
: Object.keys(dataObject);
|
|
27
27
|
const newObject =
|
|
28
28
|
type === "doughnut" ? removeOldStatus(dataObject) : dataObject;
|
|
29
|
-
const values = Object.values(newObject)
|
|
29
|
+
const values = Object.values(newObject)?.length
|
|
30
|
+
? Object.values(newObject)
|
|
31
|
+
: [0];
|
|
30
32
|
const colorsArray = Object.keys(newObject).map((key) => getStatusColor(key));
|
|
31
33
|
|
|
32
34
|
const data = {
|
|
@@ -125,8 +125,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
125
125
|
name: "Hoy",
|
|
126
126
|
function: () =>
|
|
127
127
|
setDatesRange({
|
|
128
|
-
startDate: new Date(),
|
|
129
|
-
endDate: new Date(),
|
|
128
|
+
startDate: formatDate(new Date()),
|
|
129
|
+
endDate: formatDate(new Date()),
|
|
130
130
|
}),
|
|
131
131
|
},
|
|
132
132
|
{
|
|
@@ -134,8 +134,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
134
134
|
name: "Ayer",
|
|
135
135
|
function: () =>
|
|
136
136
|
setDatesRange({
|
|
137
|
-
startDate: new Date(today.setDate(today.getDate() - 1)),
|
|
138
|
-
endDate: new Date(),
|
|
137
|
+
startDate: formatDate(new Date(today.setDate(today.getDate() - 1))),
|
|
138
|
+
endDate: formatDate(new Date()),
|
|
139
139
|
}),
|
|
140
140
|
},
|
|
141
141
|
{
|
|
@@ -143,10 +143,10 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
143
143
|
name: "Esta semana",
|
|
144
144
|
function: () =>
|
|
145
145
|
setDatesRange({
|
|
146
|
-
startDate:
|
|
147
|
-
today.setDate(today.getDate() - today.getDay())
|
|
146
|
+
startDate: formatDate(
|
|
147
|
+
new Date(today.setDate(today.getDate() - today.getDay()))
|
|
148
148
|
),
|
|
149
|
-
endDate: new Date(),
|
|
149
|
+
endDate: formatDate(new Date()),
|
|
150
150
|
}),
|
|
151
151
|
},
|
|
152
152
|
{
|
|
@@ -154,11 +154,11 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
154
154
|
name: "La semana pasada",
|
|
155
155
|
function: () =>
|
|
156
156
|
setDatesRange({
|
|
157
|
-
startDate:
|
|
158
|
-
today.setDate(today.getDate() - today.getDay() - 7)
|
|
157
|
+
startDate: formatDate(
|
|
158
|
+
new Date(today.setDate(today.getDate() - today.getDay() - 7))
|
|
159
159
|
),
|
|
160
|
-
endDate:
|
|
161
|
-
today.setDate(today.getDate() - today.getDay() + 7)
|
|
160
|
+
endDate: formatDate(
|
|
161
|
+
new Date(today.setDate(today.getDate() - today.getDay() + 7))
|
|
162
162
|
),
|
|
163
163
|
}),
|
|
164
164
|
},
|
|
@@ -167,10 +167,10 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
167
167
|
name: "Este mes",
|
|
168
168
|
function: () =>
|
|
169
169
|
setDatesRange({
|
|
170
|
-
startDate:
|
|
171
|
-
`${today.getFullYear()}-${today.getMonth() + 1}-01`
|
|
170
|
+
startDate: formatDate(
|
|
171
|
+
new Date(`${today.getFullYear()}-${today.getMonth() + 1}-01`)
|
|
172
172
|
),
|
|
173
|
-
endDate: today,
|
|
173
|
+
endDate: formatDate(today),
|
|
174
174
|
}),
|
|
175
175
|
},
|
|
176
176
|
{
|
|
@@ -178,11 +178,11 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
178
178
|
name: "El mes pasado",
|
|
179
179
|
function: () =>
|
|
180
180
|
setDatesRange({
|
|
181
|
-
startDate:
|
|
182
|
-
`${today.getFullYear()}-${today.getMonth()}-01`
|
|
181
|
+
startDate: formatDate(
|
|
182
|
+
new Date(`${today.getFullYear()}-${today.getMonth()}-01`)
|
|
183
183
|
),
|
|
184
|
-
endDate:
|
|
185
|
-
`${today.getFullYear()}-${today.getMonth() + 1}-01`
|
|
184
|
+
endDate: formatDate(
|
|
185
|
+
new Date(`${today.getFullYear()}-${today.getMonth() + 1}-01`)
|
|
186
186
|
),
|
|
187
187
|
}),
|
|
188
188
|
},
|