Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webapp interface #89

Merged
merged 81 commits into from
Apr 11, 2024
Merged

Webapp interface #89

merged 81 commits into from
Apr 11, 2024

Conversation

uo288574
Copy link

@uo288574 uo288574 commented Apr 3, 2024

No description provided.

uo288574 and others added 30 commits March 18, 2024 19:12
<Button text = "Historial" name="openHistory" onClick={() => openHistory()}/>
</div>

<h2>Esto irá en el nav(?)</h2>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que decidir ya cómo poner esto, aunque probablemente me encargue yo mañana

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vacío?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Va a haber que sacar mucho código común con FirstGame para que no nos de problemas el sonar

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
16.9% Coverage on New Code (required ≥ 80%)
10.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link

@AbelMH1 AbelMH1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que sea lo que dios quiera.
Tenéis comentarios para modificar cosas. Hay mucho código comentado. El Sonar cloud ta echando humo. PERO, como hay q entregar algo habrá q hacer un poco la vista gorda...

console.log(`Game Service listening at http://localhost:${port}`);
});

server.on('close', () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tienes ni mongo en este servicio... Esto sobra

// Route for getting questions
app.get('/gameUnlimitedQuestions', async (req, res) => {
try {
// TODO: Implement logic to fetch questions from MongoDB and send response
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Líneas que sobran

@@ -10,7 +10,8 @@ const authServiceUrl = process.env.AUTH_SERVICE_URL || 'http://localhost:8002';
const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8001';
const userStatsServiceUrl = process.env.USER_STATS_SERVICE_URL || 'http://localhost:8003';
const storeQuestionsServiceUrl = process.env.STORE_QUESTION_SERVICE_URL || 'http://localhost:8004'
const questionsGeneratorServiceUrl = process.env.QUESTIONS_GENERATOR_SERVICE_URL || 'http://localhost:8007'
// const questionsGeneratorServiceUrl = process.env.QUESTIONS_GENERATOR_SERVICE_URL || 'http://localhost:8007'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sobra

Suggested change
// const questionsGeneratorServiceUrl = process.env.QUESTIONS_GENERATOR_SERVICE_URL || 'http://localhost:8007'

@@ -78,15 +79,74 @@ app.get('/history/questions', async (req, res) => {
}
})

app.get(`/questions`, async (req, res) => {
// app.get(`/questions`, async (req, res) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sobra, lo avisa sonar cloud...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comentarios a eliminar?

console.log(document.querySelector('h1'))

const gamesBT = document.getElementsByClassName('allAnswers');
//expect(gamesBT).toHaveLength(4);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buen test, se nota que se ha aplicado exitosamente el Ostrich algorithm


var isApiCalledRef = false;
var gameId;
//var isApiCalledRef = false;//ASK - is this necessary?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk 🥴

// Recorrer el array desde el último elemento hasta el primero
for (let i = shuffledArray.length - 1; i > 0; i--) {
// Genera un índice aleatorio entre 0 y el índice actual
//const randomIndex = Math.floor(Math.random() * (i + 1));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sobra

Suggested change
//const randomIndex = Math.floor(Math.random() * (i + 1));

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buen fichero, me cuesta un poco comprender la lógica detrás de tan diversas operaciones pero parece estar correcto, no debería dar fallos.

@AbelMH1 AbelMH1 marked this pull request as ready for review April 11, 2024 20:05
@AbelMH1 AbelMH1 merged commit 4a222f4 into develop Apr 11, 2024
1 of 2 checks passed
@AbelMH1 AbelMH1 mentioned this pull request Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants