15/08/23 - 20h

recette2
cherif 2023-08-15 20:04:52 +02:00
parent 98d6416539
commit 9af7f9982c
4 changed files with 232 additions and 60 deletions

View File

@ -31,6 +31,7 @@ import Box from '@mui/material/Box';
import { Typography, LinearProgress } from '@mui/material'; import { Typography, LinearProgress } from '@mui/material';
import styled from 'styled-components'; import styled from 'styled-components';
import { CiTrash } from "react-icons/ci"; import { CiTrash } from "react-icons/ci";
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
const DisplayPartnerSession = (props) => { const DisplayPartnerSession = (props) => {
const history = useHistory(); const history = useHistory();
@ -93,11 +94,11 @@ const DisplayPartnerSession = (props) => {
borderRadius: "2px", borderRadius: "2px",
backgroundColor: " #ebf5fb", backgroundColor: " #ebf5fb",
"& .MuiLinearProgress-bar": { "& .MuiLinearProgress-bar": {
backgroundColor: "#1bd900", backgroundColor: "#1bd900",
transition: "none", transition: "none",
transformOrigin: "left", transformOrigin: "left",
}, },
})); }));
const columns = [ const columns = [
{ field: 'id', headerName: 'id', hide: true }, { field: 'id', headerName: 'id', hide: true },
@ -152,12 +153,12 @@ const DisplayPartnerSession = (props) => {
color="success" color="success"
sx={{ color: "#1bd900" }} sx={{ color: "#1bd900" }}
variant="determinate" variant="determinate"
value={(params?.row.taux_replissage*100).toFixed(2)} value={(params?.row.taux_replissage * 100).toFixed(2)}
/> />
<Typography <Typography
variant="body2" variant="body2"
color="text.secondary" color="text.secondary"
>{`${(params?.row.taux_replissage*100).toFixed(0)}%`}</Typography> >{`${(params?.row.taux_replissage * 100).toFixed(0)}%`}</Typography>
</> </>
); );
}, },
@ -311,7 +312,7 @@ const DisplayPartnerSession = (props) => {
handleClick_refuse(event, cellValues); handleClick_refuse(event, cellValues);
}} }}
> >
<FcCancel /> <FcCancel />
</Button>} </Button>}
modal modal
@ -375,7 +376,7 @@ const DisplayPartnerSession = (props) => {
handleClick_delete(event, cellValues); handleClick_delete(event, cellValues);
}} }}
> >
<CiTrash /> <CiTrash />
</Button>} </Button>}
modal modal
@ -514,12 +515,12 @@ const DisplayPartnerSession = (props) => {
var filtre3_value = ""; var filtre3_value = "";
// Recuperation des valeurs de filtres // Recuperation des valeurs de filtres
if (filtre1) { if (p_filtre1_value ) {
filtre1_value = p_filtre1_value; filtre1_value = p_filtre1_value;
form.append(filtre1, filtre1_value); form.append(filtre1, filtre1_value);
} }
if (filtre2) { if (p_filtre2_value ) {
filtre2_value = p_filtre2_value; filtre2_value = p_filtre2_value;
form.append(filtre2, filtre2_value); form.append(filtre2, filtre2_value);
} }
@ -534,7 +535,7 @@ const DisplayPartnerSession = (props) => {
// Verification s'il faut faire une recherche avec une option like. // Verification s'il faut faire une recherche avec une option like.
//console.log(" p_filtre1 = ", p_filtre1, " filtre1_value = ", filtre1_value); //console.log(" p_filtre1 = ", p_filtre1, " filtre1_value = ", filtre1_value);
if (filtre1 && String(filtre1_value) !== "") { if (p_filtre1_value || p_filtre2_value) {
myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List_filter_like/"; myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List_filter_like/";
} }
@ -561,6 +562,40 @@ const DisplayPartnerSession = (props) => {
} }
function Getall_TrainingSession_no_filter(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_TrainingSession res.data.status = " + res.data.status);
//console.log(" In Getall_TrainingSession res.data.message r_class = " + res.data.message);
setGetall_TrainingSession_api("true");
setGetall_TrainingSession_result(res.data.message);
setRows(res.data.message);
}
else {
setGetall_TrainingSession_api("false");
setGetall_TrainingSession_message(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_TrainingSession = ', error);
setGetall_TrainingSession_api("false");
//setmyApimyApiMessage("")
})
}
const [Edite_session, setEdite_session] = useState(); const [Edite_session, setEdite_session] = useState();
/* Envoi de l'envoi de l'email de confirmation de la validation de l'inscription */ /* Envoi de l'envoi de l'email de confirmation de la validation de l'inscription */
@ -3558,7 +3593,7 @@ const DisplayPartnerSession = (props) => {
setp_filtre2(); setp_filtre2();
setp_filtre2_value(); setp_filtre2_value();
Getall_TrainingSession(); Getall_TrainingSession_no_filter();
} }
@ -3585,8 +3620,11 @@ const DisplayPartnerSession = (props) => {
</TextField> </TextField>
</div> </div>
<div className="div_row_droite texte_area_filter" >
{!!p_filtre1 &&
<div className="div_row_droite texte_area_filter_value" >
{p_filtre1 &&
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required required
@ -3606,18 +3644,39 @@ const DisplayPartnerSession = (props) => {
<AiFillCloseCircle <AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }} style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => { onClick={(e) => {
setp_filtre1(); setp_filtre1_value("");
setp_filtre1_value();
}} /> }} />
</InputAdornment> </InputAdornment>
), ),
}} }}
/>} />
}
</div> </div>
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline onClick={(e) => {
setp_filtre2("1");
}} />
</a>
</div>}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
}}
/>
</a>
</div>}
</div> </div>
{!!p_filtre1_value && {p_filtre2 &&
<div className="div_row" style={{ "marginBottom": "5px" }}> <div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter"> <div className="div_row_gauche texte_area_filter">
<TextField <TextField
@ -3638,7 +3697,7 @@ const DisplayPartnerSession = (props) => {
</TextField> </TextField>
</div> </div>
<div className="div_row_droite texte_area_filter" > <div className="div_row_droite texte_area_filter" >
{!!p_filtre1 && {String(p_filtre2).length > 3 &&
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required required
@ -3658,8 +3717,7 @@ const DisplayPartnerSession = (props) => {
<AiFillCloseCircle <AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }} style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => { onClick={(e) => {
setp_filtre2(); setp_filtre2_value("");
setp_filtre2_value();
}} /> }} />
</InputAdornment> </InputAdornment>
), ),
@ -3667,8 +3725,25 @@ const DisplayPartnerSession = (props) => {
/>} />}
</div> </div>
{String(p_filtre2).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
}}
/>
</a>
</div>}
</div> </div>
} }
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}> {<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}> <div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>

View File

@ -18,11 +18,13 @@ import { useHistory } from "react-router-dom";
import axios from "axios"; import axios from "axios";
import { CiCoffeeBean, CiDesktop, CiFileOff } from "react-icons/ci"; import { CiCoffeeBean, CiDesktop, CiFileOff } from "react-icons/ci";
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
import { LuScreenShare, LuScreenShareOff } from "react-icons/lu"; import { LuScreenShare, LuScreenShareOff } from "react-icons/lu";
import MenuItem from '@mui/material/MenuItem'; import MenuItem from '@mui/material/MenuItem';
import InputAdornment from '@mui/material/InputAdornment'; import InputAdornment from '@mui/material/InputAdornment';
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
const DistplayPartnerTraningsPage = (props) => { const DistplayPartnerTraningsPage = (props) => {
@ -149,11 +151,7 @@ const DistplayPartnerTraningsPage = (props) => {
form.append(filtre3, filtre3_value); form.append(filtre3, filtre3_value);
} }
//console.log(" filtres1 = " + filtre1 + " = " + filtre1_value);
//console.log(" filtres2 = " + filtre2 + " = " + filtre2_value);
//console.log(" filtres3 = " + filtre3 + " = " + filtre3_value);
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart'); const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie); form.append("token", stored_cookie);
@ -771,9 +769,7 @@ const DistplayPartnerTraningsPage = (props) => {
setp_filtre3(); setp_filtre3();
setp_filtre3_value(); setp_filtre3_value();
GetAllClass_new_no_filter(); GetAllClass_new_no_filter();
} }
@ -820,8 +816,8 @@ const DistplayPartnerTraningsPage = (props) => {
</TextField> </TextField>
</div> </div>
<div className="div_row_droite texte_area_filter" > <div className="div_row_droite texte_area_filter_value" >
{!!p_filtre1 && {p_filtre1 &&
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required required
@ -841,20 +837,39 @@ const DistplayPartnerTraningsPage = (props) => {
<AiFillCloseCircle <AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }} style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => { onClick={(e) => {
setp_filtre1(); setp_filtre1_value("");
setp_filtre1_value();
}} /> }} />
</InputAdornment> </InputAdornment>
), ),
}} }}
/>} />
}
</div> </div>
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline onClick={(e) => {
setp_filtre2("1");
}} />
</a>
</div>}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
}}
/>
</a>
</div>}
</div> </div>
{!!p_filtre1_value && {p_filtre2 &&
<div className="div_row" style={{ "marginBottom": "5px" }}> <div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter"> <div className="div_row_gauche texte_area_filter">
<TextField <TextField
@ -875,8 +890,8 @@ const DistplayPartnerTraningsPage = (props) => {
</TextField> </TextField>
</div> </div>
<div className="div_row_droite texte_area_filter" > <div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
{!!p_filtre1 && {String(p_filtre2).length > 3 &&
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required required
@ -896,8 +911,7 @@ const DistplayPartnerTraningsPage = (props) => {
<AiFillCloseCircle <AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }} style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => { onClick={(e) => {
setp_filtre2(); setp_filtre2_value("");
setp_filtre2_value();
}} /> }} />
</InputAdornment> </InputAdornment>
), ),
@ -905,10 +919,35 @@ const DistplayPartnerTraningsPage = (props) => {
/>} />}
</div> </div>
{String(p_filtre2).length > 3 && <div className='filter_bton_add' >
<Tooltip id="my-tooltip03" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip03" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline
onClick={(e) => {
setp_filtre3("1");
}}
/>
</a>
</div>}
{String(p_filtre2).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
}}
/>
</a>
</div>}
</div> </div>
} }
{!!p_filtre2_value &&
{p_filtre3 &&
<div className="div_row" style={{ "marginBottom": "5px" }}> <div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter"> <div className="div_row_gauche texte_area_filter">
<TextField <TextField
@ -929,8 +968,8 @@ const DistplayPartnerTraningsPage = (props) => {
</TextField> </TextField>
</div> </div>
<div className="div_row_droite texte_area_filter" > <div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
{!!p_filtre2 && {String(p_filtre3).length > 3 &&
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required required
@ -950,8 +989,7 @@ const DistplayPartnerTraningsPage = (props) => {
<AiFillCloseCircle <AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }} style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => { onClick={(e) => {
setp_filtre3(); setp_filtre3_value("");
setp_filtre3_value();
}} /> }} />
</InputAdornment> </InputAdornment>
), ),
@ -959,6 +997,16 @@ const DistplayPartnerTraningsPage = (props) => {
/>} />}
</div> </div>
{String(p_filtre3).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip05" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip05" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre3();
setp_filtre3_value();
}} />
</a>
</div>}
</div> </div>
} }
@ -1003,12 +1051,12 @@ const DistplayPartnerTraningsPage = (props) => {
'& .line--published': { '& .line--published': {
backgroundColor: '#E6F7C8', backgroundColor: '#E6F7C8',
color: 'black', color: 'black',
}, },
'& .line--unpublished': { '& .line--unpublished': {
backgroundColor: '#FAD7A0', backgroundColor: '#FAD7A0',
color: 'black', color: 'black',
}, },
}} }}
> >
<DataGrid <DataGrid
@ -1046,22 +1094,22 @@ const DistplayPartnerTraningsPage = (props) => {
}} }}
getCellClassName={(params) => { getCellClassName={(params) => {
if (params.field === 'published' && String(params.value) === "1") { if (params.field === 'published' && String(params.value) === "1") {
return 'cell--published'; return 'cell--published';
} }
if (params.field === "published" && String(params.value) !== "1") { if (params.field === "published" && String(params.value) !== "1") {
return 'cell--unpublished' return 'cell--unpublished'
} }
}} }}
getRowClassName={(params) => { getRowClassName={(params) => {
if (String(params.row.published) === "1") { if (String(params.row.published) === "1") {
return 'line--published'; return 'line--published';
} }
if (String(params.row.published) !== "1") { if (String(params.row.published) !== "1") {
return 'line--unpublished'; return 'line--unpublished';
} }
}} }}
/> />

