contentoh-components-library 21.3.28 → 21.3.30
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 +0 -3
- package/.env.production +3 -2
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/ProgressBar/index.js +6 -36
- package/dist/components/atoms/ProgressBar/styles.js +3 -11
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/GalleryElement/index.js +1 -1
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +4 -6
- package/dist/components/organisms/Chat/ContainerItems/index.js +13 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
- package/dist/components/pages/ProviderProductEdition/index.js +11 -17
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -73
- package/dist/components/pages/RetailerProductEdition/index.js +14 -19
- package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
- package/dist/global-files/data.js +23 -18
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -13
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/atoms/ProgressBar/index.js +5 -40
- package/src/components/atoms/ProgressBar/styles.js +0 -24
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/GalleryElement/index.js +1 -1
- package/src/components/molecules/HeaderTop/styles.js +2 -5
- package/src/components/molecules/ProductNameHeader/index.js +2 -7
- package/src/components/organisms/FullProductNameHeader/index.js +0 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
- package/src/components/pages/ProviderProductEdition/index.js +9 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -78
- package/src/components/pages/RetailerProductEdition/index.js +20 -18
- package/src/components/pages/RetailerProductEdition/utils.js +1 -2
- package/src/global-files/data.js +23 -18
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- 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/assets/sounds/newMessage.mp3 +0 -0
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -68
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- 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 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- 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 -178
- 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/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- 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 -109
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
- package/src/components/molecules/SelectV2/index.js +0 -357
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -60
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -149
- 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 -513
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -348
- 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 -922
- 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 -661
- 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 -93
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -238
- 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/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -225
- package/src/global-files/handle_userTech.js +0 -7
- package/src/global-files/utils.js +0 -330
|
@@ -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)
|
|
@@ -3,11 +3,8 @@ import styled from "styled-components";
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
4
|
display: flex;
|
|
5
5
|
justify-content: space-between;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
align-items: center;
|
|
9
|
-
padding-top: 10px;
|
|
10
|
-
}
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
11
8
|
|
|
12
9
|
.buttons-container {
|
|
13
10
|
display: flex;
|
|
@@ -10,17 +10,12 @@ export const ProductNameHeader = ({
|
|
|
10
10
|
percent,
|
|
11
11
|
priority,
|
|
12
12
|
date,
|
|
13
|
-
percentRequired,
|
|
14
13
|
}) => {
|
|
15
14
|
return (
|
|
16
15
|
<Container>
|
|
17
16
|
<ScreenHeader headerType={"product-name-header"} text={productName} />
|
|
18
|
-
|
|
19
|
-
<ProgressBar
|
|
20
|
-
percent={percentRequired}
|
|
21
|
-
progressBarType={statusType}
|
|
22
|
-
percentRequired={percentRequired}
|
|
23
|
-
/>
|
|
17
|
+
<Status statusType={statusType} />
|
|
18
|
+
<ProgressBar percent={percent} progressBarType={statusType} />
|
|
24
19
|
<PriorityFlag priority={priority} />
|
|
25
20
|
<ScreenHeader headerType={"date-header"} text={date} />
|
|
26
21
|
</Container>
|
|
@@ -16,76 +16,74 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: true,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyOWY3YWY3Zi0yNmQ0LTRiMWItODZmZS0zOWY2ZTUyMDFhNzAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2OTkyNzAyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2Njk5MzA2MjEsImlhdCI6MTY2OTkyNzAyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.NK6hVSiBksguboJ1m8yYqtDq19kzgE3GqYDEJHLUya_n_TsXriv6W1ypq7XiSo9zrqWcmHBpOoJQS7WbWzjGe__NlJEXjo8bykS8QBTTOiMrKxz1KzGRYJkwgG0axk-zVysUQH0_y-fbwgEgMPtd6qO46DB_KlFI_PEL1-uR5MJ9U0kNkS61gMbHwFQFs_DU-sS01NxjBsjUEp783rs1r-jm7TelZac1rGaFNUyi5vHdSozYzlnzfzGcuACZ0lHqvah2FHbDyurp-G_uhpUn5lNmcL4rVNh2lDd4TOnhJ3AtN1wGSmtErmhjmBHTvavh1ub9pklA1B9qjVuTRpYANw",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
upc: "102852",
|
|
24
|
+
id_article: 3,
|
|
25
|
+
id_category: 2032,
|
|
26
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
27
|
+
upc: "161157",
|
|
28
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
29
|
+
categoryName: "Decoración|Cortinas y Persianas|Cortinas",
|
|
31
30
|
version: 1,
|
|
32
31
|
retailersAvailable: [
|
|
33
32
|
{
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
name: "The Home Depot Golden",
|
|
34
|
+
id: 58,
|
|
36
35
|
},
|
|
37
36
|
],
|
|
38
37
|
},
|
|
39
38
|
productToEdit: {
|
|
40
|
-
idCategory:
|
|
41
|
-
ArticleId:
|
|
39
|
+
idCategory: 2032,
|
|
40
|
+
ArticleId: 3,
|
|
42
41
|
product: [
|
|
43
42
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
upc: "102852",
|
|
43
|
+
id_article: 3,
|
|
44
|
+
id_category: 2032,
|
|
45
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
46
|
+
upc: "161157",
|
|
47
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
48
|
+
categoryName: "Decoración|Cortinas y Persianas|Cortinas",
|
|
51
49
|
version: 1,
|
|
52
50
|
retailersAvailable: [
|
|
53
51
|
{
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
name: "The Home Depot Golden",
|
|
53
|
+
id: 58,
|
|
56
54
|
},
|
|
57
55
|
],
|
|
58
56
|
},
|
|
59
57
|
],
|
|
60
58
|
},
|
|
61
59
|
location: {
|
|
62
|
-
state: { origin: "Contentoh"
|
|
60
|
+
state: { origin: "Contentoh" },
|
|
63
61
|
},
|
|
64
62
|
user: {
|
|
65
|
-
id_user:
|
|
66
|
-
name: "
|
|
67
|
-
last_name: "
|
|
68
|
-
email: "
|
|
69
|
-
position: "
|
|
70
|
-
telephone: "+
|
|
63
|
+
id_user: 28,
|
|
64
|
+
name: "Ismael",
|
|
65
|
+
last_name: "López",
|
|
66
|
+
email: "ilopez@contentoh.com",
|
|
67
|
+
position: "Test States",
|
|
68
|
+
telephone: "+523111366336",
|
|
71
69
|
country: "México",
|
|
72
|
-
id_company:
|
|
73
|
-
id_cognito: "
|
|
70
|
+
id_company: 1,
|
|
71
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
74
72
|
birth_Date: null,
|
|
75
|
-
about_me:
|
|
76
|
-
zip_code:
|
|
77
|
-
address:
|
|
78
|
-
job:
|
|
79
|
-
id_stripe:
|
|
73
|
+
about_me: "",
|
|
74
|
+
zip_code: "",
|
|
75
|
+
address: "",
|
|
76
|
+
job: "",
|
|
77
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
80
78
|
id_role: 0,
|
|
81
79
|
active: 1,
|
|
82
80
|
is_retailer: 0,
|
|
83
|
-
email_notify:
|
|
84
|
-
is_user_tech:
|
|
81
|
+
email_notify: 0,
|
|
82
|
+
is_user_tech: "AS",
|
|
85
83
|
membership: {
|
|
86
|
-
id:
|
|
87
|
-
start_date: "
|
|
88
|
-
end_date: "
|
|
84
|
+
id: 76,
|
|
85
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
86
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
89
87
|
planID: 8,
|
|
90
88
|
plan: "prod_KtlhECVSFG2iro",
|
|
91
89
|
name: "Plan Pro",
|
|
@@ -93,37 +91,21 @@ ProviderProductEditionDefault.args = {
|
|
|
93
91
|
products_limit: "5000",
|
|
94
92
|
type: "Enterprise",
|
|
95
93
|
},
|
|
96
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
94
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1669927021851",
|
|
97
95
|
},
|
|
98
96
|
company: {
|
|
99
|
-
id_company:
|
|
100
|
-
trade_name: "
|
|
101
|
-
company_name: "
|
|
102
|
-
rfc: "
|
|
103
|
-
adress: "
|
|
104
|
-
about_company:
|
|
105
|
-
telephone:
|
|
106
|
-
web_site:
|
|
107
|
-
zip_code:
|
|
97
|
+
id_company: 1,
|
|
98
|
+
trade_name: "GRUPO BRAHMA",
|
|
99
|
+
company_name: "GRUPO BRAHMA",
|
|
100
|
+
rfc: "XAXX010101000",
|
|
101
|
+
adress: "AA",
|
|
102
|
+
about_company: "",
|
|
103
|
+
telephone: "",
|
|
104
|
+
web_site: "",
|
|
105
|
+
zip_code: "",
|
|
108
106
|
email: null,
|
|
109
|
-
social_link:
|
|
107
|
+
social_link: "",
|
|
110
108
|
is_retailer: 0,
|
|
111
|
-
financedRetailers: [
|
|
112
|
-
{
|
|
113
|
-
id: 68,
|
|
114
|
-
name: "The Home Depot Merchants",
|
|
115
|
-
country: "México",
|
|
116
|
-
id_region: 1,
|
|
117
|
-
active: 1,
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
retailers: [
|
|
121
|
-
{
|
|
122
|
-
id: null,
|
|
123
|
-
name: null,
|
|
124
|
-
country: null,
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
109
|
},
|
|
128
110
|
showSurvey: (v) => v && alert("se muestra"),
|
|
129
111
|
};
|
|
@@ -42,7 +42,6 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
|
|
|
42
42
|
import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
|
|
43
43
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
44
44
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
45
|
-
import { number } from "prop-types";
|
|
46
45
|
|
|
47
46
|
const reducerImages = (state, action) => {
|
|
48
47
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -134,7 +133,6 @@ export const ProviderProductEdition = ({
|
|
|
134
133
|
setShowContentohRequestModal,
|
|
135
134
|
showSurvey,
|
|
136
135
|
company,
|
|
137
|
-
withChat,
|
|
138
136
|
}) => {
|
|
139
137
|
const [activeTab, setActiveTab] = useState("Descripción");
|
|
140
138
|
const [activeImage, setActiveImage] = useState();
|
|
@@ -274,7 +272,8 @@ export const ProviderProductEdition = ({
|
|
|
274
272
|
|
|
275
273
|
setImages({ action: "init", init: services[2] });
|
|
276
274
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
277
|
-
|
|
275
|
+
|
|
276
|
+
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
278
277
|
setLoading(false);
|
|
279
278
|
};
|
|
280
279
|
|
|
@@ -364,13 +363,12 @@ export const ProviderProductEdition = ({
|
|
|
364
363
|
useEffect(() => {
|
|
365
364
|
const productTemp = product;
|
|
366
365
|
const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
retailer
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
366
|
+
retailers?.forEach((retailer) => {
|
|
367
|
+
retailer["percentage"] = percentages?.find(
|
|
368
|
+
(percent) => retailer?.id === percent?.id_retailer
|
|
369
|
+
)?.percentage;
|
|
370
|
+
});
|
|
371
|
+
|
|
374
372
|
setProduct(productTemp);
|
|
375
373
|
setActivePercentage(retailers[0]?.percentage);
|
|
376
374
|
}, [percentages]);
|
|
@@ -1058,12 +1056,7 @@ export const ProviderProductEdition = ({
|
|
|
1058
1056
|
];
|
|
1059
1057
|
return (
|
|
1060
1058
|
<Container headerTop={headerTop}>
|
|
1061
|
-
<HeaderTop
|
|
1062
|
-
setHeaderTop={setHeaderTop}
|
|
1063
|
-
withChat={location?.state?.withChat}
|
|
1064
|
-
productSelected={productSelected}
|
|
1065
|
-
token={token}
|
|
1066
|
-
/>
|
|
1059
|
+
<HeaderTop setHeaderTop={setHeaderTop} />
|
|
1067
1060
|
<div className="data-container">
|
|
1068
1061
|
<div className="image-data-panel">
|
|
1069
1062
|
<ImagePreviewer
|
|
@@ -12,127 +12,90 @@ export const RetailerProductEditionDefault = Template.bind({});
|
|
|
12
12
|
RetailerProductEditionDefault.args = {
|
|
13
13
|
tabsSections: {
|
|
14
14
|
Descripción: true,
|
|
15
|
-
"Ficha técnica":
|
|
16
|
-
Imágenes:
|
|
15
|
+
"Ficha técnica": false,
|
|
16
|
+
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6IjllNTRjMDc0LWFjNzktNGEwNC1iOGEzLWNhOWU2ZmQxNDE3ZiIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjc3NTQ1NzA2LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjc3NTQ5MzA2LCJpYXQiOjE2Nzc1NDU3MDYsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.CS5zthG2PFlQIn5yCV64aadrBvh0ccEMlm8osN_BHTqqYARTiGJMnGUzD-FqmCB9JNeLn036eNHQ7TppqlvhBEe66-F7Aq3fSCMR2X31dWkASsg1E9kSmYS2V6NeG1G5WkfaIBOh7d7VH5Dnu6i5phne_BAu_fDbnBgsQUxQQMh-LMfv2heQ_MInJ6O2MrIzbYYMZYK7ioO5C7FvBnOCpDuk3DcgVFwuqBdVJAGkm-VYJbbnR6NYmYMnZfzrFJ8DjNE3O-L3ugVDOIfZOjuVBt2ZsfIB0-I7h_TBuIzwVE309f68AoDAujacOKvPORoN4ympPrAUSa7ZrM6ye2564g",
|
|
20
20
|
productSelected: {
|
|
21
21
|
services: {
|
|
22
22
|
datasheets: 1,
|
|
23
23
|
descriptions: 1,
|
|
24
24
|
images: 1,
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
27
|
-
status: "
|
|
28
|
-
datasheet_status: "
|
|
26
|
+
orderId: 130,
|
|
27
|
+
status: "PA",
|
|
28
|
+
datasheet_status: "PA",
|
|
29
29
|
prio: "none",
|
|
30
|
-
version:
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status: "
|
|
30
|
+
version: 17,
|
|
31
|
+
description_status: "PA",
|
|
32
|
+
images_status: "PA",
|
|
33
33
|
statusByRetailer: {
|
|
34
|
-
|
|
35
|
-
datasheet: "
|
|
36
|
-
description: "
|
|
37
|
-
images: "
|
|
38
|
-
},
|
|
39
|
-
5: {
|
|
40
|
-
datasheet: "CA",
|
|
41
|
-
description: "CA",
|
|
42
|
-
images: "AS",
|
|
43
|
-
},
|
|
44
|
-
6: {
|
|
45
|
-
description: "CA",
|
|
46
|
-
images: "AS",
|
|
47
|
-
datasheet: "CA",
|
|
48
|
-
},
|
|
49
|
-
12: {
|
|
50
|
-
datasheet: "CA",
|
|
51
|
-
description: "CA",
|
|
52
|
-
images: "AS",
|
|
53
|
-
},
|
|
54
|
-
17: {
|
|
55
|
-
datasheet: "CA",
|
|
56
|
-
description: "AC",
|
|
57
|
-
images: "AS",
|
|
34
|
+
58: {
|
|
35
|
+
datasheet: "PA",
|
|
36
|
+
description: "PA",
|
|
37
|
+
images: "PA",
|
|
58
38
|
},
|
|
59
39
|
},
|
|
60
40
|
article: {
|
|
61
|
-
id_article:
|
|
62
|
-
id_category: "
|
|
63
|
-
name: "
|
|
64
|
-
upc: "
|
|
65
|
-
timestamp: "
|
|
41
|
+
id_article: 3,
|
|
42
|
+
id_category: "2032",
|
|
43
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
44
|
+
upc: "161157",
|
|
45
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
66
46
|
id_user: 28,
|
|
67
47
|
status: "NULL",
|
|
68
48
|
active: 1,
|
|
69
49
|
company_id: 1,
|
|
70
50
|
company_name: "GRUPO BRAHMA",
|
|
71
51
|
country: "México",
|
|
72
|
-
id_order:
|
|
73
|
-
id_datasheet_especialist:
|
|
74
|
-
id_datasheet_facilitator:
|
|
75
|
-
id_description_especialist:
|
|
76
|
-
id_description_facilitator:
|
|
77
|
-
id_images_especialist:
|
|
78
|
-
id_images_facilitator:
|
|
79
|
-
id_auditor:
|
|
52
|
+
id_order: 130,
|
|
53
|
+
id_datasheet_especialist: null,
|
|
54
|
+
id_datasheet_facilitator: null,
|
|
55
|
+
id_description_especialist: null,
|
|
56
|
+
id_description_facilitator: null,
|
|
57
|
+
id_images_especialist: null,
|
|
58
|
+
id_images_facilitator: null,
|
|
59
|
+
id_auditor: null,
|
|
80
60
|
id_recepcionist: null,
|
|
81
|
-
category:
|
|
82
|
-
"Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
61
|
+
category: "Decoración|Cortinas y Persianas|Cortinas",
|
|
83
62
|
missingAttributes: 0,
|
|
84
63
|
missingDescriptions: 0,
|
|
85
64
|
missingImages: 0,
|
|
86
65
|
},
|
|
87
66
|
retailers: [
|
|
88
67
|
{
|
|
89
|
-
id:
|
|
90
|
-
name: "
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: 5,
|
|
94
|
-
name: "Chedraui",
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: 6,
|
|
98
|
-
name: "HEB",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 12,
|
|
102
|
-
name: "La Comer",
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: 17,
|
|
106
|
-
name: "Genérico",
|
|
68
|
+
id: 58,
|
|
69
|
+
name: "The Home Depot Golden",
|
|
107
70
|
},
|
|
108
71
|
],
|
|
109
72
|
country: "México",
|
|
110
|
-
upc: "
|
|
73
|
+
upc: "161157",
|
|
111
74
|
},
|
|
112
75
|
location: {
|
|
113
|
-
product: { articleId:
|
|
76
|
+
product: { articleId: 109485, versionId: 3 },
|
|
114
77
|
},
|
|
115
78
|
user: {
|
|
116
|
-
id_user:
|
|
117
|
-
name: "
|
|
118
|
-
last_name: "",
|
|
119
|
-
email: "
|
|
120
|
-
position: "",
|
|
79
|
+
id_user: 30,
|
|
80
|
+
name: "Admin",
|
|
81
|
+
last_name: "Ulises",
|
|
82
|
+
email: "salmeron.5@hotmail.com",
|
|
83
|
+
position: "Admin",
|
|
121
84
|
telephone: "",
|
|
122
|
-
country: "",
|
|
85
|
+
country: "México",
|
|
123
86
|
id_company: 2,
|
|
124
|
-
id_cognito: "
|
|
87
|
+
id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
|
|
125
88
|
birth_Date: null,
|
|
126
89
|
about_me: "",
|
|
127
90
|
zip_code: "",
|
|
128
91
|
address: "",
|
|
129
92
|
job: "",
|
|
130
93
|
id_stripe: "",
|
|
131
|
-
id_role:
|
|
94
|
+
id_role: 6,
|
|
132
95
|
active: 1,
|
|
133
96
|
is_retailer: 0,
|
|
134
97
|
email_notify: 1,
|
|
135
|
-
is_user_tech:
|
|
98
|
+
is_user_tech: "ADMIN-AS",
|
|
136
99
|
membership: {
|
|
137
100
|
id: 2,
|
|
138
101
|
start_date: "2021-11-05T02:35:12.000Z",
|
|
@@ -144,6 +107,6 @@ RetailerProductEditionDefault.args = {
|
|
|
144
107
|
products_limit: "3",
|
|
145
108
|
type: "PyMES",
|
|
146
109
|
},
|
|
147
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
110
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1676494961913",
|
|
148
111
|
},
|
|
149
112
|
};
|
|
@@ -176,7 +176,6 @@ export const RetailerProductEdition = ({
|
|
|
176
176
|
const [percentages, setPercentages] = useState(
|
|
177
177
|
new Array(product?.retailers?.length).fill({ percentage: 0 })
|
|
178
178
|
);
|
|
179
|
-
// const [percentages, setPercentages] = useState([{ retailers: {} }]);
|
|
180
179
|
const [activePercentage, setActivePercentage] = useState(0);
|
|
181
180
|
const [activeRetailer, setActiveRetailer] = useState({});
|
|
182
181
|
const [services, setServices] = useState([]);
|
|
@@ -244,9 +243,7 @@ export const RetailerProductEdition = ({
|
|
|
244
243
|
};
|
|
245
244
|
|
|
246
245
|
useEffect(() => {
|
|
247
|
-
|
|
248
|
-
loadAuditableData();
|
|
249
|
-
}
|
|
246
|
+
loadAuditableData();
|
|
250
247
|
}, [auditableVersion]);
|
|
251
248
|
|
|
252
249
|
useEffect(() => {
|
|
@@ -267,9 +264,12 @@ export const RetailerProductEdition = ({
|
|
|
267
264
|
//Converts the data inside the datasheets object to array
|
|
268
265
|
setServices(services);
|
|
269
266
|
getServices();
|
|
267
|
+
|
|
268
|
+
// setActiveRetailer(product?.retailers[0]);
|
|
270
269
|
setImages({ action: "init", init: services[2] });
|
|
271
270
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
272
|
-
|
|
271
|
+
|
|
272
|
+
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
273
273
|
setLoading(false);
|
|
274
274
|
} catch (error) {
|
|
275
275
|
console.log(error);
|
|
@@ -410,23 +410,25 @@ export const RetailerProductEdition = ({
|
|
|
410
410
|
}, [userGroups]);
|
|
411
411
|
|
|
412
412
|
useEffect(() => {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
);
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
setActivePercentage(retailers[0]?.percentage);
|
|
413
|
+
product?.retailers?.forEach((retailer) => {
|
|
414
|
+
retailer["percentage"] = percentages.length
|
|
415
|
+
? percentages?.filter(
|
|
416
|
+
(percent) => retailer?.id === percent?.id_retailer
|
|
417
|
+
)[0]?.percentage
|
|
418
|
+
: 0;
|
|
419
|
+
});
|
|
420
|
+
setActivePercentage(product?.retailers[0]?.percentage);
|
|
425
421
|
}, [percentages]);
|
|
426
422
|
|
|
427
423
|
useEffect(() => {
|
|
428
424
|
getInputsData(services, activeRetailer, setDatasheets, setDescriptions);
|
|
429
|
-
auditableVersion &&
|
|
425
|
+
auditableVersion &&
|
|
426
|
+
getInputsData(
|
|
427
|
+
auditServices,
|
|
428
|
+
activeRetailer,
|
|
429
|
+
setAuditDatasheets,
|
|
430
|
+
setAuditDescriptions
|
|
431
|
+
);
|
|
430
432
|
setActivePercentage(Math.round(activeRetailer?.percentage, 0));
|
|
431
433
|
activeRetailer?.id &&
|
|
432
434
|
setImages({ action: "orderImages", retailerId: activeRetailer.id });
|
|
@@ -5,9 +5,8 @@ export const getAuditVersion = async (articleId, setState, token) => {
|
|
|
5
5
|
`${process.env.REACT_APP_GET_AUDIT}?articleId=${articleId}`,
|
|
6
6
|
{ headers: { Authorization: token } }
|
|
7
7
|
);
|
|
8
|
-
|
|
9
8
|
if (auditResponse.status === 200) {
|
|
10
|
-
setState(JSON.parse(auditResponse.data.body).data
|
|
9
|
+
setState(JSON.parse(auditResponse.data.body).data);
|
|
11
10
|
}
|
|
12
11
|
};
|
|
13
12
|
|