Merge branch 'master' of https://codefirst.iut.uca.fr/git/Crypteam/Cryptid into playerIcon
continuous-integration/drone/push Build is failing Details

pull/99/head
Pierre Ferreira 1 year ago
commit 8cbe03043c

@ -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 ]

@ -30,3 +30,4 @@ EXPOSE 80
# Définissez ENTRYPOINT pour démarrer Nginx lorsque le conteneur est lancé
ENTRYPOINT ["nginx", "-g", "daemon off;"]
#

@ -41,8 +41,9 @@ import messagesEn from './Translations/en.json';
/* Gestion d' erreur */
import ErrorBoundary from './Error/ErrorBoundary';
import ErrorPage from './Error/ErrorPage';
import DeducCheck from './Pages/DeducCheck';
const basePath = process.env.REACT_APP_BASE_PATH || '';
const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
const messages = {
fr: messagesFr,
@ -86,7 +87,8 @@ function App() {
<Route path={`${basePath}/endgame`} element={<EndGame/>} />
<Route path={`${basePath}/game`} element={<InGame locale={locale} changeLocale={changeLocale}/>}/>
<Route path={`${basePath}/info`} element={<InfoPage locale={locale} changeLocale={changeLocale}/>} />
<Route path={`${basePath}/deduc`} element={<DeducGrid/>} />
<Route path="/deduc" element={<DeducCheck/>} />
<Route path="/TheRealDeduc" element={<DeducGrid/>} />
<Route path={`${basePath}/profile`} element={<Profile/>} />
<Route path={`${basePath}/join`} element={<Lobbies/>}/>
{/* <Route path="/solo" element={<SoloGame locale={locale} changeLocale={changeLocale} />}/> */}

@ -67,8 +67,7 @@ let cptBug = 0
let cptUseEffect = 0
let testPlayers: Player[] = []
const basePath = process.env.REACT_APP_BASE_PATH || '';
const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork, setNetworkEnigme, setPlayerIndex, askedWrong, setAskedWrong, importToPdf, setImportToPdf}) => {
let cptTour: number = 0
@ -1020,7 +1019,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
catch(error){
console.log(error);
}
navigate(`${basePath}/endgame?solo=true+${isDaily}`)
navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`)
}
}

@ -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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
const LobbyContainer: React.FC<LobbyContainerProps> = ({roomNum, HeadPlayer, nbPlayer, setFirst, started}) => {
const theme=useTheme();

@ -25,8 +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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
// @ts-ignore
function AppNavbar({changeLocale}) {
@ -53,13 +52,13 @@ function AppNavbar({changeLocale}) {
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="me-auto">
<Nav.Link href="/" style={{ color: theme.colors.text }}>
<Nav.Link href={`${basePath}/`} style={{ color: theme.colors.text }}>
Jouer
</Nav.Link>
<Nav.Link href="/presentation" style={{ color: theme.colors.text }}>
<Nav.Link href={`${basePath}/presentation`} style={{ color: theme.colors.text }}>
Présentation
</Nav.Link>
<Nav.Link href="/info" style={{ color: theme.colors.text }}>
<Nav.Link href={`${basePath}/info`} style={{ color: theme.colors.text }}>
Info
</Nav.Link>
</Nav>

@ -6,8 +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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
//@ts-ignore
function ErrorPage({ code = "", msg = "Something is wrong"}) {

@ -0,0 +1,120 @@
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';
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';
//const { actualPlayerIndex, players } = useGame();
// let playerstmp
// if (players.length == 0) playerstmp = ["1", "2", "3", "4", "5", "4"];
// else { playerstmp = players}
//* 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);
return (
<div style={{ margin: '20px', display: 'flex', flexDirection: 'column' }}>
<div style={{ display: 'flex', flexDirection: 'row', overflowX: 'auto' }}>
{/* Premier tableau */}
<Table striped bordered hover style={{ marginRight: '20px' }}>
<thead>
<tr>
<th>Indices</th>
{players.map((player, index) => (
<th key={index}>{player}</th>
))}
</tr>
</thead>
<tbody>
{firstHalfIndices.map((indice, rowIndex) => (
<tr key={rowIndex}>
<td>{indice.ToString("fr")}</td>
{players.map((player, colIndex) => (
<td key={colIndex}>
{/* <input type="checkbox"/> */}
<Form.Check aria-label="option 1" />
</td>
))}
</tr>
))}
</tbody>
</Table>
{/* Deuxième tableau */}
<Table striped bordered hover>
<thead>
<tr>
<th>Indices</th>
{players.map((player, index) => (
<th key={index}>{player}</th>
))}
</tr>
</thead>
<tbody>
{secondHalfIndices.map((indice, rowIndex) => (
<tr key={rowIndex}>
<td>{indice.ToString("fr")}</td>
{players.map((player, colIndex) => (
<td key={colIndex}>
{/* <input type="checkbox"/> */}
<Form.Check aria-label="option 1" />
</td>
))}
</tr>
))}
</tbody>
</Table>
</div>
</div>
);
}
export default DeducCheck;

@ -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() {
{/* <h3> <u><FormattedMessage id="game.illustratedBy"/></u><br/> Kwanchai Moriya</h3> */}
{/* <button>Jouer au jeu</button> */}
<br/>
<Link to="/play" className='button'
<Link to={`${basePath}/`} className='button'
style={{
backgroundColor: theme.colors.primary,
borderColor: theme.colors.secondary

@ -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;
}

@ -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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
//@ts-ignore
const InGame = ({locale, changeLocale}) => {
@ -68,7 +68,7 @@ const InGame = ({locale, changeLocale}) => {
if (cptNavigation % 2 == 0){
if (navigationType.toString() == "POP"){
socket.emit("player quit")
navigate(`${basePath}/play`)
navigate(`/${basePath}/play`)
}
}
@ -280,8 +280,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 (
<div id="mainDiv">
@ -375,12 +377,9 @@ const InGame = ({locale, changeLocale}) => {
<img src={Info} alt="info" height="40"/>
</button>
</Link>
{/* <button className='button' onClick={() => openInNewTab('http://localhost:3000/play')}> //! avec url =={'>'} dangereux
<img src={Check} alt="check" height="40"/>
</button> */}
{!IsSolo &&
<Link to='/deduc' target='_blank'>
<Link to={navdeduc} target='_blank'>
<button className='button'
style={{
backgroundColor: theme.colors.tertiary,

@ -50,8 +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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
function Lobby() {
const theme=useTheme();

@ -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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
const SignIn = () => {
const navigate = useNavigate();

@ -34,8 +34,7 @@ import Lobbies from './Lobbies';
let cptNavigation = 0
const basePath = process.env.REACT_APP_BASE_PATH || '';
const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
function NewPlay() {

@ -32,8 +32,7 @@ import Info from '../res/icon/infoGreen.png';
let cptNavigation = 0
const basePath = process.env.REACT_APP_BASE_PATH || '';
const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
function Play() {
let first = true

@ -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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
//@ts-ignore
const Profile = () => {

@ -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.REACT_APP_BASE_PATH || '/containers/Crypteam-website';
const SignUp = () => {

Loading…
Cancel
Save