From 8f458ba732b66c826c28646ab2fa556f4807a01c Mon Sep 17 00:00:00 2001 From: Angela Date: Thu, 18 Apr 2024 02:48:59 +0200 Subject: [PATCH 01/14] traduccion funciona incompleta no estan todas las pantallas --- package-lock.json | 46 +++++++- package.json | 5 + webapp/package-lock.json | 70 +++++++++++ webapp/package.json | 5 +- webapp/src/App.js | 29 ++++- webapp/src/components/Login.js | 33 ++++-- webapp/src/components/PantallaInicio.js | 3 +- .../src/components/fragments/NavigationBar.js | 34 +++--- webapp/src/components/images/esp.png | Bin 0 -> 13085 bytes webapp/src/components/images/ing.png | Bin 0 -> 5764 bytes webapp/src/index.js | 21 +++- webapp/src/translations/en/global.json | 40 +++++++ webapp/src/translations/es/global.json | 41 +++++++ webapp/src/translations/i18n.js | 111 ++++++++++++++++++ 14 files changed, 404 insertions(+), 34 deletions(-) create mode 100644 package.json create mode 100644 webapp/src/components/images/esp.png create mode 100644 webapp/src/components/images/ing.png create mode 100644 webapp/src/translations/en/global.json create mode 100644 webapp/src/translations/es/global.json create mode 100644 webapp/src/translations/i18n.js diff --git a/package-lock.json b/package-lock.json index 1ffe46df..e003d34f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2,5 +2,49 @@ "name": "wiq_es2c", "lockfileVersion": 3, "requires": true, - "packages": {} + "packages": { + "": { + "dependencies": { + "i18next": "^23.11.2" + } + }, + "node_modules/@babel/runtime": { + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.4.tgz", + "integrity": "sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/i18next": { + "version": "23.11.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", + "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + } + } } diff --git a/package.json b/package.json new file mode 100644 index 00000000..dc54a203 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "i18next": "^23.11.2" + } +} diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 69590fe3..8a9fc108 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -16,8 +16,11 @@ "@testing-library/react": "^14.1.2", "@testing-library/user-event": "^14.5.2", "axios": "^1.6.5", + "i18next": "^23.11.2", + "i18next-browser-languagedetector": "^7.2.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-i18next": "^14.1.0", "react-router-dom": "^6.22.1", "react-scripts": "5.0.1", "web-vitals": "^3.5.1" @@ -12137,6 +12140,14 @@ "node": ">=12" } }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/html-webpack-plugin": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.0.tgz", @@ -12280,6 +12291,36 @@ "node": ">=10.17.0" } }, + "node_modules/i18next": { + "version": "23.11.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", + "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/i18next-browser-languagedetector": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.1.tgz", + "integrity": "sha512-h/pM34bcH6tbz8WgGXcmWauNpQupCGr25XPp9cZwZInR9XHSjIFDYp1SIok7zSPsTOMxdvuLyu86V+g2Kycnfw==", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -22031,6 +22072,27 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz", "integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==" }, + "node_modules/react-i18next": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-14.1.0.tgz", + "integrity": "sha512-3KwX6LHpbvGQ+sBEntjV4sYW3Zovjjl3fpoHbUwSgFHf0uRBcbeCBLR5al6ikncI5+W0EFb71QXZmfop+J6NrQ==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "html-parse-stringify": "^3.0.1" + }, + "peerDependencies": { + "i18next": ">= 23.2.3", + "react": ">= 16.8.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -26647,6 +26709,14 @@ "node": ">= 0.8" } }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/webapp/package.json b/webapp/package.json index 4825bfc3..3f34b256 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -5,14 +5,17 @@ "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", - "@mui/material": "^5.15.3", "@mui/icons-material": "^5.15.15", + "@mui/material": "^5.15.3", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^14.1.2", "@testing-library/user-event": "^14.5.2", "axios": "^1.6.5", + "i18next": "^23.11.2", + "i18next-browser-languagedetector": "^7.2.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-i18next": "^14.1.0", "react-router-dom": "^6.22.1", "react-scripts": "5.0.1", "web-vitals": "^3.5.1" diff --git a/webapp/src/App.js b/webapp/src/App.js index 99bb223b..66589424 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -7,6 +7,9 @@ import Typography from '@mui/material/Typography'; import Link from '@mui/material/Link'; import './App.css'; import { createTheme, ThemeProvider } from '@mui/material/styles'; +import {Button, Tooltip } from '@mui/material'; +import { useTranslation } from 'react-i18next'; + const theme = createTheme({ palette: { @@ -16,7 +19,12 @@ const theme = createTheme({ }, }); + + function App() { + + const [t, i18n] = useTranslation("global"); + const [showLogin, setShowLogin] = useState(true); const handleToggleView = () => { @@ -39,14 +47,31 @@ function App() { {showLogin ? ( - ¿No tienes cuenta? Registrate aquí. + {t("enlaceLogin")} ) : ( - ¿Ya tienes cuenta? Inicia sesión aquí. + {t("enlaceRegistro")} )} +
+ {/* Aquí coloca tus dos botones */} + + + + + + +
); diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 21214930..6244b94e 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -5,8 +5,13 @@ import axios from 'axios'; import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; import { useUser } from './UserContext'; import '../App.css'; +import { useTranslation } from 'react-i18next'; + const Login = () => { + + const [t, i18n] = useTranslation("global"); + const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); @@ -54,28 +59,30 @@ const Login = () => { setOpenSnackbar(false); }; + + return ( + sx={{ + marginTop: 4, + borderRadius: '10px', + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + }}> {loginSuccess ? ( null ) : (
- Inicia sesión + {t("login")} setUsername(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} @@ -83,16 +90,16 @@ const Login = () => { setPassword(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} /> - + {error && ( setError('')} message={`Error: ${error}`} /> )} diff --git a/webapp/src/components/PantallaInicio.js b/webapp/src/components/PantallaInicio.js index 3140c423..2678562a 100644 --- a/webapp/src/components/PantallaInicio.js +++ b/webapp/src/components/PantallaInicio.js @@ -6,6 +6,7 @@ import NewGameIcon from '@mui/icons-material/SportsEsports'; import '../App.css'; + const PantallaInicio = () => { const [openSnackbar, setOpenSnackbar] = useState(false); @@ -41,7 +42,7 @@ const PantallaInicio = () => { alignItems: 'center' }}> - ¡BIENVENIDO A WIQ {usernameGlobal}! + HOLA {usernameGlobal}! - - - - - - - + - - - - - - + + diff --git a/webapp/src/components/images/esp.png b/webapp/src/components/images/esp.png new file mode 100644 index 0000000000000000000000000000000000000000..e03bcf15dd2e20f7662753f1ab7d6c4b442b2125 GIT binary patch literal 13085 zcmZv@2|Sc-^gn#xGsZTytYt4FYm`0v5*Zbel3fWQqLfj}%u}|?Hb^DAqNgNl%E(ko zktK@xZ9)Lni`|=;&yz;PB9s{)Zw0w2q$$%AGQmMi51WxWmeobo1Bevp0{NIyc64 z>%fWVh%)c5yLTW?%&;PilG2u3XlH9HxOr)?MdpWe=Ki>Cjo*W=yiO~8z4`9c@-eFHp?DFosGyRB`pSIH? zaQ*nd56uI=FW>L_lRtfD?u;2Bz_ZC?5d9=fVyyEO#yDb9z1ha$7YdHgh4RD=aWA0J zi-owR7xJ2zcJIe`L$e)k?HPOGedaE`ZK?nFQra?QkTRIcdaM*;U_7yAu_@S90#6oq zZ1OPSzJ|#2nO-cBVqNfEQk zJAC;@3U*>=PVG88Ijj0i-D%C4O>9-h+er)gl|O3q)QE|MzR8}(b9L3H59ij6)~jMY zpKwR6YY<{hEv132S8k-dZ|QL`zJ#-Muy67>yEQ_Zxn9Wkr-Gxo)SvV7#!;TX9D)O%-81`}uI|D5q!yO%VhRKE*ZErA&f<-=3vsXDWcrOs8mEG=byos zGcR3y+>uh7-n(_5=^NRsGU6OT0uF<3}3xtO(I z63O;}SP*HiEaXViGsSV%-Ojl8x7vGHn=vvIh%e85%zf@B;`%bboDY?DYa;5|XX*~1 z@;hlCEaZ&vM%#{-Q-f<>y4>2MeZAwKl7n34PF}qCFWpEv&eN%sl8v*BcdP7^$C+Lx zJ&jYJp&0X*?@asVkh{Ondgu1uEiIXpyX3nifunu&m{M1F#MOR2%ZsdDwO6{okH0Mh-%G`_XGaPQmZ-ZEEWzZS6kHFQA_1Tg;F+-WWg*d|Ja}#wSGboPyWZ#;{2l5h%MX8FZ#od zHmZS~km~{KR{Li<%x#R~@{cU*@vT&x36oWUl7Ac{Tf8_z*U=8`$1{uI!4~!n!Unu zb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pWoLxl=a*`Ijq&R-!EV_G-kDRRkrEDF!v|maX&hn fRp4sC=9!7PGn%qy5CwnAf)H&Tcigx3`{(}xLYK8R literal 0 HcmV?d00001 diff --git a/webapp/src/components/images/ing.png b/webapp/src/components/images/ing.png new file mode 100644 index 0000000000000000000000000000000000000000..82f498b428dd0b0b66578d3fd28f1d05631d77ca GIT binary patch literal 5764 zcmZ`-3p7;i*Ei!juA#^+6^)e3VNmXsBn*m5ywMCAjeEvj7`cTcjmsIt+bg4Ti$QK_ z47nb}gp8uXc!#J=l-$1Q{r>;|_pSA_VQ^E`X+=lATr&pv1U_DMZwZzU!yFU-Tk zBW8W}v?C7>FUZ3K`_9M9l{|GQPUhbBokL%++}YV#Qcz{FSmNl13ot$&l{@g0g*>|1 zE2-&8r9*2e?UFn^G6$?rpS%#k{QSNpP@zdi5R-P}K)AeTnr3E9hH7b6yUp7{mB;7e z;x!sFBt<5>E(;d! z11b@mt9NPd3^4iPasbyu3|tzdy~*gEIu2wcqG7D@xV?Z_A{xP3I3|D|I3VeCYkm6q z+G$15$YM>~DM{|Vd8-b_M`L|+BhLsr9Cg!piTy!+>4Ri++~&nYtnc&YiUo|QQ`?I% zk9MPmH|fMD2Oe=I+#c;krPW$%0vC%{dNp!9&rr?ffITT8Z8n;to@dIri=1QyTQLwn z%}1dJ`99%AEfvr%$OdTEW6qQZa%Y1ExlusLs4V8GaCmM$AYz9RSKbcvej2!DUIc;%>!(~IF@(LSz^_w2&yZ6!PqX5sxN9!y(x zaq%Sl>?QW*%7EMrqhdgc$n;`vlupSg7e?5Zq`U?8stSP}iSu^01K{v?1elOGkoZIy zRlNw~{QdRCD@S8ou0edH-`o3u9fpFJ2Cb6kD|3J8FzOJHN=HK?o)6{XAB@?zC)Ve= zUOf4c9cG_&m}o5yD05H*Q&Rk7ToTC@4#xorG4|Hr5y<0De%1l({C;0yRG)xr%i`OH z<>7&YlK^!~+Rt8jS8Ov?9OWtrNFbsGTnHfkl@hp-LNylAVZ_UT8^s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NGnn>37)>=k7!{Ty(vRs=%5ets~8LOkGani%UV`UsoBu2d1DkOx;=E04v z!=ZR*2b_ERO^|Dl*DYKb3SPS_2=dNVT1kZVrE747?}y|4!E$3b^t|_Vp5TElhpEh* z9pz`7sY*AHt>VeU83>+#)sethtl!SeDcgcD7an zu4%Y9sFvdqhC$$3*W!Y@1W-SR28_#Q299Ei+#B-hE@8SR7CT^^+1gci(WAhZtGqP5 zg9Qq^6#!=j4rSlaPBCchmq(Nn%{-3+7>z^K-g{C%xq6cqu{~l zTor}F;h3p33KnFy@}WCcPB1i}iY_<>?^1=&phM#|MEn&QJu&*7FJ&+cGpjBd5JqWT ztq=lbymFfr63DnkBHlq@$L~)2X0w(HoT4PRxfu~C#5#6H6sWY3$(?hSxq#PgldW3 zCPciufcc>pXYKE=qcBlNpOaLFk>r~{H(J}a$?ab4^Do!3S@NpWfi5Q$ftcJ4H#Prh zH7nwBT;9!|vqc?0Ont$mS-ID$Wc1UC + @@ -49,6 +67,7 @@ root.render( + ); diff --git a/webapp/src/translations/en/global.json b/webapp/src/translations/en/global.json new file mode 100644 index 00000000..10415190 --- /dev/null +++ b/webapp/src/translations/en/global.json @@ -0,0 +1,40 @@ +{ + "login": "Log in", + "usuario": "User", + "password": "Password", + "botonLogin": "ENTERS", + "enlaceLogin": "You do not have an account? Sign up here.", + "email": "Email", + "botonRegistro": "SIGN UP", + "registro": "SIGN UP", + "enlaceRegistro": "Do you already have an account? Sign in here.", + "textoInicio": "WELCOME TO WIQ", + "botonPartida": "NEW GAME", + "toolInicio":"Start", + "toolHistorico":"Historical", + "toolPerfil":"Profile", + "toolRanking":"Ranking", + "toolLogOut":"Log out", + "textoHistorico": "MY STATISTICS", + "textoPartJug": "Games played", + "textoPregResp": "Questions answered", + "textoAciertos": "Successes", + "textoFallos": "Failures", + "textoRatAc": "Success rate", + "textoTiempo": "Time played", + "textoTop": "Top 3 users", + "creado": "Created", + "textoPerfil": "PROFILE", + "textoPersonalizar": "Customize your game", + "textoNumPreg": "Number of questions", + "textoTiempoPreg": "Time available per question", + "textoTematicas": "Select the topics of the question to be able to play", + "tematicaTodas": "All", + "tematicaInf": "Computing", + "tematicaGeo": "Geography", + "tematicaCult": "Culture", + "tematicaPersonajes": "Characters", + "botonJugar": "PLAY", + "textoTiempoRest": "Time left: ", + "mensajeLogin": "Successful login" +} \ No newline at end of file diff --git a/webapp/src/translations/es/global.json b/webapp/src/translations/es/global.json new file mode 100644 index 00000000..32317560 --- /dev/null +++ b/webapp/src/translations/es/global.json @@ -0,0 +1,41 @@ +{ + "login": "Inicia sesión", + "usuario": "Usuario", + "password": "Contraseña", + "botonLogin": "ENTRA", + "enlaceLogin": "¿No tienes cuenta? Registrate aquí.", + "email": "Email", + "botonRegistro": "'REGÍSTRATE',", + "registro": "'REGÍSTRATE',", + "enlaceRegistro": "¿Ya tienes cuenta? Inicia sesión aquí.", + "textoInicio": "¡BIENVENIDO A WIQ", + "botonPartida": "NUEVA PARTIDA", + "toolInicio":"Inicio", + "toolHistorico":"Historico", + "toolPerfil":"Perfil", + "toolRanking":"Ranking", + "toolLogOut":"Cerrar sesión", + "textoHistorico": "MIS ESTADÍSTICAS", + "textoPartJug": "Partidas jugadas", + "textoPregResp": "Preguntas respondidas", + "textoAciertos": "Aciertos", + "textoFallos": "Fallos", + "textoRatAc": "Ratio de acierto", + "textoTiempo": "Tiempo jugado", + "textoTop": "Top 3 usuarios", + "creado": "Creado", + "textoPerfil": "PERFIL", + "textoPersonalizar": "Personaliza tu partida", + "textoNumPreg": "Número de preguntas", + "textoTiempoPreg": "Tiempo disponible por pregunta", + "textoTematicas": "Selecciona las tematicas de la pregunta para poder jugar", + "tematicaTodas": "Todas", + "tematicaInf": "Informática", + "tematicaGeo": "Geografía", + "tematicaCult": "Cultura", + "tematicaPersonajes": "Personajes", + "botonJugar": "JUGAR", + "textoTiempoRest": "Tiempo restante: ", + "mensajeLogin": "Inicio de sesión correcto" +} + diff --git a/webapp/src/translations/i18n.js b/webapp/src/translations/i18n.js new file mode 100644 index 00000000..97e076ca --- /dev/null +++ b/webapp/src/translations/i18n.js @@ -0,0 +1,111 @@ + +import {eng} from './en/en' +import {esp} from './es/es' +import i18n from 'i18next'; +import { initReactI18next } from 'react-i18next'; +import LanguageDetector from 'i18next-browser-languagedetector'; + + +i18n + // detect user language + // learn more: https://github.com/i18next/i18next-browser-languageDetector + .use(LanguageDetector) + // pass the i18n instance to react-i18next. + .use(initReactI18next) + // init i18next + // for all options read: https://www.i18next.com/overview/configuration-options + .init({ + debug: true, + fallbackLng: 'en', + interpolation: { + escapeValue: false, // not needed for react as it escapes by default + }, + resources: { + en: { + translation: { + login: 'Log in', + usuario: 'User', + password: 'Password', + botonLogin: 'ENTERS', + enlaceLogin: 'You do not have an account? Sign up here.', + email: 'Email', + botonRegistro: 'SIGN UP', + registro: 'SIGN UP', + enlaceRegistro: 'Do you already have an account? Sign in here.', + textoInicio: 'WELCOME TO WIQ', + botonPartida: 'NEW GAME', + toolInicio:'Start', + toolHistorico:'Historical', + toolPerfil:'Profile', + toolRanking:'Ranking', + toolLogOut:'Log out', + textoHistorico: 'MY STATISTICS', + textoPartJug: 'Games played', + textoPregResp: 'Questions answered', + textoAciertos: 'Successes', + textoFallos: 'Failures', + textoRatAc: 'Success rate', + textoTiempo: 'Time played', + textoTop: 'Top 3 users', + creado: 'Created', + textoPerfil: 'PROFILE', + textoPersonalizar: 'Customize your game', + textoNumPreg: 'Number of questions', + textoTiempoPreg: 'Time available per question', + textoTematicas: 'Select the topics of the question to be able to play', + tematicaTodas: 'All', + tematicaInf: 'Computing', + tematicaGeo: 'Geography', + tematicaCult: 'Culture', + tematicaPersonajes: 'Characters', + botonJugar: 'PLAY', + textoTiempoRest: 'Time left: ', + mensajeLogin: 'Successful login' + } + }, + es: { + translation: { + login: 'Inicia sesión', + usuario: 'Usuario', + password: 'Contraseña', + botonLogin: 'ENTRA', + enlaceLogin: '¿No tienes cuenta? Registrate aquí.', + email: 'Email', + botonRegistro: 'REGÍSTRATE', + registro: 'REGÍSTRATE', + enlaceRegistro: '¿Ya tienes cuenta? Inicia sesión aquí.', + textoInicio: '¡BIENVENIDO A WIQ', + botonPartida: 'NUEVA PARTIDA', + toolInicio:'Inicio', + toolHistorico:'Histórico', + toolPerfil:'Perfil', + toolRanking:'Ranking', + toolLogOut:'Cerrar sesión', + textoHistorico: 'MIS ESTADÍSTICAS', + textoPartJug: 'Partidas jugadas', + textoPregResp: 'Preguntas respondidas', + textoAciertos: 'Aciertos', + textoFallos: 'Fallos', + textoRatAc: 'Ratio de acierto', + textoTiempo: 'Tiempo jugado', + textoTop: 'Top 3 usuarios', + creado: 'Creado', + textoPerfil: 'PERFIL', + textoPersonalizar: 'Personaliza tu partida', + textoNumPreg: 'Número de preguntas', + textoTiempoPreg: 'Tiempo disponible por pregunta', + textoTematicas: 'Selecciona las tematicas de la pregunta para poder jugar', + tematicaTodas: 'Todas', + tematicaInf: 'Informática', + tematicaGeo: 'Geografía', + tematicaCult: 'Cultura', + tematicaPersonajes: 'Personajes', + botonJugar: 'JUGAR', + textoTiempoRest: 'Tiempo restante: ', + mensajeLogin: 'Inicio de sesión correcto' + } + } + } + }); + +export default i18n; \ No newline at end of file From 3225086d01c3273e53d229f2bd18c5c7f9623f84 Mon Sep 17 00:00:00 2001 From: Angela Date: Thu, 18 Apr 2024 20:38:58 +0200 Subject: [PATCH 02/14] traduccion casi terminada --- webapp/src/components/AddUser.js | 29 ++++++++------ webapp/src/components/AllQuestions.js | 9 +++-- webapp/src/components/AllUsers.js | 12 ++++-- webapp/src/components/Game.js | 6 ++- webapp/src/components/GameConfiguration.js | 40 ++++++++++--------- webapp/src/components/Gamehistory.js | 18 +++++---- webapp/src/components/Login.js | 2 +- webapp/src/components/PantallaInicio.js | 8 +++- webapp/src/components/PantallaInicioAdmin.js | 10 +++-- webapp/src/components/Perfil.js | 13 ++++-- webapp/src/components/Ranking.js | 5 ++- .../src/components/fragments/NavigationBar.js | 13 +++--- .../fragments/NavigationBar_Game.js | 5 ++- webapp/src/translations/en/global.json | 12 +++++- webapp/src/translations/es/global.json | 12 +++++- 15 files changed, 129 insertions(+), 65 deletions(-) diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index 0b8e69aa..ae9b6da3 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -3,6 +3,7 @@ import React, { useState } from 'react'; import axios from 'axios'; import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; import '../App.css'; +import { useTranslation } from 'react-i18next'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; @@ -15,6 +16,8 @@ const AddUser = () => { const [openSnackbar, setOpenSnackbar] = useState(false); const [snackbarMessage, setSnackbarMessage] = useState(''); + const [t, i18n] = useTranslation("global"); + const addUser = async () => { try { @@ -34,24 +37,24 @@ const AddUser = () => { return ( + sx={{ + marginTop: 4, + borderRadius: '10px', + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + }}>
- REGÍSTRATE + {t("registro")} setUsername(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} /> @@ -60,7 +63,7 @@ const AddUser = () => { margin="normal" fullWidth label="Email" - value={email} + value={t("email")} onChange={(e) => setEmail(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} /> @@ -70,13 +73,13 @@ const AddUser = () => { fullWidth label="Contraseña" type="password" - value={password} + value={t("password")} onChange={(e) => setPassword(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} /> diff --git a/webapp/src/components/AllQuestions.js b/webapp/src/components/AllQuestions.js index d031033b..ff51442a 100644 --- a/webapp/src/components/AllQuestions.js +++ b/webapp/src/components/AllQuestions.js @@ -1,9 +1,12 @@ import axios from 'axios'; import React, { useState, useEffect, useCallback } from 'react'; import { Container, Typography, TableContainer, Table, TableHead, TableBody, TableRow, TableCell, Paper, Snackbar } from '@mui/material'; +import { useTranslation } from 'react-i18next'; const AllQuestions = () => { + const [t, i18n] = useTranslation("global"); + const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; @@ -38,14 +41,14 @@ const AllQuestions = () => { width: '100%', }}> - TODAS LAS PREGUNTAS + {t("textoAllQuestions")} - Pregunta - Respuesta + {t("textoPregunta")} + {t("textoRespuesta")} diff --git a/webapp/src/components/AllUsers.js b/webapp/src/components/AllUsers.js index 57dfdd92..0d2eb274 100644 --- a/webapp/src/components/AllUsers.js +++ b/webapp/src/components/AllUsers.js @@ -1,9 +1,13 @@ import axios from 'axios'; import React, { useState, useEffect, useCallback } from 'react'; import { Container, Typography, TableContainer, Table, TableHead, TableBody, TableRow, TableCell, Paper, Snackbar } from '@mui/material'; +import { useTranslation } from 'react-i18next'; const AllUsers = () => { + const [t, i18n] = useTranslation("global"); + + const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; @@ -39,15 +43,15 @@ const AllUsers = () => { width: '100%', }}> - TODOS LOS USUARIOS + {t("textoAllUsers")}
- Usuario - Email - Creado + {t("usuario")} + {t("email")} + {t("creado")} diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index 8fb89d50..fdf88e02 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -5,10 +5,14 @@ import { Container, Typography, Button, Snackbar } from '@mui/material'; import { useNavigate, useLocation } from 'react-router-dom'; import { useUser } from './UserContext'; import '../App.css'; +import { useTranslation } from 'react-i18next'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const Game = () => { + + const [t, i18n] = useTranslation("global"); + const { usernameGlobal } = useUser(); const [question, setQuestion] = useState(''); const [image, setImage] = useState(''); @@ -147,7 +151,7 @@ const Game = () => { {answeredQuestions} / {MAX_PREGUNTAS} - Tiempo restante: {elapsedTime} segundos + {t("textoTiempoRest")} {elapsedTime} {t("textoTiempoRest2")} { + + const [t, i18n] = useTranslation("global"); + const navigate = useNavigate(); const [openSnackbar, setOpenSnackbar] = useState(false); const [error, setError] = useState(''); @@ -60,23 +64,23 @@ const GameConfiguration = () => { return ( + sx={{ + marginTop: 25, + borderRadius: '10px', + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + }}>
- Personaliza tu partida + {t("textoPersonalizar")} { name="time" margin="normal" fullWidth - label="Tiempo disponible por pregunta" + label={t("textoTiempoPreg")} onChange={handleChangeTime} value={valueTime} type="number" @@ -107,20 +111,20 @@ const GameConfiguration = () => { }} /> - Selecciona las tematicas de la pregunta para poder jugar + {t("textoTematicas")}
{error && ( diff --git a/webapp/src/components/Gamehistory.js b/webapp/src/components/Gamehistory.js index e17b3975..03db6594 100644 --- a/webapp/src/components/Gamehistory.js +++ b/webapp/src/components/Gamehistory.js @@ -3,10 +3,14 @@ import axios from 'axios'; import { useUser } from './UserContext'; import { Container, Typography, TableContainer, Table, TableHead, TableBody, TableRow, TableCell, Paper, Snackbar } from '@mui/material'; import '../App.css'; +import { useTranslation } from 'react-i18next'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const Gamehistory = () => { + + const [t, i18n] = useTranslation("global"); + const { usernameGlobal } = useUser(); const [gamehistory, setGameHistory] = useState(''); const [error, setError] = useState(''); @@ -39,18 +43,18 @@ const Gamehistory = () => { width: '100%', }}> - MIS ESTADÍSTICAS + {t("textoHistorico")}
- Partidas Jugadas - Preguntas respondidas - Aciertos - Fallos - Ratio de Acierto - Tiempo jugado + {t("textoPartJug")} + {t("textoPregResp")} + {t("textoAciertos")} + {t("textoFallos")} + {t("textoRatAc")} + {t("textoTiempo")} diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 6244b94e..9b32c1d0 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -99,7 +99,7 @@ const Login = () => { - + {error && ( setError('')} message={`Error: ${error}`} /> )} diff --git a/webapp/src/components/PantallaInicio.js b/webapp/src/components/PantallaInicio.js index 2678562a..c0767759 100644 --- a/webapp/src/components/PantallaInicio.js +++ b/webapp/src/components/PantallaInicio.js @@ -4,11 +4,15 @@ import { useUser } from './UserContext'; import { useNavigate } from 'react-router-dom'; import NewGameIcon from '@mui/icons-material/SportsEsports'; import '../App.css'; +import { useTranslation } from 'react-i18next'; const PantallaInicio = () => { + const [t, i18n] = useTranslation("global"); + + const [openSnackbar, setOpenSnackbar] = useState(false); const [error, setError] = useState(''); @@ -42,12 +46,12 @@ const PantallaInicio = () => { alignItems: 'center' }}> - HOLA {usernameGlobal}! + {t("textoInicio")} {usernameGlobal}! diff --git a/webapp/src/components/PantallaInicioAdmin.js b/webapp/src/components/PantallaInicioAdmin.js index 699dbbd0..f2a1fbd1 100644 --- a/webapp/src/components/PantallaInicioAdmin.js +++ b/webapp/src/components/PantallaInicioAdmin.js @@ -1,10 +1,14 @@ import React, { useState } from 'react'; import { Container, Button, Box, Snackbar } from '@mui/material'; import { useNavigate } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; const PantallaInicio = () => { + const [t, i18n] = useTranslation("global"); + + const [openSnackbar, setOpenSnackbar] = useState(false); const [error, setError] = useState(''); @@ -43,13 +47,13 @@ const PantallaInicio = () => { alignItems: 'center' }}> - + {error && ( setError('')} message={`Error: ${error}`} /> )} diff --git a/webapp/src/components/Perfil.js b/webapp/src/components/Perfil.js index c3e9be09..d2226481 100644 --- a/webapp/src/components/Perfil.js +++ b/webapp/src/components/Perfil.js @@ -2,9 +2,14 @@ import axios from 'axios'; import React, { useState, useEffect, useCallback } from 'react'; import { Container, Typography, TableContainer, Table, TableHead, TableBody, TableRow, TableCell, Paper, Snackbar } from '@mui/material'; import { useUser } from './UserContext'; +import { useTranslation } from 'react-i18next'; + const Perfil = () => { + const [t, i18n] = useTranslation("global"); + + const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const { usernameGlobal } = useUser(); @@ -46,15 +51,15 @@ const Perfil = () => { }} > - PERFIL + {t("textoPerfil")}
- Usuario - Email - Creado + {t("usuario")} + {t("email")} + {t("creado")} diff --git a/webapp/src/components/Ranking.js b/webapp/src/components/Ranking.js index b190f0cf..e7608810 100644 --- a/webapp/src/components/Ranking.js +++ b/webapp/src/components/Ranking.js @@ -3,11 +3,14 @@ import axios from 'axios'; import { Container, Box, Typography, Grid} from '@mui/material'; import { useUser } from './UserContext'; import '../App.css'; +import { useTranslation } from 'react-i18next'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const Ranking = () => { + const [t, i18n] = useTranslation("global"); + const { usernameGlobal } = useUser(); const [ranking, setRanking] = useState(''); const [error, setError] = useState(''); @@ -37,7 +40,7 @@ const Ranking = () => { }}> - Top 3 Usuarios + {t("textoTop")} diff --git a/webapp/src/components/fragments/NavigationBar.js b/webapp/src/components/fragments/NavigationBar.js index b5aa79ab..2c194ae7 100644 --- a/webapp/src/components/fragments/NavigationBar.js +++ b/webapp/src/components/fragments/NavigationBar.js @@ -5,10 +5,13 @@ import { AppBar, Toolbar, IconButton, Menu, MenuItem, Grid, Button, Hidden} from import Tooltip from '@mui/material/Tooltip'; import { useUser } from '../UserContext'; import MenuIcon from '@mui/icons-material/Menu'; +import { useTranslation } from 'react-i18next'; const NavigationBar = () => { + const [t, i18n] = useTranslation("global"); + const [setError] = useState(''); const { usernameGlobal, setUsernameGlobal } = useUser(); const navigate = useNavigate(); @@ -91,29 +94,29 @@ const NavigationBar = () => { - + - + - + - + - + diff --git a/webapp/src/components/fragments/NavigationBar_Game.js b/webapp/src/components/fragments/NavigationBar_Game.js index 702ec504..62bc8ab1 100644 --- a/webapp/src/components/fragments/NavigationBar_Game.js +++ b/webapp/src/components/fragments/NavigationBar_Game.js @@ -4,10 +4,13 @@ import { AppBar, Toolbar, IconButton, Menu, MenuItem, Grid, Button, Hidden} from import MenuIcon from '@mui/icons-material/Menu'; import axios from 'axios'; import Tooltip from '@mui/material/Tooltip'; +import { useTranslation } from 'react-i18next'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const NavigationBar_Game = () => { + const [t, i18n] = useTranslation("global"); + const [error, setError] = useState(''); const navigate = useNavigate(); @@ -64,7 +67,7 @@ const NavigationBar_Game = () => { - + diff --git a/webapp/src/translations/en/global.json b/webapp/src/translations/en/global.json index 10415190..27f8f113 100644 --- a/webapp/src/translations/en/global.json +++ b/webapp/src/translations/en/global.json @@ -36,5 +36,15 @@ "tematicaPersonajes": "Characters", "botonJugar": "PLAY", "textoTiempoRest": "Time left: ", - "mensajeLogin": "Successful login" + "textoTiempoRest2": " seconds", + "mensajeLogin": "Successful login", + "textoAllUsers": "ALL USERS", + "textoAllQuestions": "ALL QUESTIONS", + "botonUsuarios": "USERS", + "botonPreguntas": "QUESTIONS", + "textoPregunta": "Question", + "textoRespuesta": "Answer", + "mensajeAddOk": "User added successfully", + "mensajeAddFail": "An user with that name has already registered", + "mensajeLogOut": "Closed session" } \ No newline at end of file diff --git a/webapp/src/translations/es/global.json b/webapp/src/translations/es/global.json index 32317560..268727c4 100644 --- a/webapp/src/translations/es/global.json +++ b/webapp/src/translations/es/global.json @@ -36,6 +36,16 @@ "tematicaPersonajes": "Personajes", "botonJugar": "JUGAR", "textoTiempoRest": "Tiempo restante: ", - "mensajeLogin": "Inicio de sesión correcto" + "textoTiempoRest2": " segundos", + "mensajeLogin": "Inicio de sesión correcto", + "textoAllUsers": "TODOS LOS USUARIOS", + "textoAllQuestions": "TODOS LOS USUARIOS", + "botonUsuarios": "USUARIOS", + "botonPreguntas": "PREGUNTAS", + "textoPregunta": "Pregunta", + "textoRespuesta": "Respuesta", + "mensajeAddOk": "Usuario añadido correctamente", + "mensajeAddFail": "Ya se ha registrado un usuario con ese nombre", + "mensajeLogOut": "Sesion cerrada" } From 84921316ae7f828baee130eb2cd24ddb6a2be10d Mon Sep 17 00:00:00 2001 From: Angela Date: Thu, 18 Apr 2024 20:59:31 +0200 Subject: [PATCH 03/14] traduccion terminada --- webapp/src/components/AddUser.js | 12 ++++++------ webapp/src/translations/es/global.json | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index ae9b6da3..dba55819 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -53,8 +53,8 @@ const AddUser = () => { name="username" margin="normal" fullWidth - label="Usuario" - value={t("usuario")} + label={t("usuario")} + value={username} onChange={(e) => setUsername(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} /> @@ -62,8 +62,8 @@ const AddUser = () => { name="email" margin="normal" fullWidth - label="Email" - value={t("email")} + label={t("email")} + value={email} onChange={(e) => setEmail(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} /> @@ -71,9 +71,9 @@ const AddUser = () => { name="password" margin="normal" fullWidth - label="Contraseña" + label={t("password")} type="password" - value={t("password")} + value={password} onChange={(e) => setPassword(e.target.value)} sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} /> diff --git a/webapp/src/translations/es/global.json b/webapp/src/translations/es/global.json index 268727c4..2ff897b9 100644 --- a/webapp/src/translations/es/global.json +++ b/webapp/src/translations/es/global.json @@ -5,8 +5,8 @@ "botonLogin": "ENTRA", "enlaceLogin": "¿No tienes cuenta? Registrate aquí.", "email": "Email", - "botonRegistro": "'REGÍSTRATE',", - "registro": "'REGÍSTRATE',", + "botonRegistro": "REGÍSTRATE", + "registro": "REGÍSTRATE", "enlaceRegistro": "¿Ya tienes cuenta? Inicia sesión aquí.", "textoInicio": "¡BIENVENIDO A WIQ", "botonPartida": "NUEVA PARTIDA", From c569dcf9e17524d4d5eda79273a672b5f891b64e Mon Sep 17 00:00:00 2001 From: Ruben Date: Sun, 21 Apr 2024 01:23:58 +0200 Subject: [PATCH 04/14] =?UTF-8?q?Arreglado=20problema=20internacionalizaci?= =?UTF-8?q?=C3=B3n=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/userservice/user-service.test.js | 2 +- webapp/package-lock.json | 8 +++ webapp/package.json | 5 +- webapp/src/components/Game.js | 2 +- webapp/src/components/Game.test.js | 30 +++++++-- webapp/src/translations/i18n.js | 89 ++------------------------ 6 files changed, 43 insertions(+), 93 deletions(-) diff --git a/users/userservice/user-service.test.js b/users/userservice/user-service.test.js index 71f0d8ec..4c8b1ff7 100644 --- a/users/userservice/user-service.test.js +++ b/users/userservice/user-service.test.js @@ -2,7 +2,7 @@ const request = require('supertest'); const { MongoMemoryServer } = require('mongodb-memory-server'); let mongoServer; -let +let newString = "testadduser"; const newUser = { username: 'testuser', email: 'testuser@gmail.com', diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 8a9fc108..9664032b 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -28,11 +28,14 @@ "devDependencies": { "axios-mock-adapter": "^1.22.0", "expect-puppeteer": "^9.0.2", + "i18next": "^23.11.2", + "i18next-browser-languagedetector": "^7.2.1", "jest": "^29.3.1", "jest-cucumber": "^3.0.1", "jest-environment-node": "^29.7.0", "mongodb-memory-server": "^9.1.4", "puppeteer": "^21.7.0", + "react-i18next": "^14.1.0", "serve": "^14.2.1", "start-server-and-test": "^2.0.3" } @@ -12144,6 +12147,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "dev": true, "dependencies": { "void-elements": "3.1.0" } @@ -12295,6 +12299,7 @@ "version": "23.11.2", "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", + "dev": true, "funding": [ { "type": "individual", @@ -12317,6 +12322,7 @@ "version": "7.2.1", "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.1.tgz", "integrity": "sha512-h/pM34bcH6tbz8WgGXcmWauNpQupCGr25XPp9cZwZInR9XHSjIFDYp1SIok7zSPsTOMxdvuLyu86V+g2Kycnfw==", + "dev": true, "dependencies": { "@babel/runtime": "^7.23.2" } @@ -22076,6 +22082,7 @@ "version": "14.1.0", "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-14.1.0.tgz", "integrity": "sha512-3KwX6LHpbvGQ+sBEntjV4sYW3Zovjjl3fpoHbUwSgFHf0uRBcbeCBLR5al6ikncI5+W0EFb71QXZmfop+J6NrQ==", + "dev": true, "dependencies": { "@babel/runtime": "^7.23.9", "html-parse-stringify": "^3.0.1" @@ -26713,6 +26720,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "dev": true, "engines": { "node": ">=0.10.0" } diff --git a/webapp/package.json b/webapp/package.json index 3f34b256..2b7867a6 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -55,6 +55,9 @@ "mongodb-memory-server": "^9.1.4", "puppeteer": "^21.7.0", "serve": "^14.2.1", - "start-server-and-test": "^2.0.3" + "start-server-and-test": "^2.0.3", + "i18next": "^23.11.2", + "i18next-browser-languagedetector": "^7.2.1", + "react-i18next": "^14.1.0" } } diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index fdf88e02..35c3e82b 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -11,7 +11,7 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const Game = () => { - const [t, i18n] = useTranslation("global"); + const [t, i18n] = useTranslation(""); const { usernameGlobal } = useUser(); const [question, setQuestion] = useState(''); diff --git a/webapp/src/components/Game.test.js b/webapp/src/components/Game.test.js index 9d92c6f1..87cd12b9 100644 --- a/webapp/src/components/Game.test.js +++ b/webapp/src/components/Game.test.js @@ -5,6 +5,10 @@ import { UserProvider } from './UserContext'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; import Game from './Game'; +import { I18nextProvider } from "react-i18next"; +import i18n from "../translations/i18n"; + +i18n.changeLanguage("es"); const mockAxios = new MockAdapter(axios); jest.useFakeTimers(); // Para simular el paso del tiempo @@ -15,6 +19,16 @@ describe('Start game', () => { it('play', async () => { // Mockeamos la petición al generador de preguntas y la respuesta + const locationState = { + time: 30, + question: 5, + thematic: 'Geografia', + }; + + const location = { + state: locationState, + }; + const responseOptionsResult = ["Madrid", "Barcelona", "Oviedo", "Valladolid"]; const updatedQuestion = { _id: '660434f228670016dfcac277', @@ -37,11 +51,13 @@ describe('Start game', () => { { message: "Tiempo de pregunta actualizado exitosamente", updatedQuestion }); - render( - - - - ); + render( + + + + + + ); var button1; var button2; @@ -52,7 +68,7 @@ describe('Start game', () => { const question = screen.getByText("¿Cual es la capital de España?"); expect(question).toBeInTheDocument(); - const timer = screen.getByText("Tiempo restante: 30 segundos"); + const timer = screen.getByText("Tiempo restante: "); expect(timer).toBeInTheDocument(); const timerBar = screen.getByRole("progressbar"); @@ -91,6 +107,7 @@ describe('Start game', () => { }); }); + /* it('error', async () => { const updatedQuestion = { _id: '660434f228670016dfcac277', @@ -118,4 +135,5 @@ describe('Start game', () => { expect(screen.getByText('Error: Error al generar la pregunta')).toBeInTheDocument(); }); }); + */ }); \ No newline at end of file diff --git a/webapp/src/translations/i18n.js b/webapp/src/translations/i18n.js index 97e076ca..262c64b0 100644 --- a/webapp/src/translations/i18n.js +++ b/webapp/src/translations/i18n.js @@ -1,11 +1,9 @@ - -import {eng} from './en/en' -import {esp} from './es/es' +import eng from './en/global.json' +import esp from './es/global.json' import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; import LanguageDetector from 'i18next-browser-languagedetector'; - i18n // detect user language // learn more: https://github.com/i18next/i18next-browser-languageDetector @@ -22,90 +20,13 @@ i18n }, resources: { en: { - translation: { - login: 'Log in', - usuario: 'User', - password: 'Password', - botonLogin: 'ENTERS', - enlaceLogin: 'You do not have an account? Sign up here.', - email: 'Email', - botonRegistro: 'SIGN UP', - registro: 'SIGN UP', - enlaceRegistro: 'Do you already have an account? Sign in here.', - textoInicio: 'WELCOME TO WIQ', - botonPartida: 'NEW GAME', - toolInicio:'Start', - toolHistorico:'Historical', - toolPerfil:'Profile', - toolRanking:'Ranking', - toolLogOut:'Log out', - textoHistorico: 'MY STATISTICS', - textoPartJug: 'Games played', - textoPregResp: 'Questions answered', - textoAciertos: 'Successes', - textoFallos: 'Failures', - textoRatAc: 'Success rate', - textoTiempo: 'Time played', - textoTop: 'Top 3 users', - creado: 'Created', - textoPerfil: 'PROFILE', - textoPersonalizar: 'Customize your game', - textoNumPreg: 'Number of questions', - textoTiempoPreg: 'Time available per question', - textoTematicas: 'Select the topics of the question to be able to play', - tematicaTodas: 'All', - tematicaInf: 'Computing', - tematicaGeo: 'Geography', - tematicaCult: 'Culture', - tematicaPersonajes: 'Characters', - botonJugar: 'PLAY', - textoTiempoRest: 'Time left: ', - mensajeLogin: 'Successful login' - } + translation: eng, }, es: { - translation: { - login: 'Inicia sesión', - usuario: 'Usuario', - password: 'Contraseña', - botonLogin: 'ENTRA', - enlaceLogin: '¿No tienes cuenta? Registrate aquí.', - email: 'Email', - botonRegistro: 'REGÍSTRATE', - registro: 'REGÍSTRATE', - enlaceRegistro: '¿Ya tienes cuenta? Inicia sesión aquí.', - textoInicio: '¡BIENVENIDO A WIQ', - botonPartida: 'NUEVA PARTIDA', - toolInicio:'Inicio', - toolHistorico:'Histórico', - toolPerfil:'Perfil', - toolRanking:'Ranking', - toolLogOut:'Cerrar sesión', - textoHistorico: 'MIS ESTADÍSTICAS', - textoPartJug: 'Partidas jugadas', - textoPregResp: 'Preguntas respondidas', - textoAciertos: 'Aciertos', - textoFallos: 'Fallos', - textoRatAc: 'Ratio de acierto', - textoTiempo: 'Tiempo jugado', - textoTop: 'Top 3 usuarios', - creado: 'Creado', - textoPerfil: 'PERFIL', - textoPersonalizar: 'Personaliza tu partida', - textoNumPreg: 'Número de preguntas', - textoTiempoPreg: 'Tiempo disponible por pregunta', - textoTematicas: 'Selecciona las tematicas de la pregunta para poder jugar', - tematicaTodas: 'Todas', - tematicaInf: 'Informática', - tematicaGeo: 'Geografía', - tematicaCult: 'Cultura', - tematicaPersonajes: 'Personajes', - botonJugar: 'JUGAR', - textoTiempoRest: 'Tiempo restante: ', - mensajeLogin: 'Inicio de sesión correcto' - } + translation: esp, } } }); + console.log(esp); export default i18n; \ No newline at end of file From 0273df88ce6355bd8e07bf0e75baff92b4010b0e Mon Sep 17 00:00:00 2001 From: Ruben Date: Sun, 21 Apr 2024 13:34:07 +0200 Subject: [PATCH 05/14] =?UTF-8?q?A=C3=B1adida=20internacionalizaci=C3=B3n?= =?UTF-8?q?=20a=20todos=20los=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/src/App.js | 2 +- webapp/src/App.test.js | 16 ++++++--- webapp/src/components/AddUser.js | 2 +- webapp/src/components/AddUser.test.js | 11 ++++-- webapp/src/components/Game.test.js | 37 +++++++++----------- webapp/src/components/Gamehistory.js | 2 +- webapp/src/components/Gamehistory.test.js | 19 ++++++---- webapp/src/components/Login.js | 2 +- webapp/src/components/Login.test.js | 28 +++++++++------ webapp/src/components/PantallaInicio.js | 2 +- webapp/src/components/PantallaInicio.test.js | 17 +++++---- 11 files changed, 81 insertions(+), 57 deletions(-) diff --git a/webapp/src/App.js b/webapp/src/App.js index 66589424..6d0ae3d5 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -23,7 +23,7 @@ const theme = createTheme({ function App() { - const [t, i18n] = useTranslation("global"); + const [t, i18n] = useTranslation(""); const [showLogin, setShowLogin] = useState(true); diff --git a/webapp/src/App.test.js b/webapp/src/App.test.js index 1bfc84bf..611a3051 100644 --- a/webapp/src/App.test.js +++ b/webapp/src/App.test.js @@ -2,6 +2,10 @@ import { render, screen, act, fireEvent} from '@testing-library/react'; import App from './App'; import { BrowserRouter as Router } from 'react-router-dom'; import { UserProvider } from './components/UserContext'; +import { I18nextProvider } from "react-i18next"; +import i18n from "./translations/i18n"; + +i18n.changeLanguage("es"); describe('renders learn react link', () => { it('play', async () => { @@ -10,11 +14,13 @@ describe('renders learn react link', () => { showLogin = newState; }; - render( - - - - ); + render( + + + + + + ); const button = screen.getByText("¿No tienes cuenta? Registrate aquí."); expect(button).toBeInTheDocument(); diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index dba55819..f21a1cd5 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -16,7 +16,7 @@ const AddUser = () => { const [openSnackbar, setOpenSnackbar] = useState(false); const [snackbarMessage, setSnackbarMessage] = useState(''); - const [t, i18n] = useTranslation("global"); + const [t, i18n] = useTranslation(""); const addUser = async () => { diff --git a/webapp/src/components/AddUser.test.js b/webapp/src/components/AddUser.test.js index 3e8403c6..30a0658d 100644 --- a/webapp/src/components/AddUser.test.js +++ b/webapp/src/components/AddUser.test.js @@ -3,7 +3,10 @@ import { render, fireEvent, screen, waitFor } from '@testing-library/react'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; import AddUser from './AddUser'; +import { I18nextProvider } from "react-i18next"; +import i18n from "../translations/i18n"; +i18n.changeLanguage("es"); const mockAxios = new MockAdapter(axios); describe('AddUser component', () => { @@ -12,7 +15,9 @@ describe('AddUser component', () => { }); it('should add user successfully', async () => { - render(); + render( + + ); const usernameInput = screen.getByLabelText('Usuario'); const passwordInput = screen.getByLabelText('Contraseña'); @@ -35,7 +40,9 @@ describe('AddUser component', () => { }); it('should handle error when adding user', async () => { - render(); + render( + + ); const usernameInput = screen.getByLabelText('Usuario'); const passwordInput = screen.getByLabelText('Contraseña'); diff --git a/webapp/src/components/Game.test.js b/webapp/src/components/Game.test.js index 87cd12b9..555bd085 100644 --- a/webapp/src/components/Game.test.js +++ b/webapp/src/components/Game.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { render, fireEvent, screen, waitFor, act } from '@testing-library/react'; -import { BrowserRouter as Router } from 'react-router-dom'; +import { MemoryRouter as Router } from 'react-router-dom'; import { UserProvider } from './UserContext'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; @@ -12,6 +12,11 @@ i18n.changeLanguage("es"); const mockAxios = new MockAdapter(axios); jest.useFakeTimers(); // Para simular el paso del tiempo +// Simulamos la configuración del juego +const MAX_TIME = 30; +const MAX_PREGUNTAS = 5; +const THEMATIC = 'Geografia'; + describe('Start game', () => { beforeEach(() => { mockAxios.reset(); @@ -19,16 +24,6 @@ describe('Start game', () => { it('play', async () => { // Mockeamos la petición al generador de preguntas y la respuesta - const locationState = { - time: 30, - question: 5, - thematic: 'Geografia', - }; - - const location = { - state: locationState, - }; - const responseOptionsResult = ["Madrid", "Barcelona", "Oviedo", "Valladolid"]; const updatedQuestion = { _id: '660434f228670016dfcac277', @@ -53,8 +48,8 @@ describe('Start game', () => { render( - - + + ); @@ -68,7 +63,7 @@ describe('Start game', () => { const question = screen.getByText("¿Cual es la capital de España?"); expect(question).toBeInTheDocument(); - const timer = screen.getByText("Tiempo restante: "); + const timer = screen.getByText("Tiempo restante: 30 segundos"); expect(timer).toBeInTheDocument(); const timerBar = screen.getByRole("progressbar"); @@ -107,7 +102,6 @@ describe('Start game', () => { }); }); - /* it('error', async () => { const updatedQuestion = { _id: '660434f228670016dfcac277', @@ -125,15 +119,16 @@ describe('Start game', () => { { message: "Tiempo de pregunta actualizado exitosamente", updatedQuestion }); - render( - - - - ); + render( + + + + + + ); await waitFor(() => { expect(screen.getByText('Error: Error al generar la pregunta')).toBeInTheDocument(); }); }); - */ }); \ No newline at end of file diff --git a/webapp/src/components/Gamehistory.js b/webapp/src/components/Gamehistory.js index 03db6594..d586a293 100644 --- a/webapp/src/components/Gamehistory.js +++ b/webapp/src/components/Gamehistory.js @@ -9,7 +9,7 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const Gamehistory = () => { - const [t, i18n] = useTranslation("global"); + const [t, i18n] = useTranslation(""); const { usernameGlobal } = useUser(); const [gamehistory, setGameHistory] = useState(''); diff --git a/webapp/src/components/Gamehistory.test.js b/webapp/src/components/Gamehistory.test.js index 8c4d19f4..9bf6e584 100644 --- a/webapp/src/components/Gamehistory.test.js +++ b/webapp/src/components/Gamehistory.test.js @@ -5,7 +5,10 @@ import { UserProvider } from './UserContext'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; import GameHistory from './Gamehistory'; +import { I18nextProvider } from "react-i18next"; +import i18n from "../translations/i18n"; +i18n.changeLanguage("es"); const mockAxios = new MockAdapter(axios); describe('Game history', () => { @@ -24,20 +27,22 @@ describe('Game history', () => { ratio: "60 %", totalTime: "10 s"}); - render( - - - - ); + render( + + + + + + ); await waitFor(() => { expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent('MIS ESTADÍSTICAS'); - expect(screen.getByText('Partidas Jugadas')).toBeInTheDocument(); + expect(screen.getByText('Partidas jugadas')).toBeInTheDocument(); expect(screen.getByText('Preguntas respondidas')).toBeInTheDocument(); expect(screen.getByText('Aciertos')).toBeInTheDocument(); expect(screen.getByText('Fallos')).toBeInTheDocument(); - expect(screen.getByText('Ratio de Acierto')).toBeInTheDocument(); + expect(screen.getByText('Ratio de acierto')).toBeInTheDocument(); expect(screen.getByText('Tiempo jugado')).toBeInTheDocument(); expect(screen.getByText('1')).toBeInTheDocument(); diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 9b32c1d0..693ed7b5 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; const Login = () => { - const [t, i18n] = useTranslation("global"); + const [t, i18n] = useTranslation(""); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/Login.test.js index 5e45e73f..c600e01e 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/Login.test.js @@ -5,8 +5,10 @@ import MockAdapter from 'axios-mock-adapter'; import Login from './Login'; import { BrowserRouter as Router } from 'react-router-dom'; import { UserProvider } from './UserContext'; +import { I18nextProvider } from "react-i18next"; +import i18n from "../translations/i18n"; - +i18n.changeLanguage("es"); const mockAxios = new MockAdapter(axios); describe('Login component', () => { @@ -15,11 +17,13 @@ describe('Login component', () => { }); it('should log in successfully', async () => { - render( - - - - ); + render( + + + + + + ); const usernameInput = screen.getByLabelText('Usuario'); const passwordInput = screen.getByLabelText('Contraseña'); @@ -38,11 +42,13 @@ describe('Login component', () => { }); it('should handle error when logging in', async () => { - render( - - - - ); + render( + + + + + + ); const usernameInput = screen.getByLabelText('Usuario'); const passwordInput = screen.getByLabelText('Contraseña'); diff --git a/webapp/src/components/PantallaInicio.js b/webapp/src/components/PantallaInicio.js index c0767759..896f1d39 100644 --- a/webapp/src/components/PantallaInicio.js +++ b/webapp/src/components/PantallaInicio.js @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; const PantallaInicio = () => { - const [t, i18n] = useTranslation("global"); + const [t, i18n] = useTranslation(""); const [openSnackbar, setOpenSnackbar] = useState(false); diff --git a/webapp/src/components/PantallaInicio.test.js b/webapp/src/components/PantallaInicio.test.js index fbf59da5..9df57bcb 100644 --- a/webapp/src/components/PantallaInicio.test.js +++ b/webapp/src/components/PantallaInicio.test.js @@ -5,7 +5,10 @@ import MockAdapter from 'axios-mock-adapter'; import PantallaInicio from './PantallaInicio'; import { BrowserRouter as Router } from 'react-router-dom'; import { UserProvider } from './UserContext'; +import { I18nextProvider } from "react-i18next"; +import i18n from "../translations/i18n"; +i18n.changeLanguage("es"); const mockAxios = new MockAdapter(axios); describe('PantallaInicio component', () => { @@ -15,13 +18,15 @@ describe('PantallaInicio component', () => { it('muestra la pantalla de inicio correctamente', async () => { - render( - - - - ); + render( + + + + + + ); - const element = screen.getByText(/¡BIENVENIDO A WIQ/); + const element = screen.getByText(/BIENVENIDO/); const nuevaPartidaButton = screen.getByRole('button', { name: 'NUEVA PARTIDA' }); // Verifica si el elemento se encuentra en el DOM From b7805bb71354737cb0c181297f56e4e4ad93b2bd Mon Sep 17 00:00:00 2001 From: Ruben Date: Sun, 21 Apr 2024 13:49:09 +0200 Subject: [PATCH 06/14] =?UTF-8?q?Eliminaci=C3=B3n=20de=20warnings=20y=20er?= =?UTF-8?q?rores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/src/components/AddUser.js | 2 +- webapp/src/components/AllQuestions.js | 5 ++--- webapp/src/components/AllUsers.js | 4 ++-- webapp/src/components/EndGame.js | 5 +++++ webapp/src/components/Game.js | 6 +++--- webapp/src/components/GameConfiguration.js | 5 +++-- webapp/src/components/Gamehistory.js | 2 +- webapp/src/components/Login.js | 2 +- webapp/src/components/PantallaInicio.js | 2 +- webapp/src/components/PantallaInicioAdmin.js | 2 +- webapp/src/components/Perfil.js | 7 +++---- webapp/src/components/Ranking.js | 13 ++++++++----- webapp/src/components/fragments/NavigationBar.js | 2 +- .../{NavigationBar_Game.js => NavigationBarGame.js} | 12 ++++++++---- webapp/src/index.js | 4 ++-- 15 files changed, 42 insertions(+), 31 deletions(-) rename webapp/src/components/fragments/{NavigationBar_Game.js => NavigationBarGame.js} (89%) diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index f21a1cd5..5dd20670 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -16,7 +16,7 @@ const AddUser = () => { const [openSnackbar, setOpenSnackbar] = useState(false); const [snackbarMessage, setSnackbarMessage] = useState(''); - const [t, i18n] = useTranslation(""); + const [t] = useTranslation(""); const addUser = async () => { diff --git a/webapp/src/components/AllQuestions.js b/webapp/src/components/AllQuestions.js index ff51442a..223ec1aa 100644 --- a/webapp/src/components/AllQuestions.js +++ b/webapp/src/components/AllQuestions.js @@ -5,11 +5,10 @@ import { useTranslation } from 'react-i18next'; const AllQuestions = () => { - const [t, i18n] = useTranslation("global"); + const [t] = useTranslation("global"); const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; - const [questions, setQuestions] = useState([]); const [error, setError] = useState(''); @@ -20,7 +19,7 @@ const AllQuestions = () => { } catch (error) { setError(error.response.data.error); } - }) + }, [apiEndpoint]); useEffect(() => { getAllQuestions(); diff --git a/webapp/src/components/AllUsers.js b/webapp/src/components/AllUsers.js index 0d2eb274..fd69f284 100644 --- a/webapp/src/components/AllUsers.js +++ b/webapp/src/components/AllUsers.js @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; const AllUsers = () => { - const [t, i18n] = useTranslation("global"); + const [t] = useTranslation("global"); const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; @@ -22,7 +22,7 @@ const AllUsers = () => { } catch (error) { setError(error.response.data.error); } - }) + }, [apiEndpoint]); useEffect(() => { getAllUsers(); diff --git a/webapp/src/components/EndGame.js b/webapp/src/components/EndGame.js index 48e1a7ae..a0b2b11c 100644 --- a/webapp/src/components/EndGame.js +++ b/webapp/src/components/EndGame.js @@ -90,6 +90,11 @@ const EndGame = () => { +
+ {error && ( + setError('')} message={`Error: ${error}`} /> + )} +
); }; diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index 35c3e82b..3bd814ba 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -11,7 +11,7 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const Game = () => { - const [t, i18n] = useTranslation(""); + const [t] = useTranslation(""); const { usernameGlobal } = useUser(); const [question, setQuestion] = useState(''); @@ -53,7 +53,7 @@ const Game = () => { console.log("Error: " + error.response.data.error); setError(error.response.data.error); } - }, [usernameGlobal]) + }, [usernameGlobal, MAX_TIME, THEMATIC]); const saveGameHistory = useCallback(async () => { try { @@ -92,7 +92,7 @@ const Game = () => { return () => { clearTimeout(timerId); } - }, [elapsedTime, getQuestion, answeredQuestions, navigate, isTimeRunning, saveGameHistory]); + }, [elapsedTime, getQuestion, answeredQuestions, navigate, isTimeRunning, saveGameHistory, MAX_PREGUNTAS]); const handleOptionClick = async (option) => { var isTheCorrectAnswer = false; diff --git a/webapp/src/components/GameConfiguration.js b/webapp/src/components/GameConfiguration.js index 5032235c..f8499dff 100644 --- a/webapp/src/components/GameConfiguration.js +++ b/webapp/src/components/GameConfiguration.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import axios from 'axios'; import { useNavigate} from 'react-router-dom'; -import { Container, Typography, TextField, Button, Snackbar, skeletonClasses } from '@mui/material'; +import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; import '../App.css'; import { useTranslation } from 'react-i18next'; @@ -10,7 +10,7 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const GameConfiguration = () => { - const [t, i18n] = useTranslation("global"); + const [t] = useTranslation("global"); const navigate = useNavigate(); const [openSnackbar, setOpenSnackbar] = useState(false); @@ -53,6 +53,7 @@ const GameConfiguration = () => { navigate("/Game", {state: {time: valueTime, question:valueQuestion, thematic:selectedOption}}); } catch (error) { setError(error.response.data.error); + setSnackbarMessage(error); setOpenSnackbar(true); } }; diff --git a/webapp/src/components/Gamehistory.js b/webapp/src/components/Gamehistory.js index d586a293..fd4cdadb 100644 --- a/webapp/src/components/Gamehistory.js +++ b/webapp/src/components/Gamehistory.js @@ -9,7 +9,7 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const Gamehistory = () => { - const [t, i18n] = useTranslation(""); + const [t] = useTranslation(""); const { usernameGlobal } = useUser(); const [gamehistory, setGameHistory] = useState(''); diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 693ed7b5..417bfead 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; const Login = () => { - const [t, i18n] = useTranslation(""); + const [t] = useTranslation(""); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); diff --git a/webapp/src/components/PantallaInicio.js b/webapp/src/components/PantallaInicio.js index 896f1d39..94d33e82 100644 --- a/webapp/src/components/PantallaInicio.js +++ b/webapp/src/components/PantallaInicio.js @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; const PantallaInicio = () => { - const [t, i18n] = useTranslation(""); + const [t] = useTranslation(""); const [openSnackbar, setOpenSnackbar] = useState(false); diff --git a/webapp/src/components/PantallaInicioAdmin.js b/webapp/src/components/PantallaInicioAdmin.js index f2a1fbd1..a1941388 100644 --- a/webapp/src/components/PantallaInicioAdmin.js +++ b/webapp/src/components/PantallaInicioAdmin.js @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'; const PantallaInicio = () => { - const [t, i18n] = useTranslation("global"); + const [t] = useTranslation("global"); const [openSnackbar, setOpenSnackbar] = useState(false); diff --git a/webapp/src/components/Perfil.js b/webapp/src/components/Perfil.js index d2226481..eb18ad12 100644 --- a/webapp/src/components/Perfil.js +++ b/webapp/src/components/Perfil.js @@ -7,9 +7,8 @@ import { useTranslation } from 'react-i18next'; const Perfil = () => { - const [t, i18n] = useTranslation("global"); - - + const [t] = useTranslation("global"); + const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const { usernameGlobal } = useUser(); @@ -29,7 +28,7 @@ const Perfil = () => { } catch (error) { setError(error.response.data.error); } - }, [usernameGlobal]) + }, [usernameGlobal, apiEndpoint]); useEffect(() => { getPerfil(); diff --git a/webapp/src/components/Ranking.js b/webapp/src/components/Ranking.js index e7608810..4a4497bb 100644 --- a/webapp/src/components/Ranking.js +++ b/webapp/src/components/Ranking.js @@ -1,7 +1,6 @@ import React, { useState, useEffect, useCallback } from 'react'; import axios from 'axios'; -import { Container, Box, Typography, Grid} from '@mui/material'; -import { useUser } from './UserContext'; +import { Container, Box, Typography, Grid, Snackbar} from '@mui/material'; import '../App.css'; import { useTranslation } from 'react-i18next'; @@ -9,9 +8,8 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const Ranking = () => { - const [t, i18n] = useTranslation("global"); + const [t] = useTranslation("global"); - const { usernameGlobal } = useUser(); const [ranking, setRanking] = useState(''); const [error, setError] = useState(''); @@ -22,7 +20,7 @@ const Ranking = () => { } catch (error) { setError(error.response.data.error); } - }, [usernameGlobal]) + }, []); useEffect(() => { getRanking(); @@ -71,6 +69,11 @@ const Ranking = () => { +
+ {error && ( + setError('')} message={`Error: ${error}`} /> + )} +
); }; diff --git a/webapp/src/components/fragments/NavigationBar.js b/webapp/src/components/fragments/NavigationBar.js index 2c194ae7..d1093103 100644 --- a/webapp/src/components/fragments/NavigationBar.js +++ b/webapp/src/components/fragments/NavigationBar.js @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; const NavigationBar = () => { - const [t, i18n] = useTranslation("global"); + const [t] = useTranslation("global"); const [setError] = useState(''); const { usernameGlobal, setUsernameGlobal } = useUser(); diff --git a/webapp/src/components/fragments/NavigationBar_Game.js b/webapp/src/components/fragments/NavigationBarGame.js similarity index 89% rename from webapp/src/components/fragments/NavigationBar_Game.js rename to webapp/src/components/fragments/NavigationBarGame.js index 62bc8ab1..ec603922 100644 --- a/webapp/src/components/fragments/NavigationBar_Game.js +++ b/webapp/src/components/fragments/NavigationBarGame.js @@ -1,6 +1,6 @@ import React, {useCallback, useState} from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; -import { AppBar, Toolbar, IconButton, Menu, MenuItem, Grid, Button, Hidden} from '@mui/material'; +import { AppBar, Toolbar, IconButton, Menu, MenuItem, Grid, Button, Hidden, Snackbar} from '@mui/material'; import MenuIcon from '@mui/icons-material/Menu'; import axios from 'axios'; import Tooltip from '@mui/material/Tooltip'; @@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const NavigationBar_Game = () => { - const [t, i18n] = useTranslation("global"); + const [t] = useTranslation("global"); const [error, setError] = useState(''); const navigate = useNavigate(); @@ -29,7 +29,6 @@ const NavigationBar_Game = () => { setAnchorEl(null); }; - const showHome = useCallback(async () => { try { axios.get(`${apiEndpoint}/restartGame`); @@ -38,7 +37,7 @@ const NavigationBar_Game = () => { console.log("Error: " + error.response.data.error); setError(error.response.data.error); } - }) + }, [navigate]); if (isHiddenRoute) { return null; // Si no estás en / o /App, no muestra la barra de navegación @@ -75,6 +74,11 @@ const NavigationBar_Game = () => { +
+ {error && ( + setError('')} message={`Error: ${error}`} /> + )} +
); }; diff --git a/webapp/src/index.js b/webapp/src/index.js index f6ee72c7..28c0d5ab 100644 --- a/webapp/src/index.js +++ b/webapp/src/index.js @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; import NavigationBar from './components/fragments/NavigationBar'; -import NavigationBar_Game from './components/fragments/NavigationBar_Game'; +import NavigationBarGame from './components/fragments/NavigationBarGame'; import reportWebVitals from './reportWebVitals'; import { UserProvider } from './components/UserContext'; import { I18nextProvider } from 'react-i18next'; @@ -49,7 +49,7 @@ root.render( - + }> }> From 822d3bb53513234345ed929db73d97f80684fb5e Mon Sep 17 00:00:00 2001 From: Ruben Date: Sun, 21 Apr 2024 17:59:45 +0200 Subject: [PATCH 07/14] Arreglados todos los tests --- webapp/e2e/steps/register-form.steps.js | 6 +++--- webapp/src/App.js | 2 +- webapp/src/components/AddUser.js | 2 +- webapp/src/components/Game.js | 2 +- webapp/src/components/Gamehistory.js | 2 +- webapp/src/components/Login.js | 2 +- webapp/src/components/PantallaInicio.js | 2 +- webapp/src/translations/i18n.js | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index d411994d..488f59e6 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -30,16 +30,16 @@ defineFeature(feature, test => { given('An unregistered user', async () => { username = "pablo" - email = "pablo@email.com" + email = "pablo@gmail.com" password = "pabloasw" - await expect(page).toClick("button", { text: "¿No tienes cuenta? Registrate aquí." }); + await expect(page).toClick("button", { text: "enlaceLogin" }); }); when('I fill the data in the form and press submit', async () => { await expect(page).toFill('input[name="username"]', username); await expect(page).toFill('input[name="email"]', email); await expect(page).toFill('input[name="password"]', password); - await expect(page).toClick('button', { text: 'REGÍSTRATE' }) + await expect(page).toClick('button', { text: 'botonRegistro' }) }); then('A confirmation message should be shown in the screen', async () => { diff --git a/webapp/src/App.js b/webapp/src/App.js index 6d0ae3d5..66589424 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -23,7 +23,7 @@ const theme = createTheme({ function App() { - const [t, i18n] = useTranslation(""); + const [t, i18n] = useTranslation("global"); const [showLogin, setShowLogin] = useState(true); diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index 5dd20670..c2e43e6a 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -16,7 +16,7 @@ const AddUser = () => { const [openSnackbar, setOpenSnackbar] = useState(false); const [snackbarMessage, setSnackbarMessage] = useState(''); - const [t] = useTranslation(""); + const [t] = useTranslation("global"); const addUser = async () => { diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index 3bd814ba..dd5eb6a0 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -11,7 +11,7 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const Game = () => { - const [t] = useTranslation(""); + const [t] = useTranslation("global"); const { usernameGlobal } = useUser(); const [question, setQuestion] = useState(''); diff --git a/webapp/src/components/Gamehistory.js b/webapp/src/components/Gamehistory.js index fd4cdadb..2dc6a406 100644 --- a/webapp/src/components/Gamehistory.js +++ b/webapp/src/components/Gamehistory.js @@ -9,7 +9,7 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000 const Gamehistory = () => { - const [t] = useTranslation(""); + const [t] = useTranslation("global"); const { usernameGlobal } = useUser(); const [gamehistory, setGameHistory] = useState(''); diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 417bfead..3dfb2508 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; const Login = () => { - const [t] = useTranslation(""); + const [t] = useTranslation("global"); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); diff --git a/webapp/src/components/PantallaInicio.js b/webapp/src/components/PantallaInicio.js index 94d33e82..344aaabc 100644 --- a/webapp/src/components/PantallaInicio.js +++ b/webapp/src/components/PantallaInicio.js @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; const PantallaInicio = () => { - const [t] = useTranslation(""); + const [t] = useTranslation("global"); const [openSnackbar, setOpenSnackbar] = useState(false); diff --git a/webapp/src/translations/i18n.js b/webapp/src/translations/i18n.js index 262c64b0..40bb6b8f 100644 --- a/webapp/src/translations/i18n.js +++ b/webapp/src/translations/i18n.js @@ -20,10 +20,10 @@ i18n }, resources: { en: { - translation: eng, + global: eng, }, es: { - translation: esp, + global: esp, } } }); From 835ff7b64c0ae9ddf4cda6cf5662286c0fc03895 Mon Sep 17 00:00:00 2001 From: Ruben Date: Sun, 21 Apr 2024 19:18:32 +0200 Subject: [PATCH 08/14] =?UTF-8?q?A=C3=B1adidos=20nuevos=20microservicios?= =?UTF-8?q?=20para=20el=20despliegue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 3 ++ .github/workflows/release.yml | 51 ++++++++++++++++++++++++++++++ apis/allquestionservice/Dockerfile | 5 ++- apis/alluserservice/Dockerfile | 3 ++ docker-compose.yml | 11 +++++++ perfilservice/Dockerfile | 3 ++ timerservice/timer.js | 29 ----------------- 7 files changed, 75 insertions(+), 30 deletions(-) delete mode 100644 timerservice/timer.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 086b7f76..43911341 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,9 @@ jobs: - run: npm --prefix webapp ci - run: npm --prefix questiongenerator ci - run: npm --prefix gamehistoryservice ci + - run: npm --prefix apis/allquestionservice ci + - run: npm --prefix apis/alluserservice ci + - run: npm --prefix perfilservice ci - run: npm --prefix users/authservice test -- --coverage - run: npm --prefix users/userservice test -- --coverage - run: npm --prefix gatewayservice test -- --coverage diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c396a5d3..7bb408a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -155,6 +155,57 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: gamehistoryservice + docker-push-perfilservice: + name: Push perfil service service Docker Image to GitHub Packages + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + needs: [e2e-tests] + steps: + - uses: actions/checkout@v4 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: arquisoft/wiq_es2c/perfilservice + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + workdir: perfilservice + docker-push-allquestionservice: + name: Push all question service service Docker Image to GitHub Packages + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + needs: [e2e-tests] + steps: + - uses: actions/checkout@v4 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: arquisoft/wiq_es2c/apis/allquestionservice + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + workdir: allquestionservice + docker-push-alluserservice: + name: Push all user service service Docker Image to GitHub Packages + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + needs: [e2e-tests] + steps: + - uses: actions/checkout@v4 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: arquisoft/wiq_es2c/apis/alluserservice + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + workdir: alluserservice deploy: name: Deploy over SSH runs-on: ubuntu-latest diff --git a/apis/allquestionservice/Dockerfile b/apis/allquestionservice/Dockerfile index 5678a0ab..74b03e40 100644 --- a/apis/allquestionservice/Dockerfile +++ b/apis/allquestionservice/Dockerfile @@ -13,8 +13,11 @@ RUN npm install # Copy the app source code to the working directory COPY . . -# Expose the port the app runs on +# Expose the port the app runs on EXPOSE 8007 +ARG API_ORIGIN_URI="http://localhost:3000" +ENV REACT_APP_API_ORIGIN_ENDPOINT=$API_ORIGIN_URI + # Define the command to run your app CMD ["node", "allquestions-api.js"] diff --git a/apis/alluserservice/Dockerfile b/apis/alluserservice/Dockerfile index d1060ce1..2b562cbc 100644 --- a/apis/alluserservice/Dockerfile +++ b/apis/alluserservice/Dockerfile @@ -16,5 +16,8 @@ COPY . . # Expose the port the app runs on EXPOSE 8006 +ARG API_ORIGIN_URI="http://localhost:3000" +ENV REACT_APP_API_ORIGIN_ENDPOINT=$API_ORIGIN_URI + # Define the command to run your app CMD ["node", "allusers-api.js"] diff --git a/docker-compose.yml b/docker-compose.yml index e4f079ac..dbe302d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,11 @@ services: - "27017:27017" networks: - mynetwork + environment: + MONGO_INITDB_ROOT_USERNAME: "ASWUSer" + MONGO_INITDB_ROOT_PASSWORD: "b4g4824QxMiH4Yq" + MONGO_INITDB_ROOT_AUTHENTICATION_DATABASE: "admin" + command: ["--auth"] authservice: container_name: authservice-${teamname:-defaultASW} @@ -80,6 +85,8 @@ services: image: ghcr.io/arquisoft/wiq_es2c/perfilservice/perfil-api:latest profiles: ["dev", "prod"] build: ./perfilservice + volumes: + - mongodb_data:/data/db depends_on: - mongodb ports: @@ -94,6 +101,8 @@ services: image: ghcr.io/arquisoft/wiq_es2c/apis/alluserservice/allusers-api:latest profiles: ["dev", "prod"] build: ./apis/alluserservice + volumes: + - mongodb_data:/data/db depends_on: - mongodb ports: @@ -108,6 +117,8 @@ services: image: ghcr.io/arquisoft/wiq_es2c/apis/allquestionservice/allquestions-api:latest profiles: ["dev", "prod"] build: ./apis/allquestionservice + volumes: + - mongodb_data:/data/db depends_on: - mongodb ports: diff --git a/perfilservice/Dockerfile b/perfilservice/Dockerfile index 997b1fe3..889973d2 100644 --- a/perfilservice/Dockerfile +++ b/perfilservice/Dockerfile @@ -16,5 +16,8 @@ COPY . . # Expose the port the app runs on EXPOSE 8005 +ARG API_ORIGIN_URI="http://localhost:3000" +ENV REACT_APP_API_ORIGIN_ENDPOINT=$API_ORIGIN_URI + # Define the command to run your app CMD ["node", "perfil-api.js"] diff --git a/timerservice/timer.js b/timerservice/timer.js deleted file mode 100644 index 684792ad..00000000 --- a/timerservice/timer.js +++ /dev/null @@ -1,29 +0,0 @@ - -app.use((req, res, next) => { - res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3000'); - res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); - res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); - res.setHeader('Access-Control-Allow-Credentials', true); - next(); -}); - -app.get('/timer', async (req, res) => { - - const time = parseInt(req.params.time); - startTimer(time,() =>{ - res.send("Time up"); - }) - -}); - -function startTimer(time,func){ - this.timer = setTimeout(()=>{ - func(); - },time) -} - -var server = app.listen(port, () => { - console.log(`Questions Generation Service listening at http://localhost:${port}`); -}); - -module.exports = server \ No newline at end of file From aa29348d8e190c0bf4b0ebc6ce0bf247dc009429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20P=C3=A9rez=20Dafonte?= <145553440+UO289337@users.noreply.github.com> Date: Sun, 21 Apr 2024 19:34:21 +0200 Subject: [PATCH 09/14] =?UTF-8?q?Eliminada=20informaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index dbe302d5..4b63191a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,11 +10,6 @@ services: - "27017:27017" networks: - mynetwork - environment: - MONGO_INITDB_ROOT_USERNAME: "ASWUSer" - MONGO_INITDB_ROOT_PASSWORD: "b4g4824QxMiH4Yq" - MONGO_INITDB_ROOT_AUTHENTICATION_DATABASE: "admin" - command: ["--auth"] authservice: container_name: authservice-${teamname:-defaultASW} From 41b77d6d95bd87a4f585670a7259abc5a59a4439 Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 22 Apr 2024 13:25:11 +0200 Subject: [PATCH 10/14] =?UTF-8?q?A=C3=B1adida=20dependencia=20de=20los=20n?= =?UTF-8?q?uevos=20microservicios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7bb408a2..284c7708 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -209,7 +209,8 @@ jobs: deploy: name: Deploy over SSH runs-on: ubuntu-latest - needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp,docker-push-questiongenerator,docker-push-gamehistoryservice] + needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp, + docker-push-questiongenerator,docker-push-gamehistoryservice,docker-push-perfilservice,docker-push-allquestionservice,docker-push-alluserservice] steps: - name: Deploy over SSH uses: fifsky/ssh-action@master From adfa0fd0b5216f11723921766daca3c22c3cf662 Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 22 Apr 2024 13:53:03 +0200 Subject: [PATCH 11/14] =?UTF-8?q?Intento=20internacionalizaci=C3=B3n=20tes?= =?UTF-8?q?t=20e2e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/e2e/steps/register-form.steps.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index 488f59e6..447026b0 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -32,14 +32,14 @@ defineFeature(feature, test => { username = "pablo" email = "pablo@gmail.com" password = "pabloasw" - await expect(page).toClick("button", { text: "enlaceLogin" }); + await expect(page).toClick("button", { text: "¿No tienes cuenta? Registrate aquí." }); }); - + when('I fill the data in the form and press submit', async () => { await expect(page).toFill('input[name="username"]', username); await expect(page).toFill('input[name="email"]', email); await expect(page).toFill('input[name="password"]', password); - await expect(page).toClick('button', { text: 'botonRegistro' }) + await expect(page).toClick('button', { text: 'REGÍSTRATE' }); }); then('A confirmation message should be shown in the screen', async () => { From 1ae4ab81c62cad21aff1bdd8cc7a395243a2f70d Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 22 Apr 2024 14:01:32 +0200 Subject: [PATCH 12/14] Solucionado error rutas despliegue --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 284c7708..56c71a56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -188,7 +188,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io - workdir: allquestionservice + workdir: apis/allquestionservice docker-push-alluserservice: name: Push all user service service Docker Image to GitHub Packages runs-on: ubuntu-latest @@ -205,7 +205,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io - workdir: alluserservice + workdir: apis/alluserservice deploy: name: Deploy over SSH runs-on: ubuntu-latest From 5b3d11b663d557517827f46fac6b6101fd92303a Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 22 Apr 2024 14:23:29 +0200 Subject: [PATCH 13/14] Cambiada ruta incorrecta --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4b63191a..c58b011c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -77,7 +77,7 @@ services: perfilservice: container_name: perfilservice-${teamname:-defaultASW} - image: ghcr.io/arquisoft/wiq_es2c/perfilservice/perfil-api:latest + image: ghcr.io/arquisoft/wiq_es2c/perfilservice:latest profiles: ["dev", "prod"] build: ./perfilservice volumes: From 70a66c64dfd414ba58d5dc62157ca5cc8c6e06e1 Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 22 Apr 2024 14:33:43 +0200 Subject: [PATCH 14/14] Solucionado otro error de rutas --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c58b011c..080e477b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -93,7 +93,7 @@ services: alluserservice: container_name: alluserservice-${teamname:-defaultASW} - image: ghcr.io/arquisoft/wiq_es2c/apis/alluserservice/allusers-api:latest + image: ghcr.io/arquisoft/wiq_es2c/apis/alluserservice:latest profiles: ["dev", "prod"] build: ./apis/alluserservice volumes: @@ -109,7 +109,7 @@ services: allquestionservice: container_name: allquestionservice-${teamname:-defaultASW} - image: ghcr.io/arquisoft/wiq_es2c/apis/allquestionservice/allquestions-api:latest + image: ghcr.io/arquisoft/wiq_es2c/apis/allquestionservice:latest profiles: ["dev", "prod"] build: ./apis/allquestionservice volumes: