diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 113b9b2..edd53c1 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -31,6 +31,7 @@ import Box from '@mui/material/Box'; import { Typography, LinearProgress } from '@mui/material'; import styled from 'styled-components'; import { CiTrash } from "react-icons/ci"; +import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; const DisplayPartnerSession = (props) => { const history = useHistory(); @@ -93,11 +94,11 @@ const DisplayPartnerSession = (props) => { borderRadius: "2px", backgroundColor: " #ebf5fb", "& .MuiLinearProgress-bar": { - backgroundColor: "#1bd900", - transition: "none", + backgroundColor: "#1bd900", + transition: "none", transformOrigin: "left", - }, - })); + }, + })); const columns = [ { field: 'id', headerName: 'id', hide: true }, @@ -152,12 +153,12 @@ const DisplayPartnerSession = (props) => { color="success" sx={{ color: "#1bd900" }} variant="determinate" - value={(params?.row.taux_replissage*100).toFixed(2)} + value={(params?.row.taux_replissage * 100).toFixed(2)} /> {`${(params?.row.taux_replissage*100).toFixed(0)}%`} + >{`${(params?.row.taux_replissage * 100).toFixed(0)}%`} ); }, @@ -311,7 +312,7 @@ const DisplayPartnerSession = (props) => { handleClick_refuse(event, cellValues); }} > - + } modal @@ -375,7 +376,7 @@ const DisplayPartnerSession = (props) => { handleClick_delete(event, cellValues); }} > - + } modal @@ -514,12 +515,12 @@ const DisplayPartnerSession = (props) => { var filtre3_value = ""; // Recuperation des valeurs de filtres - if (filtre1) { + if (p_filtre1_value ) { filtre1_value = p_filtre1_value; form.append(filtre1, filtre1_value); } - if (filtre2) { + if (p_filtre2_value ) { filtre2_value = p_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. //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/"; } @@ -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(); /* 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_value(); - Getall_TrainingSession(); + Getall_TrainingSession_no_filter(); } @@ -3585,8 +3620,11 @@ const DisplayPartnerSession = (props) => { -
- {!!p_filtre1 && + + + +
+ {p_filtre1 && { { - setp_filtre1(); - setp_filtre1_value(); + setp_filtre1_value(""); }} /> ), }} - />} + /> + + }
+ {p_filtre1 && } + {p_filtre1 && } + +
- {!!p_filtre1_value && + {p_filtre2 &&
{
- {!!p_filtre1 && + {String(p_filtre2).length > 3 && { { - setp_filtre2(); - setp_filtre2_value(); + setp_filtre2_value(""); }} /> ), @@ -3667,8 +3725,25 @@ const DisplayPartnerSession = (props) => { />}
+ + + {String(p_filtre2).length > 3 && }
} + + + + {
diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index d121762..9db5a53 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -18,11 +18,13 @@ import { useHistory } from "react-router-dom"; import axios from "axios"; import { CiCoffeeBean, CiDesktop, CiFileOff } from "react-icons/ci"; 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 MenuItem from '@mui/material/MenuItem'; import InputAdornment from '@mui/material/InputAdornment'; import Box from '@mui/material/Box'; +import 'react-tooltip/dist/react-tooltip.css' +import { Tooltip } from 'react-tooltip' const DistplayPartnerTraningsPage = (props) => { @@ -149,11 +151,7 @@ const DistplayPartnerTraningsPage = (props) => { 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'); form.append("token", stored_cookie); @@ -771,9 +769,7 @@ const DistplayPartnerTraningsPage = (props) => { setp_filtre3(); setp_filtre3_value(); - GetAllClass_new_no_filter(); - } @@ -820,8 +816,8 @@ const DistplayPartnerTraningsPage = (props) => {
-
- {!!p_filtre1 && +
+ {p_filtre1 && { { - setp_filtre1(); - setp_filtre1_value(); + setp_filtre1_value(""); }} /> ), }} - />} + /> + } +
+ {p_filtre1 && } + {p_filtre1 && }
- {!!p_filtre1_value && + {p_filtre2 &&
{
-
- {!!p_filtre1 && +
+ {String(p_filtre2).length > 3 && { { - setp_filtre2(); - setp_filtre2_value(); + setp_filtre2_value(""); }} /> ), @@ -905,10 +919,35 @@ const DistplayPartnerTraningsPage = (props) => { />}
+ + {String(p_filtre2).length > 3 && } + + {String(p_filtre2).length > 3 && } +
} - {!!p_filtre2_value && + + {p_filtre3 &&
{
-
- {!!p_filtre2 && +
+ {String(p_filtre3).length > 3 && { { - setp_filtre3(); - setp_filtre3_value(); + setp_filtre3_value(""); }} /> ), @@ -959,6 +997,16 @@ const DistplayPartnerTraningsPage = (props) => { />}
+ + {String(p_filtre3).length > 3 && }
} @@ -1003,12 +1051,12 @@ const DistplayPartnerTraningsPage = (props) => { '& .line--published': { backgroundColor: '#E6F7C8', color: 'black', - }, - '& .line--unpublished': { + }, + '& .line--unpublished': { backgroundColor: '#FAD7A0', color: 'black', - }, - + }, + }} > { }} getCellClassName={(params) => { if (params.field === 'published' && String(params.value) === "1") { - return 'cell--published'; + return 'cell--published'; } - + if (params.field === "published" && String(params.value) !== "1") { - return 'cell--unpublished' + return 'cell--unpublished' } - - }} - getRowClassName={(params) => { + + }} + getRowClassName={(params) => { if (String(params.row.published) === "1") { return 'line--published'; - } + } - if (String(params.row.published) !== "1") { + if (String(params.row.published) !== "1") { return 'line--unpublished'; - } + } }} /> diff --git a/src/styles/components/_displaypartnersession.scss b/src/styles/components/_displaypartnersession.scss index dee004a..003108b 100644 --- a/src/styles/components/_displaypartnersession.scss +++ b/src/styles/components/_displaypartnersession.scss @@ -1392,7 +1392,7 @@ .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { padding: 1px !important; - } + } .selectsession { width: 90%; @@ -1711,13 +1711,37 @@ .texte_area_filter { float: left; - width: 47% !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; - } + } + + .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 { font-family: "Quicksand", "Signika", sans-serif; diff --git a/src/styles/components/_displaypartnertrainingpagination.scss b/src/styles/components/_displaypartnertrainingpagination.scss index 9b69dd9..b63fa8b 100644 --- a/src/styles/components/_displaypartnertrainingpagination.scss +++ b/src/styles/components/_displaypartnertrainingpagination.scss @@ -805,7 +805,7 @@ .texte_area_filter { float: left; - width: 47% !important; + width: 40% !important; font-size: x-small !important; font-family: "verdana", "Quicksand", "Signika", sans-serif; margin: 0.4rem !important; @@ -813,6 +813,30 @@ 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 { float: left; //border: 1px solid black; @@ -904,6 +928,7 @@ border-radius: 5px; background: white; border: solid gainsboro 1px; + padding-top: 0.5rem !important; } .training_caract {