contentoh-components-library 21.3.78 → 21.3.80
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/fonts/roboto/LICENSE.txt +202 -0
- package/dist/components/atoms/Card/index.js +7 -2
- package/dist/components/atoms/GeneralInput/index.js +24 -20
- package/dist/components/atoms/InputFormatter/index.js +14 -16
- package/dist/components/atoms/TabSection/styles.js +1 -1
- package/dist/components/molecules/TabsMenu/index.js +23 -56
- package/dist/components/molecules/TagAndInput/index.js +0 -2
- package/dist/components/organisms/FullTabsMenu/index.js +2 -12
- package/dist/components/organisms/ImageDataTable/index.js +0 -2
- package/dist/components/pages/ProviderProductEdition/index.js +32 -54
- package/dist/components/pages/RetailerProductEdition/index.js +2 -28
- package/package.json +1 -1
- package/src/components/atoms/Card/index.js +1 -2
- package/src/components/atoms/GeneralInput/index.js +20 -21
- package/src/components/atoms/InputFormatter/index.js +14 -18
- package/src/components/molecules/AvatarAndValidation/index.js +1 -1
- package/src/components/molecules/TabsMenu/index.js +66 -119
- package/src/components/molecules/TagAndInput/index.js +0 -4
- package/src/components/organisms/FullTabsMenu/index.js +4 -16
- package/src/components/organisms/ImageDataTable/index.js +0 -3
- package/src/components/organisms/InputGroup/index.js +2 -5
- package/src/components/pages/ProviderProductEdition/index.js +6 -24
- package/src/components/pages/RetailerProductEdition/index.js +1 -26
|
@@ -464,35 +464,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
464
464
|
}),
|
|
465
465
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
466
466
|
origin = _useState64[0],
|
|
467
|
-
setOrigin = _useState64[1];
|
|
467
|
+
setOrigin = _useState64[1];
|
|
468
468
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
var _useState65 = (0, _react.useState)([]),
|
|
469
|
+
var _useState65 = (0, _react.useState)(false),
|
|
473
470
|
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
var _useState67 = (0, _react.useState)([]),
|
|
478
|
-
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
479
|
-
fich = _useState68[0],
|
|
480
|
-
setFich = _useState68[1];
|
|
481
|
-
|
|
482
|
-
var _useState69 = (0, _react.useState)([]),
|
|
483
|
-
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
484
|
-
imag = _useState70[0],
|
|
485
|
-
setImag = _useState70[1];
|
|
486
|
-
/* ------------------------------------- Cambios ----------------------------------*/
|
|
487
|
-
//! ==========================================Daniel===========================================
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
var _useState71 = (0, _react.useState)(false),
|
|
491
|
-
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
492
|
-
inCart = _useState72[0],
|
|
493
|
-
setInCart = _useState72[1];
|
|
471
|
+
inCart = _useState66[0],
|
|
472
|
+
setInCart = _useState66[1];
|
|
494
473
|
|
|
495
|
-
var
|
|
474
|
+
var _useState67 = (0, _react.useState)({
|
|
496
475
|
message: "¿Estás seguro de continuar?",
|
|
497
476
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
498
477
|
button1: {
|
|
@@ -507,34 +486,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
507
486
|
},
|
|
508
487
|
img: _defaultProfileImage.default
|
|
509
488
|
}),
|
|
510
|
-
|
|
511
|
-
dataGenericModal =
|
|
512
|
-
setDataGenericModal =
|
|
489
|
+
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
490
|
+
dataGenericModal = _useState68[0],
|
|
491
|
+
setDataGenericModal = _useState68[1];
|
|
513
492
|
|
|
514
|
-
var
|
|
515
|
-
|
|
516
|
-
socketType =
|
|
517
|
-
setSocketType =
|
|
493
|
+
var _useState69 = (0, _react.useState)(null),
|
|
494
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
495
|
+
socketType = _useState70[0],
|
|
496
|
+
setSocketType = _useState70[1];
|
|
518
497
|
|
|
519
|
-
var
|
|
520
|
-
|
|
521
|
-
saving =
|
|
522
|
-
setSaving =
|
|
498
|
+
var _useState71 = (0, _react.useState)(loading),
|
|
499
|
+
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
500
|
+
saving = _useState72[0],
|
|
501
|
+
setSaving = _useState72[1];
|
|
523
502
|
|
|
524
|
-
var
|
|
525
|
-
|
|
526
|
-
retailerStatus =
|
|
527
|
-
setRetailerStatus =
|
|
503
|
+
var _useState73 = (0, _react.useState)(product.statusByRetailer),
|
|
504
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
505
|
+
retailerStatus = _useState74[0],
|
|
506
|
+
setRetailerStatus = _useState74[1];
|
|
528
507
|
|
|
529
508
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
530
509
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
531
510
|
showVersionSelector = _useCloseModal2[0],
|
|
532
511
|
setShowVersionSelector = _useCloseModal2[1];
|
|
533
512
|
|
|
534
|
-
var
|
|
535
|
-
|
|
536
|
-
globalModal =
|
|
537
|
-
setGlobalModal =
|
|
513
|
+
var _useState75 = (0, _react.useState)(),
|
|
514
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
515
|
+
globalModal = _useState76[0],
|
|
516
|
+
setGlobalModal = _useState76[1];
|
|
538
517
|
|
|
539
518
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
540
519
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -2019,6 +1998,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2019
1998
|
}];
|
|
2020
1999
|
|
|
2021
2000
|
var sendToEvaluation = function sendToEvaluation(result) {
|
|
2001
|
+
console.log({
|
|
2002
|
+
result: result
|
|
2003
|
+
});
|
|
2004
|
+
|
|
2022
2005
|
if (result === "A") {
|
|
2023
2006
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2024
2007
|
setDataGenericModal(function (prev) {
|
|
@@ -2052,7 +2035,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2052
2035
|
sendEvaluation("A");
|
|
2053
2036
|
}
|
|
2054
2037
|
} else {
|
|
2055
|
-
if (
|
|
2038
|
+
if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2056
2039
|
return;
|
|
2057
2040
|
} else if (user.is_retailer) {
|
|
2058
2041
|
if (product.id_order || product.orderId) {
|
|
@@ -2122,7 +2105,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2122
2105
|
servicesData: servicesData ? servicesData : null,
|
|
2123
2106
|
showApproveRejectAll: isRevision() && getSectionStatus(),
|
|
2124
2107
|
approveAll: function approveAll() {
|
|
2125
|
-
if (
|
|
2108
|
+
if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2126
2109
|
setDataGenericModal(function (prev) {
|
|
2127
2110
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
2128
2111
|
button2: {
|
|
@@ -2155,7 +2138,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2155
2138
|
}
|
|
2156
2139
|
},
|
|
2157
2140
|
rejectAll: function rejectAll() {
|
|
2158
|
-
if (
|
|
2141
|
+
if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2159
2142
|
return;
|
|
2160
2143
|
} else if (user.is_retailer) {
|
|
2161
2144
|
if (product.id_order || product.orderId) {
|
|
@@ -2198,14 +2181,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2198
2181
|
isRetailer: isRetailer,
|
|
2199
2182
|
showSaveButton: enableActions(product.version_status),
|
|
2200
2183
|
version: version,
|
|
2201
|
-
desc: desc,
|
|
2202
|
-
setDesc: setDesc,
|
|
2203
|
-
fich: fich,
|
|
2204
|
-
setFich: setFich,
|
|
2205
|
-
imag: imag,
|
|
2206
|
-
setImag: setImag,
|
|
2207
2184
|
updatedDescriptions: updatedDescriptions,
|
|
2208
2185
|
updatedDatasheets: updatedDatasheets,
|
|
2186
|
+
images: images,
|
|
2209
2187
|
selectedImages: selectedImages,
|
|
2210
2188
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2211
2189
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
@@ -485,28 +485,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
485
485
|
var _useState83 = (0, _react.useState)(false),
|
|
486
486
|
_useState84 = (0, _slicedToArray2.default)(_useState83, 2),
|
|
487
487
|
valRejAll = _useState84[0],
|
|
488
|
-
setValRejAll = _useState84[1];
|
|
489
|
-
|
|
490
|
-
/* ====================================== Cambios =================================*/
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
var _useState85 = (0, _react.useState)([]),
|
|
494
|
-
_useState86 = (0, _slicedToArray2.default)(_useState85, 2),
|
|
495
|
-
desc = _useState86[0],
|
|
496
|
-
setDesc = _useState86[1];
|
|
497
|
-
|
|
498
|
-
var _useState87 = (0, _react.useState)([]),
|
|
499
|
-
_useState88 = (0, _slicedToArray2.default)(_useState87, 2),
|
|
500
|
-
fich = _useState88[0],
|
|
501
|
-
setFich = _useState88[1];
|
|
502
|
-
|
|
503
|
-
var _useState89 = (0, _react.useState)([]),
|
|
504
|
-
_useState90 = (0, _slicedToArray2.default)(_useState89, 2),
|
|
505
|
-
imag = _useState90[0],
|
|
506
|
-
setImag = _useState90[1];
|
|
507
|
-
/* ------------------------------------- Cambios ----------------------------------*/
|
|
508
|
-
//! ==========================================Daniel===========================================
|
|
509
|
-
|
|
488
|
+
setValRejAll = _useState84[1];
|
|
510
489
|
|
|
511
490
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
512
491
|
var _ref3, id_article;
|
|
@@ -1993,14 +1972,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1993
1972
|
isRetailer: isRetailer,
|
|
1994
1973
|
showSaveButton: auditorAssigned() || userAssigned(),
|
|
1995
1974
|
version: version,
|
|
1996
|
-
desc: desc,
|
|
1997
|
-
setDesc: setDesc,
|
|
1998
|
-
fich: fich,
|
|
1999
|
-
setFich: setFich,
|
|
2000
|
-
imag: imag,
|
|
2001
|
-
setImag: setImag,
|
|
2002
1975
|
updatedDescriptions: updatedDescriptions,
|
|
2003
1976
|
updatedDatasheets: updatedDatasheets,
|
|
1977
|
+
images: images,
|
|
2004
1978
|
selectedImages: selectedImages,
|
|
2005
1979
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2006
1980
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
package/package.json
CHANGED
|
@@ -13,8 +13,7 @@ export const Card = ({
|
|
|
13
13
|
|
|
14
14
|
const handleOnChange = (e, cardId) => {
|
|
15
15
|
if (e.target.checked) {
|
|
16
|
-
card
|
|
17
|
-
setCard && setCard(card);
|
|
16
|
+
setCard && setCard({ ...card, isNew: 0 });
|
|
18
17
|
setStripe && setStripe(stripe);
|
|
19
18
|
setSelectedCard && setSelectedCard(cardId);
|
|
20
19
|
} else {
|
|
@@ -7,7 +7,7 @@ export const GeneralInput = ({
|
|
|
7
7
|
inputType,
|
|
8
8
|
inputId,
|
|
9
9
|
inputName,
|
|
10
|
-
inputValue,
|
|
10
|
+
inputValue = "",
|
|
11
11
|
inputPlaceholder,
|
|
12
12
|
validateInput,
|
|
13
13
|
position,
|
|
@@ -43,7 +43,6 @@ export const GeneralInput = ({
|
|
|
43
43
|
) {
|
|
44
44
|
let generalValue;
|
|
45
45
|
if (optionList?.length > 0) {
|
|
46
|
-
let index = evt.target.selectedIndex;
|
|
47
46
|
let valueSelected = evt.target.value;
|
|
48
47
|
generalValue = valueSelected;
|
|
49
48
|
setTextValue({ value: generalValue });
|
|
@@ -56,26 +55,26 @@ export const GeneralInput = ({
|
|
|
56
55
|
}
|
|
57
56
|
let dataSave = updatedDatasheets?.slice();
|
|
58
57
|
|
|
59
|
-
if (dataSave
|
|
60
|
-
dataSave.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
58
|
+
if (dataSave?.length > 0) {
|
|
59
|
+
const index = dataSave.findIndex((e) => e.attributeId === inputId);
|
|
60
|
+
if (index !== -1) {
|
|
61
|
+
if (generalValue !== inputValue) dataSave[index].value = generalValue;
|
|
62
|
+
else dataSave.splice(index, 1);
|
|
63
|
+
} else {
|
|
64
|
+
dataSave.push({
|
|
65
|
+
articleId: articleId,
|
|
66
|
+
attributeId: inputId,
|
|
67
|
+
value: generalValue,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
72
70
|
} else {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
if (generalValue !== inputValue) {
|
|
72
|
+
dataSave.push({
|
|
73
|
+
articleId: articleId,
|
|
74
|
+
attributeId: inputId,
|
|
75
|
+
value: generalValue,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
79
78
|
}
|
|
80
79
|
setUpdatedDatasheets(dataSave);
|
|
81
80
|
} else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ReactQuill from "react-quill";
|
|
2
2
|
import "react-quill/dist/quill.snow.css";
|
|
3
|
-
import {
|
|
3
|
+
import { useState } from "react";
|
|
4
4
|
import { Container } from "./styles";
|
|
5
5
|
|
|
6
6
|
export const InputFormatter = ({
|
|
@@ -9,8 +9,6 @@ export const InputFormatter = ({
|
|
|
9
9
|
articleId,
|
|
10
10
|
updatedDescriptions,
|
|
11
11
|
setUpdatedDescriptions,
|
|
12
|
-
addTextAreaToArray,
|
|
13
|
-
name,
|
|
14
12
|
isRequired,
|
|
15
13
|
maxChar,
|
|
16
14
|
}) => {
|
|
@@ -44,7 +42,7 @@ export const InputFormatter = ({
|
|
|
44
42
|
.replace(/\&/gm, "&");
|
|
45
43
|
};
|
|
46
44
|
|
|
47
|
-
const onChange = (valueInput,
|
|
45
|
+
const onChange = (valueInput, h) => {
|
|
48
46
|
let value = "";
|
|
49
47
|
try {
|
|
50
48
|
if (h.getLength() - 1 <= maxLength) {
|
|
@@ -72,12 +70,10 @@ export const InputFormatter = ({
|
|
|
72
70
|
let idInput = inputId;
|
|
73
71
|
let dataSave = updatedDescriptions?.slice();
|
|
74
72
|
if (dataSave?.length > 0) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
});
|
|
73
|
+
const index = dataSave.findIndex((e) => e.attributeId === idInput);
|
|
74
|
+
if (index !== -1) {
|
|
75
|
+
if (value !== mainValue) dataSave[index].value = value;
|
|
76
|
+
else dataSave.splice(index, 1);
|
|
81
77
|
} else {
|
|
82
78
|
dataSave.push({
|
|
83
79
|
articleId: articleId,
|
|
@@ -86,11 +82,13 @@ export const InputFormatter = ({
|
|
|
86
82
|
});
|
|
87
83
|
}
|
|
88
84
|
} else {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
if (value !== mainValue) {
|
|
86
|
+
dataSave.push({
|
|
87
|
+
articleId: articleId,
|
|
88
|
+
attributeId: idInput,
|
|
89
|
+
value: value,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
94
92
|
}
|
|
95
93
|
setUpdatedDescriptions(dataSave);
|
|
96
94
|
}
|
|
@@ -142,9 +140,7 @@ export const InputFormatter = ({
|
|
|
142
140
|
e.preventDefault();
|
|
143
141
|
}
|
|
144
142
|
}}
|
|
145
|
-
onChange={(valueInput, user, range, h) =>
|
|
146
|
-
onChange(valueInput, user, range, h);
|
|
147
|
-
}}
|
|
143
|
+
onChange={(valueInput, user, range, h) => onChange(valueInput, h)}
|
|
148
144
|
onChangeSelection={getSelection}
|
|
149
145
|
/>
|
|
150
146
|
<p className="description-limit">
|
|
@@ -2,156 +2,103 @@ import { Container } from "./styles";
|
|
|
2
2
|
import { TabSection } from "../../atoms/TabSection";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
import { Modal } from "../../organisms/Modal";
|
|
7
6
|
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
8
7
|
|
|
9
|
-
|
|
10
8
|
export const TabsMenu = ({
|
|
11
9
|
tabsSections = {},
|
|
12
10
|
setImagesSection,
|
|
13
11
|
setActiveTab,
|
|
14
12
|
activeTab,
|
|
15
|
-
|
|
16
|
-
desc,
|
|
17
|
-
setDesc,
|
|
18
|
-
fich,
|
|
19
|
-
setFich,
|
|
20
|
-
imag,
|
|
21
|
-
setImag,
|
|
22
13
|
updatedDescriptions,
|
|
23
14
|
updatedDatasheets,
|
|
24
|
-
|
|
25
|
-
setUpdatedDescriptions,
|
|
26
|
-
setUpdatedDatasheets,
|
|
27
|
-
setSelectedImages
|
|
15
|
+
images,
|
|
28
16
|
}) => {
|
|
29
17
|
const [sections, setSections] = useState(tabsSections);
|
|
30
18
|
|
|
31
|
-
|
|
32
|
-
const [
|
|
33
|
-
const [
|
|
34
|
-
const [
|
|
35
|
-
const [cancelAccept, setCancelAccept] = useState('')
|
|
36
|
-
const [llave, setLlave] = useState('')
|
|
37
|
-
const [objeto, setObjeto] = useState()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
const [modal, setModal] = useState(false);
|
|
20
|
+
const [cancelAccept, setCancelAccept] = useState("");
|
|
21
|
+
const [llave, setLlave] = useState("");
|
|
22
|
+
const [objeto, setObjeto] = useState();
|
|
41
23
|
|
|
42
24
|
const activeSection = (key, array = {}) => {
|
|
43
25
|
let tempArray = {};
|
|
44
26
|
setImagesSection(key === "Imágenes");
|
|
45
27
|
Object.keys(array).forEach((section) => {
|
|
46
28
|
tempArray[section] = section === key;
|
|
47
|
-
if (section === key)
|
|
48
|
-
|
|
49
|
-
setUpdatedDatasheets([])
|
|
50
|
-
setUpdatedDescriptions([])
|
|
51
|
-
setSelectedImages([])
|
|
52
|
-
setDesc([])
|
|
53
|
-
setFich([])
|
|
54
|
-
setImag([])
|
|
55
|
-
return setActiveTab(key)
|
|
56
|
-
};
|
|
29
|
+
if (section === key) return setActiveTab(key);
|
|
57
30
|
});
|
|
58
31
|
setSections(tempArray);
|
|
59
32
|
};
|
|
60
33
|
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if ((cancelAccept === "Aceptar") & (llave !== "")) {
|
|
36
|
+
setCancelAccept("");
|
|
37
|
+
setModal(false);
|
|
38
|
+
activeSection(llave, objeto);
|
|
39
|
+
} else if ((cancelAccept === "Cancelar") & (llave !== "")) {
|
|
40
|
+
setModal(false);
|
|
41
|
+
setCancelAccept("");
|
|
42
|
+
}
|
|
43
|
+
}, [cancelAccept]);
|
|
61
44
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
//! ==========================================Daniel===========================================
|
|
65
|
-
{/*=============================================================================
|
|
66
|
-
UseEffect para poder recolectar la info
|
|
67
|
-
==============================================================================*/}
|
|
68
|
-
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (cancelAccept==='Aceptar' & llave!==''){
|
|
71
|
-
setCancelAccept('')
|
|
72
|
-
setModal(false)
|
|
73
|
-
activeSection(llave, objeto)
|
|
74
|
-
} else if (cancelAccept==='Cancelar' & llave!=='') {
|
|
75
|
-
setModal(false)
|
|
76
|
-
setCancelAccept('')
|
|
77
|
-
}
|
|
78
|
-
},[cancelAccept])
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function detectClickFunction (e,key,sections) {
|
|
83
|
-
|
|
84
|
-
|
|
45
|
+
const detectClickFunction = (e, key, sections) => {
|
|
85
46
|
const targetIsTheCurrentTab = e.target.innerHTML === activeTab;
|
|
86
47
|
const descriptionsWereUpdated = updatedDescriptions.length > 0;
|
|
87
48
|
const datasheetWereUpdated = updatedDatasheets.length > 0;
|
|
88
|
-
const imagesWereUpdated =
|
|
89
|
-
const dataWereUpdated =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
else if(!targetIsTheCurrentTab &&
|
|
97
|
-
setModal(true)
|
|
98
|
-
setLlave(key)
|
|
99
|
-
setObjeto(sections)
|
|
100
|
-
|
|
101
|
-
|
|
49
|
+
const imagesWereUpdated = images?.values?.filter((f) => !f.id)?.length > 0;
|
|
50
|
+
const dataWereUpdated =
|
|
51
|
+
descriptionsWereUpdated || datasheetWereUpdated || imagesWereUpdated;
|
|
52
|
+
|
|
53
|
+
if (!targetIsTheCurrentTab && !dataWereUpdated) {
|
|
54
|
+
setLlave(key);
|
|
55
|
+
setObjeto(sections);
|
|
56
|
+
activeSection(key, sections);
|
|
57
|
+
} else if (!targetIsTheCurrentTab && dataWereUpdated) {
|
|
58
|
+
setModal(true);
|
|
59
|
+
setLlave(key);
|
|
60
|
+
setObjeto(sections);
|
|
102
61
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
//! ==========================================Daniel===========================================
|
|
109
|
-
|
|
62
|
+
};
|
|
110
63
|
|
|
111
64
|
return (
|
|
112
65
|
<>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
onClick={(event) => setCancelAccept(event.target.textContent)}
|
|
135
|
-
/>,
|
|
136
|
-
]}
|
|
137
|
-
/>
|
|
138
|
-
}
|
|
139
|
-
{/*=============================================================================
|
|
140
|
-
Llamado al componente para poder renderizar la alerta
|
|
141
|
-
==============================================================================*/}
|
|
142
|
-
{/* //! ==========================================Daniel=========================================== */ }
|
|
143
|
-
<Container>
|
|
144
|
-
{Object.keys(sections).map((key, index) => (
|
|
145
|
-
<TabSection
|
|
146
|
-
key={index}
|
|
147
|
-
label={key}
|
|
148
|
-
active={sections[key]}
|
|
149
|
-
onClick={(e)=>{
|
|
150
|
-
detectClickFunction (e, key, sections)
|
|
151
|
-
}}
|
|
66
|
+
{activeTab && (
|
|
67
|
+
<Modal
|
|
68
|
+
show={modal}
|
|
69
|
+
title="Cambios sin Guardar"
|
|
70
|
+
message="Estás cambiando de vista y aun no guardas cambios ¿Estás seguro?"
|
|
71
|
+
buttons={[
|
|
72
|
+
<ButtonV2
|
|
73
|
+
key={"btn-Cancelar"}
|
|
74
|
+
type={"white"}
|
|
75
|
+
label={"Cancelar"}
|
|
76
|
+
size={12}
|
|
77
|
+
onClick={(event) => setCancelAccept(event.target.textContent)}
|
|
78
|
+
/>,
|
|
79
|
+
<ButtonV2
|
|
80
|
+
key={"btn-Aceptar"}
|
|
81
|
+
type={"pink"}
|
|
82
|
+
label={"Aceptar"}
|
|
83
|
+
size={12}
|
|
84
|
+
onClick={(event) => setCancelAccept(event.target.textContent)}
|
|
85
|
+
/>,
|
|
86
|
+
]}
|
|
152
87
|
/>
|
|
153
|
-
)
|
|
154
|
-
|
|
88
|
+
)}
|
|
89
|
+
|
|
90
|
+
<Container>
|
|
91
|
+
{Object.keys(sections).map((key, index) => (
|
|
92
|
+
<TabSection
|
|
93
|
+
key={index}
|
|
94
|
+
label={key}
|
|
95
|
+
active={sections[key]}
|
|
96
|
+
onClick={(e) => {
|
|
97
|
+
detectClickFunction(e, key, sections);
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
))}
|
|
101
|
+
</Container>
|
|
155
102
|
</>
|
|
156
103
|
);
|
|
157
|
-
};
|
|
104
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Container } from "./styles";
|
|
2
2
|
import { ScreenHeader } from "../../atoms/ScreenHeader/index";
|
|
3
3
|
import { GeneralInput } from "../../atoms/GeneralInput/index";
|
|
4
|
-
import { useEffect } from "react";
|
|
5
|
-
import { useState } from "react";
|
|
6
4
|
|
|
7
5
|
export const TagAndInput = ({
|
|
8
6
|
inputType,
|
|
@@ -32,7 +30,6 @@ export const TagAndInput = ({
|
|
|
32
30
|
showTooltip,
|
|
33
31
|
auditClass,
|
|
34
32
|
}) => {
|
|
35
|
-
|
|
36
33
|
return (
|
|
37
34
|
<Container
|
|
38
35
|
inputType={inputType}
|
|
@@ -76,5 +73,4 @@ export const TagAndInput = ({
|
|
|
76
73
|
/>
|
|
77
74
|
</Container>
|
|
78
75
|
);
|
|
79
|
-
|
|
80
76
|
};
|
|
@@ -19,19 +19,13 @@ export const FullTabsMenu = ({
|
|
|
19
19
|
canAssign,
|
|
20
20
|
version,
|
|
21
21
|
setShowVersionSelector,
|
|
22
|
-
|
|
23
|
-
desc,
|
|
24
|
-
setDesc,
|
|
25
|
-
fich,
|
|
26
|
-
setFich,
|
|
27
|
-
imag,
|
|
28
|
-
setImag,
|
|
22
|
+
images,
|
|
29
23
|
updatedDescriptions,
|
|
30
24
|
updatedDatasheets,
|
|
31
25
|
selectedImages,
|
|
32
26
|
setUpdatedDescriptions,
|
|
33
27
|
setUpdatedDatasheets,
|
|
34
|
-
setSelectedImages
|
|
28
|
+
setSelectedImages,
|
|
35
29
|
}) => {
|
|
36
30
|
const [imagesSection, setImagesSection] = useState(false);
|
|
37
31
|
|
|
@@ -42,13 +36,7 @@ export const FullTabsMenu = ({
|
|
|
42
36
|
setImagesSection={setImagesSection}
|
|
43
37
|
setActiveTab={setActiveTab}
|
|
44
38
|
activeTab={activeTab}
|
|
45
|
-
|
|
46
|
-
desc={ desc }
|
|
47
|
-
setDesc={ setDesc }
|
|
48
|
-
fich={fich}
|
|
49
|
-
setFich={setFich}
|
|
50
|
-
imag={imag}
|
|
51
|
-
setImag={setImag}
|
|
39
|
+
images={images}
|
|
52
40
|
updatedDescriptions={updatedDescriptions}
|
|
53
41
|
updatedDatasheets={updatedDatasheets}
|
|
54
42
|
selectedImages={selectedImages}
|
|
@@ -74,4 +62,4 @@ export const FullTabsMenu = ({
|
|
|
74
62
|
/>
|
|
75
63
|
</Container>
|
|
76
64
|
);
|
|
77
|
-
};
|
|
65
|
+
};
|
|
@@ -3,7 +3,6 @@ import { TableHeader } from "../../molecules/TableHeader";
|
|
|
3
3
|
import { Container as Row } from "../../molecules/TableRow/styles";
|
|
4
4
|
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
5
5
|
import LabelToInput from "../../atoms/LabelToInput";
|
|
6
|
-
import { useState, useEffect } from "react";
|
|
7
6
|
|
|
8
7
|
export const ImageDataTable = ({
|
|
9
8
|
activeImage,
|
|
@@ -21,7 +20,6 @@ export const ImageDataTable = ({
|
|
|
21
20
|
setShowVersionSelector,
|
|
22
21
|
shotThd,
|
|
23
22
|
}) => {
|
|
24
|
-
|
|
25
23
|
return (
|
|
26
24
|
<Container darkMode={darkMode}>
|
|
27
25
|
<TableHeader
|
|
@@ -45,7 +43,6 @@ export const ImageDataTable = ({
|
|
|
45
43
|
}
|
|
46
44
|
/>
|
|
47
45
|
</Row>
|
|
48
|
-
|
|
49
46
|
<Row>
|
|
50
47
|
<ScreenHeader headerType={"table-row-text"} text="Tipo de empaque" />
|
|
51
48
|
<ScreenHeader
|