From 2a1d61a0d872917e2011d74257350123b510bcf9 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 18 Jun 2023 17:20:07 -0400 Subject: [PATCH 1/9] refactor(ui): use pure MUI components Former-commit-id: 7e266fea39acc16861da50bcb597fd9efc6a201d [formerly e268bb5afe68f3a3dd6a1e3369196f6e6c99ecae] [formerly f46f4339f6177f4f4bce77771cf9366ecff59816 [formerly c9a600226bf06b3052af054745d1138955d3e875]] [formerly 356c8541c16b5091331c2fee68326bf58a525827 [formerly fade4efd6ac0a242e299eaa6d194648fd704db6d] [formerly 1dcfcccebc64ade336658e7092ca92794ffe1fa0 [formerly 9c17d21bed13491ab73f5a20e89d12e9bef8632e]]] [formerly 25b8bf18102797e389c013c045acd99f8aa85089 [formerly c871a04a6e3d3c4630954a518928b093aee9dacb] [formerly d2c00cc3daac853632f726b9bbc2af84c88ba39b [formerly f1c3387817fee8ac7d3faeb40b9cda8e423f5bfb]] [formerly b58fc558441824ee8f11570cc3eb298d74acf29f [formerly 87ca394b8e428717d8fec50baeb57ed048d1d6be] [formerly 9edf2df07064766ac0ab0a6e154b02f89f84f2b0 [formerly 4bdd4fda0fe45eaf0dc378e30b8ebc8bca15636c]]]] [formerly 76d56df8b0e66708081a25d2311dde9d6d416351 [formerly dc8b2fb8ba89dd4aac461c7421c6cc98b17015c1] [formerly 976327d698a56d566bc3dfa394dfaed3fc43557e [formerly 1aa5b4efaffc3d89c57da9b1f4f7166d2f35e602]] [formerly d0fd7a1f8e9634447fbc29c9ba4bb8ae3ee7f36a [formerly ec472af6cebcbf6a4d35befd6b951c5ef02cca87] [formerly 9c2ae1dcc68db533590a90c393c9fc6bf3239816 [formerly b81b2ab83d5020698f084cd5e1e58341a00ffe9c]]] [formerly db025fd922e76344f88dd067667dd9da6071f960 [formerly 37b823b906c3c3f529190cb9a2a2ce251d38fdfb] [formerly 7fdddb621abae8882330c088de4041498f4feafd [formerly 46a453061748bd29c3b2f227365451f96dc65059]] [formerly b140928c673404f6452583241a67e992f85d0735 [formerly 62600809af2b04d0c6bd5befaf4b703ae4b5978e] [formerly 12ec1eb0b26de785aadedb0f60d1d5d31c8e17e6 [formerly 67211257083c0e0118be002b0e04d4115e7a8796]]]]] Former-commit-id: 298c5ee168d1d14db4c87dddffc3441dc21ddd0e [formerly 0d73d9ba3dc309ba17bb8660bcc31a30316f34e4] [formerly 4fc06832a319a210b0c511b36405cb75325328ed [formerly 8701a46f860774badb0c035b3dc9f96bb5c2870f]] [formerly efbefd34e4fab1a0a955d62923699d2d93e57c43 [formerly 840ff3407e0707a2adec8479e3f7b8feca748f23] [formerly b8a2a3b784f778ed6badbaf04bcbe149d20db385 [formerly cee29247d79435590ae78a43bcbf8a36b52d8dfc]]] [formerly fa8553401adf4834d58ec642eccecb72af90e6e1 [formerly 897e13d2403461947c5024aac0966ed8ff3208d4] [formerly 42ead0603c1128b947d23c312f0e2fabe9e983f1 [formerly 526f3ba693bf4fe3042308ae8c8a1e2d0b9af212]] [formerly ea9d9128915b084173c3716dabedf817be785763 [formerly 5127aa96deb56d240e6d533b68c3f2963e9277c0] [formerly 6e9772c2bcccaa65163ae2bf8eb0bd9814f0eb30 [formerly 7b8ce9b8f7f9bfcd7167042123d45d6b7cbcd0c1]]]] Former-commit-id: d81b7ce8d6d87fcbce2e497286505bec1f154e49 [formerly ce86dae4a433f1b7398e7e131e03371310fdfdd8] [formerly b66c6b95504c911c63d159053aac31ca29041150 [formerly da461c3114a9fec8b8d5a19588d2809977fa0cd7]] [formerly 8c2a2799f6b90cec3581c4a29bda04bbe34b6229 [formerly 8569b92eef4d08639740a0ab705f3fd85631c810] [formerly 84e6282c0f94174e2cce027ac992417690b7b2d2 [formerly 989d89f462f9842ae8a68b5aab17c5488caf5c59]]] Former-commit-id: b2cd881cc2ac5711e69b9cf250398de3d775258f [formerly 95918f5634ef82e092e9cbd108db6af7c39913e8] [formerly 1c5f2ccaaf584977bdaf4800feddf49ff08cbda7 [formerly cf85771425aa08aacbc7b54522ebaab4d139e1a7]] Former-commit-id: 6a5626c45d6f1c2256cb72d093411eabe9a6db0d [formerly e25e5e441aa2e90e66f2ac1b185ee8666ab87342] Former-commit-id: 7a496e9fe8fa4f4acf0931f621432c303ca7b374 --- .../biometric/face-liveness-detector.tsx | 15 +- src/components/elements/alert/index.tsx | 97 +++++--- src/pages/_app.tsx | 15 +- src/pages/register/stepper/step1.tsx | 76 +++--- src/pages/register/stepper/step2.tsx | 72 +++--- src/pages/register/stepper/step2Modal.tsx | 11 +- src/pages/register/stepper/step3.tsx | 217 ++++++++++-------- yarn.lock.REMOVED.git-id | 2 +- 8 files changed, 278 insertions(+), 227 deletions(-) diff --git a/src/components/biometric/face-liveness-detector.tsx b/src/components/biometric/face-liveness-detector.tsx index e5835db0..45097990 100644 --- a/src/components/biometric/face-liveness-detector.tsx +++ b/src/components/biometric/face-liveness-detector.tsx @@ -3,7 +3,7 @@ import { Loader, ThemeProvider } from '@aws-amplify/ui-react'; import React from 'react'; import { useState, useEffect } from 'react'; -import { AlertErrorMessage } from '../elements/alert'; +import { useSnackbar } from '@/components/elements/alert'; import { defaultLivenessDisplayText } from './displayText'; export function LivenessQuickStartReact({ handleNextForm, cedula }: any) { @@ -12,6 +12,7 @@ export function LivenessQuickStartReact({ handleNextForm, cedula }: any) { const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [sessionId, setSessionId] = useState(null); + const { AlertError } = useSnackbar(); const fetchCreateLiveness = async () => { const response = await fetch(`/api/biometric`, { method: 'POST' }); @@ -48,14 +49,14 @@ export function LivenessQuickStartReact({ handleNextForm, cedula }: any) { }); }, []); + useEffect(() => { + if (error) { + AlertError("No se ha podido validar correctamente la identidad."); + } + }, [error, AlertError]); + return ( <> - {error && ( - - )}
{loading ? ( diff --git a/src/components/elements/alert/index.tsx b/src/components/elements/alert/index.tsx index b7b8c9aa..8ce945ee 100644 --- a/src/components/elements/alert/index.tsx +++ b/src/components/elements/alert/index.tsx @@ -1,39 +1,74 @@ -import Swal from 'sweetalert2'; -import Alert from '@mui/material/Alert'; +import React, { createContext, useContext, useState } from 'react'; +import Snackbar from '@mui/material/Snackbar'; +import MuiAlert, { AlertProps } from '@mui/material/Alert'; -interface IPropsAlertErrorMessage { - message: string; - type: 'error' | 'warning' | 'info' | 'success'; +interface SnackbarContextProps { + openSnackbar: (message: string, severity: AlertProps['severity']) => void; } -export const AlertErrorMessage = ({ - message, - type, -}: IPropsAlertErrorMessage) => {message}; - -export const AlertError = (text?: string) => { - return Swal.fire({ - icon: 'error', - title: 'Error', - text: text ? text : 'Ocurrió un error al procesar la solicitud', - confirmButtonColor: '#003670', - }); -}; +// Create context with default undefined value +const SnackbarContext = createContext( + undefined +); + +interface SnackbarProviderProps { + children?: React.ReactNode; +} -export const AlertWarning = (text: string) => { - return Swal.fire({ - icon: 'warning', - title: 'Aviso', - text: text, - confirmButtonColor: '#003670', +export const SnackbarProvider = ({ children }: SnackbarProviderProps) => { + const [snackbarConfig, setSnackbarConfig] = useState({ + open: false, + message: '', + severity: 'success' as AlertProps['severity'], }); + + // Open snackbar + const openSnackbar = (message: string, severity: AlertProps['severity']) => { + setSnackbarConfig({ open: true, message, severity }); + }; + + // Close snackbar + const closeSnackbar = () => { + setSnackbarConfig((prevState) => ({ ...prevState, open: false })); + }; + + return ( + + + + {snackbarConfig.message} + + + {children} + + ); }; -export const AlertSuccess = (text?: string) => { - return Swal.fire({ - icon: 'success', - title: 'Correcto', - text: text ? text : 'Proceso realizado correctamente', - confirmButtonColor: '#003670', - }); +export const useSnackbar = () => { + const context = useContext(SnackbarContext); + + if (!context) { + throw new Error('useSnackbar must be used within a SnackbarProvider'); + } + + const { openSnackbar } = context; + + return { + AlertError: (text?: string) => + openSnackbar( + text || 'Ocurrió un error al procesar la solicitud', + 'error' + ), + AlertWarning: (text: string) => openSnackbar(text, 'warning'), + AlertSuccess: (text: string) => + openSnackbar(text || 'Proceso realizado correctamente', 'success'), + }; }; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 0afb72bd..a348922c 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -3,6 +3,7 @@ import { ThemeProvider } from '@mui/material/styles'; import type { AppProps } from 'next/app'; import { Amplify } from 'aws-amplify'; import { ReCaptchaProvider } from "next-recaptcha-v3"; +import { SnackbarProvider } from '../components/elements/alert'; import Head from 'next/head'; import Layout from '../components/layout'; @@ -22,13 +23,13 @@ export default function App({ Component, pageProps }: AppProps) { - - - - - + + + + + + + ); diff --git a/src/pages/register/stepper/step1.tsx b/src/pages/register/stepper/step1.tsx index 717dcb8b..bbc6c68d 100644 --- a/src/pages/register/stepper/step1.tsx +++ b/src/pages/register/stepper/step1.tsx @@ -2,18 +2,20 @@ import { yupResolver } from '@hookform/resolvers/yup'; import { useForm } from 'react-hook-form'; import { useCallback, useState } from 'react'; import { useReCaptcha } from 'next-recaptcha-v3'; +import { CitizensBasicInformationResponse } from '@/pages/api/types'; import axios from 'axios'; import * as yup from 'yup'; -import { GridContainer, GridItem } from '@/components/elements/grid'; -import { CitizensBasicInformationResponse } from '@/pages/api/types'; -import LoadingBackdrop from '@/components/elements/loadingBackdrop'; -import { TextBody } from '@/components/elements/typography'; -import { AlertWarning } from '@/components/elements/alert'; -import { ButtonApp } from '@/components/elements/button'; -import { FormControlApp } from '@/components/form/input'; -import { InputApp } from '@/themes/form/input'; -import { labels } from '@/constants/labels'; +import { useSnackbar } from '@/components/elements/alert'; +import { + Button, + Grid, + TextField, + Typography, + Backdrop, + CircularProgress, + Tooltip, +} from '@mui/material'; interface IFormInputs { cedula: string; @@ -23,7 +25,7 @@ const schema = yup.object({ cedula: yup .string() .trim() - .required(labels.form.requiredField) + .required('This field is required') .min(11, 'Debe contener 11 dígitos'), }); @@ -55,6 +57,7 @@ export default function Step1({ setInfoCedula, handleNext }: any) { // Import 'executeRecaptcha' using 'useReCaptcha' hook const { executeRecaptcha } = useReCaptcha(); + const { AlertError, AlertWarning } = useSnackbar(); const handleSubmit = useCallback( async (data: IFormInputs) => { @@ -92,35 +95,39 @@ export default function Step1({ setInfoCedula, handleNext }: any) { } } catch (err) { console.error(err); - AlertWarning('Parece que ha introducido una cédula inválida.'); + AlertError('Parece que ha introducido una cédula inválida.'); } finally { setLoading(false); } }, - [executeRecaptcha, handleNext, setInfoCedula] + [executeRecaptcha, handleNext, setInfoCedula, AlertWarning, AlertError] ); return ( <> - {loading && } +
+ theme.zIndex.drawer + 1 }} + open={loading} + > + + Validando cédula... + +

- + Este es el primer paso para poder verificar tu identidad y crear tu cuenta ciudadana. - +
- - - - + + + { e.preventDefault(); return false; @@ -131,14 +138,19 @@ export default function Step1({ setInfoCedula, handleNext }: any) { }} autoComplete="off" onChange={(e) => handleChange(e)} + error={Boolean(errors.cedula)} + helperText={errors.cedula?.message} + fullWidth /> - - + + - - CONFIRMAR - - + + + +
); diff --git a/src/pages/register/stepper/step2.tsx b/src/pages/register/stepper/step2.tsx index e62e0a25..7f31ce4b 100644 --- a/src/pages/register/stepper/step2.tsx +++ b/src/pages/register/stepper/step2.tsx @@ -5,25 +5,24 @@ import { useForm } from 'react-hook-form'; import { useState } from 'react'; import * as yup from 'yup'; -import { GridContainer, GridItem } from '@/components/elements/grid'; +import Grid from '@mui/material/Grid'; import FormControlLabel from '@mui/material/FormControlLabel'; -import { TextBody } from '@/components/elements/typography'; -import { AlertWarning } from '@/components/elements/alert'; -import { ButtonApp } from '@/components/elements/button'; +import Button from '@mui/material/Button'; import FormGroup from '@mui/material/FormGroup'; import Checkbox from '@mui/material/Checkbox'; -import { labels } from '@/constants/labels'; -import { Typography } from '@mui/material'; +import Typography from '@mui/material/Typography'; import Step2Modal from './step2Modal'; +import { useSnackbar } from '@/components/elements/alert'; + interface IFormInputs { acceptTermAndConditions: boolean; } -const schema = yup.object({ +const schema = yup.object().shape({ acceptTermAndConditions: yup .boolean() - .required(labels.form.requiredField) + .required('Required field') .default(false), }); @@ -32,21 +31,20 @@ export default function Step2({ infoCedula, handleNext }: any) { const handleClick = () => setOpen(!open); - const { - handleSubmit, - formState: {}, - setValue, - } = useForm({ + const { handleSubmit, setValue } = useForm({ reValidateMode: 'onSubmit', shouldFocusError: false, resolver: yupResolver(schema), }); + const { AlertError } = useSnackbar(); + const onSubmit = (data: IFormInputs) => { if (!data.acceptTermAndConditions) { - return AlertWarning( + AlertError( 'Para continuar debe aceptar Términos y Políticas de Privacidad' ); + return; } handleClick(); }; @@ -54,17 +52,17 @@ export default function Step2({ infoCedula, handleNext }: any) { return ( <>
- + ¡Hola {infoCedula?.name}!{' '} Ahora vamos a validar tu identidad mediante una verificación facial para continuar con tu registro. Asegúrate de cumplir con lo siguiente: - +
- - + +
cámara integrada.
-
+ - +
tu rostro.
-
+ - {/* - - Verificación con pasaporte disponible próximamente - - */} - {/*
*/}
- - + + } onChange={(e: any) => { setValue('acceptTermAndConditions', e.target.checked); }} - control={} label={ + // TODO: Add link to terms and conditions Aceptar Términos y Políticas de Privacidad{' '} * @@ -133,12 +123,14 @@ export default function Step2({ infoCedula, handleNext }: any) { } /> - -
+ + - - - INICIAR PROCESO + + + {open && ( )} - - + + ); diff --git a/src/pages/register/stepper/step2Modal.tsx b/src/pages/register/stepper/step2Modal.tsx index a3b2cdb8..e9fda7d1 100644 --- a/src/pages/register/stepper/step2Modal.tsx +++ b/src/pages/register/stepper/step2Modal.tsx @@ -1,5 +1,4 @@ import { TransitionProps } from '@mui/material/transitions'; -import { ThemeProvider } from '@aws-amplify/ui-react'; import LogoutIcon from '@mui/icons-material/Logout'; import Toolbar from '@mui/material/Toolbar'; import AppBar from '@mui/material/AppBar'; @@ -65,12 +64,10 @@ export default function Step2Modal({ padding: '0 10px', }} > - - - + diff --git a/src/pages/register/stepper/step3.tsx b/src/pages/register/stepper/step3.tsx index 0b3854ad..98b36789 100644 --- a/src/pages/register/stepper/step3.tsx +++ b/src/pages/register/stepper/step3.tsx @@ -4,21 +4,25 @@ import { useForm } from 'react-hook-form'; import { useState } from 'react'; import * as yup from 'yup'; import axios from 'axios'; +import { Crypto } from '@/helpers'; -import { - AlertError, - AlertErrorMessage, - AlertWarning, -} from '@/components/elements/alert'; -import { GridContainer, GridItem } from '@/components/elements/grid'; -import LoadingBackdrop from '@/components/elements/loadingBackdrop'; import PasswordLevel from '@/components/elements/passwordLevel'; -import { TextBody } from '@/components/elements/typography'; -import { FormControlApp } from '@/components/form/input'; -import { ButtonApp } from '@/components/elements/button'; -import { InputApp } from '@/themes/form/input'; +import { useSnackbar } from '@/components/elements/alert'; import { labels } from '@/constants/labels'; -import { Crypto } from '@/helpers'; +import { + Backdrop, + Button, + CircularProgress, + Grid, + IconButton, + InputAdornment, + Snackbar, + TextField, + Tooltip, + Typography, +} from '@mui/material'; +import Visibility from '@mui/icons-material/Visibility'; +import VisibilityOff from '@mui/icons-material/VisibilityOff'; interface IFormInputs { email: string; @@ -48,9 +52,11 @@ const schema = yup.object({ export default function Step3({ handleNext, infoCedula }: any) { const [loadingValidatingPassword, setLoadingValidatingPassword] = useState(false); - const [loading, setLoading] = useState(false); + const [loading, setLoading] = useState(false); const [passwordLevel, setPasswordLevel] = useState({}); const [isPwned, setIsPwned] = useState(false); + const { AlertError, AlertWarning } = useSnackbar(); + const [showPassword, setShowPassword] = useState(false); const { register, @@ -62,6 +68,14 @@ export default function Step3({ handleNext, infoCedula }: any) { resolver: yupResolver(schema), }); + const handleClickShowPassword = () => setShowPassword((show) => !show); + + const handleMouseDownPassword = ( + event: React.MouseEvent + ) => { + event.preventDefault(); + }; + const handleChangePassword = (password: string) => { const level = passwordStrength(password); setPasswordLevel(level); @@ -97,7 +111,7 @@ export default function Step3({ handleNext, infoCedula }: any) { }) .catch((err) => { if (err?.response?.status === 409) { - AlertWarning('El correo electrónico ya está registrado.'); + AlertError('Esta cédula/correo ya está registrado.'); } else { AlertError(); } @@ -106,7 +120,7 @@ export default function Step3({ handleNext, infoCedula }: any) { } }) .catch(() => { - return AlertWarning('No pudimos validar si la contraseña es segura.'); + AlertWarning('No pudimos validar si la contraseña es segura.'); }) .finally(() => setLoadingValidatingPassword(false)); } @@ -114,69 +128,56 @@ export default function Step3({ handleNext, infoCedula }: any) { return ( <> - {loadingValidatingPassword && ( - - )} - {loading && } +
+ theme.zIndex.drawer + 1 }} + open={loadingValidatingPassword} + > + + Validando contraseña... + +
+
+ theme.zIndex.drawer + 1 }} + open={loading} + > + + Creando usuario... + +

- + Para finalizar tu registro completa los siguientes campos: - +
- - - - { - e.preventDefault(); - return false; - }} - onCopy={(e) => { - e.preventDefault(); - return false; - }} - autoComplete="off" + + + + - - + + - - + - { - e.preventDefault(); - return false; - }} - onCopy={(e) => { - e.preventDefault(); - return false; - }} - autoComplete="off" - {...register('emailConfirm')} - /> - - - - - + + + + Al menos 8 caracteres de largo @@ -189,50 +190,62 @@ export default function Step3({ handleNext, infoCedula }: any) {
  • Caracteres especiales (por ejemplo, !@#$%^&*)
  • } - required > - ) => - handleChangePassword(e.target.value) + onChange={(e) => handleChangePassword(e.target.value)} + endAdornment={ + + + {showPassword ? : } + + } /> -
    + -
    + - - + - - - + placeholder="*********" + helperText={errors.passwordConfirm?.message} + fullWidth + {...register('passwordConfirm')} + disabled={passwordLevel.id === 3 ? false : true} + /> + {isPwned && ( - - - + + + + Esta contraseña ha estado en filtraciones de datos, por eso no + se considera segura. Te recomendamos eligir otra contraseña. + + + )} - - CREAR CUENTA ÚNICA - -
    + + + + ); diff --git a/yarn.lock.REMOVED.git-id b/yarn.lock.REMOVED.git-id index 00be43df..d734deef 100644 --- a/yarn.lock.REMOVED.git-id +++ b/yarn.lock.REMOVED.git-id @@ -1 +1 @@ -ccebcb26b43c4e25feed455af0e1b2af912118a5 \ No newline at end of file +1166a57a4c4db8c23656f94a943af9a71607290f \ No newline at end of file From 77149d01d3c1499c7d26c616073d90c21e5bf53e Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 18 Jun 2023 18:07:07 -0400 Subject: [PATCH 2/9] fix(step3): handle both password fields with MUI Former-commit-id: 741b0403588af0c1889e7cc40f024c4ec2c92163 [formerly 73a3fb7a20d932df1fb89a5adc542da758520c20] [formerly 5321205e96da690546effbc8a1c986e8bba1085c [formerly cd9b48290b5f6430c0c571106ba74f14b458d62a]] [formerly 191ecdbed7ccd1fb7b836994b4a529d410d559e7 [formerly b1624d283fcdb9c5da7f3f16a025a82739c3ddb8] [formerly ac798696d1be5f16e17b4db0974c7edee9193a64 [formerly 207efc4051dc6e5668e9fd52746b9fb4aef9ffa9]]] [formerly f56182821520cacaaa4bbd26312f891b297faf7c [formerly b77dec0e3d9e32ddbd9f6991553042d39416f14e] [formerly e7664f88afd79442fe6f2542f3e699c7cf6372d1 [formerly a67fac82fdd7947bc7a082b81a9c7ee20f785cd9]] [formerly c3e93eb0d8bdc8b16c57491ef502ba6912a1c784 [formerly ea74f174138b216754ed8cd3587cb7cce95b24d0] [formerly 6fe992c452e0cde7732641270e7452b80efd3aaa [formerly 62b096eeabf763cdde185e036182ff7ba58e3046]]]] [formerly 15e5c865f2cc246b5621fec59f45bf180f504492 [formerly 5445034e7f09e68f52506b0c9b37aea0474a5b94] [formerly 637408dbda05825509547fd06ea9dba0de51ef8e [formerly 5c33ca8d55938defe8d4de80d5610ba3b8df4e0d]] [formerly ff5e721e58bd9db85c7ef1118cdd1507d421cc1a [formerly e2bbc11086ef03797e1e9b0fec19d938b3d18d03] [formerly e218fa4cf267002e65be4c769232ed2f937f2467 [formerly d8aa7a1a389511451bb534b301321f5ac3163e9b]]] [formerly 97d00c5c97ef71283ebeb0c2f29a892993b47aa9 [formerly a5b3356a0894a8728e8def5f49495f91dc658bb1] [formerly 1248dae608d1c63be1c3e8e76eca29106832a96d [formerly 78f9d5761df6d052b1338b599299e14a071929d4]] [formerly 46dfaf6d9e0195708c4f2a83b0b69c3caf35d0c5 [formerly f64be666917471b55e28c45b397cce94121ef48b] [formerly face4a97c21723458c1326eb7f5d4ab8be4835bb [formerly 82890acc0c9e4cddb675589172caeaba75882831]]]]] Former-commit-id: 0265f3d2396d8ffb27f7e139c0ad27ac0cbf1672 [formerly a34b2c8590d46f60f9454ac6d5dc77a9d3885970] [formerly dd9e3ad02db5b839b58aeb3c84442532e8a847c8 [formerly fb408b155c19834a5e13564930240601c192a6ed]] [formerly d6f1d76bb0031d8df9fbf72731516646b7a2be05 [formerly d1037eca4c92419b70f17f49ce543934e4e6805e] [formerly 38130902bc79908ddb6ddb810fdec8892e20952b [formerly e6f13c7ca43906153dd055bb1f3f826c2135fd43]]] [formerly 14be722f2c7edd7c457d6dbeaa9356fa216f7cde [formerly e0719c6ab348c14246ad5f284c54e4e8655560af] [formerly 2d1940ef31d73831bd224021a392a5a0af4ae1e9 [formerly cec12f30bc1dc385fa2bc3a0f49407927a0661cc]] [formerly ab31ae0a34750497e0bcb48c50c4e5481284afaf [formerly 166145a40b27a373601a4d193c93f4adfb054e7f] [formerly 753ecfa8f0fbd4dc1053d1ccd01bb85c7106fb1f [formerly e80239b997f22bff470486def2b98d2d8a60e986]]]] Former-commit-id: f07f596d0d5ba0aabd6d8c38569be4f6fe149260 [formerly ecb01d7af70f4914b1006099f6275fa278b005a5] [formerly dacaba5930f459a4b0e7bab79d192a66473e31c6 [formerly 2f98593254aaf3bba848d29b15f1b4e78af60569]] [formerly c01860847df87a32b16f33d4a64fd4a9e381e160 [formerly 7c770df3140ad532dae950f30200060a317c2e92] [formerly 7c43c516b5a213065aab4dae64da3040a92c3c46 [formerly 373ce2e6c9eeeb21080d21e4a9f5b6eba648aed7]]] Former-commit-id: ac168fac174cac5f638f8b2d7cf7e67b41abf328 [formerly 14cbbd948268e53c91c2f864e9c5a5cfc9e515c5] [formerly 93d52b91b763d35c85c135002977837b897bb17d [formerly d447b4b04ddf68564f4e8825a11446da2cd98ae0]] Former-commit-id: f4e510dcc5044377d309e754da287c1db2116ae4 [formerly b29f616713f71b36fe1883c32ba64e15a4c7c09b] Former-commit-id: 5a9d810875269ddfc8519e263f9e72152262c634 --- src/pages/register/stepper/step3.tsx | 46 +++++++++++++++++++--------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/src/pages/register/stepper/step3.tsx b/src/pages/register/stepper/step3.tsx index 98b36789..2dfff844 100644 --- a/src/pages/register/stepper/step3.tsx +++ b/src/pages/register/stepper/step3.tsx @@ -126,6 +126,7 @@ export default function Step3({ handleNext, infoCedula }: any) { } }; + // TODO: Use this Password UI approach https://stackblitz.com/edit/material-password-strength?file=Icons.js return ( <>
    @@ -193,25 +194,27 @@ export default function Step3({ handleNext, infoCedula }: any) { > handleChangePassword(e.target.value)} - endAdornment={ - - - {showPassword ? : } - - - } + InputProps={{ + endAdornment: ( + + + {showPassword ? : } + + + ), + }} /> @@ -219,13 +222,28 @@ export default function Step3({ handleNext, infoCedula }: any) { + + {showPassword ? : } + + + ), + }} /> From fe64ca3cfe570c6b40505899980e61607bf1ca28 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 18 Jun 2023 19:00:58 -0400 Subject: [PATCH 3/9] refactor(steps): optimize steps load and validations Former-commit-id: 8c269c707c1437e4088b8a9a2c2a2c1c606cbc98 [formerly e815f41932cd5dfbcbb9bf9433c01725189cecf4] [formerly a5230c0279f4f6a7e268290426a9a90f7451e2ac [formerly 3f29f3ec0fee3e3bd8e0e088de82f8facca743b1]] [formerly af0eeaa8933ca47e4cd31d6af8984b9a4fd1fdd1 [formerly 69a6bc5ee3f99495d1a00cb5879719a14ba2c604] [formerly 4d4b1b2dfa51b8495959d3dcd028db554afb3f99 [formerly 72a7bfbc897bb3d018e23b6cd3ea544519e5cb35]]] [formerly da178000f57151a86f3443fe0cb89646846efc10 [formerly 37655a21f84187b53c62d0064c5510ab6b46836e] [formerly 736e21660bcbcc1de0b19625e46e1c8955fe554d [formerly ac212832896a94792ff39d6e0b02546cc1469de8]] [formerly c323e07c780b959648cba384f0586814d38f27ff [formerly edb31a7bb872204d24b4b0e82d04b5dc19c4217b] [formerly 753bc47dbc979a9ce25c8ba7b2464bb95490168a [formerly b0d94ca3d8dd70bb9f1e5be8c87c5ad531281419]]]] [formerly 83e06cc4c3d21e5fbc6aa83bfa25a92c6442ca4d [formerly 796ea53500859491598d07c8092309114b85256b] [formerly 8b10cac37c5407cca64ef0df231fed65c4239d91 [formerly 8594f9c3dad9212b11fdc04a43ac4e39a778ad6d]] [formerly 4da2a9c8c4903fe2db81979706f7d0b025014cde [formerly 44062b74f4ffb399a1a9faa95faec5deb6935349] [formerly 698f62a376032e47ea9f8282057869886d2ec28e [formerly aff2647b186f2fd0dedc86fb10085a37f7dc8a1b]]] [formerly 59943c3be77483fd8cbe1abf0b091fddbdb08acd [formerly 969f3bce30390eee42f24c99e6cb1868ea7a2440] [formerly e44c6ba243647eeb5c6b8ef0c3b3dfc8c70f0ed2 [formerly 7d1c320fc73bfe1ca57e875410fa3c2ec2972184]] [formerly fb0c3f9da81cd00df79927512bc600341636025a [formerly 6b0feeef93141b60dbbb00032d711dac9fb84616] [formerly d91fc36e84d28a3129cb0af552ed19255a55b7e7 [formerly 2b079a6ccf6c195932e48fb17c61c47e61269cfa]]]]] Former-commit-id: 2a3995a13459a717fd5a7c478232b8c92acd2143 [formerly e348d0c780414461e5a3bf857d31ad1cd774fc15] [formerly 3a7e59ada7f9206ed462d6c2c04ec2a2693da763 [formerly 6a8ac2a524501b76f0958213842b18e6c9dd8c08]] [formerly 57aabefe103d52ad6d97d139d0fd9a4ac2bf5117 [formerly 5983e3d1cf4008aeb331332ca183e390105ec5ec] [formerly aed617a1ba66c1bd5a2085313a112d994d43fdf3 [formerly 97d20a3cc23e2c798a9f925b1f94cb9f58dee6c9]]] [formerly 41ca52f682b688862459916b9fa06765324c8b05 [formerly e7a02b0259fc28ede84a860d809981787f66db9c] [formerly 0649be5b0a03211100e7511246f243729504cf85 [formerly 20109aacbf7d960d0b48609c92d955ade5b055a0]] [formerly 70b9036df0d8cfba33c5b5c50024230574930efe [formerly f869abf1c96384eead8b12c29fc119c7c73a96fe] [formerly e6c84a4d841f277a9f8eb61ed0281d4ce11b37b7 [formerly cde6f2bac1ace2598e8b775ff501bd0c611a753c]]]] Former-commit-id: 48a88f4411eb0da9bd826432d617339302ae9679 [formerly b16c86ad2413e67d9842bc766031a1e24eb7b5de] [formerly 3638fc7fc99295f8801ec9cfbcee889185c2935a [formerly 0c2d3add3d2bf1834399841227e89811ecfa45d1]] [formerly e7d64e0053133e97c7389556d1022f1ccfb4ef9c [formerly 613a82070a7eba911e5b40ba5b8e7ab74d946dea] [formerly 0e61bbd4678294ee42ca47a5ac31de12aa803cdf [formerly 5bcd24a99783ca6d501c9ddbe11b7127604ac8ca]]] Former-commit-id: 7660ffda4df3480eb24528a246820916a7d8449d [formerly 5f27e1c2b83447fe17294a5b2e4e0163ae75967b] [formerly e66725bacdac90a9541e42942ce02e78ea236ed8 [formerly f5c4c30dcbde3c5136734f2ff53426ea86f2e949]] Former-commit-id: 0af7b5c7a4ff27c3428daf234ba02f3327eda906 [formerly 470cc92fb59e01b484d71f3db405bdd472928d54] Former-commit-id: 6c4e12ab8635cd2c0f79985ad1ad57ec8f472877 --- src/pages/register/stepper/index.tsx | 93 +++++++++++----------------- src/pages/register/stepper/step1.tsx | 79 +++++++++++------------ src/pages/register/stepper/step2.tsx | 45 ++++++++------ 3 files changed, 101 insertions(+), 116 deletions(-) diff --git a/src/pages/register/stepper/index.tsx b/src/pages/register/stepper/index.tsx index 2138d9cb..08423487 100644 --- a/src/pages/register/stepper/index.tsx +++ b/src/pages/register/stepper/index.tsx @@ -14,6 +14,7 @@ import Step2 from './step2'; import Step3 from './step3'; const steps = ['PASO 1', 'PASO 2', 'PASO 3']; +const optionalLabels = ['Identifícate', 'Verifícate', 'Regístrate']; export async function getServerSideProps() { await axios.get(`/api/auth`); @@ -30,78 +31,66 @@ export default function StepperRegister() { const [skipped, setSkipped] = React.useState(new Set()); React.useEffect(() => { - const fetcher = async (url: string) => { - await fetch(url); - }; - - fetcher(`/api/auth`).then().catch(); + axios.get(`/api/auth`).then().catch(); }, []); const [infoCedula, setInfoCedula] = React.useState({}); - const isStepSkipped = (step: number) => { - return skipped.has(step); - }; - const handleNext = () => { if (activeStep === steps.length - 1) { return router.push(routes.register.registered); } - let newSkipped = skipped; - - if (isStepSkipped(activeStep)) { - newSkipped = new Set(newSkipped.values()); + if (skipped.has(activeStep)) { + const newSkipped = new Set(skipped.values()); newSkipped.delete(activeStep); + setSkipped(newSkipped); } setActiveStep((prevActiveStep) => prevActiveStep + 1); - setSkipped(newSkipped); }; const handleReset = () => { setActiveStep(0); }; + const getStepComponent = () => { + switch (activeStep) { + case 0: + return ; + case 1: + return ; + case 2: + return ; + default: + return null; + } + }; + return ( - {steps.map((label, index) => { - const labelProps: { - optional?: React.ReactNode; - } = {}; - if (index === 0) { - labelProps.optional = ( - Identifícate - ); - } - if (index === 1) { - labelProps.optional = ( - Verifícate - ); - } - if (index === 2) { - labelProps.optional = ( - Regístrate - ); - } - - return ( - ( + + + {optionalLabels[index]} + + } > - - {label} - - - ); - })} + {label} + + + ))} {activeStep === steps.length ? ( @@ -114,17 +103,7 @@ export default function StepperRegister() { ) : ( -
    - {activeStep === 0 && ( - - )} - {activeStep === 1 && ( - - )} - {activeStep === 2 && ( - - )} -
    +
    {getStepComponent()}
    )} ); diff --git a/src/pages/register/stepper/step1.tsx b/src/pages/register/stepper/step1.tsx index bbc6c68d..45e9d0a1 100644 --- a/src/pages/register/stepper/step1.tsx +++ b/src/pages/register/stepper/step1.tsx @@ -1,11 +1,8 @@ -import { yupResolver } from '@hookform/resolvers/yup'; +import { useCallback, useState, useEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; -import { useCallback, useState } from 'react'; import { useReCaptcha } from 'next-recaptcha-v3'; import { CitizensBasicInformationResponse } from '@/pages/api/types'; import axios from 'axios'; -import * as yup from 'yup'; - import { useSnackbar } from '@/components/elements/alert'; import { Button, @@ -16,53 +13,65 @@ import { CircularProgress, Tooltip, } from '@mui/material'; +import IMask from 'imask'; interface IFormInputs { cedula: string; } -const schema = yup.object({ - cedula: yup - .string() - .trim() - .required('This field is required') - .min(11, 'Debe contener 11 dígitos'), -}); +interface IFormInputs { + cedula: string; +} export default function Step1({ setInfoCedula, handleNext }: any) { const [loading, setLoading] = useState(false); + const inputRef = useRef(); + + useEffect(() => { + if (inputRef.current) { + const maskOptions = { + mask: '000-0000000-0', + }; + IMask(inputRef.current, maskOptions); + } + }, []); - const handleChange = (e: any) => { - const cedulaValue = e.target.value - .replace(/\D/g, '') - .match(/(\d{0,3})(\d{0,7})(\d{0,1})/); - e.target.value = !cedulaValue[2] - ? cedulaValue[1] - : `${cedulaValue[1]}-${cedulaValue[2]}${`${ - cedulaValue[3] ? `-${cedulaValue[3]}` : '' - }`}${`${cedulaValue[4] ? `-${cedulaValue[4]}` : ''}`}`; - const numbers = e.target.value.replace(/(\D)/g, ''); - setValue('cedula', numbers); + const luhnCheck = (num: string) => { + const arr = (num + '') + .split('') + .reverse() + .map((x) => parseInt(x)); + const lastDigit = arr.splice(0, 1)[0]; + let sum = arr.reduce( + (acc, val, i) => + i % 2 !== 0 ? acc + val : acc + ((2 * val) % 9) || 9, + 0 + ); + sum += lastDigit; + return sum % 10 === 0; }; + const { + register, handleSubmit: handleFormSubmit, formState: { errors }, - setValue, } = useForm({ reValidateMode: 'onSubmit', shouldFocusError: false, - resolver: yupResolver(schema), }); - // Import 'executeRecaptcha' using 'useReCaptcha' hook const { executeRecaptcha } = useReCaptcha(); const { AlertError, AlertWarning } = useSnackbar(); const handleSubmit = useCallback( async (data: IFormInputs) => { + const cleanCedula = data?.cedula?.replace(/-/g, ''); + if (cleanCedula?.length !== 11 || !luhnCheck(cleanCedula)) { + AlertError('Por favor introduzca un número de cédula válido.'); + return; + } setLoading(true); - // Generate ReCaptcha token const token = await executeRecaptcha('form_submit'); @@ -79,7 +88,7 @@ export default function Step1({ setInfoCedula, handleNext }: any) { token, }); if (response.data && response.data.isHuman === true) { - const response = await fetch(`/api/citizens/${data.cedula}`); + const response = await fetch(`/api/citizens/${cleanCedula}`); if (response.status !== 200) { throw new Error('Failed to fetch citizen data'); } @@ -95,7 +104,7 @@ export default function Step1({ setInfoCedula, handleNext }: any) { } } catch (err) { console.error(err); - AlertError('Parece que ha introducido una cédula inválida.'); + AlertError('Esta cédula es correcta, pero no hemos podido validarla.'); } finally { setLoading(false); } @@ -125,26 +134,18 @@ export default function Step1({ setInfoCedula, handleNext }: any) { { - e.preventDefault(); - return false; - }} - onCopy={(e) => { - e.preventDefault(); - return false; - }} + inputRef={inputRef} autoComplete="off" - onChange={(e) => handleChange(e)} error={Boolean(errors.cedula)} - helperText={errors.cedula?.message} + helperText={errors.cedula && 'Debe contener 11 dígitos'} fullWidth /> -
    -
    - - Este es el primer paso para poder verificar tu identidad y crear tu - cuenta ciudadana. + + + Este es el primer paso para poder verificar tu identidad y crear tu + cuenta ciudadana. +
    diff --git a/src/pages/register/stepper/step2.tsx b/src/pages/register/stepper/step2.tsx index 3a675667..ef5683dd 100644 --- a/src/pages/register/stepper/step2.tsx +++ b/src/pages/register/stepper/step2.tsx @@ -3,12 +3,15 @@ import CameraAltOutlinedIcon from '@mui/icons-material/CameraAltOutlined'; import { useForm } from 'react-hook-form'; import { useCallback, useState } from 'react'; -import Grid from '@mui/material/Grid'; -import FormControlLabel from '@mui/material/FormControlLabel'; -import Button from '@mui/material/Button'; -import FormGroup from '@mui/material/FormGroup'; -import Checkbox from '@mui/material/Checkbox'; -import Typography from '@mui/material/Typography'; +import { + Box, + Button, + FormControlLabel, + FormGroup, + Checkbox, + Grid, + Typography, +} from '@mui/material'; import Step2Modal from './step2Modal'; import { useSnackbar } from '@/components/elements/alert'; @@ -49,18 +52,18 @@ export default function Step2({ infoCedula, handleNext }: IStep2Props) { return ( <> -
    - - ¡Hola {infoCedula?.name}!{' '} - + + ¡Hola {infoCedula?.name}! + + {' '} Ahora vamos a validar tu identidad mediante una verificación facial para continuar con tu registro. Asegúrate de cumplir con lo siguiente: - + - +
    - Tener disponible un teléfono móvil o computadora con{' '} + Tener disponible un dispositivo con{' '} cámara integrada.
    - +
    Creando usuario...
    -
    - - Para finalizar tu registro completa los siguientes campos: + + + Para finalizar tu registro completa los siguientes campos: + @@ -157,18 +159,19 @@ export default function Step3({ handleNext, infoCedula }: any) { Date: Sun, 18 Jun 2023 23:19:20 -0400 Subject: [PATCH 6/9] fix(ux): multiple issues with experience Former-commit-id: 0a9fbcc0a148fe1ab4e938f062da80628626bb42 [formerly fd63662804ca745c412f2eda7380dcd074b45e98] [formerly 4e07c6a63ae44331ce5ffc11a199c8497bf16b3f [formerly 7c59b812baefc0a2701cc28d7ebd83e432afa987]] [formerly 088cf51a4c05b70eaf9ba5da533510990d38d97b [formerly 2da569a102d7d00b1560e80d5de0f92f8c2f703f] [formerly 93d8ce1f8b04651424e86c1e5aa34a91e5fa9edd [formerly ae64472ede27a7e4a32479254a43478a8b7573f8]]] [formerly 881cf8d3e5e5e60eef40f3e5f65ae5812c23da21 [formerly be1ca198b7fd094284c2f184eae737d01fe6e526] [formerly 4e23fdb950e0e8134c49a70db9ecb79f4473eb5f [formerly dcf3ff97900ab8c73edd6b672c1a8b0daeaca82b]] [formerly 95c588974025839236603bbe98be648c926a11e4 [formerly 42c0c919b651adaaf90205979de9f8be1493ff2a] [formerly a1d5117dacb51f068ea1d5e17efd88f4dd9338b2 [formerly e80767ee7d0438f398bc28f53c2a0c32b0361738]]]] [formerly d0fef1b1116d189bbf6b9d5aaa193abd80446752 [formerly 0e828d8f3ea6cfd5275c099831ed749c647a7291] [formerly c329e38de97b14e4294bb2f3bed62c31b6deb8d7 [formerly 32fe5bdd6cf2088c6811aee467d87ced0e0c46da]] [formerly 04bc2d0179b8535c31974580ab883c06cd721111 [formerly 405b82aa0051f9314bbee0c224ad01abab55b86a] [formerly c32e2fb8092d9a8bd116d49668cadaa1ded9b40b [formerly 47d4ae930ad5d5c38f7cedf16d766eeac804abf6]]] [formerly 2c0e80ffbaaecba6dde36d1362029f070adbc400 [formerly f92c44646f05df6658c12efe6e51f49c9b3712c8] [formerly 20eaf2f18fc849dcee6e08f5e26889a65ceb9c93 [formerly f32ba662f96220ca7e930c95c0bdd5df92190f10]] [formerly f5d4dc95c9c800b7179482fe485c0c05f83f23d4 [formerly 6bc3b780953f751594736c04158e9beaaa5fe8a3] [formerly 54f9fd41ee3bd55786bd44d26aba819d9e1d55a6 [formerly 2d533cc56e9a2c7c453667b1708d767ac4f0e89d]]]]] Former-commit-id: ea24a17f3399c4ecc12530039806f5a640567201 [formerly 6fa51aec8a90e950b6b9c77d9d728921f808f0b2] [formerly 570d8e6efe0b7c7786140f0c33db092e27ea0835 [formerly bfaa401ca6ccacb04dbeaf89f97f6bb70804ba75]] [formerly 746e900faaec1d0dc7914fe038ce3fa2e9f7f724 [formerly cc3475d7416532f669ae5a4fec68ea96915d1355] [formerly c17c4e37517043725dccf8e2476068b95a015763 [formerly a5c9309bb278adb1e9991666f52c24dbdc28a198]]] [formerly 83e68b30a29aff588e592c3caf82e45199c0f1b1 [formerly 1f244a07cf093dc4fed8555464ad1e011b00692f] [formerly 6926586f27073eb74804a27e47915f0a0faf9ffb [formerly 87b1497d9c33338310d164dbc50d4519b66dcbba]] [formerly 69150f02267290694188050191d856d2a056731c [formerly 1822f229526e76e23025244ea03a5552ad8e019b] [formerly aa9ccb1da916511068b7fbb129f98aa02e3dd2d9 [formerly c185a4dad80381a8b455cac956b1038432138075]]]] Former-commit-id: 99c7d66cbe304c21f5d1528b6583ce807360c51a [formerly 81c0a1856518b81bb05b47f8a762d2df083bee2f] [formerly 0836ffc0bc78107b8ad787505b8c5dcf172a4f5a [formerly 8fdc00a8c09656fc0632e96dd7f34cff8cfe5a85]] [formerly b6d4e2bc9708a428004c735f78d415ab1fad3ccc [formerly 939d8be92c2ab6eec34e343ab01fad7d91202675] [formerly 6014f137f2746519d25a0eb1c98bdf0f764cf2d8 [formerly 3e0c9c1b69ce411cf272e1209f3cc2159cbcf01a]]] Former-commit-id: a4280bef0ade29bd2498c7e64f1ac0f7740414c9 [formerly a907703674790a4de1dbe68eb3f08da0896993c9] [formerly 795b62e421ed5e84901afd261676684aae736e2e [formerly 646ccc7902643c041aec769fead6f4b081f5e01f]] Former-commit-id: e160602e013dc249d5cf2bb70a1e53ee56e6dcfb [formerly 278a2d3bdec5f4be4f580551453188bb344b3ffb] Former-commit-id: fdcefd1ad317d057e7600bd1b10737f00fb5b5ec --- package.json | 1 - src/pages/register/stepper/step1.tsx | 21 ++------------------- src/pages/register/stepper/step2.tsx | 2 +- src/pages/register/stepper/step3.tsx | 2 +- yarn.lock.REMOVED.git-id | 2 +- 5 files changed, 5 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 56ec0170..c5d3f238 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "eslint": "^8.40.0", "eslint-config-next": "13.2.3", "hibp": "^13.0.0", - "imask": "^6.6.3", "next": "13.2.3", "next-recaptcha-v3": "^1.1.5", "react": "18.2.0", diff --git a/src/pages/register/stepper/step1.tsx b/src/pages/register/stepper/step1.tsx index 58b0307b..bed67d2f 100644 --- a/src/pages/register/stepper/step1.tsx +++ b/src/pages/register/stepper/step1.tsx @@ -1,4 +1,4 @@ -import { useCallback, useState, useEffect, useRef } from 'react'; +import { useCallback, useState } from 'react'; import { useForm } from 'react-hook-form'; import { useReCaptcha } from 'next-recaptcha-v3'; import { CitizensBasicInformationResponse } from '@/pages/api/types'; @@ -14,28 +14,12 @@ import { CircularProgress, Tooltip, } from '@mui/material'; -import IMask from 'imask'; - -interface IFormInputs { - cedula: string; -} - interface IFormInputs { cedula: string; } export default function Step1({ setInfoCedula, handleNext }: any) { const [loading, setLoading] = useState(false); - const inputRef = useRef(); - - useEffect(() => { - if (inputRef.current) { - const maskOptions = { - mask: '000-0000000-0', - }; - IMask(inputRef.current, maskOptions); - } - }, []); const luhnCheck = (num: string) => { const arr = (num + '') @@ -122,7 +106,7 @@ export default function Step1({ setInfoCedula, handleNext }: any) { Validando cédula... - + Este es el primer paso para poder verificar tu identidad y crear tu cuenta ciudadana. @@ -138,7 +122,6 @@ export default function Step1({ setInfoCedula, handleNext }: any) { required label="Número de Cédula" placeholder="***-**00000-0" - inputRef={inputRef} autoComplete="off" error={Boolean(errors.cedula)} helperText={errors.cedula && 'Debe contener 11 dígitos'} diff --git a/src/pages/register/stepper/step2.tsx b/src/pages/register/stepper/step2.tsx index ef5683dd..d9e6e12b 100644 --- a/src/pages/register/stepper/step2.tsx +++ b/src/pages/register/stepper/step2.tsx @@ -52,7 +52,7 @@ export default function Step2({ infoCedula, handleNext }: IStep2Props) { return ( <> - + ¡Hola {infoCedula?.name}! {' '} diff --git a/src/pages/register/stepper/step3.tsx b/src/pages/register/stepper/step3.tsx index c961135a..a4b3c3e5 100644 --- a/src/pages/register/stepper/step3.tsx +++ b/src/pages/register/stepper/step3.tsx @@ -148,7 +148,7 @@ export default function Step3({ handleNext, infoCedula }: any) { Creando usuario... - + Para finalizar tu registro completa los siguientes campos: diff --git a/yarn.lock.REMOVED.git-id b/yarn.lock.REMOVED.git-id index 0bca6298..57faf24f 100644 --- a/yarn.lock.REMOVED.git-id +++ b/yarn.lock.REMOVED.git-id @@ -1 +1 @@ -293a51141da75579c2c0c49e0060f9495e90b32d \ No newline at end of file +cfcb4c68032de6c744c4ca6b08467a4fc65eeea2 \ No newline at end of file From 16b01fcc94b7293534e3e8170f86056dd012edc5 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 19 Jun 2023 08:11:28 -0400 Subject: [PATCH 7/9] fix(liveness): missing translations Former-commit-id: 3b34942a016d7db6fdba09f69e951ad356980ba5 [formerly db078d01b5ae8e5ce86169b93b28088f263e3504] [formerly f4e0a97c2e786cec274986bba286263a5a09e309 [formerly 502dcf267e6b7d74766dd527349f21cd1c592673]] [formerly b2c555005e149f60771d45ee937404b932ab79ff [formerly d559061955af820fbbf3c46d340c78b4ac380e8a] [formerly fdad4e30a228e54d60be7a08daec8a0b2da0fc3b [formerly f9834d939de019033afea593b4513cb9ed9e7fa8]]] [formerly c280c06f4ec2db3d8807e778bcc6936b0af9c60d [formerly ea5efb3781ae59aff70b78c12887e89bd00447b7] [formerly d94486c9a94f11185b42a15ed90b7ec1c9b27c78 [formerly d7ba9b91c48e3ee4dbfb84131af0c9bec50354c2]] [formerly f5a748cdce46eef7e3d6f4695dfae99b165e98d9 [formerly 252f6d1224cf847e9ce37ec2883f3869fc7d0f40] [formerly 8d8710f33b92c05d46b2dd4b3479085f9e0cc809 [formerly 904f4e21145000b6a78a0e194ff8660be8e8aa45]]]] [formerly 51c5ac58cad43140c7afc3a469428d6503d779ac [formerly bbaba964fbce693722f8e62a8e80f889b32d2942] [formerly 993e8daff8e9a5ccf3c0baf6820bd8e89482d46c [formerly 5b52c04e308edb4a178c3dee415f412a011aa571]] [formerly 6d7cc23f642dfde3a192f04a3e420f169a4d8386 [formerly cd9359d469fcc1f9f8da775e3fe8c050245a1c10] [formerly 87c74836058eb14649976c9bad8862485a4fde1d [formerly 6e110e031fad9f8a655c20975e56dd7f55426c7e]]] [formerly 0581dc27e039d8acf6af1ca48c99a1f92ffe0224 [formerly d5a7d03212a1cc76791ae336c8d930240abeb862] [formerly c29354164659a153cec771494317588cbf038727 [formerly bcc3857e1a607f2f491fa4262f46f184b6f99daa]] [formerly e357e6bad16b27d82850cd94cfbca571c747e9e1 [formerly 2fedd99b2992064a12e6a05a5e9c04810dd0bd6c] [formerly ca070f852899dcb3973a84aa3e6449a614447474 [formerly 74b70a49f0555dd2537facc43750a3f3b0d1ed7b]]]]] Former-commit-id: e641b136bea62984997aaf0c12329f16c286c9c2 [formerly 31e01271920f6862538f46077157ec4b7264c269] [formerly fc54ace725c4e8c66d1795b5106440c7e8639a6b [formerly 34b7ee890e2ea6daebeaee1abcc7f3b88466d59f]] [formerly b147f5f5e95f55a7a139ec376a664a836331918d [formerly bab4bf17e4a5e3384b4cf4c59c1a21ab14fefb41] [formerly 7996f46f411edf381cfdce6eaf85fceea7825bc2 [formerly 777a66cafe17015609bda8977d7ed5c3ada8a9b5]]] [formerly 6f628c744a126251cfe14826465ab17ef0a93e61 [formerly 56fa98ddcd25ed68d82c874d8fdb28cc24db821d] [formerly 6b8d3c71fd8361dd05e168ec76b20699dfa3c65b [formerly 011b404703a03979a11a683ab4da6ef6a677269c]] [formerly 67ec2181c7abcd21044c14664e897eaf6d765a24 [formerly 363f5bb5caf2c6e98c18ff3522d5ef3d800d3789] [formerly 94c2f544c61812bb812d5f41c32eef712cf8e0f0 [formerly 7c8cee5bbb3a2fc763325e4ca91a296a05dee710]]]] Former-commit-id: eaf9f5974d379ef829598ba80b1460aa30dfb988 [formerly 142b08135ceaae558173d6fca8eb0004b9477f0a] [formerly 54020910f67566e6968b7d2ce759f78984004f0e [formerly daf08d3627ce86543d427754b7db8419cb348b66]] [formerly 1062a530e8b4bea3b294aba10136323599ae5c74 [formerly c392779a545c41493e6d3ec62eef65e02ae41fd2] [formerly 8124a56ca6a97a9000dd1121b04ff33c7538009f [formerly 43a33971a785f0cfbe789bef532543f34c64a0ef]]] Former-commit-id: 3413de2f2daa1700b729debbe02dfe083ccd77a0 [formerly ac420e5e2174bc53294b62adcd859f937bfa09ec] [formerly bd34455536de2675f11decc210083ae2478be056 [formerly d7a680b98bd811f43245112b4b16fc699f9599e0]] Former-commit-id: e67aa76cfb863aaf690dd6482606630bbc71b903 [formerly 58795a695af6c6cc3d940af0dc9b3d663c4b2ae4] Former-commit-id: d5afb3305272428db6c9313c75ce1c756ff99e67 --- src/components/biometric/displayText.ts | 64 ++++++++++++------------- src/pages/register/stepper/step2.tsx | 8 ++-- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/components/biometric/displayText.ts b/src/components/biometric/displayText.ts index 2f507e98..e9ac18f3 100644 --- a/src/components/biometric/displayText.ts +++ b/src/components/biometric/displayText.ts @@ -49,9 +49,9 @@ export const defaultErrorDisplayText = { timeoutHeaderText: 'Se acabó el tiempo', timeoutMessageText: 'La cara no llenó el óvalo dentro del límite de tiempo. Vuelva a intentarlo y llene completamente el óvalo con la cara en 7 segundos.', - faceDistanceHeaderText: 'Comprobación fallida durante la cuenta atrás', + faceDistanceHeaderText: 'Comprobación fallida durante la cuenta regresiva', faceDistanceMessageText: - 'Evite acercarse durante la cuenta regresiva y asegúrese de que solo una cara esté frente a la cámara.', + 'Evite acercarse durante la cuenta regresiva y asegúrese de que solo haya una cara frente a la cámara.', clientHeaderText: 'Error del cliente', clientMessageText: 'Verificación fallida debido a un problema con el cliente', serverHeaderText: 'Problema del servidor', @@ -69,54 +69,54 @@ export type ErrorDisplayTextFoo = typeof defaultErrorDisplayText; export type ErrorDisplayText = Partial; export const defaultLivenessDisplayText: Required = { - instructionsHeaderHeadingText: 'Liveness check', + instructionsHeaderHeadingText: 'Prueba de vida', instructionsHeaderBodyText: - 'You will go through a face verification process to prove that you are a real person.', - instructionsBeginCheckText: 'Begin check', - photosensitivyWarningHeadingText: 'Photosensitivity warning', + 'Ahora va a realizar un proceso de verificación facial para demostrar que es una persona real.', + instructionsBeginCheckText: 'Iniciar prueba', + photosensitivyWarningHeadingText: 'Alerta de fotosensibilidad', photosensitivyWarningBodyText: - 'This check displays colored lights. Use caution if you are photosensitive.', + 'Esta comprobación muestra luces de colores. Tenga cuidado si es fotosensible.', photosensitivyWarningInfoText: - 'A small percentage of individuals may experience epileptic seizures when exposed to colored lights. Use caution if you, or anyone in your family, have an epileptic condition.', - instructionListHeadingText: 'Follow the instructions to complete the check:', - goodFitCaptionText: 'Good fit', + 'Un pequeño porcentaje de personas puede experimentar convulsiones epilépticas cuando se exponen a luces de colores. Tenga cuidado si usted o alguien de su familia tiene alguna condición epiléptica.', + instructionListHeadingText: 'Siga las instrucciones para completar la verificación:', + goodFitCaptionText: 'Bien encajado', goodFitAltText: - "Ilustration of a person's face, perfectly fitting inside of an oval.", - tooFarCaptionText: 'Too far', + 'Ilustración de la cara de una persona, encajando perfectamente dentro de un óvalo.', + tooFarCaptionText: 'Demasiado lejos', tooFarAltText: - "Illustration of a person's face inside of an oval; there is a gap between the perimeter of the face and the boundaries of the oval.", + 'Ilustración de la cara de una persona dentro de un óvalo; hay un espacio entre el perímetro de la cara y los límites del óvalo.', instructionListStepOneText: - 'When an oval appears, fill the oval with your face within 7 seconds.', - instructionListStepTwoText: "Maximize your screen's brightness.", + 'Cuando el óvalo aparezca, llénelo con su cara en 7 segundos.', + instructionListStepTwoText: 'Maximice el brillo de su pantalla.', instructionListStepThreeText: - 'Make sure your face is not covered with sunglasses or a mask.', + 'Asegúrese de que su cara no esté cubierta con gafas de sol o una máscara.', instructionListStepFourText: - 'Move to a well-lit place that is not in direct sunlight.', + 'Muévase a un lugar bien iluminado que no esté expuesto a la luz solar directa.', cameraMinSpecificationsHeadingText: - 'Camera does not meet minimum specifications', + 'La cámara no cumple con las especificaciones mínimas', cameraMinSpecificationsMessageText: - 'Camera must support at least 320*240 resolution and 15 frames per second.', - cameraNotFoundHeadingText: 'Camera not accessible.', + 'La cámara debe admitir una resolución de al menos 320 * 240 y 15 fotogramas por segundo.', + cameraNotFoundHeadingText: 'Cámara no accesible', cameraNotFoundMessageText: 'Verifique que la cámara esté conectada y que los permisos de la cámara estén habilitados en la configuración antes de volver a intentarlo.', retryCameraPermissionsText: 'Procesar de nuevo', - cancelLivenessCheckText: 'Cancelar comprobación de vitalidad', - recordingIndicatorText: 'Grabación', - hintMoveFaceFrontOfCameraText: 'Mover la cara frente a la cámara', + cancelLivenessCheckText: 'Cancelar prueba de vida', + recordingIndicatorText: 'Grabando', + hintMoveFaceFrontOfCameraText: 'Posicione la cara frente a la cámara', hintTooManyFacesText: - 'Asegúrese de que solo una cara esté frente a la cámara', + 'Asegúrese que solo una cara esté frente a la cámara', hintFaceDetectedText: 'Cara detectada', - hintCanNotIdentifyText: 'Mover la cara frente a la cámara', - hintTooCloseText: 'Muévete mas atrás', - hintTooFarText: 'Muévete mas cerca', + hintCanNotIdentifyText: 'No podemos identificar su cara frente a la cámara', + hintTooCloseText: 'Muévase más atrás', + hintTooFarText: 'Muévase más cerca', hintHoldFacePositionCountdownText: - 'Mantener la posición de la cara durante la cuenta regresiva', + 'Mantenga la posición de la cara durante la cuenta regresiva', hintConnectingText: 'Conectando...', hintVerifyingText: 'Verificando...', - hintIlluminationTooBrightText: 'Mover al área de atenuación', - hintIlluminationTooDarkText: 'Mover a un área más brillante', - hintIlluminationNormalText: 'Condiciones de iluminación normales', - hintHoldFaceForFreshnessText: 'Quédate quieto', + hintIlluminationTooBrightText: 'Muévase a un área con menos iluminación', + hintIlluminationTooDarkText: 'Muévase a un área con mayor iluminación', + hintIlluminationNormalText: 'Condiciones de iluminación correctas', + hintHoldFaceForFreshnessText: 'Quédese quieto', ...defaultErrorDisplayText, }; diff --git a/src/pages/register/stepper/step2.tsx b/src/pages/register/stepper/step2.tsx index d9e6e12b..795a7628 100644 --- a/src/pages/register/stepper/step2.tsx +++ b/src/pages/register/stepper/step2.tsx @@ -56,8 +56,8 @@ export default function Step2({ infoCedula, handleNext }: IStep2Props) { ¡Hola {infoCedula?.name}! {' '} - Ahora vamos a validar tu identidad mediante una verificación facial - para continuar con tu registro. Asegúrate de cumplir con lo siguiente: + Ahora vamos a validar tu identidad mediante una verificación facial y + una prueba de vida. Asegúrate de cumplir con lo siguiente: @@ -79,7 +79,7 @@ export default function Step2({ infoCedula, handleNext }: IStep2Props) { color="info" /> - Tener disponible un dispositivo con{' '} + Utilizar un dispositivo que posea {' '} cámara integrada. @@ -101,7 +101,7 @@ export default function Step2({ infoCedula, handleNext }: IStep2Props) { color="info" /> - Estar de acuerdo en que hagamos capturas de{' '} + Permitir que tomemos capturas de {' '} tu rostro. From d53bf8cd835fac70591b5d388e508c1ecf19bf48 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 19 Jun 2023 08:20:54 -0400 Subject: [PATCH 8/9] feat(liveness): add instructions screen Former-commit-id: 4d1e0d5bd480819c257eb84115f35ff19f986155 [formerly 0f80c0a305becac6b34b138cd934a42c295128f2] [formerly 141290e9bb94f1f9f7d0f1cfee44e23f54ea4c0c [formerly 456400c29988ba1fd530d5e745d50b477b935b97]] [formerly 8e61e9f0a25dba0cc560616377b0090461167fd8 [formerly 21dd80dc2482acf28778cc5a34a9087c62796bdd] [formerly 23545c50873c5bd4a82e01b914037937eb4505e4 [formerly 5d3f0e4f1e71cfda4337e72a21f0f0a90958250b]]] [formerly c56cc5497810ec6364333062b12baf0ad2b0177b [formerly ce7584b291dfc46d9334df929f5ebc33006817a3] [formerly f70b7f2d1946dd50ac1157b9bf5b9ff305eb2251 [formerly c1482b3e71bc3d1529e8df1ee106dc03834868a7]] [formerly 1f57cd7c9f2fb97dcc281f1b04ac42c006a24ad6 [formerly b3fc45a7aa335f020d236745926d10c46f70f6d8] [formerly 77f1647403c3311e78bfc0da9d9fe08f98aabd7f [formerly 493060e9bdffb36b0ae62bc29b7381d9be0ce619]]]] [formerly 4d0de97025cac90108f616671d2db5ed40509533 [formerly 5db5bd7a9ccb6647f71468c1b8d5d57acd001797] [formerly 83e387a78b4114796e1c2551044e7286519d0f57 [formerly 409d20b6fbf833b92e91cc49c7facdb997f1529a]] [formerly 30de90fc1968342a7cb19279826ea9e72ea147e0 [formerly 6899adf2ed1871e9e121c2b754e7dbd3d6b40193] [formerly 617e00476e11c3f87df9ea7206eeed42a43047b4 [formerly 88b73074c91fe43caf4fcec0f89429d55d3515d1]]] [formerly 66c28e86d75308b723764a384492bcfca5909629 [formerly 215135e51b9d003f18194a399fc0c80ce7aace0e] [formerly 5f5246886755093bb1ea4bcf196d6ec5393dc0f6 [formerly 666e1418baf6c9dbcd11db81f048ab5471a19b29]] [formerly 312bcea4e1b4f8f6dca91037d2a99df265e6e757 [formerly 2dbf7c1a882780cd51b6d056409adb050e0fe4dd] [formerly 480f4ad7846132957722be8d5fdb98bac96b7ad3 [formerly 5a8a12aa43f95917068ae26b02314475289a9a59]]]]] Former-commit-id: 8cdd77050a86ec07e2593f01de5d6649cc0098e5 [formerly 0e62f56cc2f986fcefa29dc39145fdf794dfcb1c] [formerly 524fade4562c08719589e83fb517a592de38dcc7 [formerly 9e7b570c7d4403efc5fa574653423e0b99507c98]] [formerly b2be4c71906f90ffdd397fad90bedb86ac76b199 [formerly 7e105d3f79dfb2239db1979d5a7d2e1ae0b9f4c9] [formerly 391d6855810579c5cc787f2853c1aaa18f8cdce9 [formerly 0a9926277999a3120940dd41546a565d6c7a64e8]]] [formerly 529254338af6077d388780e642e636caaef3bdad [formerly bbac58044fb35a7f24469925b1cab415b72a3214] [formerly ba1c033fd2435bbb65ae156efeb7d44127055936 [formerly 2a24fa3a998d661a9bb1fc78cf0117571296dc2d]] [formerly 4ebeb9d3164465cea6ed1f427d446eec3821f8e2 [formerly d87db0f7754dacf010f2e7f9bd44a29337479391] [formerly 49b32ae6e7ace5a44df4e522b53ed25e915b63a5 [formerly 2468a4cfbeaadff2853c4dcde183033b4e0250af]]]] Former-commit-id: 47d7b9fa6c6ee7b8443fc18af39ea2be0edd362a [formerly 4ade64f24409e4a25613e7c74225c2d94fb08d03] [formerly 7f5449614bd747bb54ca55f714b27c9e049ce9cc [formerly ea3bab15c97688132580dda65176e1ccfad93cdc]] [formerly e16cc65e9b5a35a459a5f337ac5c495fe9c70b20 [formerly 7a00e4fe2796d2867444fea2d5e43cffbe754350] [formerly 567b007618ebcb675aa5bf525bbb2b44cfd49674 [formerly ffa334d1cb0e0beec68effe1dbd5ce7c7ea9cd34]]] Former-commit-id: 4f6c3ee0cc40847ac8db45286b477cc71d26bcf3 [formerly 88c4012174621d74668d4b4f982a330ea46feba1] [formerly fec36e993df2b6da36ccf850c8ec980f9c95ffb4 [formerly 075a026570414f706c8eeb1abd46bceb3a21c5ec]] Former-commit-id: 21e322192a7cf2f387401d92f3a6d8458a342106 [formerly af5aeb0dcc7b68d0c5d21b2e97a533d82775e1fd] Former-commit-id: b62cf4aca7ecee1541d903c9dce54c12eeb94c7f --- src/components/biometric/face-liveness-detector.tsx | 2 +- src/pages/register/registered/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/biometric/face-liveness-detector.tsx b/src/components/biometric/face-liveness-detector.tsx index 45097990..38ca135d 100644 --- a/src/components/biometric/face-liveness-detector.tsx +++ b/src/components/biometric/face-liveness-detector.tsx @@ -69,7 +69,7 @@ export function LivenessQuickStartReact({ handleNextForm, cedula }: any) { onUserCancel={onUserCancel} onError={(error) => setError(error)} onAnalysisComplete={handleAnalysisComplete} - disableInstructionScreen={true} + disableInstructionScreen={false} displayText={defaultLivenessDisplayText} /> ) diff --git a/src/pages/register/registered/index.tsx b/src/pages/register/registered/index.tsx index 15738f78..ba19d9a9 100644 --- a/src/pages/register/registered/index.tsx +++ b/src/pages/register/registered/index.tsx @@ -53,8 +53,8 @@ export default function Index() {
    Revisa tu correo y haz clic en el enlace de confirmación, luego - podras ver, realizar tramites y solicitar servicios - gubernamentales con una sola cuenta y contraseña. + realizar tramites y solicitar servicios gubernamentales + con una sola cuenta y contraseña.
    From 61ccec1f7d3bdd734836061cfe21e54d348f8d3d Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 19 Jun 2023 08:25:20 -0400 Subject: [PATCH 9/9] chore(linter): fix Prettier issues Former-commit-id: ae6b9336de48281262b1790c2b31dfcb9831933e [formerly b40affc8024d95f8e1c2055e19482eb2723d730e] [formerly 6fca41daefa0265cbc0007c837ad72ccbb57e19b [formerly 1d09fecbb57e86f1fba989605b26818362477578]] [formerly 006f101edca1d5bad2dcfb3007cccf40c83e2378 [formerly 70fae385c014f8b743f5f2301900b3a257f35083] [formerly 9e2fba8179dfdb2b3dc07ae7b12aa1e0d6ed483a [formerly c980b0264c9c0907d2f207c3b2b8d2dc46531970]]] [formerly cdc95d1c454c5bc0bdb3b2c70fa5a5fdacce413a [formerly 956cf2d5d2ab65e5e05a080b7a0c4fc6b296ef07] [formerly 5ad076bfab037a51a0872313e813e6ae88308cb8 [formerly 348332c2699e242ff6630215e7eff29c810f6601]] [formerly 55c0d244c9d19b9f63b71eda0433b422f864a04d [formerly 0955d53fe348c36682e1cad9aef86fdb30d322ac] [formerly 3832dda35594533af013493fbb708fe0d681a582 [formerly dc927554d39d7f1ed82685613e641f2bf8598a5f]]]] [formerly 98f72e50c622582f60c5f3400605a1c255d1a8ec [formerly 4d80199a302dd92f161f31bbe3a78b128477a74f] [formerly 2c3ba3a7d28ec7dde573f9c5fb5c8f4e6e69271d [formerly 68b6f6099a891850ed23e8b77db1d9907536a561]] [formerly f4b1d4f75d6196e4a6b4cbe5c2d71f5d0410398f [formerly e14df4b9ba1ae403fa1a526a83d85d0e301cd998] [formerly 5b8682acb1ffe3975f849ce8dc23ce7726b4f4f5 [formerly a9e77e7e441fd222b75c2dd0859239026b3431a9]]] [formerly 19087386efdf213cc803e461340d10c3b7602343 [formerly 8c5e70bf77a410b66bd85c5cbdd09c9e40806b8b] [formerly 1fb4a26bab4e4a7f80e0fcdf88c6c4f95c436721 [formerly dad0c8fe5d485cc4cf933d23f9e9907268b9d960]] [formerly 39fbaaba6e0aa3b18f662f84f009d81d90b70f10 [formerly 9406eb913e726f771557c78c12add88d3143c225] [formerly 356847e201bea532a4276c14f4dad9d636ba3596 [formerly 15cd37263099535b629e0b41ad98817781b5dd9c]]]]] Former-commit-id: 78b710bf54a27e62232ce596fe2c7d0b7da8a07e [formerly 71a1336f628680a311273bc42f57ce950196a4d0] [formerly 22764e93d59cca47525e3a072b57ebd3a5c9961a [formerly cc5c5ba87d232b07d41f3ee280f41f4917bd0fbf]] [formerly 027e8bf0672662286d1f8d7032fee30fbff4a5ba [formerly e469904eedc04dc9da948969d93fd782a0c063a7] [formerly 9d5cd64332f0271bc79aa084641b0dd4c78f96b5 [formerly ffbd17680752fee43444a2271bb7970133853637]]] [formerly c40e20600732f8f39a84bf5a8aa51e04027a9329 [formerly fd4ce7a99469e9ddef2ad372fd9d06d0e28481b3] [formerly 924c27fb7a1ac7ab83b935cc612725a5b1c0dcb1 [formerly 4800dbc8f9e9207cda716bc19b97ba62b93f3934]] [formerly 04d7d96cb12962e313f6b88027d9a92a1ca44a60 [formerly ed02b301aa1b2c0c68964b24f9ad6d30b4d74016] [formerly 73bae89458ac719c7e26ed29bc8268cdc628ea6f [formerly dcc980cbc2b4dabab8e837123183a82fcaaeb1f0]]]] Former-commit-id: 96c842fee1314fb7cb7c975c3f9cebcef2a86cf2 [formerly 67d77ec838c7ec9ea887e9e7b79b9be67b6b4948] [formerly b6518fc21d3d207a38f4300cfd572738b7447393 [formerly 0f305f09594c594eddecdd56dc23c8dd16b14b20]] [formerly 8cb85716498e86061736bb9f96378779576061b2 [formerly 7c8c3a07f3266b426e0b866d73c7fdab68488486] [formerly c89439026d1cd701a696253848ba1be007637b12 [formerly 8aeb5cfbcc3bed468aa421a6d33d8819e2877283]]] Former-commit-id: 55939641d59f583c34d3a31a08732fac1997311d [formerly 1e506aa46b138b9e0addba6e3c576278417b44c9] [formerly bb7fb45ccfd6c8ae37ef7de20cd642c6778b7f2a [formerly c789b808bce929ee102069ac7e774b74873cead7]] Former-commit-id: d588ae5c3d6547036904e9bd87584bfbccd94534 [formerly d0f0c1c6154ac656ce131fb41536137747594616] Former-commit-id: fd55546390147e77aab9dfb9c2da0b1f86f34acc --- src/components/biometric/displayText.ts | 6 +++--- src/components/biometric/face-liveness-detector.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/biometric/displayText.ts b/src/components/biometric/displayText.ts index e9ac18f3..43e4dfc9 100644 --- a/src/components/biometric/displayText.ts +++ b/src/components/biometric/displayText.ts @@ -78,7 +78,8 @@ export const defaultLivenessDisplayText: Required = { 'Esta comprobación muestra luces de colores. Tenga cuidado si es fotosensible.', photosensitivyWarningInfoText: 'Un pequeño porcentaje de personas puede experimentar convulsiones epilépticas cuando se exponen a luces de colores. Tenga cuidado si usted o alguien de su familia tiene alguna condición epiléptica.', - instructionListHeadingText: 'Siga las instrucciones para completar la verificación:', + instructionListHeadingText: + 'Siga las instrucciones para completar la verificación:', goodFitCaptionText: 'Bien encajado', goodFitAltText: 'Ilustración de la cara de una persona, encajando perfectamente dentro de un óvalo.', @@ -103,8 +104,7 @@ export const defaultLivenessDisplayText: Required = { cancelLivenessCheckText: 'Cancelar prueba de vida', recordingIndicatorText: 'Grabando', hintMoveFaceFrontOfCameraText: 'Posicione la cara frente a la cámara', - hintTooManyFacesText: - 'Asegúrese que solo una cara esté frente a la cámara', + hintTooManyFacesText: 'Asegúrese que solo una cara esté frente a la cámara', hintFaceDetectedText: 'Cara detectada', hintCanNotIdentifyText: 'No podemos identificar su cara frente a la cámara', hintTooCloseText: 'Muévase más atrás', diff --git a/src/components/biometric/face-liveness-detector.tsx b/src/components/biometric/face-liveness-detector.tsx index 38ca135d..9c6bc8af 100644 --- a/src/components/biometric/face-liveness-detector.tsx +++ b/src/components/biometric/face-liveness-detector.tsx @@ -51,7 +51,7 @@ export function LivenessQuickStartReact({ handleNextForm, cedula }: any) { useEffect(() => { if (error) { - AlertError("No se ha podido validar correctamente la identidad."); + AlertError('No se ha podido validar correctamente la identidad.'); } }, [error, AlertError]);