contentoh-components-library 21.4.44 → 21.4.46
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/components/molecules/BoxAttribute/index.js +13 -4
- package/dist/components/molecules/BoxButtons/index.js +4 -1
- package/dist/components/organisms/Box/index.js +44 -7
- package/dist/components/organisms/BoxOnboarding/index.js +37 -48
- package/dist/components/organisms/InputGroup/index.js +17 -19
- package/dist/components/pages/ProviderProductEdition/index.js +34 -16
- package/package.json +1 -1
- package/src/components/molecules/BoxAttribute/index.js +48 -37
- package/src/components/molecules/BoxButtons/index.js +3 -2
- package/src/components/organisms/Box/index.js +71 -40
- package/src/components/organisms/BoxOnboarding/index.js +60 -71
- package/src/components/organisms/InputGroup/index.js +120 -114
- package/src/components/pages/ProviderProductEdition/index.js +48 -22
- package/src/components/pages/ProviderProductEdition/out.json +0 -0
- package/dist/assets/images/Icons/delete.svg +0 -8
- package/dist/assets/images/Icons/edit.svg +0 -3
- package/dist/components/molecules/ButtonsAssignation/ButtonsAssignation.stories.js +0 -34
- package/dist/components/molecules/ButtonsAssignation/index.js +0 -142
- package/dist/components/molecules/ButtonsAssignation/styles.js +0 -20
- package/dist/components/molecules/ButtonsEdition/ButtonsEdition.stories.js +0 -34
- package/dist/components/molecules/ButtonsEdition/index.js +0 -182
- package/dist/components/molecules/ButtonsEdition/styles.js +0 -24
- package/dist/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +0 -64
- package/dist/components/molecules/ProductSkuStatus/index.js +0 -36
- package/dist/components/molecules/ProductSkuStatus/styles.js +0 -18
- package/dist/components/molecules/Validation/Validation.stories.js +0 -28
- package/dist/components/molecules/Validation/index.js +0 -77
- package/dist/components/molecules/Validation/styles.js +0 -18
- package/dist/components/organisms/BarButtons/BarButtons.stories.js +0 -30
- package/dist/components/organisms/BarButtons/index.js +0 -61
- package/dist/components/organisms/BarButtons/styles.js +0 -18
- package/dist/components/pages/ProviderProductEdition1/ProviderProductEdition.stories.js +0 -222
- package/dist/components/pages/ProviderProductEdition1/index.js +0 -2339
- package/dist/components/pages/ProviderProductEdition1/styles.js +0 -23
|
@@ -1,23 +1,46 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import { Container } from "./styles";
|
|
3
3
|
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
4
4
|
import { BoxOnboarding } from "../BoxOnboarding";
|
|
5
5
|
import { BoxButtons } from "../../molecules/BoxButtons";
|
|
6
|
-
import { useEffect } from "react";
|
|
7
6
|
|
|
8
|
-
export const Box = ({onChange}) => {
|
|
7
|
+
export const Box = ({ onChange, dataInputs, inputGroup }) => {
|
|
9
8
|
const [isDeleteDisabled, setIsDeleteDisabled] = useState(true);
|
|
10
9
|
const [isEditEnabled, setIsEditEnabled] = useState(false);
|
|
11
10
|
const [boxOnboardingList, setBoxOnboardingList] = useState([
|
|
12
11
|
{
|
|
13
12
|
showAdd: true,
|
|
14
|
-
value:{}
|
|
13
|
+
value: {},
|
|
15
14
|
},
|
|
16
15
|
]);
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
console.log("dataInputs:", dataInputs);
|
|
19
|
+
console.log("inputGroup:", inputGroup);
|
|
20
|
+
const temp = {};
|
|
21
|
+
let maxBoxId = 0;
|
|
22
|
+
inputGroup.inputs.forEach((attrId) => {
|
|
23
|
+
if (!dataInputs[attrId].box) return;
|
|
24
|
+
Object.entries(dataInputs[attrId].box).forEach(([boxId, value]) => {
|
|
25
|
+
if (boxId > maxBoxId) maxBoxId = boxId;
|
|
26
|
+
if (!temp[boxId]) temp[boxId] = {};
|
|
27
|
+
temp[boxId][attrId] = value;
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const tempList = Object.values(temp);
|
|
31
|
+
if (tempList.length > 0) {
|
|
32
|
+
setBoxOnboardingList(
|
|
33
|
+
tempList.map((value, index) =>
|
|
34
|
+
index === tempList.length - 1 ? { showAdd: true, value } : { value }
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
18
40
|
const handleAddBoxOnboarding = () => {
|
|
19
41
|
const newBoxOnboarding = {
|
|
20
|
-
showAdd: false,
|
|
42
|
+
showAdd: false,
|
|
43
|
+
value: {},
|
|
21
44
|
};
|
|
22
45
|
|
|
23
46
|
setBoxOnboardingList([...boxOnboardingList, newBoxOnboarding]);
|
|
@@ -35,47 +58,55 @@ export const Box = ({onChange}) => {
|
|
|
35
58
|
const handleToggleEdit = () => {
|
|
36
59
|
setIsEditEnabled(!isEditEnabled);
|
|
37
60
|
};
|
|
38
|
-
|
|
39
|
-
useEffect((
|
|
40
|
-
onChange && onChange(boxOnboardingList)
|
|
41
|
-
}, [
|
|
42
|
-
boxOnboardingList
|
|
43
|
-
])
|
|
44
|
-
// console.log(atributos)
|
|
45
|
-
console.log("onboardinglist",boxOnboardingList)
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
onChange && onChange(boxOnboardingList);
|
|
64
|
+
}, [boxOnboardingList]);
|
|
46
65
|
|
|
47
66
|
return (
|
|
48
|
-
<Container
|
|
49
|
-
|
|
67
|
+
<Container
|
|
68
|
+
fontFamily={FontFamily.Raleway}
|
|
69
|
+
color={GlobalColors.original_magenta}
|
|
70
|
+
>
|
|
71
|
+
<h1 fontFamily={FontFamily.Raleway}>{inputGroup.dataGroup}</h1>
|
|
50
72
|
<div className="container-box">
|
|
51
73
|
{boxOnboardingList.map((boxOnboarding, index) => (
|
|
52
74
|
<>
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
|
|
76
|
+
<div className="container-buttons">
|
|
77
|
+
<BoxOnboarding
|
|
78
|
+
key={index}
|
|
79
|
+
index={index}
|
|
80
|
+
showAdd={boxOnboarding.showAdd}
|
|
81
|
+
data={boxOnboarding.value}
|
|
82
|
+
dataInputs={dataInputs}
|
|
83
|
+
inputs={inputGroup.inputs}
|
|
84
|
+
isEditEnabled={isEditEnabled}
|
|
85
|
+
onChange={(e) => {
|
|
86
|
+
console.log("e in Box",e);
|
|
87
|
+
setBoxOnboardingList((prev) => {
|
|
88
|
+
return prev.map((box, i) => {
|
|
89
|
+
if (i != index) {
|
|
90
|
+
return box;
|
|
91
|
+
}
|
|
92
|
+
return { ...box, value: e };
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}}
|
|
96
|
+
/>
|
|
97
|
+
<BoxButtons
|
|
98
|
+
key={index}
|
|
99
|
+
index={index}
|
|
100
|
+
showAdd={boxOnboarding.showAdd}
|
|
101
|
+
onAdd={handleAddBoxOnboarding}
|
|
102
|
+
onDelete={() => handleDeleteBoxOnboarding(index)}
|
|
103
|
+
isDeleteDisabled={isDeleteDisabled}
|
|
104
|
+
onToggleEdit={handleToggleEdit}
|
|
105
|
+
isEditEnabled={isEditEnabled}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
76
108
|
</>
|
|
77
109
|
))}
|
|
78
|
-
|
|
79
110
|
</div>
|
|
80
111
|
</Container>
|
|
81
112
|
);
|
|
@@ -1,75 +1,64 @@
|
|
|
1
1
|
import { Container, ContainerIcon } from "./styles";
|
|
2
2
|
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
3
|
import { BoxAttribute } from "../../molecules/BoxAttribute";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import {
|
|
4
|
+
import { useState, useEffect, memo } from "react";
|
|
5
|
+
import { isEqual } from "lodash";
|
|
6
6
|
|
|
7
|
-
export const BoxOnboarding = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
className="caja"
|
|
66
|
-
text="Peso"
|
|
67
|
-
isEditEnabled={isEditEnabled}
|
|
68
|
-
atributos={atributos.peso}
|
|
69
|
-
setAtributos={setAtributos}
|
|
70
|
-
></BoxAttribute>
|
|
71
|
-
)}
|
|
72
|
-
</div>
|
|
73
|
-
</Container>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
7
|
+
export const BoxOnboarding = memo(
|
|
8
|
+
({
|
|
9
|
+
panelColor,
|
|
10
|
+
isEditEnabled,
|
|
11
|
+
index,
|
|
12
|
+
onChange,
|
|
13
|
+
data,
|
|
14
|
+
dataInputs,
|
|
15
|
+
inputs,
|
|
16
|
+
}) => {
|
|
17
|
+
const [atributos, setAtributos] = useState({});
|
|
18
|
+
// console.log("input",inputs);
|
|
19
|
+
//console.log("atributossss BO",atributos)
|
|
20
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
console.log("atributos use", atributos)
|
|
24
|
+
onChange && onChange(atributos);
|
|
25
|
+
}, [atributos]);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (isLoading && Object.keys(data).length > 0) {
|
|
30
|
+
setAtributos(data);
|
|
31
|
+
setIsLoading(false);
|
|
32
|
+
}
|
|
33
|
+
}, [data]);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Container
|
|
37
|
+
panelColor={panelColor}
|
|
38
|
+
fontFamily={FontFamily.Raleway}
|
|
39
|
+
color={GlobalColors.original_magenta}
|
|
40
|
+
>
|
|
41
|
+
<div id="contenedor-caja">
|
|
42
|
+
<p fontFamily={FontFamily.Raleway}>Caja {index + 1}</p>
|
|
43
|
+
{inputs.map((attrId) => {
|
|
44
|
+
console.log("data inputsss name:",atributos)
|
|
45
|
+
return (
|
|
46
|
+
<BoxAttribute
|
|
47
|
+
id={attrId}
|
|
48
|
+
key={attrId}
|
|
49
|
+
borderType="rectangle"
|
|
50
|
+
className="caja"
|
|
51
|
+
text={dataInputs[attrId]?.name}
|
|
52
|
+
isEditEnabled={isEditEnabled}
|
|
53
|
+
atributos={atributos}
|
|
54
|
+
setAtributos={setAtributos}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
58
|
+
|
|
59
|
+
</div>
|
|
60
|
+
</Container>
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
isEqual
|
|
64
|
+
);
|
|
@@ -21,13 +21,10 @@ export const InputGroup = ({
|
|
|
21
21
|
compare,
|
|
22
22
|
groupData = [],
|
|
23
23
|
isShowbox,
|
|
24
|
-
|
|
25
|
-
// boxOnboardingInput,
|
|
26
|
-
setUpdatedBoxData,
|
|
24
|
+
setUpdatedBoxData
|
|
27
25
|
}) => {
|
|
28
|
-
|
|
29
|
-
console.log(
|
|
30
|
-
console.log('groupData: ', groupData);
|
|
26
|
+
// console.log("groupData: ", typeof groupData);
|
|
27
|
+
// console.log("groupData: ", groupData);
|
|
31
28
|
const inputTypeValue = (type) => {
|
|
32
29
|
switch (type) {
|
|
33
30
|
case "Booleano":
|
|
@@ -40,124 +37,133 @@ export const InputGroup = ({
|
|
|
40
37
|
};
|
|
41
38
|
|
|
42
39
|
const isOnboarding = () => {
|
|
43
|
-
const contentBoxAttribute = groupData.find(
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
const contentBoxAttribute = groupData.find(
|
|
41
|
+
({ dataGroup }) => dataGroup === "Caja"
|
|
42
|
+
);
|
|
43
|
+
if (contentBoxAttribute) {
|
|
44
|
+
console.log("content box attribute");
|
|
46
45
|
} else {
|
|
47
|
-
console.log(
|
|
46
|
+
console.log("dont content box attribute");
|
|
48
47
|
}
|
|
49
48
|
return contentBoxAttribute;
|
|
50
|
-
}
|
|
51
|
-
|
|
49
|
+
};
|
|
52
50
|
|
|
53
51
|
const isEquals = (dataInputsVal, auditInputsVal) => {
|
|
54
52
|
const result = dataInputsVal === auditInputsVal;
|
|
53
|
+
console.log("Input Val",dataInputsVal)
|
|
55
54
|
return result;
|
|
56
55
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (
|
|
56
|
+
return inputGroup.groupId !== "16" ? (
|
|
60
57
|
<>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
)}
|
|
74
|
-
<div className="inputs-container">
|
|
75
|
-
{inputGroup?.inputs?.map((input, index) =>
|
|
76
|
-
activeSection === "Ficha técnica" ? (
|
|
77
|
-
<>
|
|
78
|
-
|
|
79
|
-
<TagAndInput
|
|
80
|
-
key={
|
|
81
|
-
index +
|
|
82
|
-
"-" +
|
|
83
|
-
dataInputs[input]?.value +
|
|
84
|
-
"-" +
|
|
85
|
-
dataInputs[input]?.id +
|
|
86
|
-
"-" +
|
|
87
|
-
compare
|
|
88
|
-
}
|
|
89
|
-
//disabled={input === 40001}
|
|
90
|
-
disabled={false}
|
|
91
|
-
inputId={dataInputs[input]?.id}
|
|
92
|
-
version={version}
|
|
93
|
-
inputType={inputTypeValue(dataInputs[input]?.type)}
|
|
94
|
-
label={
|
|
95
|
-
dataInputs[input]?.name +
|
|
96
|
-
(dataInputs[input]?.required ? "*" : "")
|
|
97
|
-
}
|
|
98
|
-
value={
|
|
99
|
-
compare ? auditInputs[input]?.value : dataInputs[input]?.value
|
|
100
|
-
}
|
|
101
|
-
inputPlaceHolder={input?.placeholder}
|
|
102
|
-
articleId={articleId}
|
|
103
|
-
isRequired={dataInputs[input]?.required}
|
|
104
|
-
updatedDatasheets={updatedDatasheets}
|
|
105
|
-
setUpdatedDatasheets={setUpdatedDatasheets}
|
|
106
|
-
maxChar={
|
|
107
|
-
dataInputs[input]?.max_chars
|
|
108
|
-
? dataInputs[input]?.max_chars
|
|
109
|
-
: 999
|
|
110
|
-
}
|
|
111
|
-
optionList={dataInputs[input]?.option_list}
|
|
112
|
-
description={dataInputs[input]?.description}
|
|
113
|
-
showTooltip={true}
|
|
114
|
-
auditClass={
|
|
115
|
-
compare &&
|
|
116
|
-
!isEquals(dataInputs[input].value, auditInputs[input].value)
|
|
117
|
-
? "audit-class"
|
|
118
|
-
: ""
|
|
119
|
-
}
|
|
120
|
-
/>
|
|
121
|
-
</>
|
|
122
|
-
|
|
123
|
-
) : (
|
|
124
|
-
<TagAndInput
|
|
125
|
-
key={index + "-" + input?.value + "-" + compare}
|
|
126
|
-
inputId={input.id}
|
|
127
|
-
index={index}
|
|
128
|
-
inputType={"textarea"}
|
|
129
|
-
label={input?.name + (input.required ? "*" : "")}
|
|
130
|
-
value={
|
|
131
|
-
compare ? auditInputGroup?.inputs[index]?.value : input?.value
|
|
132
|
-
}
|
|
133
|
-
isRequired={input.required}
|
|
134
|
-
maxChar={input.max_chars}
|
|
135
|
-
inputPlaceHolder={input?.placeholder}
|
|
136
|
-
updatedDescriptions={updatedDescriptions}
|
|
137
|
-
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
138
|
-
articleId={articleId}
|
|
139
|
-
version={version}
|
|
140
|
-
dinamicHeight={dinamicHeight}
|
|
141
|
-
description={input?.description}
|
|
142
|
-
showTooltip={true}
|
|
143
|
-
auditClass={
|
|
144
|
-
compare &&
|
|
145
|
-
!isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
|
|
146
|
-
? "audit-class"
|
|
147
|
-
: ""
|
|
148
|
-
}
|
|
149
|
-
/>
|
|
150
|
-
)
|
|
58
|
+
<Container
|
|
59
|
+
className={
|
|
60
|
+
activeSection === "Ficha técnica"
|
|
61
|
+
? "datasheets-layout"
|
|
62
|
+
: "descriptions-layout"
|
|
63
|
+
}
|
|
64
|
+
>
|
|
65
|
+
{inputGroup?.dataGroup && (
|
|
66
|
+
<ScreenHeader
|
|
67
|
+
headerType={"retailer-name-header"}
|
|
68
|
+
text={`${inputGroup.groupId} - ${inputGroup?.dataGroup}`}
|
|
69
|
+
/>
|
|
151
70
|
)}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
71
|
+
<div className="inputs-container">
|
|
72
|
+
{inputGroup?.inputs?.map((input, index) =>
|
|
73
|
+
activeSection === "Ficha técnica" ? (
|
|
74
|
+
<>
|
|
75
|
+
<TagAndInput
|
|
76
|
+
key={
|
|
77
|
+
index +
|
|
78
|
+
"-" +
|
|
79
|
+
dataInputs[input]?.value +
|
|
80
|
+
"-" +
|
|
81
|
+
dataInputs[input]?.id +
|
|
82
|
+
"-" +
|
|
83
|
+
compare
|
|
84
|
+
}
|
|
85
|
+
//disabled={input === 40001}
|
|
86
|
+
disabled={false}
|
|
87
|
+
inputId={dataInputs[input]?.id}
|
|
88
|
+
version={version}
|
|
89
|
+
inputType={inputTypeValue(dataInputs[input]?.type)}
|
|
90
|
+
label={
|
|
91
|
+
dataInputs[input]?.name +
|
|
92
|
+
(dataInputs[input]?.required ? "*" : "")
|
|
93
|
+
}
|
|
94
|
+
value={
|
|
95
|
+
compare
|
|
96
|
+
? auditInputs[input]?.value
|
|
97
|
+
: dataInputs[input]?.value
|
|
98
|
+
}
|
|
99
|
+
inputPlaceHolder={input?.placeholder}
|
|
100
|
+
articleId={articleId}
|
|
101
|
+
isRequired={dataInputs[input]?.required}
|
|
102
|
+
updatedDatasheets={updatedDatasheets}
|
|
103
|
+
setUpdatedDatasheets={setUpdatedDatasheets}
|
|
104
|
+
maxChar={
|
|
105
|
+
dataInputs[input]?.max_chars
|
|
106
|
+
? dataInputs[input]?.max_chars
|
|
107
|
+
: 999
|
|
108
|
+
}
|
|
109
|
+
optionList={dataInputs[input]?.option_list}
|
|
110
|
+
description={dataInputs[input]?.description}
|
|
111
|
+
showTooltip={true}
|
|
112
|
+
auditClass={
|
|
113
|
+
compare &&
|
|
114
|
+
!isEquals(dataInputs[input].value, auditInputs[input].value)
|
|
115
|
+
? "audit-class"
|
|
116
|
+
: ""
|
|
117
|
+
}
|
|
118
|
+
/>
|
|
119
|
+
</>
|
|
120
|
+
) : (
|
|
121
|
+
<TagAndInput
|
|
122
|
+
key={index + "-" + input?.value + "-" + compare}
|
|
123
|
+
inputId={input.id}
|
|
124
|
+
index={index}
|
|
125
|
+
inputType={"textarea"}
|
|
126
|
+
label={input?.name + (input.required ? "*" : "")}
|
|
127
|
+
value={
|
|
128
|
+
compare ? auditInputGroup?.inputs[index]?.value : input?.value
|
|
129
|
+
}
|
|
130
|
+
isRequired={input.required}
|
|
131
|
+
maxChar={input.max_chars}
|
|
132
|
+
inputPlaceHolder={input?.placeholder}
|
|
133
|
+
updatedDescriptions={updatedDescriptions}
|
|
134
|
+
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
135
|
+
articleId={articleId}
|
|
136
|
+
version={version}
|
|
137
|
+
dinamicHeight={dinamicHeight}
|
|
138
|
+
description={input?.description}
|
|
139
|
+
showTooltip={true}
|
|
140
|
+
auditClass={
|
|
141
|
+
compare &&
|
|
142
|
+
!isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
|
|
143
|
+
? "audit-class"
|
|
144
|
+
: ""
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
)
|
|
148
|
+
)}
|
|
149
|
+
</div>
|
|
150
|
+
</Container>
|
|
161
151
|
</>
|
|
152
|
+
) : (
|
|
153
|
+
isShowbox && (
|
|
154
|
+
<Container
|
|
155
|
+
className={
|
|
156
|
+
activeSection === "Ficha técnica"
|
|
157
|
+
? "datasheets-layout"
|
|
158
|
+
: "descriptions-layout"
|
|
159
|
+
}
|
|
160
|
+
>
|
|
161
|
+
<Box
|
|
162
|
+
inputGroup={inputGroup}
|
|
163
|
+
dataInputs={dataInputs}
|
|
164
|
+
onChange={setUpdatedBoxData}
|
|
165
|
+
/>
|
|
166
|
+
</Container>
|
|
167
|
+
)
|
|
162
168
|
);
|
|
163
169
|
};
|
|
@@ -682,14 +682,34 @@ export const ProviderProductEdition = ({
|
|
|
682
682
|
};
|
|
683
683
|
|
|
684
684
|
const saveDatasheets = async () => {
|
|
685
|
-
|
|
685
|
+
const inputs = (() => {
|
|
686
|
+
|
|
687
|
+
let fields = {}
|
|
688
|
+
|
|
689
|
+
boxData.map(e=>({
|
|
690
|
+
...e.value,
|
|
691
|
+
})).forEach((item, k) => {
|
|
692
|
+
|
|
693
|
+
for (const key in item) {
|
|
694
|
+
if (!fields[key]) {
|
|
695
|
+
fields[key] = {};
|
|
696
|
+
}
|
|
697
|
+
fields[key].box = fields[key].box || {};
|
|
698
|
+
fields[key].box[k] = item[key];
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
})
|
|
702
|
+
|
|
703
|
+
return fields
|
|
704
|
+
|
|
705
|
+
})()
|
|
686
706
|
setLoading(true);
|
|
687
707
|
const dataObject = {
|
|
688
708
|
articleId: product?.id_article,
|
|
689
709
|
articleData: updatedDatasheets,
|
|
690
|
-
|
|
710
|
+
inputs
|
|
691
711
|
};
|
|
692
|
-
console.log("boxData guardado",
|
|
712
|
+
console.log("boxData guardado", dataObject);
|
|
693
713
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
694
714
|
try {
|
|
695
715
|
const res = await axios.put(
|
|
@@ -835,6 +855,7 @@ export const ProviderProductEdition = ({
|
|
|
835
855
|
return "images";
|
|
836
856
|
}
|
|
837
857
|
};
|
|
858
|
+
|
|
838
859
|
|
|
839
860
|
const createComment = async (messages = [], retailerId) => {
|
|
840
861
|
const data = {
|
|
@@ -1458,25 +1479,30 @@ export const ProviderProductEdition = ({
|
|
|
1458
1479
|
/>
|
|
1459
1480
|
)}
|
|
1460
1481
|
{activeTab === "Ficha técnica" &&
|
|
1461
|
-
(product?.datasheet_status !== "NS" ?
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1482
|
+
(product?.datasheet_status !== "NS" ? (
|
|
1483
|
+
<div>
|
|
1484
|
+
{datasheets[0]?.data?.map((dataGroup, index) => (
|
|
1485
|
+
<InputGroup
|
|
1486
|
+
key={index + "-" + activeRetailer.name}
|
|
1487
|
+
articleId={product.id_article}
|
|
1488
|
+
version={version}
|
|
1489
|
+
activeSection={activeTab}
|
|
1490
|
+
inputGroup={dataGroup}
|
|
1491
|
+
dataInputs={datasheets[1]}
|
|
1492
|
+
updatedDatasheets={updatedDatasheets}
|
|
1493
|
+
setUpdatedDatasheets={setUpdatedDatasheets}
|
|
1494
|
+
isShowbox={true}
|
|
1495
|
+
groupData={services[0][activeRetailer.id].data}
|
|
1496
|
+
setUpdatedBoxData={(e) => {
|
|
1497
|
+
console.log("UNO",e);
|
|
1498
|
+
setBoxData(e);
|
|
1499
|
+
}}
|
|
1500
|
+
index={index}
|
|
1501
|
+
//enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
|
|
1502
|
+
></InputGroup>
|
|
1503
|
+
))}
|
|
1504
|
+
</div>
|
|
1505
|
+
) : (
|
|
1480
1506
|
<ScreenHeader
|
|
1481
1507
|
text={"No cuentas con este servicio"}
|
|
1482
1508
|
headerType={"input-name-header"}
|
|
File without changes
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<mask id="mask0_37_469" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="14" height="14">
|
|
3
|
-
<rect width="14" height="14" fill="#D9D9D9"/>
|
|
4
|
-
</mask>
|
|
5
|
-
<g mask="url(#mask0_37_469)">
|
|
6
|
-
<path d="M4.76875 10.5194L7 8.16667L9.25 10.5194L10.1313 9.58611L7.9 7.23333L10.1313 4.88056L9.25 3.94722L7 6.3L4.76875 3.94722L3.86875 4.88056L6.11875 7.23333L3.86875 9.58611L4.76875 10.5194ZM2.89375 14C2.59375 14 2.33125 13.8833 2.10625 13.65C1.88125 13.4167 1.76875 13.1444 1.76875 12.8333V1.75H1V0.583333H4.525V0H9.475V0.583333H13V1.75H12.2313V12.8333C12.2313 13.1444 12.1188 13.4167 11.8938 13.65C11.6688 13.8833 11.4062 14 11.1063 14H2.89375ZM11.1063 1.75H2.89375V12.8333H11.1063V1.75Z" fill="#B64545"/>
|
|
7
|
-
</g>
|
|
8
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M1.14598 12.854H1.98636L10.4475 4.39291L9.60709 3.55252L1.14598 12.0136V12.854ZM12.8731 3.57162L10.4284 1.12688L11.2306 0.324693C11.447 0.108231 11.7144 0 12.0327 0C12.3511 0 12.6185 0.108231 12.8349 0.324693L13.6753 1.16507C13.8918 1.38154 14 1.64893 14 1.96726C14 2.28558 13.8918 2.55298 13.6753 2.76944L12.8731 3.57162ZM12.0709 4.37381L2.44475 14H0V11.5553L9.62619 1.92906L12.0709 4.37381Z" fill="#707070"/>
|
|
3
|
-
</svg>
|