contentoh-components-library 21.0.98 → 21.1.1
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/GeneralInput/index.js +13 -7
- package/dist/components/atoms/GenericModal/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/index.js +23 -20
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/molecules/LoginPasswordStrength/index.js +8 -13
- package/dist/components/molecules/TagAndInput/index.js +7 -3
- 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 +41 -53
- package/dist/components/pages/RetailerProductEdition/index.js +56 -31
- package/package.json +1 -1
- package/src/components/atoms/GeneralInput/index.js +15 -6
- package/src/components/atoms/GenericModal/styles.js +1 -1
- package/src/components/atoms/InputFormatter/index.js +18 -16
- package/src/components/atoms/InputFormatter/styles.js +1 -0
- package/src/components/molecules/LoginPasswordStrength/index.js +6 -16
- package/src/components/molecules/TagAndInput/index.js +8 -1
- 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 +41 -55
- package/src/components/pages/RetailerProductEdition/index.js +51 -10
|
@@ -31,7 +31,7 @@ RetailerProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6IjZlYzkzZDk4LTU3Y2YtNDdhMS05MTBhLTk1ZWIxNjdhYjhjNyIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjU1NTAyMDg3LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjU1NTA1Njg3LCJpYXQiOjE2NTU1MDIwODcsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.fxgw--POlE3fFg2QWJaSD6tWZB9je4bR-rX5MJGOSRH9dc2WvDROjS1x_bT41M-wx9q-_U2xcFTAIff76zd-PYFYuYD29pJzTNl3c8xpQYcg4LwCvsBueRN9-_qxDcGzdSwdzxVbbk8guGdu4FA9ll-nruVIJ5QWnt8yNkWKRfn_bDLWHuQ2fPHsvVScwdn4Q60wERB6GFy6xLuQtRD5zWOBMu-_gLIfvbTm-eEJu-pkB5WtBDQki-UY1yi3bIjk9mNVSM4cdEFA7_84zKWL1O2eUUCOVC7Cn2NXQ0OEgphYmSftTU7nVN_xvl8JSUXdqRpSpkCYka849zCL5OJV7Q",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
@@ -41,66 +41,54 @@ RetailerProductEditionDefault.args = {
|
|
|
41
41
|
descriptions: 1,
|
|
42
42
|
images: 1
|
|
43
43
|
},
|
|
44
|
-
orderId:
|
|
45
|
-
status: "
|
|
46
|
-
datasheet_status:
|
|
44
|
+
orderId: 27,
|
|
45
|
+
status: "RC",
|
|
46
|
+
datasheet_status: "AC",
|
|
47
47
|
prio: "none",
|
|
48
|
-
version:
|
|
49
|
-
description_status:
|
|
50
|
-
images_status:
|
|
48
|
+
version: 2,
|
|
49
|
+
description_status: "RC",
|
|
50
|
+
images_status: "AC",
|
|
51
51
|
article: {
|
|
52
|
-
id_article:
|
|
53
|
-
id_category: "
|
|
54
|
-
name: "
|
|
55
|
-
upc: "
|
|
56
|
-
timestamp: "2022-06-
|
|
57
|
-
id_user:
|
|
52
|
+
id_article: 55099,
|
|
53
|
+
id_category: "2004",
|
|
54
|
+
name: "Producto de prueba 1 THD",
|
|
55
|
+
upc: "SKU1235THD",
|
|
56
|
+
timestamp: "2022-06-17T23:41:20.000Z",
|
|
57
|
+
id_user: 102,
|
|
58
58
|
status: "NULL",
|
|
59
59
|
active: 1,
|
|
60
|
-
company_id:
|
|
61
|
-
company_name: "
|
|
60
|
+
company_id: 833,
|
|
61
|
+
company_name: "THD Proveedor",
|
|
62
62
|
country: "México",
|
|
63
|
-
id_order:
|
|
64
|
-
id_datasheet_especialist:
|
|
65
|
-
id_datasheet_facilitator:
|
|
66
|
-
id_description_especialist:
|
|
67
|
-
id_description_facilitator:
|
|
68
|
-
id_images_especialist:
|
|
69
|
-
id_images_facilitator:
|
|
70
|
-
id_auditor:
|
|
63
|
+
id_order: 27,
|
|
64
|
+
id_datasheet_especialist: 36,
|
|
65
|
+
id_datasheet_facilitator: 52,
|
|
66
|
+
id_description_especialist: 36,
|
|
67
|
+
id_description_facilitator: 52,
|
|
68
|
+
id_images_especialist: 55,
|
|
69
|
+
id_images_facilitator: 53,
|
|
70
|
+
id_auditor: 30,
|
|
71
71
|
id_recepcionist: null,
|
|
72
|
-
category: "
|
|
73
|
-
missingAttributes:
|
|
74
|
-
missingDescriptions:
|
|
75
|
-
missingImages:
|
|
72
|
+
category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
|
|
73
|
+
missingAttributes: null,
|
|
74
|
+
missingDescriptions: null,
|
|
75
|
+
missingImages: null
|
|
76
76
|
},
|
|
77
77
|
retailers: [{
|
|
78
|
-
id:
|
|
79
|
-
name: "
|
|
78
|
+
id: 58,
|
|
79
|
+
name: "The Home Depot Golden",
|
|
80
80
|
country: "México",
|
|
81
81
|
id_region: 1,
|
|
82
82
|
active: 1
|
|
83
83
|
}, {
|
|
84
|
-
id:
|
|
85
|
-
name: "
|
|
84
|
+
id: 59,
|
|
85
|
+
name: "The Home Depot Platinum",
|
|
86
86
|
country: "México",
|
|
87
87
|
id_region: 1,
|
|
88
88
|
active: 1
|
|
89
|
-
}, {
|
|
90
|
-
id: 1013,
|
|
91
|
-
name: "Cencosud Colombia",
|
|
92
|
-
country: "Colombia",
|
|
93
|
-
id_region: 2,
|
|
94
|
-
active: 1
|
|
95
|
-
}, {
|
|
96
|
-
id: 2005,
|
|
97
|
-
name: "ClubCo",
|
|
98
|
-
country: "Costa Rica",
|
|
99
|
-
id_region: 3,
|
|
100
|
-
active: 1
|
|
101
89
|
}],
|
|
102
90
|
country: "México",
|
|
103
|
-
upc: "
|
|
91
|
+
upc: "SKU1235THD"
|
|
104
92
|
},
|
|
105
93
|
location: {
|
|
106
94
|
product: {
|
|
@@ -109,22 +97,22 @@ RetailerProductEditionDefault.args = {
|
|
|
109
97
|
}
|
|
110
98
|
},
|
|
111
99
|
user: {
|
|
112
|
-
id_user:
|
|
113
|
-
name: "
|
|
114
|
-
last_name: "",
|
|
115
|
-
email: "
|
|
116
|
-
position:
|
|
100
|
+
id_user: 30,
|
|
101
|
+
name: "Admin",
|
|
102
|
+
last_name: "Ulises",
|
|
103
|
+
email: "salmeron.5@hotmail.com",
|
|
104
|
+
position: "Admin",
|
|
117
105
|
telephone: null,
|
|
118
|
-
country:
|
|
106
|
+
country: "México",
|
|
119
107
|
id_company: 2,
|
|
120
|
-
id_cognito: "
|
|
108
|
+
id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
|
|
121
109
|
birth_Date: null,
|
|
122
110
|
about_me: null,
|
|
123
111
|
zip_code: null,
|
|
124
112
|
address: null,
|
|
125
113
|
job: null,
|
|
126
114
|
id_stripe: null,
|
|
127
|
-
id_role:
|
|
115
|
+
id_role: 6,
|
|
128
116
|
active: 1,
|
|
129
117
|
is_retailer: 0,
|
|
130
118
|
membership: {
|
|
@@ -138,6 +126,6 @@ RetailerProductEditionDefault.args = {
|
|
|
138
126
|
products_limit: "3",
|
|
139
127
|
type: "PyMES"
|
|
140
128
|
},
|
|
141
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
129
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1655598361036"
|
|
142
130
|
}
|
|
143
131
|
};
|
|
@@ -73,6 +73,8 @@ var _Loading = require("../../atoms/Loading");
|
|
|
73
73
|
|
|
74
74
|
var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
|
|
75
75
|
|
|
76
|
+
var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
|
|
77
|
+
|
|
76
78
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
77
79
|
|
|
78
80
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -515,7 +517,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
515
517
|
// setPercentages(res)
|
|
516
518
|
// );
|
|
517
519
|
|
|
518
|
-
setActiveRetailer(
|
|
520
|
+
setActiveRetailer(function (current) {
|
|
521
|
+
return current.id ? current : product.retailers ? product.retailers[0] : product.retailersAvailable[0];
|
|
522
|
+
});
|
|
519
523
|
getComments();
|
|
520
524
|
_context4.t0 = setUserGroups;
|
|
521
525
|
_context4.next = 6;
|
|
@@ -971,24 +975,28 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
971
975
|
srvActive = _srv$filter2[0];
|
|
972
976
|
|
|
973
977
|
var unvalidated = product["".concat(getConcept(tab), "_status")] === "QF" || product["".concat(getConcept(tab), "_status")] === "IN_PROGRESS";
|
|
978
|
+
var auditorUnvalidated = !["RA", "AA"].includes(product["".concat(getConcept(tab), "_status")]);
|
|
974
979
|
|
|
975
980
|
switch (userId) {
|
|
976
981
|
case 7:
|
|
977
982
|
case 8:
|
|
978
|
-
return ["RA", "RF"].includes(product === null || product === void 0 ? void 0 : product.status) &&
|
|
983
|
+
return ["RA", "RF"].includes(product === null || product === void 0 ? void 0 : product.status) && //"IN_PROGRESS", "RF", "RA"
|
|
984
|
+
statusArray.includes(srvActive === null || srvActive === void 0 ? void 0 : srvActive.status) || statusArray.includes(product.status) && srv.filter(function (serv) {
|
|
979
985
|
return statusArray.includes(serv.status);
|
|
980
986
|
}).length === srv.length;
|
|
981
987
|
|
|
982
988
|
case 4:
|
|
983
989
|
case 5:
|
|
984
|
-
return unvalidated && ["IN_PROGRESS", "QF"].includes(product.status) &&
|
|
990
|
+
return unvalidated && ["IN_PROGRESS", "QF"].includes(product.status) && //"RF", "AF", "AA", "AP", "AC
|
|
991
|
+
srv.filter(function (serv) {
|
|
985
992
|
return statusArray.includes(serv.status);
|
|
986
993
|
}).length === srv.length;
|
|
987
994
|
|
|
988
995
|
case 6:
|
|
989
|
-
return statusArray.includes(product.status) &&
|
|
990
|
-
|
|
991
|
-
|
|
996
|
+
return statusArray.includes(product.status) && //RP, RC, AF
|
|
997
|
+
servicesData.every(function (serv) {
|
|
998
|
+
return ["RA", "AA", "AP", "AC"].includes(serv.status);
|
|
999
|
+
}) && auditorUnvalidated;
|
|
992
1000
|
|
|
993
1001
|
default:
|
|
994
1002
|
break;
|
|
@@ -1055,7 +1063,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1055
1063
|
data = {};
|
|
1056
1064
|
|
|
1057
1065
|
if (!result) {
|
|
1058
|
-
_context9.next =
|
|
1066
|
+
_context9.next = 12;
|
|
1059
1067
|
break;
|
|
1060
1068
|
}
|
|
1061
1069
|
|
|
@@ -1076,11 +1084,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1076
1084
|
});
|
|
1077
1085
|
|
|
1078
1086
|
case 10:
|
|
1079
|
-
|
|
1080
|
-
_context9.next = 32;
|
|
1087
|
+
_context9.next = 30;
|
|
1081
1088
|
break;
|
|
1082
1089
|
|
|
1083
|
-
case
|
|
1090
|
+
case 12:
|
|
1084
1091
|
specialistDone = evalStatus === "RF" || evalStatus === "RA" || evalStatus === "IN_PROGRESS";
|
|
1085
1092
|
|
|
1086
1093
|
if (specialistDone) {
|
|
@@ -1115,51 +1122,49 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1115
1122
|
retailerId: activeRetailer.id
|
|
1116
1123
|
};
|
|
1117
1124
|
_context9.t0 = user.id_role;
|
|
1118
|
-
_context9.next = _context9.t0 === 7 ?
|
|
1125
|
+
_context9.next = _context9.t0 === 7 ? 23 : _context9.t0 === 8 ? 23 : _context9.t0 === 4 ? 25 : _context9.t0 === 5 ? 25 : 27;
|
|
1119
1126
|
break;
|
|
1120
1127
|
|
|
1121
|
-
case
|
|
1128
|
+
case 23:
|
|
1122
1129
|
data.especialist = true;
|
|
1123
|
-
return _context9.abrupt("break",
|
|
1130
|
+
return _context9.abrupt("break", 28);
|
|
1124
1131
|
|
|
1125
|
-
case
|
|
1132
|
+
case 25:
|
|
1126
1133
|
data.facilitator = true;
|
|
1127
|
-
return _context9.abrupt("break",
|
|
1134
|
+
return _context9.abrupt("break", 28);
|
|
1128
1135
|
|
|
1129
|
-
case
|
|
1130
|
-
return _context9.abrupt("break",
|
|
1136
|
+
case 27:
|
|
1137
|
+
return _context9.abrupt("break", 28);
|
|
1131
1138
|
|
|
1132
|
-
case
|
|
1133
|
-
_context9.next =
|
|
1139
|
+
case 28:
|
|
1140
|
+
_context9.next = 30;
|
|
1134
1141
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1135
1142
|
headers: {
|
|
1136
1143
|
Authorization: token
|
|
1137
1144
|
}
|
|
1138
1145
|
});
|
|
1139
1146
|
|
|
1140
|
-
case
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
case 32:
|
|
1147
|
+
case 30:
|
|
1148
|
+
loadData();
|
|
1144
1149
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1145
1150
|
setProduct(productTemp);
|
|
1146
|
-
_context9.next =
|
|
1151
|
+
_context9.next = 38;
|
|
1147
1152
|
break;
|
|
1148
1153
|
|
|
1149
|
-
case
|
|
1150
|
-
_context9.prev =
|
|
1154
|
+
case 35:
|
|
1155
|
+
_context9.prev = 35;
|
|
1151
1156
|
_context9.t1 = _context9["catch"](1);
|
|
1152
1157
|
console.log(_context9.t1);
|
|
1153
1158
|
|
|
1154
|
-
case
|
|
1159
|
+
case 38:
|
|
1155
1160
|
setLoading(false);
|
|
1156
1161
|
|
|
1157
|
-
case
|
|
1162
|
+
case 39:
|
|
1158
1163
|
case "end":
|
|
1159
1164
|
return _context9.stop();
|
|
1160
1165
|
}
|
|
1161
1166
|
}
|
|
1162
|
-
}, _callee9, null, [[1,
|
|
1167
|
+
}, _callee9, null, [[1, 35]]);
|
|
1163
1168
|
}));
|
|
1164
1169
|
|
|
1165
1170
|
return function sendToFacilitator(_x) {
|
|
@@ -1622,7 +1627,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1622
1627
|
sendToFacilitator("A");
|
|
1623
1628
|
},
|
|
1624
1629
|
reject: function reject() {
|
|
1625
|
-
sendToFacilitator("R");
|
|
1630
|
+
//sendToFacilitator("R");
|
|
1631
|
+
setMessage("Rechazado");
|
|
1632
|
+
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1633
|
+
src: _errorModal.default
|
|
1634
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1635
|
+
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1636
|
+
headerType: "input-name-header",
|
|
1637
|
+
color: "white"
|
|
1638
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1639
|
+
label: "Caja de Comentario",
|
|
1640
|
+
inputType: "textarea",
|
|
1641
|
+
inputId: "modal-commentary-box",
|
|
1642
|
+
index: 0,
|
|
1643
|
+
color: "white"
|
|
1644
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1645
|
+
buttonType: "general-default-button",
|
|
1646
|
+
label: "Enviar comentario",
|
|
1647
|
+
onClick: function onClick(e) {
|
|
1648
|
+
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1649
|
+
}
|
|
1650
|
+
})]);
|
|
1626
1651
|
},
|
|
1627
1652
|
showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned())
|
|
1628
1653
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
@@ -1717,7 +1742,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1717
1742
|
buttonType: "general-transparent-button",
|
|
1718
1743
|
label: "Enviar comentario",
|
|
1719
1744
|
onClick: function onClick(e) {
|
|
1720
|
-
return createComment(e, document.querySelector("#
|
|
1745
|
+
return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1721
1746
|
}
|
|
1722
1747
|
})
|
|
1723
1748
|
})]
|
package/package.json
CHANGED
|
@@ -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,17 @@ 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 (
|
|
38
|
+
updatedDatasheets ||
|
|
39
|
+
updatedDescriptions ||
|
|
40
|
+
inputType === "textarea"
|
|
41
|
+
) {
|
|
36
42
|
setTextValue({
|
|
37
43
|
value: inputType === "checkbox" ? evt.target.checked : evt.target.value,
|
|
38
44
|
});
|
|
39
|
-
let dataSave = updatedDatasheets
|
|
45
|
+
let dataSave = updatedDatasheets?.slice();
|
|
40
46
|
if (dataSave.length === 0)
|
|
41
47
|
dataSave.push({
|
|
42
48
|
articleId: articleId,
|
|
@@ -62,6 +68,9 @@ export const GeneralInput = ({
|
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
70
|
setUpdatedDatasheets(dataSave);
|
|
71
|
+
} else {
|
|
72
|
+
setTextValue({ value: evt.target.value });
|
|
73
|
+
inputOnChange && inputOnChange(evt);
|
|
65
74
|
}
|
|
66
75
|
};
|
|
67
76
|
|
|
@@ -81,14 +90,14 @@ export const GeneralInput = ({
|
|
|
81
90
|
//disabled={!enableInputs}
|
|
82
91
|
onChange={(e) => onHandleChange(e)}
|
|
83
92
|
>
|
|
84
|
-
<option value=""
|
|
93
|
+
<option value="" disabled>
|
|
85
94
|
{description}
|
|
86
95
|
</option>
|
|
87
|
-
{JSON.parse(optionList || "[]").map((element) => (
|
|
96
|
+
{JSON.parse(optionList || "[]").map((element, index) => (
|
|
88
97
|
<option
|
|
89
|
-
key={element}
|
|
98
|
+
key={element + "-" + index}
|
|
90
99
|
value={element}
|
|
91
|
-
|
|
100
|
+
defaultValue={element === textValue.value ? "selected" : ""}
|
|
92
101
|
>
|
|
93
102
|
{element}
|
|
94
103
|
</option>
|
|
@@ -59,15 +59,23 @@ export const InputFormatter = ({
|
|
|
59
59
|
setCharsCounter(h.getLength() - 1);
|
|
60
60
|
value = valueFormater(value);
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (dataSave
|
|
66
|
-
dataSave.
|
|
67
|
-
|
|
68
|
-
e.
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
if (updatedDescriptions) {
|
|
63
|
+
let idInput = inputId;
|
|
64
|
+
let dataSave = updatedDescriptions?.slice();
|
|
65
|
+
if (dataSave?.length > 0) {
|
|
66
|
+
if (dataSave.filter((e) => e.attributeId === idInput).length > 0) {
|
|
67
|
+
dataSave.forEach((e) => {
|
|
68
|
+
if (e.attributeId === idInput) {
|
|
69
|
+
e.value = value;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
dataSave.push({
|
|
74
|
+
articleId: articleId,
|
|
75
|
+
attributeId: idInput,
|
|
76
|
+
value: value,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
71
79
|
} else {
|
|
72
80
|
dataSave.push({
|
|
73
81
|
articleId: articleId,
|
|
@@ -75,14 +83,8 @@ export const InputFormatter = ({
|
|
|
75
83
|
value: value,
|
|
76
84
|
});
|
|
77
85
|
}
|
|
78
|
-
|
|
79
|
-
dataSave.push({
|
|
80
|
-
articleId: articleId,
|
|
81
|
-
attributeId: idInput,
|
|
82
|
-
value: value,
|
|
83
|
-
});
|
|
86
|
+
setUpdatedDescriptions(dataSave);
|
|
84
87
|
}
|
|
85
|
-
setUpdatedDescriptions(dataSave);
|
|
86
88
|
};
|
|
87
89
|
|
|
88
90
|
const getSelection = (range, a, b) => {
|
|
@@ -3,6 +3,7 @@ import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div`
|
|
5
5
|
.quill {
|
|
6
|
+
background-color: ${GlobalColors.white};
|
|
6
7
|
border: 1px solid
|
|
7
8
|
${({ focus, isRequired }) =>
|
|
8
9
|
focus ? GlobalColors.magenta_s2 : isRequired ? "red" : GlobalColors.s3};
|
|
@@ -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,8 @@ export const TagAndInput = ({
|
|
|
23
23
|
required,
|
|
24
24
|
optionList,
|
|
25
25
|
description,
|
|
26
|
+
inputOnChange,
|
|
27
|
+
color,
|
|
26
28
|
}) => {
|
|
27
29
|
return (
|
|
28
30
|
<Container
|
|
@@ -31,7 +33,11 @@ export const TagAndInput = ({
|
|
|
31
33
|
key={`generalTagInput-${inputType}`}
|
|
32
34
|
>
|
|
33
35
|
<div className="title-container">
|
|
34
|
-
<ScreenHeader
|
|
36
|
+
<ScreenHeader
|
|
37
|
+
text={label}
|
|
38
|
+
headerType={"input-name-header"}
|
|
39
|
+
color={color}
|
|
40
|
+
/>
|
|
35
41
|
<span className="tooltip">{label}</span>
|
|
36
42
|
</div>
|
|
37
43
|
<GeneralInput
|
|
@@ -54,6 +60,7 @@ export const TagAndInput = ({
|
|
|
54
60
|
required={required}
|
|
55
61
|
optionList={optionList}
|
|
56
62
|
description={description}
|
|
63
|
+
inputOnChange={inputOnChange}
|
|
57
64
|
/>
|
|
58
65
|
</Container>
|
|
59
66
|
);
|
|
@@ -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(
|