View File

@ -1392,7 +1392,7 @@
.css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input {
padding: 1px !important; padding: 1px !important;
} }
.selectsession { .selectsession {
width: 90%; width: 90%;
@ -1711,13 +1711,37 @@
.texte_area_filter { .texte_area_filter {
float: left; float: left;
width: 47% !important; width: 40% !important;
font-size: x-small !important; font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif; font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important; margin: 0.4rem !important;
margin-top: 0px !important; margin-top: 0px !important;
margin-bottom: 2px !important; margin-bottom: 2px !important;
} }
.texte_area_filter_value {
float: left !important;
width: 40% !important;
font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
}
.filter_bton_add {
float: left;
width: 5% !important;
font-size: xx-large !important;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
text-align: right;
cursor: pointer;
}
.titre1 { .titre1 {
font-family: "Quicksand", "Signika", sans-serif; font-family: "Quicksand", "Signika", sans-serif;

View File

@ -805,7 +805,7 @@
.texte_area_filter { .texte_area_filter {
float: left; float: left;
width: 47% !important; width: 40% !important;
font-size: x-small !important; font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif; font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important; margin: 0.4rem !important;
@ -813,6 +813,30 @@
margin-bottom: 2px !important; margin-bottom: 2px !important;
} }
.texte_area_filter_value {
float: left !important;
width: 40% !important;
font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
}
.filter_bton_add {
float: left;
width: 5% !important;
font-size: xx-large !important;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
text-align: right;
cursor: pointer;
}
.div_row { .div_row {
float: left; float: left;
//border: 1px solid black; //border: 1px solid black;
@ -904,6 +928,7 @@
border-radius: 5px; border-radius: 5px;
background: white; background: white;
border: solid gainsboro 1px; border: solid gainsboro 1px;
padding-top: 0.5rem !important;
} }
.training_caract { .training_caract {