contentoh-components-library 21.2.89 → 21.2.90
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 -6
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
- package/dist/components/atoms/ChatPopUp/index.js +841 -0
- package/dist/components/atoms/ChatPopUp/styles.js +27 -0
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
- package/dist/components/atoms/ProgressBar/styles.js +1 -1
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +5 -35
- package/dist/components/atoms/Tooltip/index.js +24 -41
- package/dist/components/atoms/Tooltip/styles.js +1 -3
- 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/pages/Dashboard/Dashboard.stories.js +44 -16
- package/dist/components/pages/Dashboard/index.js +17 -10
- package/dist/components/pages/ProviderProductEdition/index.js +2 -3
- package/dist/components/pages/RetailerProductEdition/index.js +7 -4
- package/dist/global-files/fonts.css +0 -18
- package/dist/global-files/variables.js +1 -3
- package/dist/index.js +45 -227
- package/package.json +1 -13
- package/src/components/atoms/ProgressBar/styles.js +4 -3
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +6 -11
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/pages/Dashboard/Dashboard.stories.js +47 -16
- package/src/components/pages/Dashboard/index.js +13 -4
- package/src/components/pages/ProviderProductEdition/index.js +7 -6
- package/src/components/pages/RetailerProductEdition/index.js +4 -5
- package/src/global-files/fonts.css +0 -18
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -14
- package/dist/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/dist/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +0 -124
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -72
- package/dist/components/atoms/ButtonFileChooser/index.js +0 -118
- package/dist/components/atoms/ButtonFileChooser/styles.js +0 -20
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +0 -66
- package/dist/components/atoms/ButtonV2/index.js +0 -111
- package/dist/components/atoms/ButtonV2/styles.js +0 -53
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +0 -50
- package/dist/components/atoms/CustomIcon/index.js +0 -40
- package/dist/components/atoms/CustomIcon/styles.js +0 -33
- package/dist/components/atoms/IconFile/IconFile.stories.js +0 -48
- package/dist/components/atoms/IconFile/index.js +0 -249
- package/dist/components/atoms/IconFile/styles.js +0 -23
- package/dist/components/atoms/Image/Image.stories.js +0 -63
- package/dist/components/atoms/Image/index.js +0 -74
- package/dist/components/atoms/Image/styles.js +0 -40
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +0 -63
- package/dist/components/atoms/ImageLink/index.js +0 -77
- package/dist/components/atoms/ImageLink/styles.js +0 -40
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +0 -70
- package/dist/components/atoms/ImagePreview/index.js +0 -222
- package/dist/components/atoms/ImagePreview/styles.js +0 -44
- package/dist/components/atoms/InputText/InputText.stories.js +0 -60
- package/dist/components/atoms/InputText/index.js +0 -66
- package/dist/components/atoms/InputText/styles.js +0 -32
- package/dist/components/atoms/NotFound/NotFound.stories.js +0 -36
- package/dist/components/atoms/NotFound/index.js +0 -75
- package/dist/components/atoms/NotFound/styles.js +0 -20
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -66
- package/dist/components/molecules/ButtonDownloadFile/index.js +0 -179
- package/dist/components/molecules/ButtonDownloadFile/styles.js +0 -23
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -72
- package/dist/components/molecules/ImageTooltip/index.js +0 -84
- package/dist/components/molecules/ImageTooltip/styles.js +0 -33
- package/dist/components/organisms/Chat/Chat.stories.js +0 -215
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -83
- package/dist/components/organisms/Chat/ChatLists/index.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/styles.js +0 -29
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -176
- package/dist/components/organisms/Chat/ContainerItems/index.js +0 -572
- package/dist/components/organisms/Chat/ContainerItems/styles.js +0 -20
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -142
- package/dist/components/organisms/Chat/ContentChat/index.js +0 -1422
- package/dist/components/organisms/Chat/ContentChat/styles.js +0 -20
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +0 -43
- package/dist/components/organisms/Chat/Footer/index.js +0 -984
- package/dist/components/organisms/Chat/Footer/styles.js +0 -32
- package/dist/components/organisms/Chat/Header/Header.stories.js +0 -96
- package/dist/components/organisms/Chat/Header/index.js +0 -84
- package/dist/components/organisms/Chat/Header/styles.js +0 -20
- package/dist/components/organisms/Chat/index.js +0 -327
- package/dist/components/organisms/Chat/styles.js +0 -29
- package/dist/components/organisms/Modal/Modal.stories.js +0 -66
- package/dist/components/organisms/Modal/index.js +0 -95
- package/dist/components/organisms/Modal/styles.js +0 -20
- package/dist/global-files/handle_http.js +0 -383
- package/dist/global-files/utils.js +0 -472
- package/src/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/src/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
- 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/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -69
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -50
- package/src/components/atoms/ButtonV2/index.js +0 -74
- package/src/components/atoms/ButtonV2/styles.js +0 -187
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -43
- package/src/components/atoms/Image/index.js +0 -54
- package/src/components/atoms/Image/styles.js +0 -25
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -191
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -111
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -46
- package/src/components/molecules/ImageTooltip/index.js +0 -62
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/organisms/Chat/Chat.stories.js +0 -199
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -551
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -336
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +0 -900
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -669
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -94
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -294
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/global-files/handle_http.js +0 -231
- package/src/global-files/utils.js +0 -300
package/package.json
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentoh-components-library",
|
|
3
|
-
"version": "21.2.
|
|
3
|
+
"version": "21.2.90",
|
|
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
|
-
"@fortawesome/fontawesome-svg-core": "^6.2.0",
|
|
12
|
-
"@fortawesome/free-regular-svg-icons": "^6.2.0",
|
|
13
|
-
"@fortawesome/free-solid-svg-icons": "^6.2.0",
|
|
14
|
-
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
15
|
-
"@mui/material": "^5.10.8",
|
|
16
|
-
"@mui/styled-engine-sc": "^5.10.6",
|
|
17
9
|
"@storybook/addon-postcss": "^2.0.0",
|
|
18
10
|
"@testing-library/jest-dom": "^5.11.4",
|
|
19
11
|
"@testing-library/react": "^11.1.0",
|
|
@@ -27,7 +19,6 @@
|
|
|
27
19
|
"draft-js": "^0.11.7",
|
|
28
20
|
"file-saver": "^2.0.5",
|
|
29
21
|
"js-base64": "^3.7.2",
|
|
30
|
-
"moment": "^2.29.4",
|
|
31
22
|
"prop-types": "^15.7.2",
|
|
32
23
|
"react": "^17.0.2",
|
|
33
24
|
"react-chartjs-2": "^4.0.1",
|
|
@@ -38,10 +29,7 @@
|
|
|
38
29
|
"react-image-fallback": "^8.0.0",
|
|
39
30
|
"react-quill": "^1.3.5",
|
|
40
31
|
"react-router-dom": "^5.3.3",
|
|
41
|
-
"react-scroll": "^1.8.8",
|
|
42
|
-
"react-transition-group": "^4.4.5",
|
|
43
32
|
"styled-components": "^5.3.3",
|
|
44
|
-
"swiper": "^8.4.4",
|
|
45
33
|
"uuid": "^8.3.2",
|
|
46
34
|
"web-vitals": "^1.0.1"
|
|
47
35
|
},
|
|
@@ -16,12 +16,13 @@ export const Container = styled.div`
|
|
|
16
16
|
? GlobalColors.s4
|
|
17
17
|
: GlobalColors.white};
|
|
18
18
|
|
|
19
|
-
&.status-CA
|
|
19
|
+
&.status-CA,
|
|
20
|
+
&.status-AS,
|
|
21
|
+
&.status-PA {
|
|
20
22
|
background-color: ${GlobalColors.in_progress};
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
&.status-R
|
|
24
|
-
&.status-AS {
|
|
25
|
+
&.status-R {
|
|
25
26
|
background-color: ${GlobalColors.reception};
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -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
|
-
|
|
16
|
-
id:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
name: "Mis Favoritos",
|
|
14
|
+
{
|
|
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 { Chat } from "../../organisms/Chat";
|
|
6
5
|
|
|
7
6
|
export const HeaderTop = ({ setHeaderTop }) => {
|
|
8
7
|
const headerTop = useRef();
|
|
@@ -14,16 +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
|
-
window.location.href = `/products`;
|
|
24
|
-
}}
|
|
25
|
-
/>
|
|
26
|
-
</div>
|
|
16
|
+
<Button
|
|
17
|
+
buttonType="close-button"
|
|
18
|
+
onClick={() => {
|
|
19
|
+
window.location.href = `/products`;
|
|
20
|
+
}}
|
|
21
|
+
/>
|
|
27
22
|
</Container>
|
|
28
23
|
);
|
|
29
24
|
};
|
|
@@ -9,29 +9,30 @@ 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: 1236,
|
|
13
|
+
name: "THD",
|
|
14
|
+
last_name: "Proveedor",
|
|
15
|
+
email: "thd@allfreemail.net",
|
|
16
|
+
position: "Prod test",
|
|
17
|
+
telephone: "+523111111111",
|
|
18
|
+
country: "México",
|
|
19
|
+
id_company: 816,
|
|
20
|
+
id_cognito: "d660ccca-f906-4970-892c-6d152e832e5d",
|
|
21
21
|
birth_Date: null,
|
|
22
22
|
about_me: null,
|
|
23
23
|
zip_code: null,
|
|
24
24
|
address: null,
|
|
25
25
|
job: null,
|
|
26
26
|
id_stripe: null,
|
|
27
|
-
id_role:
|
|
27
|
+
id_role: 0,
|
|
28
28
|
active: 1,
|
|
29
29
|
is_retailer: 0,
|
|
30
|
-
email_notify:
|
|
30
|
+
email_notify: 1,
|
|
31
|
+
is_superadmin: 0,
|
|
31
32
|
membership: {
|
|
32
|
-
id:
|
|
33
|
-
start_date: "2022-
|
|
34
|
-
end_date: "2023-
|
|
33
|
+
id: 797,
|
|
34
|
+
start_date: "2022-06-19T04:18:39.000Z",
|
|
35
|
+
end_date: "2023-06-19T04:18:39.000Z",
|
|
35
36
|
planID: 6,
|
|
36
37
|
plan: "prod_KvGd6YSTJyR3AP",
|
|
37
38
|
name: "Plan Small",
|
|
@@ -39,7 +40,37 @@ DashboardDeafult.args = {
|
|
|
39
40
|
products_limit: "1000",
|
|
40
41
|
type: "Enterprise",
|
|
41
42
|
},
|
|
42
|
-
src: "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
43
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-1236/1236.png?1668676098688",
|
|
44
|
+
},
|
|
45
|
+
company: {
|
|
46
|
+
id_company: 816,
|
|
47
|
+
trade_name: "Prod Test",
|
|
48
|
+
company_name: "Prod Test",
|
|
49
|
+
rfc: "ASER12345",
|
|
50
|
+
adress: "Av. Insurgentes",
|
|
51
|
+
about_company: null,
|
|
52
|
+
telephone: null,
|
|
53
|
+
web_site: null,
|
|
54
|
+
zip_code: null,
|
|
55
|
+
email: null,
|
|
56
|
+
social_link: null,
|
|
57
|
+
is_retailer: 0,
|
|
58
|
+
financedRetailers: [
|
|
59
|
+
{
|
|
60
|
+
id: 58,
|
|
61
|
+
name: "The Home Depot Golden",
|
|
62
|
+
country: "México",
|
|
63
|
+
id_region: 1,
|
|
64
|
+
active: 1,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 59,
|
|
68
|
+
name: "The Home Depot Platinum",
|
|
69
|
+
country: "México",
|
|
70
|
+
id_region: 1,
|
|
71
|
+
active: 1,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
43
74
|
},
|
|
44
|
-
jwt: "
|
|
75
|
+
jwt: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjYwY2NjYS1mOTA2LTQ5NzAtODkyYy02ZDE1MmU4MzJlNWQiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImQ2NjBjY2NhLWY5MDYtNDk3MC04OTJjLTZkMTUyZTgzMmU1ZCIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI2NzYzN2VlZi1iMjE3LTRiYWEtODM4MC05NDMzODZjYTU5OTIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2ODY3NjA5OCwibmFtZSI6IlRIRCBQcm92ZWVkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMTExMTExIiwiZXhwIjoxNjY4Njc5Njk3LCJpYXQiOjE2Njg2NzYwOTgsImVtYWlsIjoidGhkQGFsbGZyZWVtYWlsLm5ldCJ9.ghtkS2S6ipJgGDEkGVoEd2iaxD5iKkGL_HBQ6ay-Kp-nh0VWjYW9cUBQhv83Je6gBsYdywkRfAmW9bEeqW7IuOAV9-CcQtcg7NtARtPjm3XLwt-vZePHefNASS1GdkFjjb3wioSdHoxa5UR6Di-mCTvQPad7tUdDy5XZf--8HyuB2Ir-yGnBqQ5mcyUloIwKWA0U0kboKUb97j8wCxGGP4oArrNH9yuwlwCC5dW2eyF1MKBDb4zPAnKmKM3IR-iFuyl9kAuo88YAas8o8pJ3_oc49NJ6ti2yY2hUyDFiMYlhjo-nDGMK1hQqFqjTPvrCV71H7P2vVuFHkkln9G-MbQ",
|
|
45
76
|
};
|
|
@@ -59,7 +59,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
const getRetailers = async () => {
|
|
62
|
-
const isTHDUser =
|
|
62
|
+
const isTHDUser = user.is_retailer && company.retailers;
|
|
63
63
|
const retailersResponse = await axios.get(
|
|
64
64
|
`${process.env.REACT_APP_RETAILER_ENDPOINT}`,
|
|
65
65
|
{
|
|
@@ -78,13 +78,21 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
const loadProductsByStatus = async (orderByStatus, filter) => {
|
|
81
|
+
const isTHDUser = user.is_retailer && company.retailers;
|
|
82
|
+
const isProvider = !user.is_retailer && user.id_role === 0;
|
|
83
|
+
const isCollaborator = user.id_role > 0;
|
|
81
84
|
const { ordersBydate, ordersByStatus } =
|
|
82
85
|
(await loadProductVersions(orderByStatus)) || {};
|
|
83
86
|
|
|
84
|
-
const { total = 0, R = 0, PA = 0, Ex = 0 } = ordersByStatus;
|
|
87
|
+
const { total = 0, R = 0, PA = 0, Ex = 0, ACA = 0 } = ordersByStatus;
|
|
88
|
+
let productsFinished = 0;
|
|
89
|
+
if (isTHDUser) productsFinished = Ex;
|
|
90
|
+
if (isProvider) productsFinished = ACA;
|
|
91
|
+
if (isCollaborator) productsFinished = Ex + ACA;
|
|
92
|
+
|
|
85
93
|
const inProcess = Object.keys(ordersByStatus).reduce(
|
|
86
94
|
(prev, curr) =>
|
|
87
|
-
!["total", "PA", "R", "Ex"].includes(curr)
|
|
95
|
+
!["total", "PA", "R", "Ex", "ACA"].includes(curr)
|
|
88
96
|
? prev + ordersByStatus[curr]
|
|
89
97
|
: prev,
|
|
90
98
|
0
|
|
@@ -94,11 +102,12 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
94
102
|
? metricsData[0]
|
|
95
103
|
: { label: "Productos totales", value: total },
|
|
96
104
|
];
|
|
105
|
+
|
|
97
106
|
metricsArray.push(
|
|
98
107
|
{ label: "Productos filtrados", value: total },
|
|
99
108
|
{ label: "Productos sin asignar", value: PA + R },
|
|
100
109
|
{ label: "Productos en proceso", value: inProcess },
|
|
101
|
-
{ label: "Productos terminados", value:
|
|
110
|
+
{ label: "Productos terminados", value: productsFinished }
|
|
102
111
|
);
|
|
103
112
|
setMetricsData(metricsArray);
|
|
104
113
|
setTotalCount(total);
|
|
@@ -45,7 +45,7 @@ import { useCloseModal } from "../../../global-files/customHooks";
|
|
|
45
45
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
46
46
|
|
|
47
47
|
const reducerImages = (state, action) => {
|
|
48
|
-
let { values
|
|
48
|
+
let { values, attrForImgs, inputsByRetailer } = state;
|
|
49
49
|
switch (action.action) {
|
|
50
50
|
case "init":
|
|
51
51
|
const newInputsByRetailer = {};
|
|
@@ -100,7 +100,7 @@ const reducerImages = (state, action) => {
|
|
|
100
100
|
imageIdArray.includes(input.id)
|
|
101
101
|
);
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
values = orderedImages.length > 0 ? orderedImages : [];
|
|
104
104
|
} catch (error) {
|
|
105
105
|
console.log(error);
|
|
106
106
|
}
|
|
@@ -877,10 +877,11 @@ export const ProviderProductEdition = ({
|
|
|
877
877
|
const newProductEdit = productEdit;
|
|
878
878
|
newProductEdit.product[sectionStatusKey] = serviceStatus;
|
|
879
879
|
setProductEdit(newProductEdit);
|
|
880
|
-
const showSurveyByProvider =
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
880
|
+
const showSurveyByProvider =
|
|
881
|
+
!user.is_retailer && orderStatus[orderId] === "AP";
|
|
882
|
+
const showSurveyByRetailer =
|
|
883
|
+
user.is_retailer && orderStatus[orderId] === "ACA";
|
|
884
|
+
showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
|
|
884
885
|
} else {
|
|
885
886
|
res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
886
887
|
headers: {
|
|
@@ -35,7 +35,7 @@ import { useCloseModal } from "../../../global-files/customHooks";
|
|
|
35
35
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
36
36
|
|
|
37
37
|
const reducerImages = (state, action) => {
|
|
38
|
-
let { values
|
|
38
|
+
let { values, attrForImgs, inputsByRetailer } = state;
|
|
39
39
|
switch (action.action) {
|
|
40
40
|
case "init":
|
|
41
41
|
const newInputsByRetailer = {};
|
|
@@ -80,8 +80,9 @@ const reducerImages = (state, action) => {
|
|
|
80
80
|
try {
|
|
81
81
|
const orderedImages = [];
|
|
82
82
|
const imageIdArray = [];
|
|
83
|
-
if (action?.retailerId && !inputsByRetailer[action.retailerId])
|
|
83
|
+
if (action?.retailerId && !inputsByRetailer[action.retailerId]) {
|
|
84
84
|
inputsByRetailer[action.retailerId] = [];
|
|
85
|
+
}
|
|
85
86
|
action.retailerId &&
|
|
86
87
|
inputsByRetailer[action.retailerId]?.filter((input) => {
|
|
87
88
|
imageIdArray.push(input.id_image);
|
|
@@ -89,12 +90,10 @@ const reducerImages = (state, action) => {
|
|
|
89
90
|
if (value.image_id === input.id_image) orderedImages.push(value);
|
|
90
91
|
});
|
|
91
92
|
});
|
|
92
|
-
|
|
93
93
|
inputs = inputsInitial?.filter((input) =>
|
|
94
94
|
imageIdArray.includes(input.id)
|
|
95
95
|
);
|
|
96
|
-
|
|
97
|
-
if (orderedImages.length > 0) values = orderedImages;
|
|
96
|
+
values = orderedImages.length > 0 ? orderedImages : [];
|
|
98
97
|
} catch (error) {
|
|
99
98
|
console.log(error);
|
|
100
99
|
}
|
|
@@ -43,21 +43,3 @@
|
|
|
43
43
|
src: url("../assets/fonts/raleway/Raleway-Black.ttf");
|
|
44
44
|
font-weight: 900;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
@font-face {
|
|
48
|
-
font-family: "RobotoMedium";
|
|
49
|
-
src: url("../assets/fonts/Roboto/Roboto-Medium.ttf");
|
|
50
|
-
font-weight: 500;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@font-face {
|
|
54
|
-
font-family: "RobotoRegular";
|
|
55
|
-
src: url("../assets/fonts/Roboto/Roboto-Regular.ttf");
|
|
56
|
-
font-weight: 400;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.prueba {
|
|
60
|
-
color: #9e3e26;
|
|
61
|
-
color: #b42983;
|
|
62
|
-
color: #e7e7e7;
|
|
63
|
-
}
|
package/src/index.js
CHANGED
|
@@ -23,16 +23,6 @@ export * from "./components/atoms/Status/index";
|
|
|
23
23
|
export * from "./components/atoms/TabSection/index";
|
|
24
24
|
export * from "./components/atoms/ValidationPanel/index";
|
|
25
25
|
export * from "./components/atoms/VerticalSideMenuMainPage/index";
|
|
26
|
-
export * from "./components/atoms/ButtonFileChooser/index";
|
|
27
|
-
export * from "./components/atoms/ButtonV2/index";
|
|
28
|
-
export * from "./components/atoms/CustomIcon/index";
|
|
29
|
-
export * from "./components/atoms/IconFile/index";
|
|
30
|
-
export * from "./components/atoms/Image/index";
|
|
31
|
-
export * from "./components/atoms/ImageLink/index";
|
|
32
|
-
export * from "./components/atoms/ImagePreview/index";
|
|
33
|
-
export * from "./components/atoms/InputText/index";
|
|
34
|
-
export * from "./components/atoms/NotFound/index";
|
|
35
|
-
export * from "./components/atoms/Tooltip/index";
|
|
36
26
|
|
|
37
27
|
//molecules
|
|
38
28
|
export * from "./components/molecules/AvatarAndValidation/index";
|
|
@@ -59,8 +49,6 @@ export * from "./components/molecules/TagAndInput/index";
|
|
|
59
49
|
export * from "./components/molecules/VerificationCodeResetPasswordLogin/index";
|
|
60
50
|
export * from "./components/molecules/RetailerSelector/index";
|
|
61
51
|
export * from "./components/molecules/CustomSelect/index";
|
|
62
|
-
export * from "./components/molecules/ButtonDownloadFile/index";
|
|
63
|
-
export * from "./components/molecules/ImageTooltip/index";
|
|
64
52
|
|
|
65
53
|
//organisms
|
|
66
54
|
export * from "./components/organisms/ChangePassword/index";
|
|
@@ -72,8 +60,6 @@ export * from "./components/organisms/ImagePreviewer/index";
|
|
|
72
60
|
export * from "./components/organisms/ImagesGroup/index";
|
|
73
61
|
export * from "./components/organisms/InputGroup/index";
|
|
74
62
|
export * from "./components/organisms/ProductImageModal/index";
|
|
75
|
-
export * from "./components/organisms/Chat/index";
|
|
76
|
-
export * from "./components/organisms/Modal/index";
|
|
77
63
|
|
|
78
64
|
//pages
|
|
79
65
|
export * from "./components/pages/ChangePasswordLogin";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|