fix /
continuous-integration/drone/push Build is passing Details

master
Thomas Chazot 1 year ago
parent 450123404e
commit 53ac430987

@ -89,19 +89,19 @@ function App() {
{hasNavbarVisible && <AppNavbar changeLocale={changeLocale} locale={locale} />} {hasNavbarVisible && <AppNavbar changeLocale={changeLocale} locale={locale} />}
<Routes> <Routes>
<Route path={`${basePath}/`} element={<NewPlay/>} /> <Route path={``} element={<NewPlay/>} />
<Route path={`${basePath}/login`} element={<Login />} /> <Route path={`login`} element={<Login />} />
<Route path={`${basePath}/signup`} element={<SignUp />} /> <Route path={`signup`} element={<SignUp />} />
<Route path={`${basePath}/presentation`} element={<Home />} /> <Route path={`presentation`} element={<Home />} />
<Route path={`${basePath}/lobby`} element={<Lobby/>} /> <Route path={`lobby`} element={<Lobby/>} />
<Route path={`${basePath}/endgame`} element={<EndGame lang={locale}/>} /> <Route path={`endgame`} element={<EndGame lang={locale}/>} />
<Route path={`${basePath}/game`} element={<InGame locale={locale} changeLocale={changeLocale}/>}/> <Route path={`game`} element={<InGame locale={locale} changeLocale={changeLocale}/>}/>
<Route path={`${basePath}/info`} element={<InfoPage locale={locale} changeLocale={changeLocale}/>} /> <Route path={`info`} element={<InfoPage locale={locale} changeLocale={changeLocale}/>} />
<Route path={`${basePath}/tutorial`} element={<Tutorial locale={locale} changeLocale={changeLocale}/>} /> <Route path={`tutorial`} element={<Tutorial locale={locale} changeLocale={changeLocale}/>} />
<Route path={`${basePath}/deduc`} element={<DeducCheck lang={locale}/>} /> <Route path={`deduc`} element={<DeducCheck lang={locale}/>} />
<Route path={`${basePath}/TheRealDeduc`} element={<DeducGrid/>} /> <Route path={`TheRealDeduc`} element={<DeducGrid/>} />
<Route path={`${basePath}/profile`} element={<Profile/>} /> <Route path={`profile`} element={<Profile/>} />
<Route path={`${basePath}/join`} element={<Lobbies/>}/> <Route path={`join`} element={<Lobbies/>}/>
{/* <Route path="/solo" element={<SoloGame locale={locale} changeLocale={changeLocale} />}/> */} {/* <Route path="/solo" element={<SoloGame locale={locale} changeLocale={changeLocale} />}/> */}
<Route path="*" element={<ErrorPage code="404" msg='not found' />} /> {/* page 404 */} <Route path="*" element={<ErrorPage code="404" msg='not found' />} /> {/* page 404 */}

@ -17,7 +17,7 @@ function BigButtonNav({ dest, img}) {
// }; // };
return ( return (
<Link to={`${basePath}/${dest}`} className="link-without-underline"> <Link to={`${dest}`} className="link-without-underline">
<button className='bigbuttonNabImg' style={{ backgroundColor: theme.colors.primary }}> <button className='bigbuttonNabImg' style={{ backgroundColor: theme.colors.primary }}>
<img src={img} alt="Button Image" height="100" width="100"/> <img src={img} alt="Button Image" height="100" width="100"/>
</button> </button>

@ -11,7 +11,7 @@ import {basePath} from "../AdressSetup"
function ButtonImgNav({ dest, img, text = "" }) { function ButtonImgNav({ dest, img, text = "" }) {
const theme = useTheme(); const theme = useTheme();
return ( return (
<Link to={`${basePath}/${dest}`} className="link-without-underline"> {/*target='_blank' ==> ouvre un nouvelle onglet*/ } <Link to={`${dest}`} className="link-without-underline"> {/*target='_blank' ==> ouvre un nouvelle onglet*/ }
<button className='buttonNabImg' style={{ backgroundColor: theme.colors.primary, color: theme.colors.secondary}}> <button className='buttonNabImg' style={{ backgroundColor: theme.colors.primary, color: theme.colors.secondary}}>
<img src={img} alt="Button Image" height="50" width="50"/> <img src={img} alt="Button Image" height="50" width="50"/>
<p>{text}</p> <p>{text}</p>

@ -939,7 +939,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
socket.off("asked") socket.off("asked")
socket.off("who plays") socket.off("who plays")
navigate(`${basePath}/endgame`) navigate(`endgame`)
} }
} }
}) })
@ -1137,12 +1137,12 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
testFirst = true testFirst = true
setElapsedTime(0) setElapsedTime(0)
endgame = true endgame = true
navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`) navigate(`endgame?solo=true&daily=${isDaily}`)
} }
catch(error){ catch(error){
console.log(error); console.log(error);
} }
navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`) navigate(`endgame?solo=true&daily=${isDaily}`)
} }
else{ else{
if (isDaily){ if (isDaily){
@ -1157,7 +1157,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
changecptTour(cptTour); // On le transmet a la page précédente avec la fonction changecptTour(cptTour); // On le transmet a la page précédente avec la fonction
} }
else{ else{
navigate(`${basePath}/endgame?solo=true&daily=true`) navigate(`endgame?solo=true&daily=true`)
setNetworkDataData(networkData) setNetworkDataData(networkData)
setWinnerData(null) setWinnerData(null)
} }

@ -49,7 +49,7 @@ const LobbyContainer: React.FC<LobbyContainerProps> = ({roomNum, HeadPlayer, nbP
if (nbPlayer < 6 && !started) { if (nbPlayer < 6 && !started) {
socket.off("request lobbies") socket.off("request lobbies")
setFirst(true) setFirst(true)
navigate(`${basePath}/${dest}`); navigate(`${dest}`);
} }
else if(started){ else if(started){
handleShowStart() handleShowStart()

@ -37,15 +37,15 @@ function AppNavbar({changeLocale, locale}) {
const {isLoggedIn, login, user, setUserData, manager } = useAuth(); const {isLoggedIn, login, user, setUserData, manager } = useAuth();
function navigateToProfile(){ function navigateToProfile(){
navigate(`${basePath}/profile`) navigate(`profile`)
} }
function navigateToLogin(){ function navigateToLogin(){
navigate(`${basePath}/login`) navigate(`login`)
} }
function navigateToHome(){ function navigateToHome(){
navigate(`${basePath}/`) navigate(``)
} }
return ( return (
@ -57,13 +57,13 @@ function AppNavbar({changeLocale, locale}) {
<Navbar.Toggle aria-controls="basic-navbar-nav" /> <Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav"> <Navbar.Collapse id="basic-navbar-nav">
<Nav className="me-auto"> <Nav className="me-auto">
<Nav.Link href={`${basePath}/`} style={{ color: theme.colors.text }}> <Nav.Link href={``} style={{ color: theme.colors.text }}>
<FormattedMessage id="navbar.play" /> <FormattedMessage id="navbar.play" />
</Nav.Link> </Nav.Link>
<Nav.Link href={`${basePath}/presentation`} style={{ color: theme.colors.text }}> <Nav.Link href={`presentation`} style={{ color: theme.colors.text }}>
<FormattedMessage id="navbar.presentation" /> <FormattedMessage id="navbar.presentation" />
</Nav.Link> </Nav.Link>
<Nav.Link href={`${basePath}/info`} style={{ color: theme.colors.text }}> <Nav.Link href={`info`} style={{ color: theme.colors.text }}>
<FormattedMessage id="navbar.info" /> <FormattedMessage id="navbar.info" />
</Nav.Link> </Nav.Link>
</Nav> </Nav>

@ -305,7 +305,7 @@ const TutorialGraph: React.FC<TutorialGraphProps> = ({showLast, setNetwork, setP
setPlayerTouched(-1) setPlayerTouched(-1)
setWinnerData(winner) setWinnerData(winner)
first = true first = true
navigate(`${basePath}/endgame`) navigate(`endgame`)
} }
} }
} }

@ -28,7 +28,7 @@ function ErrorPage({ code = "", msg = "Something is wrong"}) {
</div> </div>
<div className='centerDivH' style={{margin: "20px"}}> <div className='centerDivH' style={{margin: "20px"}}>
<Button href={`${basePath}/`} variant='danger'><FormattedMessage id='BackHome'/></Button> <Button href={``} variant='danger'><FormattedMessage id='BackHome'/></Button>
</div> </div>
</div> </div>
); );

@ -181,7 +181,7 @@ function EndGame({lang}: {lang: string}) {
</Row> </Row>
<Row className="justify-content-md-center"> <Row className="justify-content-md-center">
<Button href={`${basePath}/`} style={{ <Button href={``} style={{
width:"50%", width:"50%",
margin:"10px" margin:"10px"
}}>Retour à l'accueil</Button> }}>Retour à l'accueil</Button>
@ -259,7 +259,7 @@ function EndGame({lang}: {lang: string}) {
<Row className="justify-content-md-center"> <Row className="justify-content-md-center">
<Button href={`${basePath}/`} style={{ <Button href={``} style={{
width:"50%", width:"50%",
margin:"10px" margin:"10px"
}}>Retour à l'accueil</Button> }}>Retour à l'accueil</Button>
@ -322,7 +322,7 @@ function EndGame({lang}: {lang: string}) {
</Row> </Row>
<Row className='justify-content-center'> <Row className='justify-content-center'>
<Button href={`${basePath}/`} style={{ <Button href={``} style={{
width:"50%", width:"50%",
margin:"10px" margin:"10px"
}}>Retour à l'accueil</Button> }}>Retour à l'accueil</Button>

@ -83,7 +83,7 @@ function Home() {
Si un joueur place un jeton carré, le questionneur doit également jouer son jeu en plaçant un jeton carré de sa couleur sur un nœud du graphique. La contre-manipulation devient ainsi une arme redoutable pour détourner l'accusation et semer la confusion. Pour en savoir plus, plongez-vous dans les détails de ce passionnant récit sur une autre page. Si un joueur place un jeton carré, le questionneur doit également jouer son jeu en plaçant un jeton carré de sa couleur sur un nœud du graphique. La contre-manipulation devient ainsi une arme redoutable pour détourner l'accusation et semer la confusion. Pour en savoir plus, plongez-vous dans les détails de ce passionnant récit sur une autre page.
</p> </p>
<h5>Pour des informations plus détaillées, consulter les <Link to={`${basePath}/info`}>règles</Link>.</h5> <h5>Pour des informations plus détaillées, consulter les <Link to={`info`}>règles</Link>.</h5>
<hr/> <hr/>
</div> </div>
@ -116,7 +116,7 @@ function Home() {
{/* <button>Jouer au jeu</button> */} {/* <button>Jouer au jeu</button> */}
<br/> <br/>
<Link to={`${basePath}/`} className='button' <Link to={``} className='button'
style={{ style={{
backgroundColor: theme.colors.primary, backgroundColor: theme.colors.primary,
borderColor: theme.colors.secondary borderColor: theme.colors.secondary

@ -73,7 +73,7 @@ const InGame = ({locale, changeLocale}) => {
if (cptNavigation % 2 == 0){ if (cptNavigation % 2 == 0){
if (navigationType.toString() == "POP"){ if (navigationType.toString() == "POP"){
socket.emit("player quit") socket.emit("player quit")
navigate(`${basePath}/`) navigate(``)
} }
} }
@ -513,7 +513,7 @@ const handleBlurIndice = () => {
{/* <Link to='/info#indice-possible' target='_blank'> {/* <Link to='/info#indice-possible' target='_blank'>
//? redirection impossible apparament (securité des navigateur //? redirection impossible apparament (securité des navigateur
*/} */}
<Link to={`${basePath}/info`} target='_blank'> <Link to={`info`} target='_blank'>
<button className='button' <button className='button'
style={{ style={{
backgroundColor: theme.colors.tertiary, backgroundColor: theme.colors.tertiary,
@ -524,7 +524,7 @@ const handleBlurIndice = () => {
</Link> </Link>
{!IsSolo && {!IsSolo &&
<Link to={`${basePath}/${navdeduc}`} target='_blank'> <Link to={`${navdeduc}`} target='_blank'>
<button className='button' <button className='button'
style={{ style={{
backgroundColor: theme.colors.tertiary, backgroundColor: theme.colors.tertiary,
@ -650,7 +650,7 @@ const handleBlurIndice = () => {
<div className='centerDivH' style={{margin: "20px"}}> <div className='centerDivH' style={{margin: "20px"}}>
<Button variant="outline-warning" onClick={() => {setHistory([]); changeGraph(enteredNumber, enteredNumberIndices)}}><FormattedMessage id='regenerate'/></Button> <Button variant="outline-warning" onClick={() => {setHistory([]); changeGraph(enteredNumber, enteredNumberIndices)}}><FormattedMessage id='regenerate'/></Button>
</div> </div>
<Button variant="outline-danger" href={`${basePath}/`}><FormattedMessage id='BackHome'/></Button> <Button variant="outline-danger" href={``}><FormattedMessage id='BackHome'/></Button>
</div> </div>
</Offcanvas.Body> </Offcanvas.Body>
</Offcanvas> </Offcanvas>

@ -144,7 +144,7 @@ function Lobby() {
gameStarted = true gameStarted = true
//socket.off("player left") //socket.off("player left")
//socket.off("new player") //socket.off("new player")
navigate(`${basePath}/game?solo=false&daily=false`); navigate(`game?solo=false&daily=false`);
}); });
@ -181,7 +181,7 @@ function Lobby() {
setGameStartData(true) setGameStartData(true)
first = true first = true
gameStarted = true gameStarted = true
navigate(`${basePath}/game?solo=false&daily=false`) navigate(`game?solo=false&daily=false`)
}); });
socket.on("new player", (tab) =>{ socket.on("new player", (tab) =>{
@ -194,15 +194,15 @@ function Lobby() {
}); });
socket.on("room full", () => { socket.on("room full", () => {
navigate(`${basePath}/`) navigate(``)
}) })
socket.on("game started", () => { socket.on("game started", () => {
navigate(`${basePath}/`) navigate(``)
}) })
socket.on("game already started", () => { socket.on("game already started", () => {
navigate(`${basePath}/`) navigate(``)
}) })
socket.on("player left", (tab, i) => { socket.on("player left", (tab, i) => {

@ -37,7 +37,7 @@ const SignIn = () => {
setShowConfirmation(true); setShowConfirmation(true);
setTimeout(async () => { setTimeout(async () => {
await login(); await login();
navigate(`${basePath}/`); navigate(``);
}, 1250); }, 1250);
} }
} catch (error: any) { } catch (error: any) {
@ -80,7 +80,7 @@ const SignIn = () => {
</button> </button>
</div> </div>
<p className="forgot-password text-right"> <p className="forgot-password text-right">
<Link to={`${basePath}/signup`}>Pas encore inscrit ?</Link> <Link to={`signup`}>Pas encore inscrit ?</Link>
</p> </p>
</form> </form>

@ -102,7 +102,7 @@ function NewPlay() {
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
setGameStartData(true) setGameStartData(true)
navigate(`${basePath}/game?solo=true&daily=false`); navigate(`game?solo=true&daily=false`);
} }
@ -115,7 +115,7 @@ function NewPlay() {
} }
function launchTuto(){ function launchTuto(){
navigate(`${basePath}/tutorial`); navigate(`tutorial`);
} }
@ -142,7 +142,7 @@ function NewPlay() {
}, [room, navigate]); }, [room, navigate]);
const goBack = () => { const goBack = () => {
navigate(`${basePath}/lobby?room=${goBackRoom}`) navigate(`lobby?room=${goBackRoom}`)
} }
@ -165,7 +165,7 @@ function NewPlay() {
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
setGameStartData(true) setGameStartData(true)
navigate(`${basePath}/game?solo=true&daily=true&difficulty=easy`); navigate(`game?solo=true&daily=true&difficulty=easy`);
setShowOverlay(false); setShowOverlay(false);
}; };
@ -180,7 +180,7 @@ function NewPlay() {
setGameStartData(true) setGameStartData(true)
navigate(`${basePath}/game?solo=true&daily=true&difficulty=intermediate`); navigate(`game?solo=true&daily=true&difficulty=intermediate`);
if (first){ if (first){
first = false first = false
const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice()) const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice())
@ -203,7 +203,7 @@ function NewPlay() {
const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice()) const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice())
setDailyEnigmeData(map) setDailyEnigmeData(map)
} }
navigate(`${basePath}/game?solo=true&daily=true&difficulty=hard`); navigate(`game?solo=true&daily=true&difficulty=hard`);
setShowOverlay(false); setShowOverlay(false);
}; };

@ -100,7 +100,7 @@ function Play() {
setPersonNetworkData(networkPerson) setPersonNetworkData(networkPerson)
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
navigate(`${basePath}/game?solo=true&daily=false`); navigate(`game?solo=true&daily=false`);
} }
@ -136,7 +136,7 @@ function Play() {
}, [room, navigate]); }, [room, navigate]);
const goBack = () => { const goBack = () => {
navigate(`${basePath}/lobby?room=${goBackRoom}`) navigate(`lobby?room=${goBackRoom}`)
} }
@ -159,7 +159,7 @@ function Play() {
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
setIndicesData(choosenIndices) setIndicesData(choosenIndices)
navigate(`${basePath}/game?solo=true&daily=true&easy=true`); navigate(`game?solo=true&daily=true&easy=true`);
setShowOverlay(false); setShowOverlay(false);
}; };
@ -177,7 +177,7 @@ function Play() {
const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice()) const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice())
setDailyEnigmeData(map) setDailyEnigmeData(map)
} }
navigate(`${basePath}/game?solo=true&daily=true&easy=false`); navigate(`game?solo=true&daily=true&easy=false`);
setShowOverlay(false); setShowOverlay(false);
}; };
@ -240,7 +240,7 @@ function Play() {
<button onClick={createLobby} className="ButtonNav" style={{backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary}}> Créer une partie </button> <button onClick={createLobby} className="ButtonNav" style={{backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary}}> Créer une partie </button>
<button onClick= {() => navigate(`${basePath}/join`)} className="ButtonNav" style={{backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary}}> Rejoindre </button> <button onClick= {() => navigate(`join`)} className="ButtonNav" style={{backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary}}> Rejoindre </button>
</div> </div>
</div> </div>
<div className='rightContainer'> <div className='rightContainer'>

@ -48,7 +48,7 @@ const Profile = () => {
const handleLogout = () => { const handleLogout = () => {
logout(); logout();
navigate(`${basePath}/`); navigate(``);
}; };
// @ts-ignore // @ts-ignore
@ -200,7 +200,7 @@ const Profile = () => {
} }
handleCloseDeleteModal(); handleCloseDeleteModal();
navigate(`${basePath}/`) navigate(``)
} else { } else {
console.error('Phrase de confirmation incorrecte.'); console.error('Phrase de confirmation incorrecte.');

@ -34,7 +34,7 @@ const SignUp = () => {
setShowConfirmation(true); setShowConfirmation(true);
setTimeout(() => { setTimeout(() => {
navigate(`${basePath}/login`); // 3 secondes avant de rediriger vers la page de connexion navigate(`login`); // 3 secondes avant de rediriger vers la page de connexion
}, 1250); }, 1250);
} }
} catch (error: any) { } catch (error: any) {
@ -91,7 +91,7 @@ const SignUp = () => {
</button> </button>
</div> </div>
<p className="forgot-password text-right"> <p className="forgot-password text-right">
Vous avez déjà un <a href={`${basePath}/login`}>compte</a> ? Vous avez déjà un <a href={`login`}>compte</a> ?
</p> </p>
</form> </form>

@ -82,7 +82,7 @@ const Tutorial = ({locale, changeLocale}) => {
if (cptNavigation % 2 == 0){ if (cptNavigation % 2 == 0){
if (navigationType.toString() == "POP"){ if (navigationType.toString() == "POP"){
socket.emit("player quit") socket.emit("player quit")
navigate(`${basePath}/`) navigate(``)
} }
} }
@ -365,7 +365,7 @@ const Tutorial = ({locale, changeLocale}) => {
<Button variant="primary" onClick={handleShowHelp}> <Button variant="primary" onClick={handleShowHelp}>
<FormattedMessage id='aide'/> <FormattedMessage id='aide'/>
</Button> </Button>
<Link to={`${basePath}/info`} target='_blank'> <Link to={`info`} target='_blank'>
<button className='button' <button className='button'
style={{ style={{
backgroundColor: theme.colors.tertiary, backgroundColor: theme.colors.tertiary,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save