contentoh-components-library 21.2.63 → 21.2.66
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 +4 -1
- package/dist/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +323 -0
- package/dist/components/atoms/CustomSelectItem/index.js +174 -0
- package/dist/components/atoms/CustomSelectItem/styles.js +20 -0
- package/dist/components/atoms/GradientPanel/GradientPanel.stories.js +1 -1
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
- package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
- package/dist/components/molecules/CustomSelect/index.js +35 -14
- package/dist/components/molecules/CustomSelect/styles.js +1 -1
- package/dist/components/molecules/GalleryHeader/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +10 -5
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/TagAndInput/styles.js +1 -1
- package/dist/components/molecules/VersionItem/index.js +4 -4
- package/dist/components/organisms/VersionSelector/index.js +1 -1
- package/dist/components/pages/Dashboard/dashboardUtils.js +25 -32
- package/dist/components/pages/Dashboard/index.js +6 -6
- package/package.json +6 -1
- package/src/assets/images/chatPopup/Spinner.gif +0 -0
- package/src/assets/images/chatPopup/close.svg +3 -0
- 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 +1 -0
- package/src/assets/images/chatPopup/document.svg +1 -0
- package/src/assets/images/chatPopup/iconChat.svg +19 -0
- package/src/assets/images/chatPopup/iconPlus.svg +3 -0
- package/src/assets/images/chatPopup/pdf.svg +75 -0
- package/src/assets/images/chatPopup/remove.svg +4 -0
- package/src/assets/images/chatPopup/send.svg +3 -0
- package/src/assets/images/chatPopup/svgIcon.svg +109 -0
- package/src/assets/images/chatPopup/upload_file.svg +3 -0
- package/src/assets/images/chatPopup/xls.svg +53 -0
- package/src/assets/images/customSelect/starIcon.svg +14 -0
- package/src/components/atoms/ChatPopUp/ChatPopUp.stories.js +11 -0
- package/src/components/atoms/ChatPopUp/index.js +541 -0
- package/src/components/atoms/ChatPopUp/styles.js +278 -0
- package/src/components/atoms/ChatPopUp/utils/handlersChat.js +104 -0
- package/src/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +410 -0
- package/src/components/atoms/CustomSelectItem/index.js +144 -0
- package/src/components/atoms/CustomSelectItem/styles.js +32 -0
- package/src/components/atoms/GradientPanel/GradientPanel.stories.js +1 -1
- package/src/components/atoms/Tooltip/Tooltip.stories.js +15 -0
- package/src/components/atoms/Tooltip/index.js +35 -0
- package/src/components/atoms/Tooltip/styles.js +5 -0
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +19 -11
- package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
- package/src/components/molecules/CustomSelect/index.js +8 -3
- package/src/components/molecules/CustomSelect/styles.js +0 -2
- package/src/components/molecules/GalleryHeader/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +10 -6
- package/src/components/molecules/HeaderTop/styles.js +4 -0
- package/src/components/molecules/TagAndInput/styles.js +1 -2
- package/src/components/molecules/VersionItem/index.js +6 -6
- package/src/components/organisms/VersionSelector/index.js +1 -1
- package/src/components/pages/Dashboard/dashboardUtils.js +18 -22
- package/src/components/pages/Dashboard/index.js +6 -6
|
@@ -7,6 +7,7 @@ export const SelecItem = ({
|
|
|
7
7
|
setParameterArray,
|
|
8
8
|
activeFilters,
|
|
9
9
|
setActiveFilters,
|
|
10
|
+
onClickItem,
|
|
10
11
|
}) => {
|
|
11
12
|
const [showSubOptions, setShowSubOptions] = useState(false);
|
|
12
13
|
const [chkGlobal, setChkGlobal] = useState(false);
|
|
@@ -17,6 +18,9 @@ export const SelecItem = ({
|
|
|
17
18
|
id={"main-item-" + option.id}
|
|
18
19
|
label={option.name}
|
|
19
20
|
onChange={(e) => {
|
|
21
|
+
if (onClickItem) {
|
|
22
|
+
onClickItem(e.target.checked, option.id)
|
|
23
|
+
}
|
|
20
24
|
const subOptions = option.subOptions;
|
|
21
25
|
const filtersCopy = { ...activeFilters };
|
|
22
26
|
if (subOptions) {
|
|
@@ -77,6 +81,9 @@ export const SelecItem = ({
|
|
|
77
81
|
activeFilters[option.name][sub.name]
|
|
78
82
|
}
|
|
79
83
|
onChange={(e) => {
|
|
84
|
+
if (onClickItem) {
|
|
85
|
+
onClickItem(e.target.checked, sub.id)
|
|
86
|
+
}
|
|
80
87
|
if (e.target.checked) {
|
|
81
88
|
setParameterArray((current) =>
|
|
82
89
|
[...current, sub.id].sort((a, b) => a - b)
|
|
@@ -4,7 +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 {
|
|
7
|
+
import { CustomSelectItem } from "../../atoms/CustomSelectItem";
|
|
8
8
|
|
|
9
9
|
export const CustomSelect = ({
|
|
10
10
|
options,
|
|
@@ -13,6 +13,7 @@ export const CustomSelect = ({
|
|
|
13
13
|
selectLabel = "",
|
|
14
14
|
customSelectId = "defaultSelectId",
|
|
15
15
|
defaultOption,
|
|
16
|
+
parameterArray,
|
|
16
17
|
setParameterArray,
|
|
17
18
|
onClickItem,
|
|
18
19
|
icon,
|
|
@@ -84,7 +85,7 @@ export const CustomSelect = ({
|
|
|
84
85
|
setFilters(filteredArray);
|
|
85
86
|
}, [text]);
|
|
86
87
|
|
|
87
|
-
useEffect(() => {
|
|
88
|
+
useEffect(async () => {
|
|
88
89
|
let newFiltersString = selectLabel;
|
|
89
90
|
let counter = 0;
|
|
90
91
|
const filtersArray = Object.keys(activeFilters);
|
|
@@ -164,14 +165,18 @@ export const CustomSelect = ({
|
|
|
164
165
|
<p>{option.name}</p>
|
|
165
166
|
</div>
|
|
166
167
|
) : (
|
|
167
|
-
<
|
|
168
|
+
<CustomSelectItem
|
|
169
|
+
className={"main-option"}
|
|
168
170
|
key={customSelectId + option.id}
|
|
169
171
|
option={option}
|
|
170
172
|
customSelectId={customSelectId}
|
|
171
173
|
setParameterArray={setParameterArray}
|
|
172
174
|
activeFilters={activeFilters}
|
|
175
|
+
globalFilters={activeFilters}
|
|
176
|
+
parameterArray={parameterArray}
|
|
173
177
|
setActiveFilters={setActiveFilters}
|
|
174
178
|
onClickItem={onClickItem}
|
|
179
|
+
route={option.name}
|
|
175
180
|
/>
|
|
176
181
|
)
|
|
177
182
|
)}
|
|
@@ -11,8 +11,6 @@ export const Container = styled.div`
|
|
|
11
11
|
font-size: 13px;
|
|
12
12
|
display: flex;
|
|
13
13
|
padding: ${(props) => (props.selectLabel !== "" ? "10px 15px" : "5px 5px")};
|
|
14
|
-
//padding: 10px 15px;
|
|
15
|
-
//padding: 5px 5px;
|
|
16
14
|
justify-content: space-between;
|
|
17
15
|
border-radius: 50px;
|
|
18
16
|
background-color: ${({ filterActive }) =>
|
|
@@ -13,7 +13,7 @@ export const GalleryHeader = ({ setCheckAll, setSelectedImages, shotThd }) => {
|
|
|
13
13
|
<div>
|
|
14
14
|
<CheckBox id="check-all-images" onChange={(e) => checkAll(e)} />
|
|
15
15
|
</div>
|
|
16
|
-
<p className="image-header">
|
|
16
|
+
<p className="image-header">Imagen</p>
|
|
17
17
|
<p className="image-name">Nombre</p>
|
|
18
18
|
<p className="image-size">Tamaño</p>
|
|
19
19
|
<p className="image-format">Formato</p>
|
|
@@ -2,6 +2,7 @@ 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 { ChatPopUp } from "../../atoms/ChatPopUp/index";
|
|
5
6
|
|
|
6
7
|
export const HeaderTop = ({ setHeaderTop }) => {
|
|
7
8
|
const headerTop = useRef();
|
|
@@ -13,12 +14,15 @@ export const HeaderTop = ({ setHeaderTop }) => {
|
|
|
13
14
|
return (
|
|
14
15
|
<Container ref={headerTop}>
|
|
15
16
|
<ScreenHeader text="Edición de producto" />
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
<div className="buttons-top">
|
|
18
|
+
{/* <ChatPopUp /> */}
|
|
19
|
+
<Button
|
|
20
|
+
buttonType="close-button"
|
|
21
|
+
onClick={() => {
|
|
22
|
+
window.location.href = `/products`;
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
22
26
|
</Container>
|
|
23
27
|
);
|
|
24
28
|
};
|
|
@@ -18,7 +18,7 @@ export const VersionItem = ({
|
|
|
18
18
|
let textExportedDate = "";
|
|
19
19
|
if (timestamp !== null) {
|
|
20
20
|
const exportedDate = new Date(timestamp).toLocaleDateString();
|
|
21
|
-
textExportedDate =
|
|
21
|
+
textExportedDate = `Última vez exportado: ${exportedDate}`;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
return (
|
|
@@ -36,19 +36,19 @@ export const VersionItem = ({
|
|
|
36
36
|
</div>
|
|
37
37
|
<div className="version-info">
|
|
38
38
|
<ScreenHeader
|
|
39
|
-
text={"
|
|
39
|
+
text={"Versión " + version}
|
|
40
40
|
headerType={"input-name-header"}
|
|
41
41
|
color={GlobalColors.magenta_s2}
|
|
42
42
|
/>
|
|
43
43
|
<p>{textExportedDate}</p>
|
|
44
44
|
<p>
|
|
45
45
|
{currentVersion
|
|
46
|
-
? "
|
|
46
|
+
? "Versión actual"
|
|
47
47
|
: articleStatus
|
|
48
|
-
? "Edición Content-
|
|
49
|
-
: "
|
|
48
|
+
? "Edición Content-Oh!"
|
|
49
|
+
: "Versión de " + productOwner}
|
|
50
50
|
</p>
|
|
51
|
-
<p>{articleStatus ? "Content-
|
|
51
|
+
<p>{articleStatus ? "Content-Oh! digital" : productOwner}</p>
|
|
52
52
|
</div>
|
|
53
53
|
</Container>
|
|
54
54
|
);
|
|
@@ -47,7 +47,7 @@ export const VersionSelector = ({
|
|
|
47
47
|
<Container id={modalId}>
|
|
48
48
|
<div className="versions-header">
|
|
49
49
|
<ScreenHeader
|
|
50
|
-
text={"
|
|
50
|
+
text={"Versión del producto"}
|
|
51
51
|
headerType={"input-name-header"}
|
|
52
52
|
color={GlobalColors.white}
|
|
53
53
|
fontFamily={FontFamily.Lato}
|
|
@@ -39,28 +39,8 @@ export const getCategories = async (user, company) => {
|
|
|
39
39
|
const response = await axios.get(
|
|
40
40
|
`${process.env.REACT_APP_CATEGORY_ENDPOINT}${query}`
|
|
41
41
|
);
|
|
42
|
-
const categories = JSON.parse(response.data.body)?.data;
|
|
43
|
-
const
|
|
44
|
-
const subCategories = categoriesKeys?.map(
|
|
45
|
-
(key) => categories[key].sub_category
|
|
46
|
-
);
|
|
47
|
-
const finalArray = [];
|
|
48
|
-
let index = 0;
|
|
49
|
-
subCategories?.forEach((element) => {
|
|
50
|
-
element &&
|
|
51
|
-
Object.keys(element || {}).forEach((key) => {
|
|
52
|
-
const subCategory = element[key]?.sub_category || {};
|
|
53
|
-
const subOptions = [];
|
|
54
|
-
Object.keys(subCategory)?.forEach((subKey) => {
|
|
55
|
-
subOptions.push({
|
|
56
|
-
id: subCategory[subKey].id_category,
|
|
57
|
-
name: subKey,
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
finalArray.push({ id: index++, name: key, subOptions });
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
finalArray.sort((a, b) => a.name.localeCompare(b.name));
|
|
42
|
+
const categories = JSON.parse(response.data.body)?.data || {};
|
|
43
|
+
const finalArray = getCategoriesRecursive(categories);
|
|
64
44
|
return finalArray;
|
|
65
45
|
};
|
|
66
46
|
|
|
@@ -71,3 +51,19 @@ export const formatDate = (date) => {
|
|
|
71
51
|
const day = newDate.getDate();
|
|
72
52
|
return `${year}/${month}/${day}`;
|
|
73
53
|
};
|
|
54
|
+
|
|
55
|
+
const getCategoriesRecursive = (object) => {
|
|
56
|
+
const keys = Object.keys(object);
|
|
57
|
+
return keys.map((key, index) => {
|
|
58
|
+
const { sub_category } = object[key];
|
|
59
|
+
if (sub_category) {
|
|
60
|
+
return {
|
|
61
|
+
id: index,
|
|
62
|
+
name: key,
|
|
63
|
+
subOptions: getCategoriesRecursive(sub_category),
|
|
64
|
+
};
|
|
65
|
+
} else {
|
|
66
|
+
return { id: object[key].id_category, name: key };
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
};
|
|
@@ -235,7 +235,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
235
235
|
showFilterString={true}
|
|
236
236
|
options={dateOptions}
|
|
237
237
|
selectLabel="Todo el tiempo"
|
|
238
|
-
placeHolder="Buscar
|
|
238
|
+
placeHolder="Buscar fecha"
|
|
239
239
|
customSelectId="dates-select"
|
|
240
240
|
parameterArray={datesRange}
|
|
241
241
|
setParameterArray={setDatesRange}
|
|
@@ -245,7 +245,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
245
245
|
showSearchBar={true}
|
|
246
246
|
options={providers}
|
|
247
247
|
selectLabel="Todos los proveedores"
|
|
248
|
-
placeHolder="Buscar
|
|
248
|
+
placeHolder="Buscar proveedor"
|
|
249
249
|
customSelectId="providers-select"
|
|
250
250
|
parameterArray={companyId}
|
|
251
251
|
setParameterArray={setCompanyId}
|
|
@@ -256,7 +256,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
256
256
|
showSearchBar={true}
|
|
257
257
|
options={categories}
|
|
258
258
|
selectLabel="Todas las categorías"
|
|
259
|
-
placeHolder="Buscar
|
|
259
|
+
placeHolder="Buscar categoría"
|
|
260
260
|
customSelectId="category-select"
|
|
261
261
|
parameterArray={categoryId}
|
|
262
262
|
setParameterArray={setCategoryId}
|
|
@@ -266,12 +266,12 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
266
266
|
showFilterString={true}
|
|
267
267
|
showSearchBar={true}
|
|
268
268
|
options={retailers}
|
|
269
|
-
selectLabel="
|
|
270
|
-
placeHolder="Buscar
|
|
269
|
+
selectLabel="Todas las cadenas"
|
|
270
|
+
placeHolder="Buscar cadena"
|
|
271
271
|
customSelectId="retailers-select"
|
|
272
272
|
parameterArray={retailerId}
|
|
273
273
|
setParameterArray={setRetailerId}
|
|
274
|
-
defaultOption={"
|
|
274
|
+
defaultOption={"Todas las cadenas"}
|
|
275
275
|
/>
|
|
276
276
|
{user.is_retailer === 1 && (
|
|
277
277
|
<CustomSelect
|