contentoh-components-library 21.0.4 → 21.0.7
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/CharCounter/CharCounter.stories.js +31 -0
- package/dist/components/atoms/CharCounter/index.js +22 -0
- package/dist/components/atoms/CharCounter/styles.js +20 -0
- package/dist/components/atoms/GeneralInput/index.js +78 -49
- package/dist/components/atoms/GeneralInput/styles.js +4 -1
- package/dist/components/atoms/GradientPanel/styles.js +2 -2
- package/dist/components/atoms/InputFormatter/index.js +132 -66
- package/dist/components/atoms/InputFormatter/styles.js +2 -2
- package/dist/components/atoms/ProgressBar/styles.js +1 -1
- package/dist/components/atoms/Select/index.js +4 -2
- package/dist/components/atoms/Select/style.js +1 -1
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +37 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +94 -0
- package/dist/components/molecules/CarouselImagesLogin/styles.js +21 -0
- package/dist/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +28 -0
- package/dist/components/molecules/LoginPasswordStrength/index.js +131 -0
- package/dist/components/molecules/LoginPasswordStrength/styles.js +78 -0
- package/dist/components/molecules/TagAndInput/index.js +4 -2
- package/dist/components/organisms/InputGroup/index.js +13 -11
- package/dist/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +38 -0
- package/dist/components/pages/ChangePasswordLogin/index.js +131 -0
- package/dist/components/pages/ChangePasswordLogin/styles.js +18 -0
- package/dist/components/pages/EmailResetPassword/EmailResetPassword.stories.js +37 -0
- package/dist/components/pages/EmailResetPassword/index.js +130 -0
- package/dist/components/pages/EmailResetPassword/styles.js +20 -0
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +38 -0
- package/dist/components/pages/RegistrationLoginSecondStep/index.js +176 -0
- package/dist/components/pages/RegistrationLoginSecondStep/styles.js +20 -0
- package/dist/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginThirdStep/index.js +178 -0
- package/dist/components/pages/RegistrationLoginThirdStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +18 -28
- package/dist/components/pages/RetailerProductEdition/index.js +105 -66
- package/dist/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +37 -0
- package/dist/components/pages/VerificationCodeResetPassword/index.js +121 -0
- package/dist/components/pages/VerificationCodeResetPassword/styles.js +20 -0
- package/dist/components/pages/VerificationCodeResetPassword/utils.js +69 -0
- package/package.json +2 -2
- package/src/assets/images/carouselImagesLogin/login2.svg +117 -0
- package/src/assets/images/carouselImagesLogin/login3.svg +147 -0
- package/src/assets/images/carouselImagesLogin/loginImage.svg +301 -0
- package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
- package/src/components/atoms/CharCounter/index.js +13 -0
- package/src/components/atoms/CharCounter/styles.js +10 -0
- package/src/components/atoms/GeneralInput/index.js +74 -50
- package/src/components/atoms/GeneralInput/styles.js +9 -0
- package/src/components/atoms/GradientPanel/styles.js +7 -1
- package/src/components/atoms/InputFormatter/index.js +109 -46
- package/src/components/atoms/InputFormatter/styles.js +6 -0
- package/src/components/atoms/ProgressBar/styles.js +2 -1
- package/src/components/atoms/Select/index.js +3 -1
- package/src/components/atoms/Select/style.js +1 -2
- package/src/components/atoms/StatusTag/styles.js +2 -1
- package/src/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +17 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +68 -0
- package/src/components/molecules/CarouselImagesLogin/styles.js +60 -0
- package/src/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +8 -0
- package/src/components/molecules/LoginPasswordStrength/index.js +89 -0
- package/src/components/molecules/LoginPasswordStrength/styles.js +87 -0
- package/src/components/molecules/TagAndInput/index.js +2 -0
- package/src/components/organisms/InputGroup/index.js +25 -8
- package/src/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +18 -0
- package/src/components/pages/ChangePasswordLogin/index.js +78 -0
- package/src/components/pages/ChangePasswordLogin/styles.js +20 -0
- package/src/components/pages/EmailResetPassword/EmailResetPassword.stories.js +17 -0
- package/src/components/pages/EmailResetPassword/index.js +77 -0
- package/src/components/pages/EmailResetPassword/styles.js +27 -0
- package/src/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +17 -0
- package/src/components/pages/RegistrationLoginFirstStep/index.js +160 -0
- package/src/components/pages/RegistrationLoginFirstStep/styles.js +85 -0
- package/src/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +18 -0
- package/src/components/pages/RegistrationLoginSecondStep/index.js +111 -0
- package/src/components/pages/RegistrationLoginSecondStep/styles.js +64 -0
- package/src/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +17 -0
- package/src/components/pages/RegistrationLoginThirdStep/index.js +106 -0
- package/src/components/pages/RegistrationLoginThirdStep/styles.js +48 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +18 -29
- package/src/components/pages/RetailerProductEdition/index.js +84 -22
- package/src/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +17 -0
- package/src/components/pages/VerificationCodeResetPassword/index.js +92 -0
- package/src/components/pages/VerificationCodeResetPassword/styles.js +54 -0
- package/src/components/pages/VerificationCodeResetPassword/utils.js +56 -0
|
@@ -264,7 +264,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
264
264
|
activePercentage = _useState26[0],
|
|
265
265
|
setActivePercentage = _useState26[1];
|
|
266
266
|
|
|
267
|
-
var _useState27 = (0, _react.useState)(
|
|
267
|
+
var _useState27 = (0, _react.useState)(productSelected === null || productSelected === void 0 ? void 0 : productSelected.retailers[0]),
|
|
268
268
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
269
269
|
activeRetailer = _useState28[0],
|
|
270
270
|
setActiveRetailer = _useState28[1];
|
|
@@ -309,7 +309,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
309
309
|
comment = _useState44[0],
|
|
310
310
|
setComment = _useState44[1];
|
|
311
311
|
|
|
312
|
-
var _useState45 = (0, _react.useState)(
|
|
312
|
+
var _useState45 = (0, _react.useState)({
|
|
313
|
+
"Ficha técnica": 0,
|
|
314
|
+
Descripción: 0,
|
|
315
|
+
Imágenes: 0
|
|
316
|
+
}),
|
|
313
317
|
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
314
318
|
requiredNull = _useState46[0],
|
|
315
319
|
setRequiredNull = _useState46[1];
|
|
@@ -371,16 +375,22 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
371
375
|
services = _context2.sent;
|
|
372
376
|
//Converts the data inside the datasheets object to array
|
|
373
377
|
setServices(services);
|
|
374
|
-
setActiveRetailer(productSelected
|
|
378
|
+
getRequired(services); //setActiveRetailer(productSelected?.retailers[0]);
|
|
379
|
+
|
|
375
380
|
setImages({
|
|
376
381
|
action: "init",
|
|
377
382
|
init: services[2]
|
|
378
383
|
});
|
|
379
384
|
if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
|
|
380
385
|
setProduct(productSelected);
|
|
386
|
+
(0, _data2.getPercentage)({
|
|
387
|
+
data: [productSelected]
|
|
388
|
+
}).then(function (res) {
|
|
389
|
+
return setPercentages(res);
|
|
390
|
+
});
|
|
381
391
|
setLoading(false);
|
|
382
392
|
|
|
383
|
-
case
|
|
393
|
+
case 10:
|
|
384
394
|
case "end":
|
|
385
395
|
return _context2.stop();
|
|
386
396
|
}
|
|
@@ -501,23 +511,21 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
501
511
|
while (1) {
|
|
502
512
|
switch (_context5.prev = _context5.next) {
|
|
503
513
|
case 0:
|
|
504
|
-
loadData();
|
|
505
|
-
(
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
return setPercentages(res);
|
|
509
|
-
});
|
|
514
|
+
loadData(); // getPercentage({ data: [productSelected] }).then((res) =>
|
|
515
|
+
// setPercentages(res)
|
|
516
|
+
// );
|
|
517
|
+
|
|
510
518
|
getServices();
|
|
511
519
|
getComments();
|
|
512
520
|
_context5.t0 = setUserGroups;
|
|
513
|
-
_context5.next =
|
|
521
|
+
_context5.next = 6;
|
|
514
522
|
return (0, _data2.fetchUsers)(token);
|
|
515
523
|
|
|
516
|
-
case
|
|
524
|
+
case 6:
|
|
517
525
|
_context5.t1 = _context5.sent;
|
|
518
526
|
(0, _context5.t0)(_context5.t1);
|
|
519
527
|
|
|
520
|
-
case
|
|
528
|
+
case 8:
|
|
521
529
|
case "end":
|
|
522
530
|
return _context5.stop();
|
|
523
531
|
}
|
|
@@ -587,8 +595,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
587
595
|
setActivePercentage(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$reta3 = productSelected.retailers[0]) === null || _productSelected$reta3 === void 0 ? void 0 : _productSelected$reta3.percentage);
|
|
588
596
|
}, [percentages]);
|
|
589
597
|
(0, _react.useEffect)(function () {
|
|
590
|
-
var required = {};
|
|
591
|
-
|
|
592
598
|
if (services.length > 0) {
|
|
593
599
|
var _services$2, _services$3;
|
|
594
600
|
|
|
@@ -601,7 +607,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
601
607
|
return (service === null || service === void 0 ? void 0 : service.id) === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id);
|
|
602
608
|
});
|
|
603
609
|
|
|
604
|
-
setRequiredNull(required);
|
|
605
610
|
setDatasheets([datagroups, inputs]);
|
|
606
611
|
setDescriptions(_descriptions);
|
|
607
612
|
}
|
|
@@ -613,7 +618,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
613
618
|
var imageInputs = images === null || images === void 0 ? void 0 : (_images$inputs = images.inputs) === null || _images$inputs === void 0 ? void 0 : _images$inputs.map(function (e) {
|
|
614
619
|
return {
|
|
615
620
|
value: e === null || e === void 0 ? void 0 : e.id,
|
|
616
|
-
name: e === null || e === void 0 ? void 0 : e.name
|
|
621
|
+
name: e === null || e === void 0 ? void 0 : e.name,
|
|
622
|
+
required: e === null || e === void 0 ? void 0 : e.required
|
|
617
623
|
};
|
|
618
624
|
});
|
|
619
625
|
var imageType = images === null || images === void 0 ? void 0 : (_images$imageType = images.imageType) === null || _images$imageType === void 0 ? void 0 : _images$imageType.map(function (e) {
|
|
@@ -924,7 +930,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
924
930
|
}
|
|
925
931
|
|
|
926
932
|
concept = action ? action : concept;
|
|
927
|
-
return productSelected["".concat(concept, "_status")] === "QF" && (
|
|
933
|
+
return productSelected["".concat(concept, "_status")] === "QF" && (user.id_role === 1 || user.id_role === 4 || user.id_role === 5) || productSelected["".concat(concept, "_status")] === "AF" && (user.id_role === 1 || user.id_role === 6) || productSelected["".concat(concept, "_status")] === "RP" && (user.id_role === 1 || user.id_role === 6);
|
|
928
934
|
};
|
|
929
935
|
|
|
930
936
|
var getSectionIcon = function getSectionIcon() {
|
|
@@ -1037,7 +1043,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1037
1043
|
|
|
1038
1044
|
case 11:
|
|
1039
1045
|
evalStatus = "";
|
|
1040
|
-
productTemp =
|
|
1046
|
+
productTemp = productSelected;
|
|
1041
1047
|
evalStatus = productSelected["".concat(concept, "_status")];
|
|
1042
1048
|
specialistDone = evalStatus === "RF" || evalStatus === "RA" || evalStatus === "IN_PROGRESS";
|
|
1043
1049
|
|
|
@@ -1045,18 +1051,22 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1045
1051
|
setMessage("".concat(activeTab, " enviada a facilitador"));
|
|
1046
1052
|
getSectionIcon();
|
|
1047
1053
|
productTemp["".concat(concept, "_status")] = "QF";
|
|
1054
|
+
evalStatus = "QF";
|
|
1048
1055
|
} else if (evalStatus === "QF") {
|
|
1049
1056
|
setMessage("Evaluación enviada");
|
|
1050
1057
|
getSectionIcon();
|
|
1051
1058
|
productTemp["".concat(concept, "_status")] = "AF";
|
|
1059
|
+
evalStatus = "AF";
|
|
1052
1060
|
} else if (evalStatus === "AF") {
|
|
1053
1061
|
setMessage("Evaluación enviada");
|
|
1054
1062
|
getSectionIcon();
|
|
1055
1063
|
productTemp["".concat(concept, "_status")] = "AA";
|
|
1064
|
+
evalStatus = "AA";
|
|
1056
1065
|
} else if (evalStatus === "RP") {
|
|
1057
1066
|
setMessage("Evaluación enviada");
|
|
1058
1067
|
getSectionIcon();
|
|
1059
1068
|
productTemp["".concat(concept, "_status")] = "AA";
|
|
1069
|
+
evalStatus = "AA";
|
|
1060
1070
|
}
|
|
1061
1071
|
|
|
1062
1072
|
data = {};
|
|
@@ -1083,7 +1093,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1083
1093
|
});
|
|
1084
1094
|
|
|
1085
1095
|
case 22:
|
|
1086
|
-
_context10.next =
|
|
1096
|
+
_context10.next = 36;
|
|
1087
1097
|
break;
|
|
1088
1098
|
|
|
1089
1099
|
case 24:
|
|
@@ -1120,10 +1130,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1120
1130
|
}
|
|
1121
1131
|
});
|
|
1122
1132
|
|
|
1123
|
-
setProduct(productTemp);
|
|
1124
|
-
setModalSent(true);
|
|
1133
|
+
setProduct(productTemp); //setModalSent(true);
|
|
1125
1134
|
|
|
1126
|
-
case
|
|
1135
|
+
case 36:
|
|
1127
1136
|
case "end":
|
|
1128
1137
|
return _context10.stop();
|
|
1129
1138
|
}
|
|
@@ -1136,7 +1145,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1136
1145
|
};
|
|
1137
1146
|
}();
|
|
1138
1147
|
|
|
1139
|
-
var
|
|
1148
|
+
var _userAssigned = function userAssigned(tab, rol) {
|
|
1140
1149
|
var concept = "";
|
|
1141
1150
|
|
|
1142
1151
|
switch (tab) {
|
|
@@ -1220,32 +1229,57 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1220
1229
|
};
|
|
1221
1230
|
}();
|
|
1222
1231
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1232
|
+
var getRequired = function getRequired(services) {
|
|
1233
|
+
var _services$4, _services$4$inputs;
|
|
1234
|
+
|
|
1235
|
+
var objetcTemp = {};
|
|
1236
|
+
var datasheetServicesArray = Object.values(services[0]);
|
|
1237
|
+
var dsInputs = datasheetServicesArray.pop();
|
|
1238
|
+
var descriptionsServicesArray = services[1];
|
|
1239
|
+
var dsInputsRequired = [];
|
|
1240
|
+
var desInputsRequired = 0;
|
|
1241
|
+
datasheetServicesArray.forEach(function (datasheet) {
|
|
1242
|
+
return Object.values(datasheet === null || datasheet === void 0 ? void 0 : datasheet.data).forEach(function (dataGroup) {
|
|
1243
|
+
return dsInputsRequired.push.apply(dsInputsRequired, (0, _toConsumableArray2.default)(dataGroup.inputs.filter(function (input) {
|
|
1244
|
+
return dsInputs[input].required && (dsInputs[input].value === undefined || !dsInputs[input].value);
|
|
1245
|
+
})));
|
|
1246
|
+
});
|
|
1247
|
+
});
|
|
1248
|
+
objetcTemp["Ficha técnica"] = dsInputsRequired.length;
|
|
1249
|
+
descriptionsServicesArray.forEach(function (description) {
|
|
1250
|
+
return description.inputs.forEach(function (input) {
|
|
1251
|
+
return input.required && (!input.value || input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") === "") && desInputsRequired++;
|
|
1252
|
+
});
|
|
1253
|
+
});
|
|
1254
|
+
objetcTemp["Descripción"] = desInputsRequired;
|
|
1255
|
+
var requiredImages = (_services$4 = services[2]) === null || _services$4 === void 0 ? void 0 : (_services$4$inputs = _services$4.inputs) === null || _services$4$inputs === void 0 ? void 0 : _services$4$inputs.filter(function (e) {
|
|
1256
|
+
return e.required;
|
|
1257
|
+
});
|
|
1258
|
+
var requiredCounter = 0;
|
|
1259
|
+
requiredImages.forEach(function (req) {
|
|
1260
|
+
return services[2].values.filter(function (img) {
|
|
1261
|
+
return img.image_id === req.id;
|
|
1262
|
+
}).length === 0 && requiredCounter++;
|
|
1263
|
+
});
|
|
1264
|
+
objetcTemp["Imágenes"] = requiredCounter;
|
|
1265
|
+
setRequiredNull(objetcTemp);
|
|
1266
|
+
};
|
|
1229
1267
|
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
}, _callee12);
|
|
1236
|
-
})), [activeTab]);
|
|
1268
|
+
(0, _react.useEffect)(function () {
|
|
1269
|
+
setComment(comments[activeTab]);
|
|
1270
|
+
}, [activeTab]);
|
|
1237
1271
|
|
|
1238
1272
|
var commentRevised = /*#__PURE__*/function () {
|
|
1239
|
-
var
|
|
1273
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1240
1274
|
var data;
|
|
1241
|
-
return _regenerator.default.wrap(function
|
|
1275
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1242
1276
|
while (1) {
|
|
1243
|
-
switch (
|
|
1277
|
+
switch (_context12.prev = _context12.next) {
|
|
1244
1278
|
case 0:
|
|
1245
1279
|
data = {
|
|
1246
1280
|
commentId: comment.id
|
|
1247
1281
|
};
|
|
1248
|
-
|
|
1282
|
+
_context12.next = 3;
|
|
1249
1283
|
return _axios.default.put("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1250
1284
|
headers: {
|
|
1251
1285
|
Authorization: sessionStorage.getItem("jwt")
|
|
@@ -1254,47 +1288,47 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1254
1288
|
|
|
1255
1289
|
case 3:
|
|
1256
1290
|
setCrossComment(false);
|
|
1257
|
-
|
|
1291
|
+
_context12.next = 6;
|
|
1258
1292
|
return getComments();
|
|
1259
1293
|
|
|
1260
1294
|
case 6:
|
|
1261
1295
|
case "end":
|
|
1262
|
-
return
|
|
1296
|
+
return _context12.stop();
|
|
1263
1297
|
}
|
|
1264
1298
|
}
|
|
1265
|
-
},
|
|
1299
|
+
}, _callee12);
|
|
1266
1300
|
}));
|
|
1267
1301
|
|
|
1268
1302
|
return function commentRevised() {
|
|
1269
|
-
return
|
|
1303
|
+
return _ref13.apply(this, arguments);
|
|
1270
1304
|
};
|
|
1271
1305
|
}();
|
|
1272
1306
|
|
|
1273
1307
|
var setAssignation = /*#__PURE__*/function () {
|
|
1274
|
-
var
|
|
1308
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(assignationType, assignationId) {
|
|
1275
1309
|
var _product$article3;
|
|
1276
1310
|
|
|
1277
1311
|
var concept, productTemp, data;
|
|
1278
|
-
return _regenerator.default.wrap(function
|
|
1312
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1279
1313
|
while (1) {
|
|
1280
|
-
switch (
|
|
1314
|
+
switch (_context13.prev = _context13.next) {
|
|
1281
1315
|
case 0:
|
|
1282
1316
|
concept = "";
|
|
1283
|
-
|
|
1284
|
-
|
|
1317
|
+
_context13.t0 = activeTab;
|
|
1318
|
+
_context13.next = _context13.t0 === "Ficha técnica" ? 4 : _context13.t0 === "Imágenes" ? 6 : 8;
|
|
1285
1319
|
break;
|
|
1286
1320
|
|
|
1287
1321
|
case 4:
|
|
1288
1322
|
concept = "datasheet";
|
|
1289
|
-
return
|
|
1323
|
+
return _context13.abrupt("break", 10);
|
|
1290
1324
|
|
|
1291
1325
|
case 6:
|
|
1292
1326
|
concept = "images";
|
|
1293
|
-
return
|
|
1327
|
+
return _context13.abrupt("break", 10);
|
|
1294
1328
|
|
|
1295
1329
|
case 8:
|
|
1296
1330
|
concept = "description";
|
|
1297
|
-
return
|
|
1331
|
+
return _context13.abrupt("break", 10);
|
|
1298
1332
|
|
|
1299
1333
|
case 10:
|
|
1300
1334
|
productTemp = productSelected;
|
|
@@ -1319,14 +1353,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1319
1353
|
|
|
1320
1354
|
case 16:
|
|
1321
1355
|
case "end":
|
|
1322
|
-
return
|
|
1356
|
+
return _context13.stop();
|
|
1323
1357
|
}
|
|
1324
1358
|
}
|
|
1325
|
-
},
|
|
1359
|
+
}, _callee13);
|
|
1326
1360
|
}));
|
|
1327
1361
|
|
|
1328
1362
|
return function setAssignation(_x7, _x8) {
|
|
1329
|
-
return
|
|
1363
|
+
return _ref14.apply(this, arguments);
|
|
1330
1364
|
};
|
|
1331
1365
|
}();
|
|
1332
1366
|
|
|
@@ -1436,6 +1470,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1436
1470
|
}
|
|
1437
1471
|
};
|
|
1438
1472
|
|
|
1473
|
+
(0, _react.useEffect)(function () {
|
|
1474
|
+
console.log(requiredNull[activeTab], evaluationComplete(activeTab));
|
|
1475
|
+
}, [activeTab]);
|
|
1439
1476
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1440
1477
|
headerTop: headerTop,
|
|
1441
1478
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
@@ -1474,7 +1511,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1474
1511
|
approveRejectButtons: approveRejectButtons,
|
|
1475
1512
|
sendToFacilitator: sendToFacilitator,
|
|
1476
1513
|
auditorAssigned: auditorAssigned,
|
|
1477
|
-
userAssigned: userAssigned(
|
|
1514
|
+
userAssigned: function userAssigned() {
|
|
1515
|
+
return _userAssigned(activeTab, "facilitator");
|
|
1516
|
+
}
|
|
1478
1517
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1479
1518
|
tabsSections: tabsSections,
|
|
1480
1519
|
status: {
|
|
@@ -1555,7 +1594,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1555
1594
|
headerType: "input-name-header"
|
|
1556
1595
|
}))]
|
|
1557
1596
|
})
|
|
1558
|
-
}), (
|
|
1597
|
+
}), (_userAssigned(activeTab, "especialist" || "facilitator") || auditorAssigned()) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1559
1598
|
className: "commentary-box",
|
|
1560
1599
|
children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1561
1600
|
className: "commentary",
|
|
@@ -1583,24 +1622,24 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1583
1622
|
reviewed: crossComment
|
|
1584
1623
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1585
1624
|
buttonType: "circular-button accept-button",
|
|
1586
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1587
|
-
return _regenerator.default.wrap(function
|
|
1625
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
1626
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
1588
1627
|
while (1) {
|
|
1589
|
-
switch (
|
|
1628
|
+
switch (_context14.prev = _context14.next) {
|
|
1590
1629
|
case 0:
|
|
1591
1630
|
setCrossComment(true);
|
|
1592
1631
|
commentRevised();
|
|
1593
1632
|
|
|
1594
1633
|
case 2:
|
|
1595
1634
|
case "end":
|
|
1596
|
-
return
|
|
1635
|
+
return _context14.stop();
|
|
1597
1636
|
}
|
|
1598
1637
|
}
|
|
1599
|
-
},
|
|
1638
|
+
}, _callee14);
|
|
1600
1639
|
}))
|
|
1601
1640
|
})]
|
|
1602
1641
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1603
|
-
buttonType:
|
|
1642
|
+
buttonType: approveRejectButtons() || requiredNull[activeTab] === 0 || evaluationComplete(activeTab) ? "general-green-button" : "general-button-disabled",
|
|
1604
1643
|
label: "Enviar evaluación",
|
|
1605
1644
|
onClick: function onClick() {
|
|
1606
1645
|
return sendToFacilitator();
|
|
@@ -1618,11 +1657,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1618
1657
|
componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1619
1658
|
src: _genericModalCheck.default,
|
|
1620
1659
|
alt: "success icon"
|
|
1621
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1660
|
+
}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1622
1661
|
headerType: "retailer-name-header",
|
|
1623
1662
|
text: message,
|
|
1624
1663
|
color: "white"
|
|
1625
|
-
}, "
|
|
1664
|
+
}, "2")],
|
|
1626
1665
|
onClick: function onClick() {
|
|
1627
1666
|
return setMessage("");
|
|
1628
1667
|
}
|
package/dist/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.VerificationCodeResetPasswordDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _loginImage = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/loginImage.svg"));
|
|
15
|
+
|
|
16
|
+
var _login = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login2.svg"));
|
|
17
|
+
|
|
18
|
+
var _login2 = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login3.svg"));
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
var _default = {
|
|
23
|
+
title: "Components/pages/VerificationCodeResetPassword",
|
|
24
|
+
component: _index.VerificationCodeResetPassword
|
|
25
|
+
};
|
|
26
|
+
exports.default = _default;
|
|
27
|
+
|
|
28
|
+
var Template = function Template(args) {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.VerificationCodeResetPassword, (0, _objectSpread2.default)({}, args));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var VerificationCodeResetPasswordDefault = Template.bind({});
|
|
33
|
+
exports.VerificationCodeResetPasswordDefault = VerificationCodeResetPasswordDefault;
|
|
34
|
+
VerificationCodeResetPasswordDefault.args = {
|
|
35
|
+
imageArrayCarousel: [_loginImage.default, _login.default, _login2.default],
|
|
36
|
+
textCarousel: "Elige la plataforma que conecta proovedores y retailers"
|
|
37
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.VerificationCodeResetPassword = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
|
|
14
|
+
var _GradientPanel = require("../../atoms/GradientPanel");
|
|
15
|
+
|
|
16
|
+
var _CarouselImagesLogin = require("../../molecules/CarouselImagesLogin");
|
|
17
|
+
|
|
18
|
+
var _react = require("react");
|
|
19
|
+
|
|
20
|
+
var _LogoImage = require("../../atoms/LogoImage");
|
|
21
|
+
|
|
22
|
+
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
23
|
+
|
|
24
|
+
var _variables = require("../../../global-files/variables");
|
|
25
|
+
|
|
26
|
+
var _GeneralInput = require("../../atoms/GeneralInput");
|
|
27
|
+
|
|
28
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
29
|
+
|
|
30
|
+
var _utils = require("./utils");
|
|
31
|
+
|
|
32
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
|
+
|
|
34
|
+
var VerificationCodeResetPassword = function VerificationCodeResetPassword(_ref) {
|
|
35
|
+
var _ref$imageArrayCarous = _ref.imageArrayCarousel,
|
|
36
|
+
imageArrayCarousel = _ref$imageArrayCarous === void 0 ? [] : _ref$imageArrayCarous,
|
|
37
|
+
textCarousel = _ref.textCarousel,
|
|
38
|
+
backogroundColorCarousel = _ref.backogroundColorCarousel;
|
|
39
|
+
|
|
40
|
+
var _useState = (0, _react.useState)(false),
|
|
41
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
+
emptyVerificationCode = _useState2[0],
|
|
43
|
+
setEmptyVerificationCode = _useState2[1];
|
|
44
|
+
|
|
45
|
+
var _useState3 = (0, _react.useState)(),
|
|
46
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
47
|
+
inputCodeVerificationAll = _useState4[0],
|
|
48
|
+
setInputCodeVerificationAll = _useState4[1];
|
|
49
|
+
|
|
50
|
+
var inputPositions = [1, 2, 3, 4, 5, 6];
|
|
51
|
+
(0, _react.useEffect)(function () {
|
|
52
|
+
setInputCodeVerificationAll(document.querySelectorAll("[id^='verificationCodeInput']"));
|
|
53
|
+
}, []);
|
|
54
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
55
|
+
className: "credenciales",
|
|
56
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
57
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
58
|
+
color: _variables.GlobalColors.s5,
|
|
59
|
+
text: "Ingresa tus credenciales"
|
|
60
|
+
})
|
|
61
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
62
|
+
className: "user",
|
|
63
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
64
|
+
text: "Ingresa el código de verificación enviado a:",
|
|
65
|
+
headerType: "input-name-header"
|
|
66
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
67
|
+
className: "verification-code",
|
|
68
|
+
children: inputPositions.map(function (position) {
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
|
|
70
|
+
inputId: "verificationCodeInput".concat(position),
|
|
71
|
+
inputType: "text",
|
|
72
|
+
inputPlaceholder: "X",
|
|
73
|
+
validateInput: _utils.validateInput,
|
|
74
|
+
inputsArray: inputCodeVerificationAll,
|
|
75
|
+
position: position,
|
|
76
|
+
maxLength: "1"
|
|
77
|
+
});
|
|
78
|
+
})
|
|
79
|
+
}), emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
80
|
+
children: "Ingrese su c\xF3digo de verificaci\xF3n"
|
|
81
|
+
})]
|
|
82
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
83
|
+
className: "resend-code",
|
|
84
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
85
|
+
children: "Reenviar c\xF3digo de verificaci\xF3n"
|
|
86
|
+
})
|
|
87
|
+
}, "4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
88
|
+
className: "button-center",
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
90
|
+
buttonType: "general-default-button",
|
|
91
|
+
label: "Enviar",
|
|
92
|
+
onClick: function onClick(e) {
|
|
93
|
+
return (0, _utils.validate)(inputCodeVerificationAll, setEmptyVerificationCode);
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
97
|
+
className: "reset-password",
|
|
98
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
99
|
+
children: "Regresar..."
|
|
100
|
+
})
|
|
101
|
+
}, "6")];
|
|
102
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
103
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
104
|
+
className: "home-retailer",
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselImagesLogin.CarouselImagesLogin, {
|
|
106
|
+
panelImg: imageArrayCarousel,
|
|
107
|
+
panelText: textCarousel,
|
|
108
|
+
panelColor: backogroundColorCarousel
|
|
109
|
+
})
|
|
110
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
111
|
+
className: "home-login-retailer",
|
|
112
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
|
|
113
|
+
componentsArray: loginRight,
|
|
114
|
+
panelType: "home-login",
|
|
115
|
+
panelColor: _variables.GlobalColors.white
|
|
116
|
+
})
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
exports.VerificationCodeResetPassword = VerificationCodeResetPassword;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 100%;\n height: 100vh;\n .button-center {\n text-align: center;\n .general-default-button {\n width: 160px;\n }\n }\n .reset-password {\n text-align: center;\n margin: 15px !important;\n color: ", ";\n cursor: pointer;\n font-weight: bold;\n font-family: ", ";\n font-size: 13px;\n }\n .resend-code {\n margin-top: 8px !important;\n color: ", ";\n font-family: ", ";\n font-size: 11px;\n text-decoration: underline rgb(228, 81, 172);\n cursor: pointer;\n & + * {\n margin-top: 30px;\n }\n }\n .verification-code {\n display: flex;\n text-align: center;\n margin: auto;\n margin-top: 10px;\n input[type=\"number\"]::-webkit-inner-spin-button,\n input[type=\"number\"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n input {\n \n width: 70%;\n text-align: center;\n }\n }\n .home-login-retailer,\n .home-retailer {\n width: 50%;\n }\n"])), _variables.GlobalColors.secondary_magenta, _variables.FontFamily.Raleway, _variables.GlobalColors.magenta_s2, _variables.FontFamily.AvenirNext);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateInput = exports.validate = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {event} e event received triggered by verification code input
|
|
11
|
+
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
12
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
13
|
+
*/
|
|
14
|
+
var validateInput = function validateInput(e, index, inputsArray) {
|
|
15
|
+
var isValid = false;
|
|
16
|
+
var inputNotEmpty = e.target.value.length > 0;
|
|
17
|
+
|
|
18
|
+
if (inputNotEmpty) {
|
|
19
|
+
if (validateInputNumber(e) !== null) {
|
|
20
|
+
isValid = true;
|
|
21
|
+
nextInputFocus(inputsArray, index++);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return isValid ? e.target.value : "";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param {event} e event received triggered by verification code input
|
|
30
|
+
* @returns {boolean} if digit is a number
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
exports.validateInput = validateInput;
|
|
35
|
+
|
|
36
|
+
var validateInputNumber = function validateInputNumber(e) {
|
|
37
|
+
return (e.target.value || String.fromCharCode(e.keyCode)).match(/[0-9]{1}/);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
42
|
+
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
43
|
+
* changes focus to next input if digit typed is a number and there wasn't any before
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
var nextInputFocus = function nextInputFocus(inputsArray, index) {
|
|
48
|
+
var _inputsArray$index;
|
|
49
|
+
|
|
50
|
+
var button = document.getElementsByClassName("general-default-button");
|
|
51
|
+
inputsArray !== null && inputsArray !== void 0 && inputsArray.length && index === (inputsArray === null || inputsArray === void 0 ? void 0 : inputsArray.length) ? button[0].focus() : (_inputsArray$index = inputsArray[index]) === null || _inputsArray$index === void 0 ? void 0 : _inputsArray$index.focus();
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to check if there's any empty)
|
|
56
|
+
* @param {function} setEmptyVerificationCode function to update flag which handles if there's an empty char
|
|
57
|
+
* updates emptyVerificationFlag from father component
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
var validate = function validate(inputsArray, setEmptyVerificationCode) {
|
|
62
|
+
var contInputEmpty = 0;
|
|
63
|
+
inputsArray.forEach(function (element) {
|
|
64
|
+
element.value === "" ? 0 : contInputEmpty++;
|
|
65
|
+
});
|
|
66
|
+
contInputEmpty === inputsArray.length ? setEmptyVerificationCode(false) : setEmptyVerificationCode(true);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.validate = validate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentoh-components-library",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.7",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@babel/runtime": "^7.17.2",
|
|
6
6
|
"@storybook/addon-postcss": "^2.0.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"web-vitals": "^1.0.1"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"start": "start-storybook
|
|
30
|
+
"start": "start-storybook -p 6006",
|
|
31
31
|
"build": "cross-env BABEL_ENV=production babel src -d dist",
|
|
32
32
|
"chromatic": "npx chromatic --project-token=d7bb0c8ba831"
|
|
33
33
|
},
|