contentoh-components-library 21.0.97 → 21.1.0
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/atoms/AsignationOption/index.js +1 -11
- package/dist/components/atoms/GeneralInput/index.js +13 -7
- package/dist/components/molecules/LoginPasswordStrength/index.js +8 -13
- package/dist/components/molecules/TagAndInput/index.js +4 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/pages/ChangePasswordLogin/index.js +12 -35
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +115 -61
- package/dist/components/pages/ProviderProductEdition/index.js +9 -16
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +35 -47
- package/dist/components/pages/RetailerProductEdition/index.js +25 -25
- package/dist/global-files/data.js +2 -0
- package/package.json +1 -1
- package/src/components/atoms/AsignationOption/index.js +2 -8
- package/src/components/atoms/GeneralInput/index.js +11 -6
- package/src/components/molecules/LoginPasswordStrength/index.js +6 -16
- package/src/components/molecules/TagAndInput/index.js +2 -0
- package/src/components/organisms/FullProductNameHeader/index.js +5 -1
- package/src/components/pages/ChangePasswordLogin/index.js +1 -2
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +130 -62
- package/src/components/pages/ProviderProductEdition/index.js +9 -11
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +35 -49
- package/src/components/pages/RetailerProductEdition/index.js +14 -5
- package/src/global-files/data.js +2 -0
|
@@ -515,7 +515,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
515
515
|
// setPercentages(res)
|
|
516
516
|
// );
|
|
517
517
|
|
|
518
|
-
setActiveRetailer(
|
|
518
|
+
setActiveRetailer(function (current) {
|
|
519
|
+
return current.id ? current : product.retailers ? product.retailers[0] : product.retailersAvailable[0];
|
|
520
|
+
});
|
|
519
521
|
getComments();
|
|
520
522
|
_context4.t0 = setUserGroups;
|
|
521
523
|
_context4.next = 6;
|
|
@@ -971,6 +973,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
971
973
|
srvActive = _srv$filter2[0];
|
|
972
974
|
|
|
973
975
|
var unvalidated = product["".concat(getConcept(tab), "_status")] === "QF" || product["".concat(getConcept(tab), "_status")] === "IN_PROGRESS";
|
|
976
|
+
var auditorUnvalidated = !["RA", "AA"].includes(product["".concat(getConcept(tab), "_status")]);
|
|
974
977
|
|
|
975
978
|
switch (userId) {
|
|
976
979
|
case 7:
|
|
@@ -988,7 +991,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
988
991
|
case 6:
|
|
989
992
|
return statusArray.includes(product.status) && servicesData.every(function (serv) {
|
|
990
993
|
return ["RA", "AA"].includes(serv.status);
|
|
991
|
-
});
|
|
994
|
+
}) && auditorUnvalidated;
|
|
992
995
|
|
|
993
996
|
default:
|
|
994
997
|
break;
|
|
@@ -1055,7 +1058,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1055
1058
|
data = {};
|
|
1056
1059
|
|
|
1057
1060
|
if (!result) {
|
|
1058
|
-
_context9.next =
|
|
1061
|
+
_context9.next = 12;
|
|
1059
1062
|
break;
|
|
1060
1063
|
}
|
|
1061
1064
|
|
|
@@ -1076,11 +1079,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1076
1079
|
});
|
|
1077
1080
|
|
|
1078
1081
|
case 10:
|
|
1079
|
-
|
|
1080
|
-
_context9.next = 32;
|
|
1082
|
+
_context9.next = 30;
|
|
1081
1083
|
break;
|
|
1082
1084
|
|
|
1083
|
-
case
|
|
1085
|
+
case 12:
|
|
1084
1086
|
specialistDone = evalStatus === "RF" || evalStatus === "RA" || evalStatus === "IN_PROGRESS";
|
|
1085
1087
|
|
|
1086
1088
|
if (specialistDone) {
|
|
@@ -1115,51 +1117,49 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1115
1117
|
retailerId: activeRetailer.id
|
|
1116
1118
|
};
|
|
1117
1119
|
_context9.t0 = user.id_role;
|
|
1118
|
-
_context9.next = _context9.t0 === 7 ?
|
|
1120
|
+
_context9.next = _context9.t0 === 7 ? 23 : _context9.t0 === 8 ? 23 : _context9.t0 === 4 ? 25 : _context9.t0 === 5 ? 25 : 27;
|
|
1119
1121
|
break;
|
|
1120
1122
|
|
|
1121
|
-
case
|
|
1123
|
+
case 23:
|
|
1122
1124
|
data.especialist = true;
|
|
1123
|
-
return _context9.abrupt("break",
|
|
1125
|
+
return _context9.abrupt("break", 28);
|
|
1124
1126
|
|
|
1125
|
-
case
|
|
1127
|
+
case 25:
|
|
1126
1128
|
data.facilitator = true;
|
|
1127
|
-
return _context9.abrupt("break",
|
|
1129
|
+
return _context9.abrupt("break", 28);
|
|
1128
1130
|
|
|
1129
|
-
case
|
|
1130
|
-
return _context9.abrupt("break",
|
|
1131
|
+
case 27:
|
|
1132
|
+
return _context9.abrupt("break", 28);
|
|
1131
1133
|
|
|
1132
|
-
case
|
|
1133
|
-
_context9.next =
|
|
1134
|
+
case 28:
|
|
1135
|
+
_context9.next = 30;
|
|
1134
1136
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1135
1137
|
headers: {
|
|
1136
1138
|
Authorization: token
|
|
1137
1139
|
}
|
|
1138
1140
|
});
|
|
1139
1141
|
|
|
1140
|
-
case
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
case 32:
|
|
1142
|
+
case 30:
|
|
1143
|
+
loadData();
|
|
1144
1144
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1145
1145
|
setProduct(productTemp);
|
|
1146
|
-
_context9.next =
|
|
1146
|
+
_context9.next = 38;
|
|
1147
1147
|
break;
|
|
1148
1148
|
|
|
1149
|
-
case
|
|
1150
|
-
_context9.prev =
|
|
1149
|
+
case 35:
|
|
1150
|
+
_context9.prev = 35;
|
|
1151
1151
|
_context9.t1 = _context9["catch"](1);
|
|
1152
1152
|
console.log(_context9.t1);
|
|
1153
1153
|
|
|
1154
|
-
case
|
|
1154
|
+
case 38:
|
|
1155
1155
|
setLoading(false);
|
|
1156
1156
|
|
|
1157
|
-
case
|
|
1157
|
+
case 39:
|
|
1158
1158
|
case "end":
|
|
1159
1159
|
return _context9.stop();
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
}, _callee9, null, [[1,
|
|
1162
|
+
}, _callee9, null, [[1, 35]]);
|
|
1163
1163
|
}));
|
|
1164
1164
|
|
|
1165
1165
|
return function sendToFacilitator(_x) {
|
|
@@ -282,6 +282,8 @@ var getNewStatus = function getNewStatus(statusArray) {
|
|
|
282
282
|
if (lookupString.includes("AA")) return "AA";
|
|
283
283
|
if (lookupString.includes("AP")) return "AP";
|
|
284
284
|
if (lookupString.includes("AC")) return "AC";
|
|
285
|
+
if (lookupString.includes("RECEIVED")) return "RECEIVED";
|
|
286
|
+
if (lookupString.includes("NA")) return "NA";
|
|
285
287
|
return new Error("Status not found");
|
|
286
288
|
};
|
|
287
289
|
|
package/package.json
CHANGED
|
@@ -22,14 +22,8 @@ export const AsignationOption = ({
|
|
|
22
22
|
const getStatus = () => {
|
|
23
23
|
let servCad = "";
|
|
24
24
|
services.forEach((srv) => (servCad += srv));
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return "NA";
|
|
28
|
-
case "RECEIVEDRECEIVEDRECEIVED":
|
|
29
|
-
return "RECEIVED";
|
|
30
|
-
default:
|
|
31
|
-
return getNewStatus(services);
|
|
32
|
-
}
|
|
25
|
+
|
|
26
|
+
return getNewStatus(services);
|
|
33
27
|
};
|
|
34
28
|
|
|
35
29
|
const iconsAsignation = {
|
|
@@ -23,6 +23,7 @@ export const GeneralInput = ({
|
|
|
23
23
|
version,
|
|
24
24
|
optionList = [],
|
|
25
25
|
description,
|
|
26
|
+
inputOnChange,
|
|
26
27
|
}) => {
|
|
27
28
|
const [textValue, setTextValue] = useState({
|
|
28
29
|
value: inputValue,
|
|
@@ -31,12 +32,13 @@ export const GeneralInput = ({
|
|
|
31
32
|
|
|
32
33
|
const onHandleChange = (evt) => {
|
|
33
34
|
if (validateInput) {
|
|
35
|
+
console.log("here");
|
|
34
36
|
setTextValue({ value: validateInput(evt, position, inputsArray) });
|
|
35
|
-
} else {
|
|
37
|
+
} else if (updatedDatasheets || updatedDescriptions) {
|
|
36
38
|
setTextValue({
|
|
37
39
|
value: inputType === "checkbox" ? evt.target.checked : evt.target.value,
|
|
38
40
|
});
|
|
39
|
-
let dataSave = updatedDatasheets
|
|
41
|
+
let dataSave = updatedDatasheets?.slice();
|
|
40
42
|
if (dataSave.length === 0)
|
|
41
43
|
dataSave.push({
|
|
42
44
|
articleId: articleId,
|
|
@@ -62,6 +64,9 @@ export const GeneralInput = ({
|
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
setUpdatedDatasheets(dataSave);
|
|
67
|
+
} else {
|
|
68
|
+
setTextValue({ value: evt.target.value });
|
|
69
|
+
inputOnChange && inputOnChange(evt);
|
|
65
70
|
}
|
|
66
71
|
};
|
|
67
72
|
|
|
@@ -81,14 +86,14 @@ export const GeneralInput = ({
|
|
|
81
86
|
//disabled={!enableInputs}
|
|
82
87
|
onChange={(e) => onHandleChange(e)}
|
|
83
88
|
>
|
|
84
|
-
<option value=""
|
|
89
|
+
<option value="" disabled>
|
|
85
90
|
{description}
|
|
86
91
|
</option>
|
|
87
|
-
{JSON.parse(optionList || "[]").map((element) => (
|
|
92
|
+
{JSON.parse(optionList || "[]").map((element, index) => (
|
|
88
93
|
<option
|
|
89
|
-
key={element}
|
|
94
|
+
key={element + "-" + index}
|
|
90
95
|
value={element}
|
|
91
|
-
|
|
96
|
+
defaultValue={element === textValue.value ? "selected" : ""}
|
|
92
97
|
>
|
|
93
98
|
{element}
|
|
94
99
|
</option>
|
|
@@ -13,30 +13,19 @@ export const LoginPasswordStrength = ({
|
|
|
13
13
|
let numbers = /[0-9]/g;
|
|
14
14
|
let specialChar = /[‘!’,‘@’,‘#’,‘$’,‘%’,‘^’,‘&’,‘*’]/g;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
const inputValue = document.getElementById("newPasswordInput");
|
|
18
|
-
inputValue.addEventListener(
|
|
19
|
-
"input",
|
|
20
|
-
(e) => {
|
|
21
|
-
updateInfo(e, e.target.value);
|
|
22
|
-
},
|
|
23
|
-
false
|
|
24
|
-
);
|
|
25
|
-
}, []);
|
|
26
|
-
|
|
27
|
-
const updateInfo = (e, newValue) => {
|
|
16
|
+
const updateInfo = (e) => {
|
|
28
17
|
switch (e.target.id) {
|
|
29
18
|
case "newPasswordInput":
|
|
30
19
|
setPasswordStrength(0);
|
|
31
|
-
if (
|
|
20
|
+
if (e.target.value.length >= 8) {
|
|
32
21
|
setPasswordStrength((passwordStrength) => passwordStrength + 1);
|
|
33
22
|
}
|
|
34
23
|
//Verificar si la contraseña contiene mayuscula, numeros y un caracter especial
|
|
35
|
-
|
|
24
|
+
e.target.value.match(upperCaseLetters) &&
|
|
36
25
|
setPasswordStrength((passwordStrength) => passwordStrength + 1);
|
|
37
|
-
|
|
26
|
+
e.target.value.match(numbers) &&
|
|
38
27
|
setPasswordStrength((passwordStrength) => passwordStrength + 1);
|
|
39
|
-
|
|
28
|
+
e.target.value.match(specialChar) &&
|
|
40
29
|
setPasswordStrength((passwordStrength) => passwordStrength + 1);
|
|
41
30
|
break;
|
|
42
31
|
default:
|
|
@@ -52,6 +41,7 @@ export const LoginPasswordStrength = ({
|
|
|
52
41
|
inputId={"newPasswordInput"}
|
|
53
42
|
label={"Ingrese su nueva contraseña"}
|
|
54
43
|
isRequired={required}
|
|
44
|
+
inputOnChange={updateInfo}
|
|
55
45
|
/>
|
|
56
46
|
{emptyPassword && (
|
|
57
47
|
<label>La contraseña debe ser minimo de 8 caracteres</label>
|
|
@@ -23,6 +23,7 @@ export const TagAndInput = ({
|
|
|
23
23
|
required,
|
|
24
24
|
optionList,
|
|
25
25
|
description,
|
|
26
|
+
inputOnChange,
|
|
26
27
|
}) => {
|
|
27
28
|
return (
|
|
28
29
|
<Container
|
|
@@ -54,6 +55,7 @@ export const TagAndInput = ({
|
|
|
54
55
|
required={required}
|
|
55
56
|
optionList={optionList}
|
|
56
57
|
description={description}
|
|
58
|
+
inputOnChange={inputOnChange}
|
|
57
59
|
/>
|
|
58
60
|
</Container>
|
|
59
61
|
);
|
|
@@ -34,7 +34,11 @@ export const FullProductNameHeader = ({
|
|
|
34
34
|
<Container>
|
|
35
35
|
<ProductNameHeader
|
|
36
36
|
productName={headerData?.article?.name || headerData?.name}
|
|
37
|
-
statusType={
|
|
37
|
+
statusType={
|
|
38
|
+
headerData?.version_status ||
|
|
39
|
+
headerData?.status ||
|
|
40
|
+
headerData?.article_status
|
|
41
|
+
}
|
|
38
42
|
percent={percent?.toFixed(0)}
|
|
39
43
|
priority={headerData?.prio}
|
|
40
44
|
date={new Date(
|
|
@@ -17,8 +17,7 @@ export const ChangePasswordLogin = ({
|
|
|
17
17
|
const [emptyPassword, setEmptyPassword] = useState(false);
|
|
18
18
|
const [emptyConfirmPassword, setEmptyConfirmPassword] = useState(false);
|
|
19
19
|
const [matchPasswords, setMatchPasswords] = useState(true);
|
|
20
|
-
const validate =
|
|
21
|
-
e.preventDefault();
|
|
20
|
+
const validate = (e) => {
|
|
22
21
|
const password = document.querySelector("#newPasswordInput").value;
|
|
23
22
|
password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
|
|
24
23
|
const confirmPassword = document.querySelector(
|
|
@@ -16,102 +16,170 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhOTZjN2YxMi0wYjI5LTRkMzctOWMxOS1mMDAzMWFiMGY2N2EiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NTQ5MjkzNiwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjU1NDk2NTM2LCJpYXQiOjE2NTU0OTI5MzYsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.Rg3hxEzGy4pSDcG-q5lXRZWBoBiXQQKCdpRtAChvQuGM5GaQySgBW0YUEIXcLuwMbWSzj3RWJ4ZTY8NZvUhYIRbGqnIhB82FP41YCcYF7BYDilr4pZzeqEjx6U4_jR4HtbmkFfscyg0Q1VINNHTj1b0n1xLNMiE6rM7hY3eWFFhyvXn5OIH_5fZaHjYRe2uBDnF6Ogx1Za2z8DzyKkR2-QjVo4l-f64Egc5EfYWm6_3gZ1gkRGLxa7HfQXNUs0ds7Ifkx4QYHggUQdkrNdmGeYGxqZFYgG5a4LWZ-17E6x5yL87LhH-oErepE6xe6oyy-DnHaf7rWnRPqxSuilW5lQ",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
categoryName: "ILUMINACIÓN|FOCOS|LEDS",
|
|
31
|
-
asignations: [],
|
|
24
|
+
orderId: 14,
|
|
25
|
+
article_status: "AP",
|
|
26
|
+
datasheet_status: "AC",
|
|
27
|
+
description_status: "AC",
|
|
28
|
+
images_status: "AP",
|
|
29
|
+
prio: "none",
|
|
32
30
|
version: 2,
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
brand: null,
|
|
32
|
+
article: {
|
|
33
|
+
category: "ILUMINACIÓN|FOCOS|LEDS",
|
|
34
|
+
company_name: "COMPANY DEV",
|
|
35
|
+
country: "México",
|
|
36
|
+
id_category: "2146",
|
|
37
|
+
id_article: 35705,
|
|
38
|
+
name: "FOCO LED A19 (60W) LUZ AMARILLA",
|
|
39
|
+
upc: "12087311111",
|
|
40
|
+
},
|
|
41
|
+
retailers: [
|
|
35
42
|
{
|
|
36
43
|
id: 58,
|
|
37
44
|
name: "The Home Depot Golden",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 59,
|
|
48
|
+
name: "The Home Depot Platinum",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 60,
|
|
52
|
+
name: "The Home Depot Resizing",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 61,
|
|
56
|
+
name: "Home Depot TAB",
|
|
41
57
|
},
|
|
42
58
|
],
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
services: {
|
|
60
|
+
datasheets: 1,
|
|
61
|
+
descriptions: 1,
|
|
62
|
+
images: 1,
|
|
47
63
|
},
|
|
64
|
+
id_article: 35705,
|
|
65
|
+
retailersAvailable: [
|
|
66
|
+
{
|
|
67
|
+
id: 58,
|
|
68
|
+
name: "The Home Depot Golden",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 59,
|
|
72
|
+
name: "The Home Depot Platinum",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 60,
|
|
76
|
+
name: "The Home Depot Resizing",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 61,
|
|
80
|
+
name: "Home Depot TAB",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
48
83
|
},
|
|
49
84
|
productToEdit: {
|
|
85
|
+
ArticleId: 35705,
|
|
50
86
|
idCategory: "2146",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
87
|
+
product: {
|
|
88
|
+
orderId: 14,
|
|
89
|
+
article_status: "AP",
|
|
90
|
+
datasheet_status: "AC",
|
|
91
|
+
description_status: "AC",
|
|
92
|
+
images_status: "AP",
|
|
93
|
+
prio: "none",
|
|
94
|
+
version: 2,
|
|
95
|
+
brand: null,
|
|
96
|
+
article: {
|
|
97
|
+
category: "ILUMINACIÓN|FOCOS|LEDS",
|
|
98
|
+
company_name: "COMPANY DEV",
|
|
99
|
+
country: "México",
|
|
55
100
|
id_category: "2146",
|
|
101
|
+
id_article: 35705,
|
|
56
102
|
name: "FOCO LED A19 (60W) LUZ AMARILLA",
|
|
57
|
-
upc: "
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
name: "The Home Depot Golden",
|
|
68
|
-
country: "México",
|
|
69
|
-
id_region: 1,
|
|
70
|
-
active: 1,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
missing: {
|
|
74
|
-
datasheet: 33,
|
|
75
|
-
description: 0,
|
|
76
|
-
image: 23,
|
|
103
|
+
upc: "12087311111",
|
|
104
|
+
},
|
|
105
|
+
retailers: [
|
|
106
|
+
{
|
|
107
|
+
id: 58,
|
|
108
|
+
name: "The Home Depot Golden",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 59,
|
|
112
|
+
name: "The Home Depot Platinum",
|
|
77
113
|
},
|
|
114
|
+
{
|
|
115
|
+
id: 60,
|
|
116
|
+
name: "The Home Depot Resizing",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 61,
|
|
120
|
+
name: "Home Depot TAB",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
services: {
|
|
124
|
+
datasheets: 1,
|
|
125
|
+
descriptions: 1,
|
|
126
|
+
images: 1,
|
|
78
127
|
},
|
|
79
|
-
|
|
128
|
+
id_article: 35705,
|
|
129
|
+
retailersAvailable: [
|
|
130
|
+
{
|
|
131
|
+
id: 58,
|
|
132
|
+
name: "The Home Depot Golden",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 59,
|
|
136
|
+
name: "The Home Depot Platinum",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 60,
|
|
140
|
+
name: "The Home Depot Resizing",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 61,
|
|
144
|
+
name: "Home Depot TAB",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
80
148
|
},
|
|
81
149
|
location: {
|
|
82
150
|
product: { articleId: 109485, versionId: 3 },
|
|
83
|
-
state: { origin: "
|
|
151
|
+
state: { origin: "Contentoh" },
|
|
84
152
|
},
|
|
85
153
|
user: {
|
|
86
|
-
id_user:
|
|
87
|
-
name: "
|
|
88
|
-
last_name: "
|
|
89
|
-
email: "
|
|
90
|
-
position: "
|
|
154
|
+
id_user: 59,
|
|
155
|
+
name: "The Home",
|
|
156
|
+
last_name: "Depot",
|
|
157
|
+
email: "cadena.ismael@allfreemail.net",
|
|
158
|
+
position: "Admin",
|
|
91
159
|
telephone: "+523111366336",
|
|
92
160
|
country: "México",
|
|
93
|
-
id_company:
|
|
94
|
-
id_cognito: "
|
|
161
|
+
id_company: 7,
|
|
162
|
+
id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
|
|
95
163
|
birth_Date: null,
|
|
96
164
|
about_me: null,
|
|
97
165
|
zip_code: null,
|
|
98
166
|
address: null,
|
|
99
167
|
job: null,
|
|
100
|
-
id_stripe: "
|
|
168
|
+
id_stripe: "",
|
|
101
169
|
id_role: 0,
|
|
102
170
|
active: 1,
|
|
103
|
-
is_retailer:
|
|
171
|
+
is_retailer: 1,
|
|
104
172
|
membership: {
|
|
105
|
-
id:
|
|
106
|
-
start_date: "
|
|
107
|
-
end_date: "
|
|
108
|
-
planID:
|
|
109
|
-
plan: "
|
|
110
|
-
name: "Plan
|
|
111
|
-
user_limit: "
|
|
112
|
-
products_limit: "
|
|
173
|
+
id: 24,
|
|
174
|
+
start_date: "2021-11-23T03:35:50.000Z",
|
|
175
|
+
end_date: "2022-11-23T03:35:50.000Z",
|
|
176
|
+
planID: 9,
|
|
177
|
+
plan: "prod_KtlkzZVGq6bRTO",
|
|
178
|
+
name: "Plan Enterprise Full",
|
|
179
|
+
user_limit: "30",
|
|
180
|
+
products_limit: "10000",
|
|
113
181
|
type: "Enterprise",
|
|
114
182
|
},
|
|
115
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
183
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655492937526",
|
|
116
184
|
},
|
|
117
185
|
};
|
|
@@ -215,6 +215,7 @@ export const ProviderProductEdition = ({
|
|
|
215
215
|
|
|
216
216
|
//Converts the data inside the datasheets object to array
|
|
217
217
|
setServices(services);
|
|
218
|
+
getServices();
|
|
218
219
|
|
|
219
220
|
//setActiveRetailer(product?.retailers[0]);
|
|
220
221
|
setImages({
|
|
@@ -223,10 +224,6 @@ export const ProviderProductEdition = ({
|
|
|
223
224
|
});
|
|
224
225
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
225
226
|
|
|
226
|
-
setActiveRetailer(
|
|
227
|
-
product.retailers ? product.retailers[0] : product.retailersAvailable[0]
|
|
228
|
-
);
|
|
229
|
-
|
|
230
227
|
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
231
228
|
setLoading(false);
|
|
232
229
|
};
|
|
@@ -301,11 +298,13 @@ export const ProviderProductEdition = ({
|
|
|
301
298
|
|
|
302
299
|
useEffect(async () => {
|
|
303
300
|
loadData();
|
|
301
|
+
setActiveRetailer(
|
|
302
|
+
product.retailers ? product.retailers[0] : product.retailersAvailable[0]
|
|
303
|
+
);
|
|
304
304
|
// getPercentage({ data: [product] }).then((res) =>
|
|
305
305
|
// setPercentages(res)
|
|
306
306
|
// );
|
|
307
307
|
getCart();
|
|
308
|
-
getServices();
|
|
309
308
|
setUserGroups(await fetchUsers(token));
|
|
310
309
|
let arr = [];
|
|
311
310
|
switch (user.id_role) {
|
|
@@ -1175,6 +1174,7 @@ export const ProviderProductEdition = ({
|
|
|
1175
1174
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
1176
1175
|
setProduct(prod);
|
|
1177
1176
|
setShowGenericModal && setShowGenericModal(false);
|
|
1177
|
+
loadData();
|
|
1178
1178
|
};
|
|
1179
1179
|
|
|
1180
1180
|
const getSectionStatus = () => {
|
|
@@ -1447,9 +1447,7 @@ export const ProviderProductEdition = ({
|
|
|
1447
1447
|
onClick={() => {
|
|
1448
1448
|
//setModalSent(true);
|
|
1449
1449
|
sendEvaluation();
|
|
1450
|
-
setMessage(
|
|
1451
|
-
`¡Evaluación de ${translateConcept()} completada!`
|
|
1452
|
-
);
|
|
1450
|
+
setMessage(`¡Evaluación de ${activeTab} completada!`);
|
|
1453
1451
|
}}
|
|
1454
1452
|
/>
|
|
1455
1453
|
</div>
|
|
@@ -1464,10 +1462,10 @@ export const ProviderProductEdition = ({
|
|
|
1464
1462
|
</div>
|
|
1465
1463
|
{inCart ? (
|
|
1466
1464
|
<button type="button">
|
|
1467
|
-
<Link to="/checkout">
|
|
1465
|
+
{/* <Link to="/checkout">
|
|
1468
1466
|
<p>Articulo en carrito</p>
|
|
1469
1467
|
<p>Ir a checkout</p>
|
|
1470
|
-
</Link>
|
|
1468
|
+
</Link> */}
|
|
1471
1469
|
</button>
|
|
1472
1470
|
) : (
|
|
1473
1471
|
<Button
|
|
@@ -1486,7 +1484,7 @@ export const ProviderProductEdition = ({
|
|
|
1486
1484
|
{showModal && (
|
|
1487
1485
|
<ProductImageModal images={images} setShowModal={setShowModal} />
|
|
1488
1486
|
)}
|
|
1489
|
-
{message.length > 0 && (
|
|
1487
|
+
{message.length > 0 && !showSurvey && (
|
|
1490
1488
|
<GenericModal
|
|
1491
1489
|
buttonType={componentsArray.length > 0 && "delete-product"}
|
|
1492
1490
|
componentsArray={
|