From 1e0b6e46e18fd955350a9d2cc8e0c391e739b81d Mon Sep 17 00:00:00 2001 From: alegarman2002 <116609314+alegarman2002@users.noreply.github.com> Date: Thu, 11 Apr 2024 22:43:24 +0200 Subject: [PATCH 1/9] Fixed problem with history problem --- userStatsService/user-stats-service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userStatsService/user-stats-service.js b/userStatsService/user-stats-service.js index 7cbf2439..ae751c12 100644 --- a/userStatsService/user-stats-service.js +++ b/userStatsService/user-stats-service.js @@ -61,7 +61,7 @@ app.get('/history/games/:username', async (req, res) => { questions: user.questions, createdAt: user.createdAt })); - res.json(userInformation.slice(0, req.query.limit || userInformation.length)); + res.json(userInformation.slice(0, req.query.limit || userInformation.length).reverse()); } else { res.status(404).json({ error: 'User not found!' }); } From 6214fac2f7a862cee9833d6386f5ca79707a53e1 Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Fri, 12 Apr 2024 00:41:31 +0200 Subject: [PATCH 2/9] added restart always --- docker-compose.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index ebf0671b..a0fbc49f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: - "27017:27017" networks: - mynetwork + restart: always mongodb_wiki: container_name: mongodb-wiki-${teamname:-defaultASW} @@ -21,6 +22,7 @@ services: - "27018:27017" networks: - mynetwork + restart: always authservice: container_name: authservice-${teamname:-defaultASW} @@ -35,6 +37,7 @@ services: - mynetwork environment: MONGODB_URI: mongodb://mongodb:27017/userdb + restart: always userservice: container_name: userservice-${teamname:-defaultASW} @@ -49,6 +52,7 @@ services: - mynetwork environment: MONGODB_URI: mongodb://mongodb:27017/userdb + restart: always gameservice: container_name: gameservice-${teamname:-defaultASW} @@ -64,6 +68,7 @@ services: environment: QUESTIONS_GENERATOR_SERVICE_URL: http://questiongeneratorservice:8007 STORE_STATS_SERVICE: http://userstatsservice:8003 + restart: always questiongeneratorservice: container_name: questiongeneratorservice-${teamname:-defaultASW} @@ -80,6 +85,7 @@ services: environment: MONGODB_URI: mongodb://mongodb_wiki:27017/questions STORE_QUESTION_SERVICE_URL: http://storequestionservice:8004 + restart: always wikidataextractorservice: container_name: wikidataextractorservice-${teamname:-defaultASW} @@ -94,6 +100,7 @@ services: - mynetwork environment: MONGODB_URI: mongodb://mongodb_wiki:27017/questions + restart: always gatewayservice: container_name: gatewayservice-${teamname:-defaultASW} @@ -115,6 +122,7 @@ services: STORE_QUESTION_SERVICE_URL: http://storequestionservice:8004 QUESTIONS_GENERATOR_SERVICE_URL: http://questiongeneratorservice:8007 GAME_SERVICE_URL: http://gameservice:8005 + restart: always webapp: @@ -126,6 +134,7 @@ services: - gatewayservice ports: - "3000:3000" + restart: always prometheus: image: prom/prometheus @@ -173,6 +182,7 @@ services: - mynetwork environment: MONGODB_URI: mongodb://mongodb:27017/storedquestion + restart: always userstatsservice: container_name: userstats-${teamname:-defaultASW} @@ -187,6 +197,7 @@ services: - mynetwork environment: MONGODB_URI: mongodb://mongodb:27017/statsdb + restart: always volumes: From 16340746f494447fe57a829d06887d1329c7e1ab Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Fri, 12 Apr 2024 01:13:23 +0200 Subject: [PATCH 3/9] added gameservice to needs of deploy --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bcd249f..ff86a356 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -232,7 +232,7 @@ 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-questiongeneratorservice, docker-push-storequestionservice, docker-push-userstatsservice, docker-push-wikidataextractorservice] + needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp, docker-push-questiongeneratorservice, docker-push-storequestionservice, docker-push-userstatsservice, docker-push-wikidataextractorservice, docker-push-gameservice] steps: - name: Deploy over SSH uses: fifsky/ssh-action@master From 47ca87ab3d0900c991c25847247d54f19e09949c Mon Sep 17 00:00:00 2001 From: Abel Date: Fri, 12 Apr 2024 02:01:15 +0200 Subject: [PATCH 4/9] =?UTF-8?q?A=C3=B1adida=20nueva=20plantilla=20de=20pre?= =?UTF-8?q?gunta:=20(reformulaci=C3=B3n=20de=20capital-pa=C3=ADs)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../questiongenerator.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/questionsservice/questiongeneratorservice/questiongenerator.js b/questionsservice/questiongeneratorservice/questiongenerator.js index 89206f31..3d96a1ee 100644 --- a/questionsservice/questiongeneratorservice/questiongenerator.js +++ b/questionsservice/questiongeneratorservice/questiongenerator.js @@ -4,21 +4,27 @@ class QuestionGenerator { static temas = new Map([ ["paises", [0, 1, 2]], - ['capital', [0]], - ["lenguaje", [1]] + ['capital', [0, 1]], + ["lenguaje", [2]] ]); ; static plantillas = [ { - pregunta: (param) => `¿Cual es la capital de ${param}?`, - filtro: { capital: { $exists: true } }, + pregunta: (param) => `¿Cuál es la capital de ${param}?`, + filtro: { pais: { $exists: true }, capital: { $exists: true } }, campo_pregunta: 'pais', campo_respuesta: 'capital' }, + { + pregunta: (param) => `¿De qué país es capital ${param}?`, + filtro: { capital: { $exists: true }, pais: { $exists: true } }, + campo_pregunta: 'capital', + campo_respuesta: 'pais' + }, { pregunta: (param) => `¿Qué lengua se habla en ${param}?`, - filtro: { lenguaje: { $exists: true } }, + filtro: { pais: { $exists: true }, lenguaje: { $exists: true } }, campo_pregunta: 'pais', campo_respuesta: 'lenguaje' } From 02fe297b6004568a22e10abb39b03c1bc45040bc Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Fri, 12 Apr 2024 02:11:59 +0200 Subject: [PATCH 5/9] Question style improved --- webapp/src/components/FirstGame.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/webapp/src/components/FirstGame.css b/webapp/src/components/FirstGame.css index 8ab4704e..ad7935b5 100644 --- a/webapp/src/components/FirstGame.css +++ b/webapp/src/components/FirstGame.css @@ -22,6 +22,11 @@ border-image: linear-gradient(to bottom, rgba(0, 255, 0,var(--border-alpha)), rgba(0, 0, 255,var(--border-alpha))) 1; } +.questionStructure h1{ + justify-content: center; + color: #F0F0F0; +} + .questionStructure .answers { display: flex; justify-content: center; /* Alinea los elementos en el centro horizontal / @@ -34,6 +39,13 @@ grid-template-columns: auto auto; } +.allAnswers > div{ + width: 100%; + display: flex; + align-items: center; + justify-content: center; +} + .asnwers { width:100%; } @@ -41,6 +53,7 @@ .questionFirstGame { height: 100%; + width: 100%; display: inline-block; } From fef5402592ba4f5e6ce11ec1997f05da3a6710d4 Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Fri, 12 Apr 2024 02:12:20 +0200 Subject: [PATCH 6/9] GoBackButton erased ;( --- webapp/src/components/GoBackButton.jsx | 20 -------------------- webapp/src/storeQuestion/App.jsx | 2 -- webapp/src/userStats/App.jsx | 2 -- 3 files changed, 24 deletions(-) delete mode 100644 webapp/src/components/GoBackButton.jsx diff --git a/webapp/src/components/GoBackButton.jsx b/webapp/src/components/GoBackButton.jsx deleted file mode 100644 index 563d5934..00000000 --- a/webapp/src/components/GoBackButton.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import Button from "./Button"; -import { useNavigate } from 'react-router-dom'; // Importa useHistory - - - -function GoBackButton(){ - const navigation = useNavigate(); - - const goBack = async () => { - navigation('/menu') - } - - return ( -