contentoh-components-library 21.5.12 → 21.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/images/Icons/save-white-gray.svg +1 -1
- package/dist/assets/images/Icons/save-white.svg +1 -1
- package/dist/components/atoms/GeneralInput/styles.js +1 -1
- package/dist/components/atoms/ProductImage/index.js +27 -9
- package/dist/components/atoms/ProductImage/styles.js +1 -1
- package/dist/components/organisms/Table/index.js +16 -2
- package/dist/components/organisms/Table/styles.js +17 -11
- package/dist/components/pages/MultipleEdition/MultipleEdition.stories.js +3 -3
- package/dist/components/pages/MultipleEdition/index.js +5 -3
- package/dist/components/pages/MultipleEdition/styles.js +2 -2
- package/dist/components/pages/MultipleEdition/utils.js +99 -43
- package/dist/components/pages/ProductEditionv2/index.js +18 -17
- package/dist/components/pages/RetailerProductEdition/generateThumnail.js +34 -0
- package/dist/components/pages/RetailerProductEdition/index.js +465 -262
- package/package.json +1 -1
- package/src/assets/images/Icons/save-white-gray.svg +1 -1
- package/src/assets/images/Icons/save-white.svg +1 -1
- package/src/components/atoms/GeneralInput/styles.js +1 -1
- package/src/components/atoms/ProductImage/index.js +24 -11
- package/src/components/atoms/ProductImage/styles.js +7 -0
- package/src/components/organisms/Table/index.js +12 -2
- package/src/components/organisms/Table/styles.js +6 -5
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +3 -3
- package/src/components/pages/MultipleEdition/index.js +5 -1
- package/src/components/pages/MultipleEdition/styles.js +34 -8
- package/src/components/pages/MultipleEdition/utils.js +109 -57
- package/src/components/pages/ProductEditionv2/index.js +1 -1
- package/src/components/pages/RetailerProductEdition/generateThumnail.js +21 -0
- package/src/components/pages/RetailerProductEdition/index.js +141 -24
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<rect width="34" height="34" rx="17" fill="#F0F0F0"/>
|
|
3
3
|
<mask id="mask0_346_670" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="10" y="10" width="14" height="14">
|
|
4
4
|
<rect x="10" y="10" width="14" height="14" fill="#D9D9D9"/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<rect width="34" height="34" rx="17" fill="#E33AA9"/>
|
|
3
3
|
<mask id="mask0_346_670" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="10" y="10" width="14" height="14">
|
|
4
4
|
<rect x="10" y="10" width="14" height="14" fill="#D9D9D9"/>
|
|
@@ -2,15 +2,28 @@ import { Container } from "./styles";
|
|
|
2
2
|
import ReactImageFallback from "react-image-fallback";
|
|
3
3
|
import defaultProductImage from "../../../assets/images/defaultImages/defaultProductImage.png";
|
|
4
4
|
|
|
5
|
-
export const ProductImage = ({ img, imageType, altText, onClick
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export const ProductImage = ({ img, imageType, altText, onClick}) => {
|
|
6
|
+
// Expresión regular para validar que los últimos tres caracteres sean ".mp4"
|
|
7
|
+
const regex = /\.mp4$/;
|
|
8
|
+
if (regex.test(img)){
|
|
9
|
+
return (
|
|
10
|
+
<Container className={imageType}>
|
|
11
|
+
<video controls width="100%" height="auto">
|
|
12
|
+
<source src= {img} type="video/mp4" />
|
|
13
|
+
</video>
|
|
14
|
+
</Container>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
else{
|
|
18
|
+
return (
|
|
19
|
+
<Container className={imageType}>
|
|
20
|
+
<ReactImageFallback
|
|
21
|
+
src={img}
|
|
22
|
+
fallbackImage={defaultProductImage}
|
|
23
|
+
alt={altText}
|
|
24
|
+
onClick={onClick}
|
|
25
|
+
/>
|
|
26
|
+
</Container>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
16
29
|
};
|
|
@@ -27,6 +27,9 @@ export const Container = styled.div`
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
&.catalogue-image-big-size {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
align-items: center;
|
|
30
33
|
img {
|
|
31
34
|
width: 179px;
|
|
32
35
|
height: 179px;
|
|
@@ -53,6 +56,9 @@ export const Container = styled.div`
|
|
|
53
56
|
&.expanded-modal-image {
|
|
54
57
|
width: 710px;
|
|
55
58
|
height: 710px;
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
align-items: center;
|
|
56
62
|
|
|
57
63
|
img {
|
|
58
64
|
width: 710px;
|
|
@@ -60,3 +66,4 @@ export const Container = styled.div`
|
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
`;
|
|
69
|
+
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { CheckBox } from "../../atoms/CheckBox";
|
|
3
3
|
import { Container, TH, TD } from "./styles";
|
|
4
|
+
import { Tooltip } from "../../atoms/Tooltip";
|
|
4
5
|
|
|
5
|
-
export const Table = ({ columns, data, withCheckbox }) => {
|
|
6
|
+
export const Table = ({ columns, data, withCheckbox, withTooltip=false }) => {
|
|
6
7
|
const [rowsChecked, setRowsChecked] = useState([]);
|
|
7
8
|
|
|
8
9
|
function handlerSelectAll(evt) {
|
|
@@ -40,7 +41,16 @@ export const Table = ({ columns, data, withCheckbox }) => {
|
|
|
40
41
|
withCheckbox={withCheckbox}
|
|
41
42
|
{...column}
|
|
42
43
|
>
|
|
43
|
-
|
|
44
|
+
{column.description && withTooltip ? (
|
|
45
|
+
<Tooltip
|
|
46
|
+
componentTooltip={<span>{column.description}</span>}
|
|
47
|
+
position="topCenter"
|
|
48
|
+
>
|
|
49
|
+
<span>{column.Header}</span>
|
|
50
|
+
</Tooltip>
|
|
51
|
+
) : (
|
|
52
|
+
<span>{column.Header}</span>
|
|
53
|
+
)}
|
|
44
54
|
</TH>
|
|
45
55
|
))}
|
|
46
56
|
</tr>
|
|
@@ -21,7 +21,7 @@ export const Container = styled.div`
|
|
|
21
21
|
top: 0;
|
|
22
22
|
height: 45px;
|
|
23
23
|
position: sticky;
|
|
24
|
-
z-index:
|
|
24
|
+
z-index: 2;
|
|
25
25
|
& > tr {
|
|
26
26
|
background-color: #f7f7fc;
|
|
27
27
|
border-radius: 5px 5px 0px 0px;
|
|
@@ -66,6 +66,7 @@ export const Container = styled.div`
|
|
|
66
66
|
font-style: normal;
|
|
67
67
|
font-weight: 400;
|
|
68
68
|
line-height: normal;
|
|
69
|
+
gap:5px;
|
|
69
70
|
}
|
|
70
71
|
display: flex;
|
|
71
72
|
align-items: center;
|
|
@@ -78,12 +79,12 @@ export const TH = styled.th`
|
|
|
78
79
|
min-height: ${({ height }) => height ?? "auto"};
|
|
79
80
|
min-width: ${({ width }) => width ?? "auto"};
|
|
80
81
|
position: sticky;
|
|
81
|
-
left: 20px;
|
|
82
|
+
left: ${({ fixedToLeft }) => (fixedToLeft >= 0 ? `${fixedToLeft}px` : "20px")};
|
|
82
83
|
${({ fixedToLeft, withCheckbox }) =>
|
|
83
84
|
fixedToLeft >= 0 &&
|
|
84
85
|
css`
|
|
85
86
|
left: ${withCheckbox ? 20 + fixedToLeft : fixedToLeft}px;
|
|
86
|
-
z-index:
|
|
87
|
+
z-index: 10;
|
|
87
88
|
`}
|
|
88
89
|
`;
|
|
89
90
|
|
|
@@ -98,7 +99,7 @@ export const TD = styled.td`
|
|
|
98
99
|
vertical-align: middle;
|
|
99
100
|
z-index: 5;
|
|
100
101
|
position: sticky;
|
|
101
|
-
left: 20px;
|
|
102
|
+
left: ${({ fixedToLeft }) => (fixedToLeft >= 0 ? `${fixedToLeft}px` : "20px")};
|
|
102
103
|
.content {
|
|
103
104
|
white-space: nowrap;
|
|
104
105
|
overflow: hidden;
|
|
@@ -108,6 +109,6 @@ export const TD = styled.td`
|
|
|
108
109
|
fixedToLeft >= 0 &&
|
|
109
110
|
css`
|
|
110
111
|
left: ${withCheckbox ? 20 + fixedToLeft : fixedToLeft}px;
|
|
111
|
-
z-index:
|
|
112
|
+
z-index: 10;
|
|
112
113
|
`}
|
|
113
114
|
`;
|
|
@@ -9,9 +9,9 @@ const Template = (args) => <MultipleEdition {...args} />;
|
|
|
9
9
|
export const MultipleEditionDefault = Template.bind({});
|
|
10
10
|
|
|
11
11
|
MultipleEditionDefault.args = {
|
|
12
|
-
articles: [
|
|
13
|
-
versions: [1
|
|
12
|
+
articles: [121219],//[216, 238, 239],
|
|
13
|
+
versions: [1],
|
|
14
14
|
//token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxZmFjNjY2Ny1hMDMzLTQ1NjAtOWU5ZC01MTQwMDc2MmI2MWYiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjFmYWM2NjY3LWEwMzMtNDU2MC05ZTlkLTUxNDAwNzYyYjYxZiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRf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uuPTvHrl17ae8JkNoxVCJe5ZdfRrUN1lwUXnOZim7QhNg8YR_uvPs_EJRIwfw",
|
|
17
17
|
};
|
|
@@ -111,7 +111,10 @@ export const MultipleEdition = ({ articles, versions, onClose, token }) => {
|
|
|
111
111
|
<img
|
|
112
112
|
src={closeMagenta}
|
|
113
113
|
alt="Cerrar"
|
|
114
|
-
onClick={() =>
|
|
114
|
+
onClick={() => {
|
|
115
|
+
window.location.href = `/products`;
|
|
116
|
+
}}
|
|
117
|
+
//onClick={() => onClose && onClose()}
|
|
115
118
|
/>{" "}
|
|
116
119
|
</div>{" "}
|
|
117
120
|
<div className="table">
|
|
@@ -119,6 +122,7 @@ export const MultipleEdition = ({ articles, versions, onClose, token }) => {
|
|
|
119
122
|
withCheckbox
|
|
120
123
|
columns={currentData.columns}
|
|
121
124
|
data={currentData.data}
|
|
125
|
+
withTooltip={true}
|
|
122
126
|
/>{" "}
|
|
123
127
|
</div>{" "}
|
|
124
128
|
{modalFromTable} <Modal {...modal} />{" "}
|
|
@@ -37,6 +37,8 @@ export const Container = styled.div`
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.buttons-container{
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
40
42
|
background: white;
|
|
41
43
|
width: max-content;
|
|
42
44
|
padding: 8px;
|
|
@@ -44,7 +46,7 @@ export const Container = styled.div`
|
|
|
44
46
|
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
|
|
45
47
|
border-radius: 3px;
|
|
46
48
|
position: absolute;
|
|
47
|
-
top:
|
|
49
|
+
top: 0;
|
|
48
50
|
left: 50px;
|
|
49
51
|
z-index: 100;
|
|
50
52
|
}
|
|
@@ -61,7 +63,7 @@ export const Container = styled.div`
|
|
|
61
63
|
font-size: 13px;
|
|
62
64
|
line-height: 18px;
|
|
63
65
|
background-color: white;
|
|
64
|
-
|
|
66
|
+
margin-right:5px;
|
|
65
67
|
img {
|
|
66
68
|
& + p {
|
|
67
69
|
margin-left: 7px;
|
|
@@ -71,16 +73,12 @@ export const Container = styled.div`
|
|
|
71
73
|
&:hover {
|
|
72
74
|
border-radius: 10px;
|
|
73
75
|
}
|
|
74
|
-
|
|
75
|
-
& + * {
|
|
76
|
-
margin-top: 8px;
|
|
77
|
-
}
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
.validation-option {
|
|
79
|
+
display: flex;
|
|
81
80
|
width: 82px;
|
|
82
81
|
height: 20px;
|
|
83
|
-
display: flex;
|
|
84
82
|
align-items: center;
|
|
85
83
|
border: none;
|
|
86
84
|
cursor: pointer;
|
|
@@ -122,7 +120,7 @@ export const Container = styled.div`
|
|
|
122
120
|
line-height: 15px;
|
|
123
121
|
padding: 10px;
|
|
124
122
|
outline: none;
|
|
125
|
-
border-radius:
|
|
123
|
+
border-radius: 5px;
|
|
126
124
|
resize: none;
|
|
127
125
|
|
|
128
126
|
&:focus {
|
|
@@ -130,6 +128,34 @@ export const Container = styled.div`
|
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
130
|
|
|
131
|
+
.general-input {
|
|
132
|
+
width: 100%;
|
|
133
|
+
height:27px;
|
|
134
|
+
max-height:100px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.select-edition-multiple {
|
|
138
|
+
padding: 5px 10px;
|
|
139
|
+
border-radius: 5px;
|
|
140
|
+
gap: 10px;
|
|
141
|
+
border:1px solid ${GlobalColors.gray_light};
|
|
142
|
+
border-width: 1px 2px 1px 1px;
|
|
143
|
+
outline: none;
|
|
144
|
+
border-image: initial;
|
|
145
|
+
width: 100%;
|
|
146
|
+
min-height:27px;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
color: ${GlobalColors.deep_gray};
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
line-height: 21px;
|
|
151
|
+
overflow:hidden;
|
|
152
|
+
white-space:nowrap;
|
|
153
|
+
text-overflow:ellipsis;
|
|
154
|
+
:focus{
|
|
155
|
+
border:1px solid ${GlobalColors.magenta_s2};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
133
159
|
.tooltip {
|
|
134
160
|
position: relative;
|
|
135
161
|
display: inline-block;
|
|
@@ -11,6 +11,9 @@ import infoIcon from "../../../assets/images/Icons/info.svg";
|
|
|
11
11
|
import saveWhite from "../../../assets/images/Icons/save-white.svg";
|
|
12
12
|
import saveWhiteGray from "../../../assets/images/Icons/save-white-gray.svg";
|
|
13
13
|
import { DockSharp } from "@mui/icons-material";
|
|
14
|
+
import React, { useState } from 'react';
|
|
15
|
+
import nullIcon from "../../../assets/images/generalButton/nullIcon.svg";
|
|
16
|
+
import { Tooltip } from "../../atoms/Tooltip";
|
|
14
17
|
|
|
15
18
|
// variables
|
|
16
19
|
export const optionsSelect = [
|
|
@@ -500,9 +503,37 @@ export function setDataColumns(
|
|
|
500
503
|
accessor: `${attributeId + "-" + ret.id}`,
|
|
501
504
|
width: "200px",
|
|
502
505
|
style: styleData,
|
|
506
|
+
description: rules[attributeId].description,
|
|
503
507
|
});
|
|
504
508
|
}
|
|
505
509
|
});
|
|
510
|
+
|
|
511
|
+
const handleChangeOptions = (attributeId, newValue) => {
|
|
512
|
+
const updatedAttributes = Object.values(item.attributes).map((attr) => {
|
|
513
|
+
if (attr.attributeId === attributeId) {
|
|
514
|
+
return { ...attr, value: newValue };
|
|
515
|
+
}
|
|
516
|
+
return attr;
|
|
517
|
+
});
|
|
518
|
+
const updatedAttributesObject = {};
|
|
519
|
+
updatedAttributes.forEach((attr) => {
|
|
520
|
+
updatedAttributesObject[attr.attributeId] = attr;
|
|
521
|
+
});
|
|
522
|
+
return updatedAttributesObject;
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
const inputTypeValue = (type) => {
|
|
528
|
+
switch (type) {
|
|
529
|
+
case "Booleano":
|
|
530
|
+
return "checkbox";
|
|
531
|
+
case "Numérico":
|
|
532
|
+
return "number";
|
|
533
|
+
default:
|
|
534
|
+
return "text";
|
|
535
|
+
}
|
|
536
|
+
};
|
|
506
537
|
Object.values(item.attributes).forEach((des) => {
|
|
507
538
|
const props = {
|
|
508
539
|
inputId:
|
|
@@ -518,7 +549,45 @@ export function setDataColumns(
|
|
|
518
549
|
"-" +
|
|
519
550
|
item.version,
|
|
520
551
|
value: des.value,
|
|
552
|
+
inputType:inputTypeValue(des.type),
|
|
521
553
|
};
|
|
554
|
+
let inputComponent;
|
|
555
|
+
if (des.option_list.length>0) {
|
|
556
|
+
inputComponent = (
|
|
557
|
+
<select
|
|
558
|
+
id={
|
|
559
|
+
item.id +
|
|
560
|
+
"_" +
|
|
561
|
+
rules[des.attributeId].attributeId +
|
|
562
|
+
"_" +
|
|
563
|
+
item.version
|
|
564
|
+
}
|
|
565
|
+
name={
|
|
566
|
+
item.id +
|
|
567
|
+
"-" +
|
|
568
|
+
rules[des.attributeId].attributeId +
|
|
569
|
+
"-" +
|
|
570
|
+
item.version
|
|
571
|
+
}
|
|
572
|
+
className="select-edition-multiple"
|
|
573
|
+
defaultValue={des.value}
|
|
574
|
+
onChange={(e) =>{
|
|
575
|
+
handleChangeOptions(des.attributeId, e.target.value)}
|
|
576
|
+
}
|
|
577
|
+
>
|
|
578
|
+
<option value="" selected disabled>Selecciona una opción</option>
|
|
579
|
+
{des.option_list.map((option, index) => (
|
|
580
|
+
<option key={index} value={option}>
|
|
581
|
+
{option}
|
|
582
|
+
</option>
|
|
583
|
+
))}
|
|
584
|
+
</select>
|
|
585
|
+
);
|
|
586
|
+
|
|
587
|
+
} else {
|
|
588
|
+
inputComponent = <TagAndInput {...props} />;
|
|
589
|
+
}
|
|
590
|
+
|
|
522
591
|
if (
|
|
523
592
|
!attributesReviewed.find(
|
|
524
593
|
(e) =>
|
|
@@ -568,38 +637,47 @@ export function setDataColumns(
|
|
|
568
637
|
src={acceptIcon}
|
|
569
638
|
alt="accept button"
|
|
570
639
|
/>
|
|
571
|
-
)}
|
|
640
|
+
)}
|
|
572
641
|
{attributesReviewed[index].isReviewed &&
|
|
573
642
|
!attributesReviewed[index].isApproved && (
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
643
|
+
<Tooltip position="topCenter" componentTooltip={<span>Debes aprobar o rechazar para continuar</span>}>
|
|
644
|
+
<div>
|
|
645
|
+
<img
|
|
646
|
+
id={
|
|
647
|
+
"button_" +
|
|
648
|
+
item.id +
|
|
649
|
+
"_" +
|
|
650
|
+
des.attributeId +
|
|
651
|
+
"_" +
|
|
652
|
+
item.version
|
|
653
|
+
}
|
|
654
|
+
src={nullIcon}
|
|
655
|
+
alt="null button"
|
|
656
|
+
/>
|
|
657
|
+
</div>
|
|
658
|
+
</Tooltip>
|
|
659
|
+
)}
|
|
587
660
|
{typeof des.isApproved === "undefined" &&
|
|
588
661
|
!attributesReviewed[index].isReviewed && (
|
|
589
|
-
<
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
662
|
+
<Tooltip position="topCenter" componentTooltip={<span>Debes aprobar o rechazar para continuar</span>}>
|
|
663
|
+
<div>
|
|
664
|
+
<img
|
|
665
|
+
id={
|
|
666
|
+
"button_" +
|
|
667
|
+
item.id +
|
|
668
|
+
"_" +
|
|
669
|
+
des.attributeId +
|
|
670
|
+
"_" +
|
|
671
|
+
item.version
|
|
672
|
+
}
|
|
673
|
+
src={nullIcon}
|
|
674
|
+
alt="null button"
|
|
675
|
+
/>
|
|
676
|
+
</div>
|
|
677
|
+
</Tooltip>
|
|
678
|
+
|
|
601
679
|
)}
|
|
602
|
-
</button>
|
|
680
|
+
</button>
|
|
603
681
|
{showValidationPanel &&
|
|
604
682
|
attributeSelected.articleId === item.id &&
|
|
605
683
|
attributeSelected.attributeId === des.attributeId &&
|
|
@@ -630,11 +708,11 @@ export function setDataColumns(
|
|
|
630
708
|
</div>
|
|
631
709
|
)}{" "}
|
|
632
710
|
{des.comment && <div class="tooltip">
|
|
633
|
-
|
|
711
|
+
{inputComponent}
|
|
634
712
|
<span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
|
|
635
713
|
</div>}
|
|
636
714
|
{!des.comment && <div>
|
|
637
|
-
|
|
715
|
+
{inputComponent}
|
|
638
716
|
</div>}
|
|
639
717
|
</>
|
|
640
718
|
);
|
|
@@ -674,9 +752,11 @@ export function setDataColumns(
|
|
|
674
752
|
accessor: `${descriptionId}`,
|
|
675
753
|
width: "250px",
|
|
676
754
|
style: styleData,
|
|
755
|
+
description:rules[ret.id][descriptionId].description
|
|
677
756
|
});
|
|
678
757
|
}
|
|
679
758
|
});
|
|
759
|
+
|
|
680
760
|
currentData[`retailer${ret.id}-save`] = (
|
|
681
761
|
<button
|
|
682
762
|
onClick={() => {
|
|
@@ -968,31 +1048,3 @@ async function updateArticleData(
|
|
|
968
1048
|
}
|
|
969
1049
|
}
|
|
970
1050
|
|
|
971
|
-
/**
|
|
972
|
-
* Componentes para guardar y validación multiple
|
|
973
|
-
* <img
|
|
974
|
-
src={saveWhite}
|
|
975
|
-
alt="Guardar"
|
|
976
|
-
onClick={() => {
|
|
977
|
-
const params = {
|
|
978
|
-
section, data: dataServices[section], token, callbackToInitData, setModal,
|
|
979
|
-
};
|
|
980
|
-
saveData(params);
|
|
981
|
-
}}
|
|
982
|
-
/>
|
|
983
|
-
|
|
984
|
-
<SelectV2
|
|
985
|
-
items={optionsSelect}
|
|
986
|
-
triggerType="click"
|
|
987
|
-
selectButton={{
|
|
988
|
-
type: "whiteS3",
|
|
989
|
-
label: "Validación masiva",
|
|
990
|
-
size: 12,
|
|
991
|
-
}}
|
|
992
|
-
typeSelectItems="labelOnly"
|
|
993
|
-
borderType="oval"
|
|
994
|
-
onChange={(selectedItems) => {
|
|
995
|
-
console.log(selectedItems);
|
|
996
|
-
}}
|
|
997
|
-
/>
|
|
998
|
-
*/
|
|
@@ -764,7 +764,7 @@ export const ProductEditionv2 = ({
|
|
|
764
764
|
const duplicated = imagesList?.filter((image) => {
|
|
765
765
|
return imagesListTemp[image?.image_id];
|
|
766
766
|
});
|
|
767
|
-
|
|
767
|
+
console.log(imagesList)
|
|
768
768
|
const attrForImgs = Object.values(images?.attrForImgs);
|
|
769
769
|
attrForImgs.pop();
|
|
770
770
|
const data = {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
function generateThumbnail(videoSrc, timeInSeconds) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const video = document.createElement('video');
|
|
6
|
+
video.crossOrigin = 'anonymous'; // Necessary for CORS-enabled videos
|
|
7
|
+
video.src = videoSrc;
|
|
8
|
+
video.currentTime = timeInSeconds; // Set the time to capture the desired frame
|
|
9
|
+
video.addEventListener('loadeddata', () => {
|
|
10
|
+
const canvas = document.createElement('canvas');
|
|
11
|
+
canvas.width = video.videoWidth;
|
|
12
|
+
canvas.height = video.videoHeight;
|
|
13
|
+
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
14
|
+
const dataURL = canvas.toDataURL('image/jpeg'); // Change format if needed
|
|
15
|
+
resolve(dataURL);
|
|
16
|
+
});
|
|
17
|
+
video.addEventListener('error', reject);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default generateThumbnail;
|