diff --git a/.env b/.env index b085629..e9d1c5f 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ EMAIL=d.leclerc.pro@gmail.com -DOMAIN=liquors.dleclerc.me -PROXY_URL=http://liquors-quiz-app:8000 \ No newline at end of file +DOMAIN=quiz.dleclerc.me +PROXY_URL=http://quiz-app:8000 \ No newline at end of file diff --git a/Apps/Client/package-lock.json b/Apps/Client/package-lock.json index de2f71e..813eb78 100644 --- a/Apps/Client/package-lock.json +++ b/Apps/Client/package-lock.json @@ -1,11 +1,11 @@ { - "name": "liquors-quiz--client", + "name": "quiz--client", "version": "latest", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "liquors-quiz--client", + "name": "quiz--client", "version": "latest", "dependencies": { "@emotion/react": "^11.11.3", @@ -15,6 +15,7 @@ "@reduxjs/toolkit": "^2.2.1", "http-proxy-middleware": "^2.0.6", "i18next": "^23.10.0", + "i18next-http-backend": "^2.5.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-i18next": "^14.0.5", @@ -29,6 +30,7 @@ "web-vitals": "^2.1.4" }, "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -797,9 +799,17 @@ } }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.0-placeholder-for-preset-env.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", - "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "version": "7.21.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", + "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.21.0", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, "engines": { "node": ">=6.9.0" }, @@ -2042,6 +2052,17 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-env/node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/preset-env/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -6360,6 +6381,14 @@ "node": ">=10" } }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -9259,6 +9288,14 @@ "@babel/runtime": "^7.23.2" } }, + "node_modules/i18next-http-backend": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/i18next-http-backend/-/i18next-http-backend-2.5.0.tgz", + "integrity": "sha512-Z/aQsGZk1gSxt2/DztXk92DuDD20J+rNudT7ZCdTrNOiK8uQppfvdjq9+DFQfpAnFPn3VZS+KQIr1S/W1KxhpQ==", + "dependencies": { + "cross-fetch": "4.0.0" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -11531,6 +11568,44 @@ "tslib": "^2.0.3" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-forge": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", diff --git a/Apps/Client/package.json b/Apps/Client/package.json index b918240..9575dcf 100644 --- a/Apps/Client/package.json +++ b/Apps/Client/package.json @@ -1,5 +1,5 @@ { - "name": "liquors-quiz--client", + "name": "quiz--client", "version": "latest", "private": true, "dependencies": { @@ -10,6 +10,7 @@ "@reduxjs/toolkit": "^2.2.1", "http-proxy-middleware": "^2.0.6", "i18next": "^23.10.0", + "i18next-http-backend": "^2.5.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-i18next": "^14.0.5", @@ -24,6 +25,7 @@ "web-vitals": "^2.1.4" }, "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", diff --git a/Apps/Client/public/index.html b/Apps/Client/public/index.html index 120593f..da08207 100644 --- a/Apps/Client/public/index.html +++ b/Apps/Client/public/index.html @@ -5,12 +5,12 @@ - + -
- {isAuthenticated ? `${t('COMMON.WELCOME')}, ${username}!` : `${t('COMMON.WELCOME')}!`} + {isAuthenticated ? `${t('common:COMMON.WELCOME')}, ${username}!` : `${t('common:COMMON.WELCOME')}!`}
@@ -131,7 +131,7 @@ const Nav: React.FC = () => {
- {t('COMMON.QUIZ')}:
+ {t('common:COMMON.QUIZ')}:
{quizId}
@@ -42,9 +42,9 @@ const Scoreboard: React.FC {t(`ERRORS.${error}`)}
-
diff --git a/Apps/Client/src/components/forms/AdminQuizForm.tsx b/Apps/Client/src/components/forms/AdminQuizForm.tsx
index 3ce42ed..8bf6456 100644
--- a/Apps/Client/src/components/forms/AdminQuizForm.tsx
+++ b/Apps/Client/src/components/forms/AdminQuizForm.tsx
@@ -3,9 +3,9 @@ import { useDispatch, useSelector } from '../../hooks/redux';
import './AdminQuizForm.scss';
import { deleteQuiz, startQuiz } from '../../actions/QuizActions';
import { Trans, useTranslation } from 'react-i18next';
-import { selectPlayers } from '../../reducers/QuizReducer';
import { deleteDatabase } from '../../actions/DatabaseActions';
-import { logout } from '../../actions/UserActions';
+import { logout } from '../../actions/AuthActions';
+import { selectPlayers } from '../../selectors/QuizSelectors';
const AdminQuizForm: React.FC = () => {
const dispatch = useDispatch();
@@ -55,7 +55,7 @@ const AdminQuizForm: React.FC = () => {
return (
);
diff --git a/Apps/Client/src/components/forms/LoginForm.tsx b/Apps/Client/src/components/forms/LoginForm.tsx
index 88134d5..162c2de 100644
--- a/Apps/Client/src/components/forms/LoginForm.tsx
+++ b/Apps/Client/src/components/forms/LoginForm.tsx
@@ -1,10 +1,10 @@
import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useDispatch, useSelector } from '../../hooks/redux';
-import { selectAuthentication } from '../../reducers/UserReducer';
import './LoginForm.scss';
-import { login } from '../../actions/UserActions';
+import { login } from '../../actions/AuthActions';
import { useTranslation } from 'react-i18next';
+import { selectAuthentication } from '../../selectors/UserSelectors';
type Props = {
quizId: string | null,
@@ -13,8 +13,11 @@ type Props = {
const LoginForm: React.FC{t('COMMON.RANK')}
- {t('COMMON.USERNAME')}
- {t('COMMON.SCORE')}
+ {t('common:COMMON.RANK')}
+ {t('common:COMMON.USERNAME')}
+ {t('common:COMMON.SCORE')}