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
|
@@ -229,8 +229,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
229
229
|
revision = _ref$revision === void 0 ? false : _ref$revision,
|
|
230
230
|
setShowContentohRequestModal = _ref.setShowContentohRequestModal,
|
|
231
231
|
showSurvey = _ref.showSurvey,
|
|
232
|
-
company = _ref.company
|
|
233
|
-
trueTHD = _ref.trueTHD;
|
|
232
|
+
company = _ref.company;
|
|
234
233
|
|
|
235
234
|
var _useState = (0, _react.useState)("Descripción"),
|
|
236
235
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -1698,11 +1697,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1698
1697
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1699
1698
|
headerTop: headerTop,
|
|
1700
1699
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
1701
|
-
setHeaderTop: setHeaderTop
|
|
1702
|
-
chat_authorization: token,
|
|
1703
|
-
chat_id_article: product.id_article,
|
|
1704
|
-
chat_version_article: version,
|
|
1705
|
-
trueTHD: trueTHD
|
|
1700
|
+
setHeaderTop: setHeaderTop
|
|
1706
1701
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1707
1702
|
className: "data-container",
|
|
1708
1703
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
package/package.json
CHANGED
|
@@ -34,11 +34,7 @@ const myBucket = new AWS.S3({
|
|
|
34
34
|
region: REGION,
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
export const ChatPopUp = ({
|
|
38
|
-
chat_authorization,
|
|
39
|
-
chat_id_article,
|
|
40
|
-
chat_version_article,
|
|
41
|
-
}) => {
|
|
37
|
+
export const ChatPopUp = ({ props }) => {
|
|
42
38
|
const [showMenu, setShowMenu] = useState(false);
|
|
43
39
|
const [items, setItems] = useState(); // items que vienen de la BD
|
|
44
40
|
const [customItems, setCustomItems] = useState([]); // JSX acorde al tipo de los items
|
|
@@ -47,9 +43,9 @@ export const ChatPopUp = ({
|
|
|
47
43
|
const [processUpdateID, setProcessUpdateID] = useState();
|
|
48
44
|
const [countUpdate, setCountUpdate] = useState(0);
|
|
49
45
|
let arrayIMG = { data: { ext: [], nameFile: [] } };
|
|
50
|
-
const Authorization = chat_authorization;
|
|
51
|
-
const prop_id_article = chat_id_article;
|
|
52
|
-
const prop_version_article = chat_version_article;
|
|
46
|
+
const Authorization = props.chat_authorization;
|
|
47
|
+
const prop_id_article = props.chat_id_article;
|
|
48
|
+
const prop_version_article = props.chat_version_article;
|
|
53
49
|
|
|
54
50
|
useEffect(() => {
|
|
55
51
|
//setItems([])
|
|
@@ -13,6 +13,9 @@ export const Graphic = ({ data, type, options }) => {
|
|
|
13
13
|
} = chart;
|
|
14
14
|
const x = width / 2;
|
|
15
15
|
const y = height / 2 + (options.fontSize * 0.68) / 2;
|
|
16
|
+
const percent = options.value.toString().includes(".")
|
|
17
|
+
? options.value.toFixed(2)
|
|
18
|
+
: options.value;
|
|
16
19
|
ctx.save();
|
|
17
20
|
ctx.beginPath();
|
|
18
21
|
ctx.arc(x, height / 2, 60, 0, 2 * Math.PI);
|
|
@@ -23,7 +26,7 @@ export const Graphic = ({ data, type, options }) => {
|
|
|
23
26
|
ctx.font = `${options.fontSize}px ${options.fontFamily}`;
|
|
24
27
|
ctx.textAlign = options.textAlign;
|
|
25
28
|
ctx.fillStyle = options.fontColor;
|
|
26
|
-
ctx.fillText(
|
|
29
|
+
ctx.fillText(percent + "%", x, y);
|
|
27
30
|
},
|
|
28
31
|
};
|
|
29
32
|
|
|
@@ -4,6 +4,7 @@ import searchIcon from "../../../assets/images/customSelect/searchIcon.png";
|
|
|
4
4
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
5
5
|
import { SelecItem } from "./SelectItem";
|
|
6
6
|
import { Calendar } from "../../organisms/Calendar";
|
|
7
|
+
import { formatDate } from "../../pages/Dashboard/dashboardUtils";
|
|
7
8
|
|
|
8
9
|
export const CustomSelect = ({
|
|
9
10
|
options,
|
|
@@ -94,12 +95,20 @@ export const CustomSelect = ({
|
|
|
94
95
|
counter++;
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
|
-
|
|
98
|
+
setFiltersCounter(counter);
|
|
98
99
|
setFiltersString(newFiltersString);
|
|
99
100
|
}, [activeFilters]);
|
|
100
101
|
|
|
101
102
|
return (
|
|
102
|
-
<Container
|
|
103
|
+
<Container
|
|
104
|
+
id={customSelectId}
|
|
105
|
+
selectLabel={selectLabel}
|
|
106
|
+
filterActive={
|
|
107
|
+
Object.keys(activeFilters).length > 0 ||
|
|
108
|
+
(customSelectId === "dates-select" &&
|
|
109
|
+
filtersString !== "Todo el tiempo")
|
|
110
|
+
}
|
|
111
|
+
>
|
|
103
112
|
<div className="button-list" onClick={() => setShowList(!showList)}>
|
|
104
113
|
<p>{filtersString} </p>
|
|
105
114
|
<p>{filtersCounter > 0 && `+${filtersCounter}`}</p>
|
|
@@ -15,7 +15,8 @@ export const Container = styled.div`
|
|
|
15
15
|
//padding: 5px 5px;
|
|
16
16
|
justify-content: space-between;
|
|
17
17
|
border-radius: 50px;
|
|
18
|
-
background-color:
|
|
18
|
+
background-color: ${({ filterActive }) =>
|
|
19
|
+
filterActive ? "#F7F7FC" : "#fff"};
|
|
19
20
|
border: 1px solid #f0f0f0;
|
|
20
21
|
cursor: pointer;
|
|
21
22
|
|
|
@@ -93,6 +94,7 @@ export const Container = styled.div`
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
.sub-menu {
|
|
97
|
+
margin-top: 10px;
|
|
96
98
|
padding-left: 20px;
|
|
97
99
|
.sub-filter {
|
|
98
100
|
& + * {
|
|
@@ -4,13 +4,7 @@ import { Button } from "../../atoms/GeneralButton/index";
|
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
5
|
import { ChatPopUp } from "../../atoms/ChatPopUp/index";
|
|
6
6
|
|
|
7
|
-
export const HeaderTop = ({
|
|
8
|
-
setHeaderTop,
|
|
9
|
-
chat_authorization,
|
|
10
|
-
chat_id_article,
|
|
11
|
-
chat_version_article,
|
|
12
|
-
trueTHD,
|
|
13
|
-
}) => {
|
|
7
|
+
export const HeaderTop = ({ setHeaderTop }) => {
|
|
14
8
|
const headerTop = useRef();
|
|
15
9
|
|
|
16
10
|
useEffect(() => {
|
|
@@ -21,13 +15,7 @@ export const HeaderTop = ({
|
|
|
21
15
|
<Container ref={headerTop}>
|
|
22
16
|
<ScreenHeader text="Edición de producto" />
|
|
23
17
|
<div className="buttons-top">
|
|
24
|
-
{
|
|
25
|
-
<ChatPopUp
|
|
26
|
-
chat_authorization={chat_authorization}
|
|
27
|
-
chat_id_article={chat_id_article}
|
|
28
|
-
chat_version_article={chat_version_article}
|
|
29
|
-
/>
|
|
30
|
-
)}
|
|
18
|
+
{/* <ChatPopUp /> */}
|
|
31
19
|
<Button
|
|
32
20
|
buttonType="close-button"
|
|
33
21
|
onClick={() => {
|
|
@@ -31,6 +31,8 @@ export const getFullStatus = (status) => {
|
|
|
31
31
|
return "Aprobado Cadena";
|
|
32
32
|
case "R":
|
|
33
33
|
return "Por Recibir/Recibido";
|
|
34
|
+
case "Ex":
|
|
35
|
+
return "Exportado";
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
38
|
|
|
@@ -67,6 +69,8 @@ export const getStatusColor = (status) => {
|
|
|
67
69
|
return "#839192";
|
|
68
70
|
case "R":
|
|
69
71
|
return "#D35400";
|
|
72
|
+
case "Ex":
|
|
73
|
+
return "#09CAD8";
|
|
70
74
|
default:
|
|
71
75
|
return "white";
|
|
72
76
|
}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
removeOldStatus,
|
|
6
6
|
getStatusColor,
|
|
7
7
|
} from "./dashboardMetricUtils";
|
|
8
|
-
import { FontFamily } from "../../../global-files/variables";
|
|
9
8
|
|
|
10
9
|
export const DashboardMetric = ({
|
|
11
10
|
label,
|
|
@@ -19,6 +18,7 @@ export const DashboardMetric = ({
|
|
|
19
18
|
showPercent = false,
|
|
20
19
|
borderColor,
|
|
21
20
|
total,
|
|
21
|
+
totalFiltered,
|
|
22
22
|
}) => {
|
|
23
23
|
const labels =
|
|
24
24
|
type === "doughnut"
|
|
@@ -80,7 +80,7 @@ export const DashboardMetric = ({
|
|
|
80
80
|
fontSize: 25,
|
|
81
81
|
fontColor: "#707070",
|
|
82
82
|
textAlign: "center",
|
|
83
|
-
value: total || 0,
|
|
83
|
+
value: (totalFiltered / total) * 100 || 0,
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
scales: {
|
|
@@ -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: "
|
|
12
|
+
id_user: 30,
|
|
13
|
+
name: "Admin",
|
|
14
|
+
last_name: "Ulises",
|
|
15
|
+
email: "salmeron.5@hotmail.com",
|
|
16
|
+
position: "Admin",
|
|
17
|
+
telephone: "",
|
|
18
18
|
country: "México",
|
|
19
|
-
id_company:
|
|
20
|
-
id_cognito: "
|
|
19
|
+
id_company: 2,
|
|
20
|
+
id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
|
|
21
21
|
birth_Date: null,
|
|
22
|
-
about_me:
|
|
23
|
-
zip_code:
|
|
24
|
-
address:
|
|
25
|
-
job:
|
|
26
|
-
id_stripe: "
|
|
27
|
-
id_role:
|
|
22
|
+
about_me: "",
|
|
23
|
+
zip_code: "",
|
|
24
|
+
address: "",
|
|
25
|
+
job: "",
|
|
26
|
+
id_stripe: "",
|
|
27
|
+
id_role: 6,
|
|
28
28
|
active: 1,
|
|
29
29
|
is_retailer: 0,
|
|
30
30
|
email_notify: 1,
|
|
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: 2,
|
|
33
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
34
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
35
|
+
planID: 1,
|
|
36
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
37
|
+
name: "Plan Free",
|
|
38
|
+
user_limit: "1",
|
|
39
|
+
products_limit: "3",
|
|
40
|
+
type: "PyMES",
|
|
41
41
|
},
|
|
42
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
42
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1666294798400",
|
|
43
43
|
},
|
|
44
|
-
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
44
|
+
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6ImJmODBhZmM4LTVjMWMtNDJmNi1hY2RhLTg0M2I1NDg3OWExZSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjY2Mjk0Nzk2LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjY2Mjk4Mzk2LCJpYXQiOjE2NjYyOTQ3OTYsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.RHigufdS172zrKNRuSKB9AALBvpHW2_xkHKMIVl5o4UtwiLOFyCI2gtdHDb7pgXxJH1Lk5n4OyNIiD6rta40o-eq7oY5unlUI38UVO0f8VXvjkvoi2CQ3J6JdNCZVzSzpT29vk0qvT39HFKVKfru4UxjTbPvVX77yZZ_QYoQvZ6gTjhzcvQslBSlQHh-RDAIwI9jbcePBDLIExbt_fq7Q6T5WdhnXkam8xBavF-3c3tVK9SjCAD_Y2gQhVmnAO5Co2Mqh59XfdT6uwNLTtwWd3aK5YX1thWW_oACfKBWAvLMSoYO3mjiXGWzKKLe7uNSvv92VhpLUeoYnVfrtafXAg",
|
|
45
45
|
};
|
|
@@ -29,8 +29,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
29
29
|
const [categoryId, setCategoryId] = useState([]);
|
|
30
30
|
const [companyId, setCompanyId] = useState([]);
|
|
31
31
|
const [datesRange, setDatesRange] = useState({
|
|
32
|
-
startDate: new Date("1900-01-01"),
|
|
33
|
-
endDate: new Date(),
|
|
32
|
+
startDate: formatDate(new Date("1900-01-01")),
|
|
33
|
+
endDate: formatDate(new Date()),
|
|
34
34
|
});
|
|
35
35
|
const [dateOptions, setDateOptions] = useState([]);
|
|
36
36
|
const applicants = [
|
|
@@ -40,21 +40,19 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
40
40
|
const [applicantsFilter, setApplicantsFilter] = useState([]);
|
|
41
41
|
const [totalCount, setTotalCount] = useState(0);
|
|
42
42
|
|
|
43
|
-
const loadProductVersions = async (queryObject
|
|
43
|
+
const loadProductVersions = async (queryObject) => {
|
|
44
44
|
const keys = Object.keys(queryObject);
|
|
45
45
|
let string = [];
|
|
46
46
|
keys.forEach((key) => string.push(`${key}=${queryObject[key]}`));
|
|
47
47
|
const query = string.join("&");
|
|
48
|
-
const endpoint =
|
|
49
|
-
? process.env.REACT_APP_READ_ORDERS_BY_STATUS
|
|
50
|
-
: process.env.REACT_APP_READ_REQUIRED_ORDERS;
|
|
48
|
+
const endpoint = process.env.REACT_APP_READ_ORDERS_BY_STATUS;
|
|
51
49
|
try {
|
|
52
50
|
const response = await axios.get(`${endpoint}?${query}`, {
|
|
53
51
|
headers: {
|
|
54
52
|
Authorization: jwt,
|
|
55
53
|
},
|
|
56
54
|
});
|
|
57
|
-
return JSON.parse(response.data.body);
|
|
55
|
+
return JSON.parse(response.data.body).data;
|
|
58
56
|
} catch (error) {
|
|
59
57
|
console.log(error);
|
|
60
58
|
}
|
|
@@ -79,34 +77,34 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
79
77
|
setRetailers(retailers);
|
|
80
78
|
};
|
|
81
79
|
|
|
82
|
-
const loadProductsByStatus = async (orderByStatus) => {
|
|
83
|
-
const {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const { total = 0, R = 0, ACA = 0, PA = 0 } = orders;
|
|
89
|
-
const inProcess = Object.keys(orders).reduce(
|
|
80
|
+
const loadProductsByStatus = async (orderByStatus, filter) => {
|
|
81
|
+
const { ordersBydate, ordersByStatus } =
|
|
82
|
+
(await loadProductVersions(orderByStatus)) || {};
|
|
83
|
+
|
|
84
|
+
const { total = 0, R = 0, ACA = 0, PA = 0 } = ordersByStatus;
|
|
85
|
+
const inProcess = Object.keys(ordersByStatus).reduce(
|
|
90
86
|
(prev, curr) =>
|
|
91
87
|
!["total", "ACA", "PA", "R"].includes(curr)
|
|
92
|
-
? prev +
|
|
88
|
+
? prev + ordersByStatus[curr]
|
|
93
89
|
: prev,
|
|
94
90
|
0
|
|
95
91
|
);
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
let metricsArray = [
|
|
93
|
+
metricsData[0]
|
|
94
|
+
? metricsData[0]
|
|
95
|
+
: { label: "Productos totales", value: total },
|
|
96
|
+
];
|
|
97
|
+
metricsArray.push(
|
|
98
|
+
{ label: "Productos filtrados", value: total },
|
|
98
99
|
{ label: "Productos sin asignar", value: PA + R },
|
|
99
100
|
{ label: "Productos en proceso", value: inProcess },
|
|
100
|
-
{ label: "Productos terminados", value: ACA }
|
|
101
|
-
|
|
101
|
+
{ label: "Productos terminados", value: ACA }
|
|
102
|
+
);
|
|
103
|
+
setMetricsData(metricsArray);
|
|
102
104
|
setTotalCount(total);
|
|
103
|
-
delete
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const loadRequiredProducts = async (orderByRequired) => {
|
|
108
|
-
const { dates } = await loadProductVersions(orderByRequired);
|
|
109
|
-
setRequiredProducts(dates);
|
|
105
|
+
delete ordersByStatus.total;
|
|
106
|
+
setRequiredProducts(ordersBydate);
|
|
107
|
+
setProductsByStatus(ordersByStatus);
|
|
110
108
|
};
|
|
111
109
|
|
|
112
110
|
const datesSelect = () => {
|
|
@@ -118,8 +116,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
118
116
|
name: "Todo el tiempo",
|
|
119
117
|
function: () =>
|
|
120
118
|
setDatesRange({
|
|
121
|
-
startDate: new Date("1900-01-01"),
|
|
122
|
-
endDate: new Date(),
|
|
119
|
+
startDate: formatDate(new Date("1900-01-01")),
|
|
120
|
+
endDate: formatDate(new Date()),
|
|
123
121
|
}),
|
|
124
122
|
},
|
|
125
123
|
{
|
|
@@ -197,16 +195,13 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
197
195
|
await getRetailers();
|
|
198
196
|
datesSelect();
|
|
199
197
|
const today = new Date();
|
|
200
|
-
const startDate =
|
|
201
|
-
const endDate =
|
|
202
|
-
today.getMonth() + 1
|
|
203
|
-
}-${today.getDate()}`;
|
|
198
|
+
const startDate = formatDate("1900-01-01");
|
|
199
|
+
const endDate = formatDate(today);
|
|
204
200
|
const queryObject = { startDate, endDate };
|
|
205
201
|
setDatesRange({ startDate, endDate });
|
|
206
202
|
setOrderByStatus(queryObject);
|
|
207
203
|
setOrderByRequired(queryObject);
|
|
208
204
|
loadProductsByStatus(queryObject);
|
|
209
|
-
loadRequiredProducts(queryObject);
|
|
210
205
|
}, []);
|
|
211
206
|
|
|
212
207
|
useEffect(() => {
|
|
@@ -219,8 +214,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
219
214
|
useEffect(async () => {
|
|
220
215
|
const { startDate, endDate } = datesRange;
|
|
221
216
|
const queryObject = {
|
|
222
|
-
startDate:
|
|
223
|
-
endDate:
|
|
217
|
+
startDate: startDate,
|
|
218
|
+
endDate: endDate,
|
|
224
219
|
};
|
|
225
220
|
companyId.length > 0 && (queryObject["companyId"] = companyId.join(","));
|
|
226
221
|
retailerId.length > 0 && (queryObject["retailerId"] = retailerId.join(","));
|
|
@@ -228,8 +223,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
228
223
|
applicantsFilter.length > 0 &&
|
|
229
224
|
(queryObject["requestedBy"] = applicantsFilter.join(","));
|
|
230
225
|
|
|
231
|
-
await loadProductsByStatus(queryObject);
|
|
232
|
-
await loadRequiredProducts(queryObject);
|
|
226
|
+
await loadProductsByStatus(queryObject, true);
|
|
233
227
|
}, [companyId, retailerId, categoryId, datesRange, applicantsFilter]);
|
|
234
228
|
|
|
235
229
|
return loading ? (
|
|
@@ -317,7 +311,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
317
311
|
displayLegend={true}
|
|
318
312
|
showPercent={true}
|
|
319
313
|
displayScale={false}
|
|
320
|
-
|
|
314
|
+
totalFiltered={totalCount}
|
|
315
|
+
total={metricsData[0]?.value}
|
|
321
316
|
/>
|
|
322
317
|
<DashboardMetric
|
|
323
318
|
label={"Productos solicitados"}
|
|
@@ -331,7 +326,6 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
331
326
|
retailerSelected={orderByRequired.retailerId}
|
|
332
327
|
queryObject={orderByRequired}
|
|
333
328
|
setQueryObject={(evt) => {
|
|
334
|
-
loadRequiredProducts(evt);
|
|
335
329
|
setOrderByRequired(evt);
|
|
336
330
|
}}
|
|
337
331
|
borderColor={"#3B1366"}
|
|
@@ -134,7 +134,6 @@ export const ProviderProductEdition = ({
|
|
|
134
134
|
setShowContentohRequestModal,
|
|
135
135
|
showSurvey,
|
|
136
136
|
company,
|
|
137
|
-
trueTHD,
|
|
138
137
|
}) => {
|
|
139
138
|
const [activeTab, setActiveTab] = useState("Descripción");
|
|
140
139
|
const [activeImage, setActiveImage] = useState();
|
|
@@ -1066,13 +1065,7 @@ export const ProviderProductEdition = ({
|
|
|
1066
1065
|
];
|
|
1067
1066
|
return (
|
|
1068
1067
|
<Container headerTop={headerTop}>
|
|
1069
|
-
<HeaderTop
|
|
1070
|
-
setHeaderTop={setHeaderTop}
|
|
1071
|
-
chat_authorization={token}
|
|
1072
|
-
chat_id_article={product.id_article}
|
|
1073
|
-
chat_version_article={version}
|
|
1074
|
-
trueTHD={trueTHD}
|
|
1075
|
-
/>
|
|
1068
|
+
<HeaderTop setHeaderTop={setHeaderTop} />
|
|
1076
1069
|
<div className="data-container">
|
|
1077
1070
|
<div className="image-data-panel">
|
|
1078
1071
|
<ImagePreviewer
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.ListCommercialRetailersDefault = void 0;
|
|
7
|
-
|
|
8
|
-
var _index = require("./index");
|
|
9
|
-
|
|
10
|
-
var _default = {
|
|
11
|
-
title: "Components/atoms/ListCommercialRetailers",
|
|
12
|
-
component: _index.ListCommercialRetailers
|
|
13
|
-
};
|
|
14
|
-
exports.default = _default;
|
|
15
|
-
|
|
16
|
-
var Template = function Template(args) {
|
|
17
|
-
return /*#__PURE__*/React.createElement(_index.ListCommercialRetailers, args);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var ListCommercialRetailersDefault = Template.bind({});
|
|
21
|
-
exports.ListCommercialRetailersDefault = ListCommercialRetailersDefault;
|
|
22
|
-
ListCommercialRetailersDefault.args = {
|
|
23
|
-
retailersAvailable: [{
|
|
24
|
-
id: 54,
|
|
25
|
-
name: "Construrama",
|
|
26
|
-
country: "México",
|
|
27
|
-
id_region: 1,
|
|
28
|
-
active: 1
|
|
29
|
-
}, {
|
|
30
|
-
id: 4,
|
|
31
|
-
name: "Walmart Super y Superama"
|
|
32
|
-
}, {
|
|
33
|
-
id: 6,
|
|
34
|
-
name: "HEB"
|
|
35
|
-
}]
|
|
36
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.ListCommercialRetailers = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
-
|
|
12
|
-
var _styles = require("./styles");
|
|
13
|
-
|
|
14
|
-
var _listCommercialRetailers = _interopRequireDefault(require("../../../assets/images/listCommercialRetailers/listCommercialRetailers.svg"));
|
|
15
|
-
|
|
16
|
-
var _react = require("react");
|
|
17
|
-
|
|
18
|
-
var _index = require("../CheckBox/index");
|
|
19
|
-
|
|
20
|
-
var ListCommercialRetailers = function ListCommercialRetailers(_ref) {
|
|
21
|
-
var retailersAvailable = _ref.retailersAvailable;
|
|
22
|
-
|
|
23
|
-
var _useState = (0, _react.useState)(false),
|
|
24
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
25
|
-
showMenu = _useState2[0],
|
|
26
|
-
setShowMenu = _useState2[1];
|
|
27
|
-
|
|
28
|
-
var closeMenu = function closeMenu(e) {
|
|
29
|
-
if (!e.target.closest(".menu-list-commercial-retailers") && showMenu) {
|
|
30
|
-
document.removeEventListener("click", closeMenu, false);
|
|
31
|
-
setShowMenu(false);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
(0, _react.useEffect)(function () {
|
|
36
|
-
if (showMenu) {
|
|
37
|
-
document.addEventListener("click", closeMenu, false);
|
|
38
|
-
}
|
|
39
|
-
}, [showMenu]);
|
|
40
|
-
return /*#__PURE__*/React.createElement(_styles.Container, {
|
|
41
|
-
onClick: function onClick(event) {
|
|
42
|
-
if (!showMenu) {
|
|
43
|
-
setShowMenu(true);
|
|
44
|
-
} else if (showMenu && !event.target.closest(".menu-list-commercial-retailers")) {
|
|
45
|
-
setShowMenu(false);
|
|
46
|
-
document.removeEventListener("click", closeMenu, false);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
className: "list-commercial-retailers"
|
|
50
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
51
|
-
src: _listCommercialRetailers.default,
|
|
52
|
-
alt: "button up icon"
|
|
53
|
-
}), showMenu && /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: "menu-list-commercial-retailers"
|
|
55
|
-
}, retailersAvailable === null || retailersAvailable === void 0 ? void 0 : retailersAvailable.map(function (component, index) {
|
|
56
|
-
return /*#__PURE__*/React.createElement(_index.CheckBox, {
|
|
57
|
-
id: component.id,
|
|
58
|
-
label: component.name,
|
|
59
|
-
key: index + "-" + component.id
|
|
60
|
-
});
|
|
61
|
-
})));
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
exports.ListCommercialRetailers = ListCommercialRetailers;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Container = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _variables = require("../../../global-files/variables");
|
|
15
|
-
|
|
16
|
-
var _templateObject;
|
|
17
|
-
|
|
18
|
-
var Container = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: transparent;\n border: 1px solid ", ";\n border-radius: 2px;\n padding: 3px;\n display: flex;\n align-items: center;\n cursor: pointer;\n position: relative;\n height: 30px;\n .menu-list-commercial-retailers {\n width: 540px;\n height: auto;\n border-radius: 7px;\n background-color: ", ";\n padding: 14px 14px 8px 20px;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);\n position: absolute;\n top: calc(100% + 3px);\n right: calc(100% - 20px);\n display: flex;\n flex-wrap: wrap;\n z-index: 1;\n div {\n & + * {\n margin-left: 15px;\n }\n p {\n font-size: 11px;\n }\n }\n }\n"])), _variables.GlobalColors.magenta_s2, _variables.GlobalColors.s2);
|
|
19
|
-
|
|
20
|
-
exports.Container = Container;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.MenuCommercialRetailersDefault = void 0;
|
|
7
|
-
|
|
8
|
-
var _index = require("./index");
|
|
9
|
-
|
|
10
|
-
var _default = {
|
|
11
|
-
title: "Components/atoms/MenuCommercialRetailers",
|
|
12
|
-
component: _index.MenuCommercialRetailers
|
|
13
|
-
};
|
|
14
|
-
exports.default = _default;
|
|
15
|
-
|
|
16
|
-
var Template = function Template(args) {
|
|
17
|
-
return /*#__PURE__*/React.createElement(_index.MenuCommercialRetailers, args);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var MenuCommercialRetailersDefault = Template.bind({});
|
|
21
|
-
exports.MenuCommercialRetailersDefault = MenuCommercialRetailersDefault;
|
|
22
|
-
MenuCommercialRetailersDefault.args = {
|
|
23
|
-
editType: "3",
|
|
24
|
-
retailersAvailable: [{
|
|
25
|
-
id: 54,
|
|
26
|
-
name: "Construrama",
|
|
27
|
-
country: "México",
|
|
28
|
-
id_region: 1,
|
|
29
|
-
active: 1
|
|
30
|
-
}, {
|
|
31
|
-
id: 4,
|
|
32
|
-
name: "Walmart Super y Superama"
|
|
33
|
-
}, {
|
|
34
|
-
id: 6,
|
|
35
|
-
name: "HEB"
|
|
36
|
-
}]
|
|
37
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MenuCommercialRetailers = void 0;
|
|
7
|
-
|
|
8
|
-
var _styles = require("./styles");
|
|
9
|
-
|
|
10
|
-
var _StatusTag = require("../StatusTag");
|
|
11
|
-
|
|
12
|
-
var _ListCommercialRetailers = require("../ListCommercialRetailers");
|
|
13
|
-
|
|
14
|
-
var MenuCommercialRetailers = function MenuCommercialRetailers(_ref) {
|
|
15
|
-
var editType = _ref.editType,
|
|
16
|
-
retailersAvailable = _ref.retailersAvailable;
|
|
17
|
-
return /*#__PURE__*/React.createElement(_styles.Container, null, /*#__PURE__*/React.createElement(_StatusTag.StatusTag, {
|
|
18
|
-
editType: editType,
|
|
19
|
-
ovalForm: true
|
|
20
|
-
}), /*#__PURE__*/React.createElement(_ListCommercialRetailers.ListCommercialRetailers, {
|
|
21
|
-
retailersAvailable: retailersAvailable
|
|
22
|
-
}));
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
exports.MenuCommercialRetailers = MenuCommercialRetailers;
|