Skip to content

Commit

Permalink
Merge pull request #127 from Arquisoft/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287627 authored Mar 10, 2024
2 parents 3dab997 + a6f29db commit 94d8db9
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
mongodb:
container_name: mongodb-${teamname:-defaultASW}
container_name: mongodb-${teamname:-wiq_es06b}
image: mongo
profiles: ["dev", "prod"]
volumes:
Expand All @@ -12,7 +12,7 @@ services:
- mynetwork

authservice:
container_name: authservice-${teamname:-defaultASW}
container_name: authservice-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/authservice:latest
profiles: ["dev", "prod"]
build: ./users/authservice
Expand All @@ -26,7 +26,7 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

userservice:
container_name: userservice-${teamname:-defaultASW}
container_name: userservice-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/userservice:latest
profiles: ["dev", "prod"]
build: ./users/userservice
Expand All @@ -40,7 +40,7 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

answerservice:
container_name: answerservice-${teamname:-defaultASW}
container_name: answerservice-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/answerservice:latest
profiles: ["dev", "prod"]
build: ./questions/answerservice
Expand All @@ -54,7 +54,7 @@ services:
MONGODB_URI: mongodb://mongodb:27017/questiondb

createservice:
container_name: createservice-${teamname:-defaultASW}
container_name: createservice-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/createservice:latest
profiles: ["dev", "prod"]
build: ./questions/createservice
Expand All @@ -68,7 +68,7 @@ services:
MONGODB_URI: mongodb://mongodb:27017/questiondb

recordservice:
container_name: recordservice-${teamname:-defaultASW}
container_name: recordservice-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/recordservice:latest
profiles: ["dev", "prod"]
build: ./questions/recordservice
Expand All @@ -82,7 +82,7 @@ services:
MONGODB_URI: mongodb://mongodb:27017/recorddb

generatedquestservice:
container_name: generatedquestservice-${teamname:-defaultASW}
container_name: generatedquestservice-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/generatedquestservice:latest
profiles: ["dev", "prod"]
build: ./questions/generatedquestservice
Expand All @@ -96,7 +96,7 @@ services:
MONGODB_URI: mongodb://mongodb:27017/questiondb

gatewayservice:
container_name: gatewayservice-${teamname:-defaultASW}
container_name: gatewayservice-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/gatewayservice:latest
profiles: ["dev", "prod"]
build: ./gatewayservice
Expand All @@ -121,7 +121,7 @@ services:
GEN_SERVICE_URL: http://generatedquestservice:8007

webapp:
container_name: webapp-${teamname:-defaultASW}
container_name: webapp-${teamname:-wiq_es06b}
image: ghcr.io/arquisoft/wiq_es6b/webapp:latest
profiles: ["dev", "prod"]
build: ./webapp
Expand All @@ -132,7 +132,7 @@ services:

prometheus:
image: prom/prometheus
container_name: prometheus-${teamname:-defaultASW}
container_name: prometheus-${teamname:-wiq_es06b}
profiles: ["dev"]
networks:
- mynetwork
Expand All @@ -146,7 +146,7 @@ services:

grafana:
image: grafana/grafana
container_name: grafana-${teamname:-defaultASW}
container_name: grafana-${teamname:-wiq_es06b}
profiles: ["dev"]
networks:
- mynetwork
Expand Down
12 changes: 9 additions & 3 deletions webapp/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ function App() {
};

return (
<Container component="main" maxWidth="sm" style={{ marginTop: '2rem' }}>
<Paper elevation={3} style={{ padding: '2rem', textAlign: 'center' }}>
<Container component="main" maxWidth="lg" style={{ marginTop: '2rem', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>

<Paper elevation={3} style={{ padding: '2rem', textAlign: 'center', height: '500px', width: '800px', overflow: 'auto' }}>


{showLogin ? <Login setLogged={handleIsLogged}/> : <AddUser />}
{!isLogged ? (<Typography component="div" align="center" sx={{ marginTop: 2 }}>
{!isLogged ? (<Typography component="div" align="center" sx={{ marginTop: 4 }}>
{showLogin ? (




<Link name="gotoregister" component="button" variant="body2" onClick={handleToggleView}>
Don't have an account? Register here.
</Link>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/AddUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AddUser = () => {
};

return (
<Container component="main" maxWidth="xs" sx={{ marginTop: 4 }}>
<Container component="main" maxWidth="lg" sx={{ marginTop: 4 }}>
<Typography component="h1" variant="h5">
Add User
</Typography>
Expand Down
8 changes: 1 addition & 7 deletions webapp/src/components/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const Game = ({username}) => {
const resultCorrecta = data.results.bindings[indexCorrecta];
setInformacionWikidata(resultCorrecta[questionLabel].value + '?');
setRespuestaCorrecta(resultCorrecta[answerLabel].value);
//console.log("Obtener datos: answerCorrect: " + respuestaCorrecta);

// Obtener respuestas falsas
const respuestas = [];
Expand Down Expand Up @@ -126,14 +125,11 @@ const Game = ({username}) => {

const generarBotonesRespuestas = useCallback(async () => {
try{
console.log("Generando botones");
const correctPos = Math.floor(Math.random() * 4) + 1;
console.log(correctPos);
const buttonsData = [];
let contWrongAnsw = 0;
for(let i=1; i<=4; i++){
if(i===correctPos){
console.log("Generando boton correcta: "+respuestaCorrecta);
buttonsData.push({ answer: respuestaCorrecta, handler: handleButtonClickCorrect });
}else{
buttonsData.push({ answer: respuestasFalsas[contWrongAnsw], handler: handleButtonClickGeneric });
Expand All @@ -148,8 +144,6 @@ const Game = ({username}) => {
}, [respuestaCorrecta, respuestasFalsas, handleButtonClickCorrect, handleButtonClickGeneric]);

useEffect(() => {
console.log("Bien: "+respuestaCorrecta);
console.log("Mal: "+respuestasFalsas);
generarBotonesRespuestas();
}, [respuestaCorrecta, respuestasFalsas, generarBotonesRespuestas]);

Expand Down Expand Up @@ -192,7 +186,7 @@ const Game = ({username}) => {
}, [apiEndpoint, correctQuestions, finish, username, numberClics, timer]);

return (
<Container maxWidth="sm">
<Container maxWidth="lg">
<div>
{numberClics > 10 || timer > 180 ? (
<p>Fin de la partida</p>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Login = ({setLogged}) => {
</AppBar>
)}

<Container maxWidth="md" style={{ marginTop: '2rem' }}>
<Container maxWidth="lg" style={{ marginTop: '2rem' }}>
{loginSuccess ? (
<>

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<Typography component="h1" variant="h5" align="center" sx={{ marginTop: 2 }}>
Bienvenido a Saber y ganar
Bienvenido a Saber y Ganar
</Typography>
<App />
<Typography component="h1" variant="h5" align="center" sx={{ marginTop: 4 }}>
Expand Down
Empty file removed {
Empty file.

0 comments on commit 94d8db9

Please sign in to comment.