diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js
index edd53c1..16fb8f0 100644
--- a/src/components/DisplayPartnerSession.js
+++ b/src/components/DisplayPartnerSession.js
@@ -100,12 +100,15 @@ const DisplayPartnerSession = (props) => {
},
}));
+ const [datagrid_columns_size_model1, setdatagrid_columns_size_model1] = useState(200);
+ const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(80);
+
const columns = [
{ field: 'id', headerName: 'id', hide: true },
{ field: 'class_internal_url', headerName: 'class_internal_url', hide: true },
- { field: 'code_session', headerName: 'Code session', hide: false, width: 150, },
+ { field: 'code_session', headerName: 'Code session', hide: false, width: datagrid_columns_size_model1, },
{
- field: 'statut', headerName: 'Statut', hide: false,
+ field: 'statut', headerName: 'Statut', hide: false, width: datagrid_columns_size_model1,
valueFormatter: (params) => {
if (String(params.value) === "0")
return "Actif";
@@ -117,7 +120,7 @@ const DisplayPartnerSession = (props) => {
},
{
- field: 'etape', headerName: 'Etape', hide: false, width: 150,
+ field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model1,
valueFormatter: (params) => {
if (String(params.value) === "0")
return "Projet";
@@ -137,14 +140,14 @@ const DisplayPartnerSession = (props) => {
},
- { field: 'date_debut', headerName: 'Date debut', hide: false },
- { field: 'date_fin', headerName: 'Datefin', width: 100, hideable: false, flex: 1 },
- { field: 'distantiel', headerName: 'Distantiel', width: 50, hideable: false, flex: 1 },
- { field: 'presentiel', headerName: 'Presentiel', width: 50, flex: 1 },
- { field: 'formateur', headerName: 'Formateur', width: 150, flex: 1, hide: true, hideable: true, },
- { field: 'nb_participant', headerName: 'Nb Parti.', width: 100, align: "center", flex: 1 },
+ { field: 'date_debut', headerName: 'Date debut', hide: false, width: datagrid_columns_size_model2, },
+ { field: 'date_fin', headerName: 'Datefin', hideable: false, width: datagrid_columns_size_model2, },
+ { field: 'distantiel', headerName: 'Distantiel', hideable: false, width: datagrid_columns_size_model2, },
+ { field: 'presentiel', headerName: 'Presentiel', width: datagrid_columns_size_model2, },
+ { field: 'formateur', headerName: 'Formateur', width: datagrid_columns_size_model1, hide: true, hideable: true, },
+ { field: 'nb_participant', headerName: 'Nb Parti.', width: datagrid_columns_size_model2, align: "center", },
{
- field: 'taux_replissage', headerName: 'Replissage', width: 100, align: "center", flex: 0.8,
+ field: 'taux_replissage', headerName: 'Replissage', align: "center", width: datagrid_columns_size_model1,
align: "left",
renderCell: (params) => {
return (
@@ -163,12 +166,12 @@ const DisplayPartnerSession = (props) => {
);
},
},
- { field: 'nb_inscrit', headerName: 'Inscrits', width: 100, align: "center", flex: 1, hide: true, hideable: true, },
- { field: 'nb_preinscrit', headerName: 'Preinscrits', width: 100, align: "center", flex: 1, hide: true, hideable: true, },
- { field: 'prix_session', headerName: 'Prix', width: 100, align: "center", flex: 1 },
- { field: 'title', headerName: 'Formation', width: 100, align: "center", flex: 1, hide: true, hideable: true, },
- { field: 'domaine', headerName: 'Domaine', width: 100, align: "center", flex: 1, hide: true, hideable: true, },
- { field: 'duration', headerName: 'Durée', width: 100, align: "center", flex: 1 },
+ { field: 'nb_inscrit', headerName: 'Inscrits', width: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, },
+ { field: 'nb_preinscrit', headerName: 'Preinscrits', width: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, },
+ { field: 'prix_session', headerName: 'Prix', width: datagrid_columns_size_model2, align: "center", },
+ { field: 'title', headerName: 'Formation', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, },
+ { field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, },
+ { field: 'duration', headerName: 'Durée', width: datagrid_columns_size_model2, align: "center", },
]
@@ -515,12 +518,12 @@ const DisplayPartnerSession = (props) => {
var filtre3_value = "";
// Recuperation des valeurs de filtres
- if (p_filtre1_value ) {
+ if (p_filtre1_value) {
filtre1_value = p_filtre1_value;
form.append(filtre1, filtre1_value);
}
- if (p_filtre2_value ) {
+ if (p_filtre2_value) {
filtre2_value = p_filtre2_value;
form.append(filtre2, filtre2_value);
}
@@ -535,7 +538,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 (p_filtre1_value || p_filtre2_value) {
+ if (p_filtre1_value || p_filtre2_value) {
myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List_filter_like/";
}
@@ -653,6 +656,11 @@ const DisplayPartnerSession = (props) => {
Getall_TrainingSession();
GetAttestation_Certif();
+ let windowWidth = window.innerWidth;
+ if (windowWidth < 1001) {
+ setdatagrid_columns_size_model2(10);
+ }
+
}, [])
@@ -834,6 +842,11 @@ const DisplayPartnerSession = (props) => {
function submenu_add_one_session() {
setaddOneSession("1");
setEdite_session("0");
+ submenu_detail_session();
+
+ if (myRef.current) {
+ myRef.current.scrollIntoView({ behavior: "smooth" });
+ }
}
@@ -3594,13 +3607,14 @@ const DisplayPartnerSession = (props) => {
setp_filtre2_value();
Getall_TrainingSession_no_filter();
-
}
+ const myRef = useRef(null)
+
return (
-
Vos sessions de formation
+
Vos sessions de formation
Utilisez les filtres !
@@ -3725,7 +3739,7 @@ const DisplayPartnerSession = (props) => {
/>}
-
+
{String(p_filtre2).length > 3 &&
@@ -3768,11 +3782,12 @@ const DisplayPartnerSession = (props) => {
-
+
{
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
-
- handleClick_edit_session_From_Line(newSelectionModel);
+ if (newSelectionModel.length === 1)
+ handleClick_edit_session_From_Line(newSelectionModel);
}}
selectionModel={selectionModel}
@@ -3997,7 +4012,7 @@ const DisplayPartnerSession = (props) => {
-
+
@@ -4632,10 +4647,10 @@ const DisplayPartnerSession = (props) => {
}
- {String(addOneSession) === "1" &&
+ {String(addOneSession) === "1" &&
Ajout d'une session de formation
-
Choisir une formation *
+
Choisir une formation *
{
@@ -220,23 +221,42 @@ const DistplayPartnerTraningsPage = (props) => {
});
}
+
+ const [ismobilephone_columns_hide, setismobilephone_columns_hide] = useState(false);
+
+ const [datagrid_columns_size_model1, setdatagrid_columns_size_model1] = useState(200);
+ const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(80);
+
const columns = [
{ field: 'id', headerName: 'id', hide: true },
{ field: 'lms_class_code', headerName: 'lms_class_code', hide: true },
{ field: 'zone_diffusion', headerName: 'zone_diffusion', hide: true },
{ field: 'internal_url', headerName: 'internal_url', hide: true },
- { field: 'external_code', headerName: 'Code Formation', width: 200, hideable: false, flex: 1 },
- { field: 'title', headerName: 'Titre', width: 100, hideable: false, flex: 1 },
- { field: 'url', headerName: 'lien', width: 150, flex: 1 },
- { field: 'description', headerName: 'Description', width: 150, flex: 1 },
- { field: 'price', headerName: 'Prix', width: 100, align: "center", flex: 1 },
- { field: 'published', headerName: 'Publié', width: 100, align: "center", flex: 1 },
+ { field: 'external_code', headerName: 'Code Formation', width: datagrid_columns_size_model1, hideable: false, resizable: true },
+ { field: 'title', headerName: 'Titre', width: datagrid_columns_size_model1, hideable: false, },
+ { field: 'domain', headerName: 'Domaine', width: datagrid_columns_size_model1, hideable: true, },
+ { field: 'metier', headerName: 'Métier', width: datagrid_columns_size_model1, hideable: true, hide: true },
+ { field: 'url', headerName: 'lien', width: datagrid_columns_size_model1, hideable: true, hide: true },
+ { field: 'description', headerName: 'Description', width: datagrid_columns_size_model1, hide: ismobilephone_columns_hide, resizable: true, flex: 1 },
+
+ { field: 'price', headerName: 'Prix', width: datagrid_columns_size_model2, align: "center", resizable: true, hide: ismobilephone_columns_hide },
{
- field: "management", headerName: 'Gestion',
+ field: 'published', headerName: 'Publié', width: datagrid_columns_size_model2, align: "center", resizable: true,
+ valueFormatter: (params) => {
+ if (String(params.value) === "0")
+ return "Non";
+ else if (String(params.value) === "1")
+ return "Oui";
+ else
+ return "?";
+ },
+ },
+ {
+ field: "management", headerName: 'Gestion', width: datagrid_columns_size_model2,
renderCell: (cellValues) => {
return (
-