From 5d30ea47fc8ee68d62b1ae52fb5fa986d652a3f9 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Tue, 5 Dec 2023 09:22:03 +0100 Subject: [PATCH 01/12] changement du style de l'historique :lipstick: --- cryptide_project/src/Pages/InGame.css | 38 +++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/cryptide_project/src/Pages/InGame.css b/cryptide_project/src/Pages/InGame.css index 81b99e3..b371750 100644 --- a/cryptide_project/src/Pages/InGame.css +++ b/cryptide_project/src/Pages/InGame.css @@ -137,21 +137,43 @@ /** Historique*/ -.historique{ +.historique { position: absolute; z-index: 1; bottom: 2%; left: 2%; - display: flex; flex-direction: column; - /* justify-content: end; */ - padding: 15px 25px; - background-color: #d9d9d9; - border-radius: 15px; - + border: solid; + border-width: 0.5px 0.5px 5px 0.5px; + border-color: whitesmoke lightgray gray whitesmoke; + border-radius: 0 5% 15px 0; height: 250px; width: 20%; - overflow-y:auto; + + direction: rtl; + overflow-y: auto; +} + +.historique div{ + direction: ltr; +} + + +.historique::-webkit-scrollbar { + width: 10px; +} + +.historique::-webkit-scrollbar-thumb { + background-color: lightgray; + border-radius: 5px; +} + +.historique::-webkit-scrollbar-track { + background-color: whitesmoke; +} + +.historique::-webkit-scrollbar-corner { + background-color: whitesmoke; } \ No newline at end of file From 54f63188f05c23a2aee3d431e43559c58e92e8b9 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Tue, 5 Dec 2023 10:43:26 +0100 Subject: [PATCH 02/12] ajout de la page avec la nouvelle grille de deduction :boom: --- cryptide_project/src/App.tsx | 4 +- cryptide_project/src/Pages/DeducCheck.tsx | 107 ++++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 cryptide_project/src/Pages/DeducCheck.tsx diff --git a/cryptide_project/src/App.tsx b/cryptide_project/src/App.tsx index 40cf7ee..9cdc801 100644 --- a/cryptide_project/src/App.tsx +++ b/cryptide_project/src/App.tsx @@ -45,6 +45,7 @@ import messagesEn from './Translations/en.json'; import ErrorBoundary from './Error/ErrorBoundary'; import ErrorPage from './Error/ErrorPage'; import NewPlay from './Pages/NewPlay'; +import DeducCheck from './Pages/DeducCheck'; const messages = { fr: messagesFr, @@ -85,7 +86,8 @@ function App() { } /> }/> } /> - } /> + } /> + } /> } /> }/> {/* }/> */} diff --git a/cryptide_project/src/Pages/DeducCheck.tsx b/cryptide_project/src/Pages/DeducCheck.tsx new file mode 100644 index 0000000..646d77b --- /dev/null +++ b/cryptide_project/src/Pages/DeducCheck.tsx @@ -0,0 +1,107 @@ +import React from 'react'; + +/* Style */ +import './DeducGrid.css'; +import { useTheme } from '../Style/ThemeContext'; + +/* Component */ + +/* Boostrap */ +import Table from 'react-bootstrap/Table'; +import Form from 'react-bootstrap/Form'; + +/* lang */ +import { FormattedMessage } from 'react-intl'; + +/* model */ +import Stub from '../model/Stub'; + +import { useGame } from '../Contexts/GameContext'; + +function DeducCheck() { + const theme = useTheme(); + //const indices = Stub.GenerateIndice(); + + + // const { players } = useGame(); + + const indices = Stub.GenerateIndice(); + + const halfLength = Math.ceil(indices.length / 2); + const firstHalfIndices = indices.slice(0, halfLength); + const secondHalfIndices = indices.slice(halfLength); + + const players = [ + "🔵", + "🟢", + "🟡", + "🟣", + "🔴"] + + // const players = [ + // "bla", + // "bli", + // "blou", + // "blu", + // "ble", + // ] + + console.log(players) + return ( +
+
+ {/* Premier tableau */} + + + + + {players.map((player, index) => ( + + ))} + + + + {firstHalfIndices.map((indice, rowIndex) => ( + + + {players.map((player, colIndex) => ( + + ))} + + ))} + +
Indices{player}
{indice.ToString("fr")} + {/* */} + +
+ + {/* Deuxième tableau */} + + + + + {players.map((player, index) => ( + + ))} + + + + {secondHalfIndices.map((indice, rowIndex) => ( + + + {players.map((player, colIndex) => ( + + ))} + + ))} + +
Indices{player}
{indice.ToString("fr")} + {/* */} + +
+
+
+ ); +} + +export default DeducCheck; From d4e1f28c641924ef4a7539a8578cd9493072c66a Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Tue, 5 Dec 2023 11:45:03 +0100 Subject: [PATCH 03/12] tentative de passage par lien --- cryptide_project/src/Pages/DeducCheck.tsx | 55 ++++++++++++++--------- cryptide_project/src/Pages/InGame.tsx | 9 ++-- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/cryptide_project/src/Pages/DeducCheck.tsx b/cryptide_project/src/Pages/DeducCheck.tsx index 646d77b..0feb90a 100644 --- a/cryptide_project/src/Pages/DeducCheck.tsx +++ b/cryptide_project/src/Pages/DeducCheck.tsx @@ -17,36 +17,51 @@ import { FormattedMessage } from 'react-intl'; import Stub from '../model/Stub'; import { useGame } from '../Contexts/GameContext'; +import { positionToEmoji } from '../ColorHelper'; function DeducCheck() { const theme = useTheme(); //const indices = Stub.GenerateIndice(); + const params = new URLSearchParams(window.location.search); + + const NbPlayer = params.get('NbPlayer'); + const actualPlayerIndex = params.get('actualId') ?? '0'; + + console.log(parseInt(NbPlayer ?? 'nnnnnnnnnnuuuuuuuuuuuuulllllll')) + console.log(parseInt(actualPlayerIndex ?? 'nnnnnnnnnnuuuuuuuuuuuuulllllllooooooooosssssssss')) + //const { actualPlayerIndex, players } = useGame(); + + // let playerstmp + // if (players.length == 0) playerstmp = ["1", "2", "3", "4", "5", "4"]; + // else { playerstmp = players} - // const { players } = useGame(); + //* Gestion players + const playerList = Array.from({ length: parseInt(NbPlayer ?? '1') }, (_, index) => (index + 1).toString()); + const playerColors = playerList.map((_, index) => positionToEmoji(index, true)); + const players = playerColors.filter((_, index) => index !== parseInt(actualPlayerIndex ?? '0')); + + + // const players = [ + // "🔵", + // "🟢", + // "🟡", + // "🟣", + // "🔴" + //] + //console.log(players) + // console.log(playerColors) + // console.log(actualPlayerIndex) + + //* Gestion indices const indices = Stub.GenerateIndice(); const halfLength = Math.ceil(indices.length / 2); const firstHalfIndices = indices.slice(0, halfLength); const secondHalfIndices = indices.slice(halfLength); - - const players = [ - "🔵", - "🟢", - "🟡", - "🟣", - "🔴"] - // const players = [ - // "bla", - // "bli", - // "blou", - // "blu", - // "ble", - // ] - console.log(players) return (
@@ -55,7 +70,7 @@ function DeducCheck() { Indices - {players.map((player, index) => ( + {playerColors.map((player, index) => ( {player} ))} @@ -64,7 +79,7 @@ function DeducCheck() { {firstHalfIndices.map((indice, rowIndex) => ( {indice.ToString("fr")} - {players.map((player, colIndex) => ( + {playerColors.map((player, colIndex) => ( {/* */} @@ -80,7 +95,7 @@ function DeducCheck() { Indices - {players.map((player, index) => ( + {playerColors.map((player, index) => ( {player} ))} @@ -89,7 +104,7 @@ function DeducCheck() { {secondHalfIndices.map((indice, rowIndex) => ( {indice.ToString("fr")} - {players.map((player, colIndex) => ( + {playerColors.map((player, colIndex) => ( {/* */} diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index f90c73f..ee285fa 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -278,8 +278,10 @@ const InGame = ({locale, changeLocale}) => { const [SwitchEnabled, setSwitchEnabled] = useState(false) const allIndices = Stub.GenerateIndice() - const { indice, players } = useGame(); + const { indice, players, actualPlayerIndex} = useGame(); + const nbPlayer = players.length; + const navdeduc = '/deduc?actualId=' + actualPlayerIndex + '&nbPlayer=' + nbPlayer; return (
@@ -373,12 +375,9 @@ const InGame = ({locale, changeLocale}) => { info - {/* */} {!IsSolo && - + - +
diff --git a/cryptide_project/src/Pages/Profile.tsx b/cryptide_project/src/Pages/Profile.tsx index a59ad2e..91e1bf9 100644 --- a/cryptide_project/src/Pages/Profile.tsx +++ b/cryptide_project/src/Pages/Profile.tsx @@ -186,7 +186,7 @@ const Profile = () => { } handleCloseDeleteModal(); - navigate(`${basePath}/`) + navigate(`/${basePath}/`) } else { console.error('Phrase de confirmation incorrecte.'); diff --git a/cryptide_project/src/Pages/SignUpForm.tsx b/cryptide_project/src/Pages/SignUpForm.tsx index 9e29449..f7f2a1a 100644 --- a/cryptide_project/src/Pages/SignUpForm.tsx +++ b/cryptide_project/src/Pages/SignUpForm.tsx @@ -35,7 +35,7 @@ const SignUp = () => { setShowConfirmation(true); setTimeout(() => { - navigate(`${basePath}/login`); // 3 secondes avant de rediriger vers la page de connexion + navigate(`/${basePath}/login`); // 3 secondes avant de rediriger vers la page de connexion }, 1250); } } catch (error: any) { From bc24e060e5b3f9835d81d06f821aa1870e1230b2 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Tue, 5 Dec 2023 16:01:12 +0100 Subject: [PATCH 06/12] variable d'environnement pour le path avec le / --- cryptide_project/src/Components/GraphContainer.tsx | 4 ++-- cryptide_project/src/Components/LobbyContainer.tsx | 2 +- cryptide_project/src/Components/NavBar.tsx | 4 ++-- cryptide_project/src/Pages/Lobby.tsx | 10 +++++----- cryptide_project/src/Pages/LoginForm.tsx | 2 +- cryptide_project/src/Pages/NewPlay.tsx | 10 +++++----- cryptide_project/src/Pages/Play.tsx | 12 ++++++------ cryptide_project/src/Pages/Profile.tsx | 2 +- cryptide_project/src/Pages/SignUpForm.tsx | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index 634f495..83697dd 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -811,7 +811,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS socket.off("put imossible grey") socket.off("who plays") - navigate(`/${basePath}/endgame`) + navigate(`${basePath}/endgame`) } } }) @@ -1020,7 +1020,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS catch(error){ console.log(error); } - navigate(`/${basePath}/endgame?solo=true+${isDaily}`) + navigate(`${basePath}/endgame?solo=true+${isDaily}`) } } diff --git a/cryptide_project/src/Components/LobbyContainer.tsx b/cryptide_project/src/Components/LobbyContainer.tsx index ac0037c..797cef5 100644 --- a/cryptide_project/src/Components/LobbyContainer.tsx +++ b/cryptide_project/src/Components/LobbyContainer.tsx @@ -49,7 +49,7 @@ const LobbyContainer: React.FC = ({roomNum, HeadPlayer, nbP if (nbPlayer < 6 && !started) { socket.off("request lobbies") setFirst(true) - navigate(`/${basePath}/${dest}`); + navigate(`${basePath}/${dest}`); } else if(started){ handleShowStart() diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index 75b45c6..5921026 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -37,11 +37,11 @@ function AppNavbar({changeLocale}) { function navigateToProfile(){ - navigate(`/${basePath}/profile`) + navigate(`${basePath}/profile`) } function navigateToHome(){ - navigate(`/${basePath}/`) + navigate(`${basePath}/`) } return ( diff --git a/cryptide_project/src/Pages/Lobby.tsx b/cryptide_project/src/Pages/Lobby.tsx index 248c8cc..572c36a 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -136,7 +136,7 @@ function Lobby() { gameStarted = true //socket.off("player left") //socket.off("new player") - navigate(`/${basePath}/game?solo=false&daily=false`); + navigate(`${basePath}/game?solo=false&daily=false`); }); @@ -172,7 +172,7 @@ function Lobby() { setIndicesData(choosenIndices) first = true gameStarted = true - navigate(`/${basePath}/game?solo=false&daily=false`) + navigate(`${basePath}/game?solo=false&daily=false`) }); socket.on("new player", (tab) =>{ @@ -187,17 +187,17 @@ function Lobby() { socket.on("room full", () => { //TODO POP UP pour quand la room est pleine - navigate(`/${basePath}/play`) + navigate(`${basePath}/play`) }) socket.on("game started", () => { //TODO POP UP pour quand la room est pleine - navigate(`/${basePath}/play`) + navigate(`${basePath}/play`) }) socket.on("game already started", () => { //TODO POP UP pour quand la room est pleine - navigate(`/${basePath}/play`) + navigate(`${basePath}/play`) }) socket.on("player left", (tab, i) => { diff --git a/cryptide_project/src/Pages/LoginForm.tsx b/cryptide_project/src/Pages/LoginForm.tsx index 764e0f5..dde8427 100644 --- a/cryptide_project/src/Pages/LoginForm.tsx +++ b/cryptide_project/src/Pages/LoginForm.tsx @@ -37,7 +37,7 @@ const SignIn = () => { setShowConfirmation(true); setTimeout(async () => { await login(); - navigate(`/${basePath}/`); + navigate(`${basePath}/`); }, 1250); } } catch (error: any) { diff --git a/cryptide_project/src/Pages/NewPlay.tsx b/cryptide_project/src/Pages/NewPlay.tsx index 2cc7999..8c658f1 100644 --- a/cryptide_project/src/Pages/NewPlay.tsx +++ b/cryptide_project/src/Pages/NewPlay.tsx @@ -100,7 +100,7 @@ function NewPlay() { setPersonNetworkData(networkPerson) setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`/${basePath}/game?solo=true&daily=false`); + navigate(`${basePath}/game?solo=true&daily=false`); } @@ -131,12 +131,12 @@ function NewPlay() { useEffect(() => { if (room !== null) { const nouvelleURL = `/lobby?room=${room}`; - navigate(`/${basePath}${nouvelleURL}`) + navigate(`${basePath}${nouvelleURL}`) } }, [room, navigate]); const goBack = () => { - navigate(`/${basePath}/lobby?room=${goBackRoom}`) + navigate(`${basePath}/lobby?room=${goBackRoom}`) } @@ -159,7 +159,7 @@ function NewPlay() { setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`/${basePath}/game?solo=true&daily=true&easy=true`); + navigate(`${basePath}/game?solo=true&daily=true&easy=true`); setShowOverlay(false); }; @@ -177,7 +177,7 @@ function NewPlay() { const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice()) setDailyEnigmeData(map) } - navigate(`/${basePath}/game?solo=true&daily=true&easy=false`); + navigate(`${basePath}/game?solo=true&daily=true&easy=false`); setShowOverlay(false); }; diff --git a/cryptide_project/src/Pages/Play.tsx b/cryptide_project/src/Pages/Play.tsx index 097d73d..e783f53 100644 --- a/cryptide_project/src/Pages/Play.tsx +++ b/cryptide_project/src/Pages/Play.tsx @@ -100,7 +100,7 @@ function Play() { setPersonNetworkData(networkPerson) setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`/${basePath}/game?solo=true&daily=false`); + navigate(`${basePath}/game?solo=true&daily=false`); } @@ -131,12 +131,12 @@ function Play() { useEffect(() => { if (room !== null) { const nouvelleURL = `/lobby?room=${room}`; - navigate(`/${basePath}${nouvelleURL}`); + navigate(`${basePath}${nouvelleURL}`); } }, [room, navigate]); const goBack = () => { - navigate(`/${basePath}/lobby?room=${goBackRoom}`) + navigate(`${basePath}/lobby?room=${goBackRoom}`) } @@ -159,7 +159,7 @@ function Play() { setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`/${basePath}/game?solo=true&daily=true&easy=true`); + navigate(`${basePath}/game?solo=true&daily=true&easy=true`); setShowOverlay(false); }; @@ -177,7 +177,7 @@ function Play() { const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice()) setDailyEnigmeData(map) } - navigate(`/${basePath}/game?solo=true&daily=true&easy=false`); + navigate(`${basePath}/game?solo=true&daily=true&easy=false`); setShowOverlay(false); }; @@ -240,7 +240,7 @@ function Play() { - +
diff --git a/cryptide_project/src/Pages/Profile.tsx b/cryptide_project/src/Pages/Profile.tsx index 91e1bf9..a59ad2e 100644 --- a/cryptide_project/src/Pages/Profile.tsx +++ b/cryptide_project/src/Pages/Profile.tsx @@ -186,7 +186,7 @@ const Profile = () => { } handleCloseDeleteModal(); - navigate(`/${basePath}/`) + navigate(`${basePath}/`) } else { console.error('Phrase de confirmation incorrecte.'); diff --git a/cryptide_project/src/Pages/SignUpForm.tsx b/cryptide_project/src/Pages/SignUpForm.tsx index f7f2a1a..9e29449 100644 --- a/cryptide_project/src/Pages/SignUpForm.tsx +++ b/cryptide_project/src/Pages/SignUpForm.tsx @@ -35,7 +35,7 @@ const SignUp = () => { setShowConfirmation(true); setTimeout(() => { - navigate(`/${basePath}/login`); // 3 secondes avant de rediriger vers la page de connexion + navigate(`${basePath}/login`); // 3 secondes avant de rediriger vers la page de connexion }, 1250); } } catch (error: any) { From 89f376801bbfa03f3909a89520fc5519b6ccb742 Mon Sep 17 00:00:00 2001 From: Thomas CHAZOT Date: Tue, 5 Dec 2023 16:03:06 +0100 Subject: [PATCH 07/12] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'.drone.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5855957..f8710ca 100644 --- a/.drone.yml +++ b/.drone.yml @@ -47,7 +47,7 @@ steps: password: from_secret: SECRET_REGISTRY_PASSWORD environment: - REACT_APP_BASE_PATH: "/containers/Crypteam-website" + BASEPATH: "/containers/Crypteam-website" #depends_on: [ build ] From 93aa011b1d7c49e67896f62aa83f3d57b93362f8 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Tue, 5 Dec 2023 16:05:25 +0100 Subject: [PATCH 08/12] test variable d'envi --- cryptide_project/src/App.tsx | 2 +- cryptide_project/src/Components/GraphContainer.tsx | 2 +- cryptide_project/src/Components/LobbyContainer.tsx | 2 +- cryptide_project/src/Components/NavBar.tsx | 2 +- cryptide_project/src/Error/ErrorPage.tsx | 2 +- cryptide_project/src/Pages/InGame.tsx | 2 +- cryptide_project/src/Pages/Lobby.tsx | 2 +- cryptide_project/src/Pages/LoginForm.tsx | 2 +- cryptide_project/src/Pages/NewPlay.tsx | 2 +- cryptide_project/src/Pages/Play.tsx | 2 +- cryptide_project/src/Pages/Profile.tsx | 2 +- cryptide_project/src/Pages/SignUpForm.tsx | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cryptide_project/src/App.tsx b/cryptide_project/src/App.tsx index be4588a..bffffc7 100644 --- a/cryptide_project/src/App.tsx +++ b/cryptide_project/src/App.tsx @@ -42,7 +42,7 @@ import messagesEn from './Translations/en.json'; import ErrorBoundary from './Error/ErrorBoundary'; import ErrorPage from './Error/ErrorPage'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; const messages = { fr: messagesFr, diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index 83697dd..bc6dac2 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -67,7 +67,7 @@ let cptBug = 0 let cptUseEffect = 0 let testPlayers: Player[] = [] -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; const MyGraphComponent: React.FC = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork, setNetworkEnigme, setPlayerIndex, askedWrong, setAskedWrong, importToPdf, setImportToPdf}) => { diff --git a/cryptide_project/src/Components/LobbyContainer.tsx b/cryptide_project/src/Components/LobbyContainer.tsx index 797cef5..3dca90a 100644 --- a/cryptide_project/src/Components/LobbyContainer.tsx +++ b/cryptide_project/src/Components/LobbyContainer.tsx @@ -20,7 +20,7 @@ interface LobbyContainerProps { //? mettre un "nbplayermax" si le nombre de joueur max peut etre fixé ? } -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; const LobbyContainer: React.FC = ({roomNum, HeadPlayer, nbPlayer, setFirst, started}) => { const theme=useTheme(); diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index 5921026..5e1d0da 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -25,7 +25,7 @@ import { useTheme } from '../Style/ThemeContext'; import { useAuth } from '../Contexts/AuthContext'; import { useNavigate } from 'react-router-dom'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; // @ts-ignore diff --git a/cryptide_project/src/Error/ErrorPage.tsx b/cryptide_project/src/Error/ErrorPage.tsx index dc3da66..d0d26dc 100644 --- a/cryptide_project/src/Error/ErrorPage.tsx +++ b/cryptide_project/src/Error/ErrorPage.tsx @@ -6,7 +6,7 @@ import './ErrorStyle.css'; import { FormattedMessage } from 'react-intl'; import { Button } from 'react-bootstrap'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; //@ts-ignore diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index 099b6ea..e530061 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -52,7 +52,7 @@ import Indice from '../model/Indices/Indice'; let cptNavigation = 0 -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; //@ts-ignore const InGame = ({locale, changeLocale}) => { diff --git a/cryptide_project/src/Pages/Lobby.tsx b/cryptide_project/src/Pages/Lobby.tsx index 572c36a..11e4465 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -50,7 +50,7 @@ import { DataSet } from 'vis-network'; let gameStarted = false let firstLaunch = true -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; function Lobby() { diff --git a/cryptide_project/src/Pages/LoginForm.tsx b/cryptide_project/src/Pages/LoginForm.tsx index dde8427..3ca9782 100644 --- a/cryptide_project/src/Pages/LoginForm.tsx +++ b/cryptide_project/src/Pages/LoginForm.tsx @@ -5,7 +5,7 @@ import { useAuth } from '../Contexts/AuthContext'; import AuthService from '../services/AuthService'; import '../Style/Global.css'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; const SignIn = () => { const navigate = useNavigate(); diff --git a/cryptide_project/src/Pages/NewPlay.tsx b/cryptide_project/src/Pages/NewPlay.tsx index 8c658f1..7e0baec 100644 --- a/cryptide_project/src/Pages/NewPlay.tsx +++ b/cryptide_project/src/Pages/NewPlay.tsx @@ -34,7 +34,7 @@ import Lobbies from './Lobbies'; let cptNavigation = 0 -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; diff --git a/cryptide_project/src/Pages/Play.tsx b/cryptide_project/src/Pages/Play.tsx index e783f53..9a8aca2 100644 --- a/cryptide_project/src/Pages/Play.tsx +++ b/cryptide_project/src/Pages/Play.tsx @@ -32,7 +32,7 @@ import Info from '../res/icon/infoGreen.png'; let cptNavigation = 0 -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; function Play() { diff --git a/cryptide_project/src/Pages/Profile.tsx b/cryptide_project/src/Pages/Profile.tsx index a59ad2e..39778eb 100644 --- a/cryptide_project/src/Pages/Profile.tsx +++ b/cryptide_project/src/Pages/Profile.tsx @@ -25,7 +25,7 @@ import Form from 'react-bootstrap/Form'; import ProgressBar from 'react-bootstrap/ProgressBar'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; //@ts-ignore const Profile = () => { diff --git a/cryptide_project/src/Pages/SignUpForm.tsx b/cryptide_project/src/Pages/SignUpForm.tsx index 9e29449..491b21f 100644 --- a/cryptide_project/src/Pages/SignUpForm.tsx +++ b/cryptide_project/src/Pages/SignUpForm.tsx @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'; import AuthService from '../services/AuthService'; import '../Style/Global.css'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.BASEPATH || ''; const SignUp = () => { From 680d4681ebfa74d0748362bf5ffa773fe93bafac Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Tue, 5 Dec 2023 16:17:18 +0100 Subject: [PATCH 09/12] =?UTF-8?q?=C3=A7a=20devrait=20marcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cryptide_project/src/App.tsx | 2 +- cryptide_project/src/Components/GraphContainer.tsx | 3 +-- cryptide_project/src/Components/LobbyContainer.tsx | 2 +- cryptide_project/src/Components/NavBar.tsx | 3 +-- cryptide_project/src/Error/ErrorPage.tsx | 3 +-- cryptide_project/src/Pages/InGame.tsx | 2 +- cryptide_project/src/Pages/Lobby.tsx | 3 +-- cryptide_project/src/Pages/LoginForm.tsx | 2 +- cryptide_project/src/Pages/NewPlay.tsx | 3 +-- cryptide_project/src/Pages/Play.tsx | 3 +-- cryptide_project/src/Pages/Profile.tsx | 2 +- cryptide_project/src/Pages/SignUpForm.tsx | 2 +- 12 files changed, 12 insertions(+), 18 deletions(-) diff --git a/cryptide_project/src/App.tsx b/cryptide_project/src/App.tsx index bffffc7..bbac424 100644 --- a/cryptide_project/src/App.tsx +++ b/cryptide_project/src/App.tsx @@ -42,7 +42,7 @@ import messagesEn from './Translations/en.json'; import ErrorBoundary from './Error/ErrorBoundary'; import ErrorPage from './Error/ErrorPage'; -const basePath = process.env.BASEPATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const messages = { fr: messagesFr, diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index bc6dac2..80bc4c8 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -67,8 +67,7 @@ let cptBug = 0 let cptUseEffect = 0 let testPlayers: Player[] = [] -const basePath = process.env.BASEPATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const MyGraphComponent: React.FC = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork, setNetworkEnigme, setPlayerIndex, askedWrong, setAskedWrong, importToPdf, setImportToPdf}) => { let cptTour: number = 0 diff --git a/cryptide_project/src/Components/LobbyContainer.tsx b/cryptide_project/src/Components/LobbyContainer.tsx index 3dca90a..edebe08 100644 --- a/cryptide_project/src/Components/LobbyContainer.tsx +++ b/cryptide_project/src/Components/LobbyContainer.tsx @@ -20,7 +20,7 @@ interface LobbyContainerProps { //? mettre un "nbplayermax" si le nombre de joueur max peut etre fixé ? } -const basePath = process.env.BASEPATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const LobbyContainer: React.FC = ({roomNum, HeadPlayer, nbPlayer, setFirst, started}) => { const theme=useTheme(); diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index 5e1d0da..6922287 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -25,8 +25,7 @@ import { useTheme } from '../Style/ThemeContext'; import { useAuth } from '../Contexts/AuthContext'; import { useNavigate } from 'react-router-dom'; -const basePath = process.env.BASEPATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; // @ts-ignore function AppNavbar({changeLocale}) { diff --git a/cryptide_project/src/Error/ErrorPage.tsx b/cryptide_project/src/Error/ErrorPage.tsx index d0d26dc..ad90cde 100644 --- a/cryptide_project/src/Error/ErrorPage.tsx +++ b/cryptide_project/src/Error/ErrorPage.tsx @@ -6,8 +6,7 @@ import './ErrorStyle.css'; import { FormattedMessage } from 'react-intl'; import { Button } from 'react-bootstrap'; -const basePath = process.env.BASEPATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; //@ts-ignore function ErrorPage({ code = "", msg = "Something is wrong"}) { diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index e530061..3446d44 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -52,7 +52,7 @@ import Indice from '../model/Indices/Indice'; let cptNavigation = 0 -const basePath = process.env.BASEPATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; //@ts-ignore const InGame = ({locale, changeLocale}) => { diff --git a/cryptide_project/src/Pages/Lobby.tsx b/cryptide_project/src/Pages/Lobby.tsx index 11e4465..89cde23 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -50,8 +50,7 @@ import { DataSet } from 'vis-network'; let gameStarted = false let firstLaunch = true -const basePath = process.env.BASEPATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; function Lobby() { const theme=useTheme(); diff --git a/cryptide_project/src/Pages/LoginForm.tsx b/cryptide_project/src/Pages/LoginForm.tsx index 3ca9782..0f7976d 100644 --- a/cryptide_project/src/Pages/LoginForm.tsx +++ b/cryptide_project/src/Pages/LoginForm.tsx @@ -5,7 +5,7 @@ import { useAuth } from '../Contexts/AuthContext'; import AuthService from '../services/AuthService'; import '../Style/Global.css'; -const basePath = process.env.BASEPATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const SignIn = () => { const navigate = useNavigate(); diff --git a/cryptide_project/src/Pages/NewPlay.tsx b/cryptide_project/src/Pages/NewPlay.tsx index 7e0baec..38bb038 100644 --- a/cryptide_project/src/Pages/NewPlay.tsx +++ b/cryptide_project/src/Pages/NewPlay.tsx @@ -34,8 +34,7 @@ import Lobbies from './Lobbies'; let cptNavigation = 0 -const basePath = process.env.BASEPATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; function NewPlay() { diff --git a/cryptide_project/src/Pages/Play.tsx b/cryptide_project/src/Pages/Play.tsx index 9a8aca2..f0a80f3 100644 --- a/cryptide_project/src/Pages/Play.tsx +++ b/cryptide_project/src/Pages/Play.tsx @@ -32,8 +32,7 @@ import Info from '../res/icon/infoGreen.png'; let cptNavigation = 0 -const basePath = process.env.BASEPATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; function Play() { let first = true diff --git a/cryptide_project/src/Pages/Profile.tsx b/cryptide_project/src/Pages/Profile.tsx index 39778eb..73349b5 100644 --- a/cryptide_project/src/Pages/Profile.tsx +++ b/cryptide_project/src/Pages/Profile.tsx @@ -25,7 +25,7 @@ import Form from 'react-bootstrap/Form'; import ProgressBar from 'react-bootstrap/ProgressBar'; -const basePath = process.env.BASEPATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; //@ts-ignore const Profile = () => { diff --git a/cryptide_project/src/Pages/SignUpForm.tsx b/cryptide_project/src/Pages/SignUpForm.tsx index 491b21f..b1dac73 100644 --- a/cryptide_project/src/Pages/SignUpForm.tsx +++ b/cryptide_project/src/Pages/SignUpForm.tsx @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'; import AuthService from '../services/AuthService'; import '../Style/Global.css'; -const basePath = process.env.BASEPATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const SignUp = () => { From 1b27508a8d4ace226362cef7cd87874ffdc35a4d Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Tue, 5 Dec 2023 16:21:04 +0100 Subject: [PATCH 10/12] =?UTF-8?q?la=20=C3=A7a=20devrait=20vraiment=20compl?= =?UTF-8?q?=C3=A9tement=20marcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cryptide_project/src/Components/NavBar.tsx | 6 +++--- cryptide_project/src/Pages/Home.tsx | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index 6922287..bd94a74 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -52,13 +52,13 @@ function AppNavbar({changeLocale}) { diff --git a/cryptide_project/src/Pages/Home.tsx b/cryptide_project/src/Pages/Home.tsx index bc28c69..3e4d9ae 100644 --- a/cryptide_project/src/Pages/Home.tsx +++ b/cryptide_project/src/Pages/Home.tsx @@ -13,6 +13,9 @@ import { socket } from '../SocketConfig'; import JSONParser from '../JSONParser'; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; + + // @ts-ignore function Home() { const theme=useTheme(); @@ -100,7 +103,7 @@ function Home() { {/*


Kwanchai Moriya

*/} {/* */}
- Date: Tue, 5 Dec 2023 16:23:11 +0100 Subject: [PATCH 11/12] la vraiment vraiment --- cryptide_project/src/Components/GraphContainer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index 80bc4c8..f16c253 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -1019,7 +1019,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS catch(error){ console.log(error); } - navigate(`${basePath}/endgame?solo=true+${isDaily}`) + navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`) } } From 9e558d08119c3cb6e0fc0779415595b03c2a23ac Mon Sep 17 00:00:00 2001 From: Thomas CHAZOT Date: Tue, 5 Dec 2023 16:24:56 +0100 Subject: [PATCH 12/12] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'cryptide=5Fp?= =?UTF-8?q?roject/Dockerfile'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cryptide_project/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/cryptide_project/Dockerfile b/cryptide_project/Dockerfile index 591738e..64757e5 100644 --- a/cryptide_project/Dockerfile +++ b/cryptide_project/Dockerfile @@ -30,3 +30,4 @@ EXPOSE 80 # Définissez ENTRYPOINT pour démarrer Nginx lorsque le conteneur est lancé ENTRYPOINT ["nginx", "-g", "daemon off;"] +# \ No newline at end of file