From 3efd56f69cc367ee3a5a99ee447436cf5896a63e Mon Sep 17 00:00:00 2001 From: cherif Date: Fri, 10 Jan 2025 22:15:10 +0100 Subject: [PATCH] dqdqs --- config-overrides.js | 2 +- src/App.js | 308 ++++++++++-------- src/components/AddArticleAvis.js | 22 +- src/components/AddClassManual.js | 88 +++-- src/components/DisplayPartnerSession.js | 49 ++- .../DisplayPartnerTrainingsPagination.js | 8 +- src/components/Module_Alert_Confirmation.js | 58 ++-- .../_module_alert_confirmation.scss | 6 +- 8 files changed, 337 insertions(+), 204 deletions(-) diff --git a/config-overrides.js b/config-overrides.js index 482dc2b..014f8c2 100644 --- a/config-overrides.js +++ b/config-overrides.js @@ -4,7 +4,7 @@ module.exports = { ...config, optimization: { splitChunks: { - maxSize: 5000000, // 5MB in static size, before compression + maxSize: 500000, // 5MB in static size, before compression }, }, diff --git a/src/App.js b/src/App.js index c1b8ef9..10c45aa 100644 --- a/src/App.js +++ b/src/App.js @@ -1,63 +1,75 @@ -import React, { useState, useEffect, Suspense } from "react"; +import React, { useState, useEffect } from "react"; import { BrowserRouter, Switch, Route } from "react-router-dom" import './App.css'; +import NotFound from './pages/NotFound' +import Contact from './pages/Contact' +import Connexion from './pages/Connexion' +import Login from './pages/Login'; + +import Recherche_new_v2 from "./pages/recherche_new_v2"; +import Recherche_new_v3 from "./pages/recherche_new_v3"; +import Recherche_new_v4 from "./pages/recherche_new_v4"; + +import Mon_Catalogue_Public from "./pages/mon_catalogue_public"; + +import TestUrl from "./pages/testurl"; +import Account from "./pages/account"; + +import DisplayDetailClass_new_v2 from "./pages/displaydetailclass_new_v2"; +import DisplayDetailClass_new_v3 from "./pages/displaydetailclass_new_v3"; + +import Display_Partner_Catalog_DetailClass_new_v2 from "./pages/display_partner_catalog_detailclass_new_v2" + +import DisplayDetailArticle from "./pages/displaydetailarticle"; +import AddArticleAvis from "./pages/addarticleavis"; +import Acceuil from "./pages/acceuil"; +import Partner from "./pages/partner"; +import CreateAccount from "./pages/createaccount"; +import PartnerLogin from "./pages/partnerlogin"; +import PartnerLogin0 from "./pages/partnerlogin0"; +import PartnerLogin1 from "./pages/partnerlogin1"; + +import RechecheArticles from "./pages/recherchearticles"; +import AddArticle from "./pages/addarticle"; +import ResetUserPwd from "./pages/resetuserpwd"; +import DeleteUserAccount from "./pages/deleteuseraccount"; + +import ContactezNous from "./pages/contactez_nous"; +import CoupDeCoeur from "./pages/coupdecoeur"; +import AccountUserActivated from "./pages/accountuseractivated"; +import ProduitsService from "./pages/produitservice"; + +import Recherche_new from "./pages/recherche_new"; +import Recherche_old from "./pages/recherche"; +import UserSignFirst from "./pages/usersigninfirst"; +import GestionAdministrative from "./components/GestionAdministrative"; +import Emargement from "./pages/emargementOk"; +import Formation_Cartouche_Com from "./pages/recherche_cartouche_com"; +import SeDesabonner from './pages/sedesabonner'; +import OrderConfirmation_3DS from "./pages/orderconfirmation_3DS"; +import Training_Inactive_Or_Not_Found from "./pages/Traning_Inactif_Or_Not_Exist"; +import TestUrl_New from "./pages/testurl_new"; +import QuiSommesNous_v3 from "./pages/quisommesnous_v3"; +import Fonctionnalites from "./pages/fonctionnalite"; +import Test_Drag_Drop from "./pages/test_drag_drop"; + +import Test_Drag_Drop2 from "./pages/test_dnd"; + +import ESign from "./pages/eSigne"; +import ESignDiplayDignedDocument from "./pages/edigndiplaydigneddocument"; +import SurveyDocument from "./pages/surveydocument"; +import UpdateAttendeeList from "./pages/updateattendeelist"; +import Emarge_QR_Code from "./pages/emarge_qr_code"; +import AutomaticQuotation from "./pages/automaticquotation"; + +import MySyIA from "./pages/iamysy"; + +import Maintenance from "./pages/maintenance_page"; + +import Subdomain_Recherche_new_v2 from "./pages/subdomain_recherche_new_v2"; function App() { - const NotFound = React.lazy(() => import('./pages/NotFound')); - const Contact = React.lazy(() => import('./pages/Contact')); - const Connexion = React.lazy(() => import('./pages/Connexion')); - const Login = React.lazy(() => import('./pages/Login')); - const Recherche_new_v2 = React.lazy(() => import('./pages/recherche_new_v2')); - const Recherche_new_v3 = React.lazy(() => import('./pages/recherche_new_v3')); - const Recherche_new_v4 = React.lazy(() => import('./pages/recherche_new_v4')); - const Mon_Catalogue_Public = React.lazy(() => import('./pages/mon_catalogue_public')); - const TestUrl = React.lazy(() => import('./pages/testurl')); - const Account = React.lazy(() => import('./pages/account')); - const DisplayDetailClass_new_v2 = React.lazy(() => import('./pages/displaydetailclass_new_v2')); - const DisplayDetailClass_new_v3 = React.lazy(() => import('./pages/displaydetailclass_new_v3')); - const Display_Partner_Catalog_DetailClass_new_v2 = React.lazy(() => import('./pages/display_partner_catalog_detailclass_new_v2')); - const DisplayDetailArticle = React.lazy(() => import('./pages/displaydetailarticle')); - const AddArticleAvis = React.lazy(() => import('./pages/addarticleavis')); - const Acceuil = React.lazy(() => import('./pages/acceuil')); - const Partner = React.lazy(() => import('./pages/partner')); - const CreateAccount = React.lazy(() => import('./pages/createaccount')); - const PartnerLogin = React.lazy(() => import('./pages/partnerlogin')); - const PartnerLogin0 = React.lazy(() => import('./pages/partnerlogin0')); - const PartnerLogin1 = React.lazy(() => import('./pages/partnerlogin1')); - const RechecheArticles = React.lazy(() => import('./pages/recherchearticles')); - const AddArticle = React.lazy(() => import('./pages/addarticle')); - const ResetUserPwd = React.lazy(() => import('./pages/resetuserpwd')); - const DeleteUserAccount = React.lazy(() => import('./pages/deleteuseraccount')); - const ContactezNous = React.lazy(() => import('./pages/contactez_nous')); - const CoupDeCoeur = React.lazy(() => import('./pages/coupdecoeur')); - const AccountUserActivated = React.lazy(() => import('./pages/accountuseractivated')); - const ProduitsService = React.lazy(() => import('./pages/produitservice')); - const Recherche_new = React.lazy(() => import('./pages/recherche_new')); - const Recherche_old = React.lazy(() => import('./pages/recherche')); - const UserSignFirst = React.lazy(() => import('./pages/usersigninfirst')); - const GestionAdministrative = React.lazy(() => import('./components/GestionAdministrative')); - const Emargement = React.lazy(() => import('./pages/emargementOk')); - const Formation_Cartouche_Com = React.lazy(() => import('./pages/recherche_cartouche_com')); - const SeDesabonner = React.lazy(() => import('./pages/sedesabonner')); - const OrderConfirmation_3DS = React.lazy(() => import('./pages/orderconfirmation_3DS')); - const Training_Inactive_Or_Not_Found = React.lazy(() => import('./pages/Traning_Inactif_Or_Not_Exist')); - const Test_Drag_Drop = React.lazy(() => import('./pages/test_drag_drop')); - const Test_Drag_Drop2 = React.lazy(() => import('./pages/test_dnd')); - const TestUrl_New = React.lazy(() => import('./pages/testurl_new')); - const QuiSommesNous_v3 = React.lazy(() => import('./pages/quisommesnous_v3')); - const Fonctionnalites = React.lazy(() => import('./pages/fonctionnalite')); - const ESign = React.lazy(() => import('./pages/eSigne')); - const ESignDiplayDignedDocument = React.lazy(() => import('./pages/edigndiplaydigneddocument')); - const SurveyDocument = React.lazy(() => import('./pages/surveydocument')); - const UpdateAttendeeList = React.lazy(() => import('./pages/updateattendeelist')); - const Emarge_QR_Code = React.lazy(() => import('./pages/emarge_qr_code')); - const AutomaticQuotation = React.lazy(() => import('./pages/automaticquotation')); - const MySyIA = React.lazy(() => import('./pages/iamysy')); - const Maintenance = React.lazy(() => import('./pages/maintenance_page')); - const Subdomain_Recherche_new_v2 = React.lazy(() => import('./pages/subdomain_recherche_new_v2')); - - const [screenSizeh, getDimension] = useState({ dynamicWidth: window.innerHeight }); @@ -102,9 +114,9 @@ function App() { if (tab_myurl_pathname.length > 0 && !tab_action.includes(tab_myurl_pathname[1]) && !tab_reserved_subdomain.includes(subdomain)) { - + var new_url = window.location.protocol + "//" + domain.split('.')[0] + "." + domain.split('.')[1] + "/moncatalog"; - + /* window.open( @@ -116,7 +128,7 @@ function App() { } - } + } }, []); @@ -132,91 +144,109 @@ function App() {
- Loading...

}> - - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> + + + - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> + - } /> - } /> - } /> - {/* */} - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* */} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +*/ + + +
diff --git a/src/components/AddArticleAvis.js b/src/components/AddArticleAvis.js index 862553d..2928aa2 100644 --- a/src/components/AddArticleAvis.js +++ b/src/components/AddArticleAvis.js @@ -139,10 +139,30 @@ const AddArticleAvis = () => { }); }, []) - + + const [display_alert_mysy, setdisplay_alert_mysy] = useState(""); + const [alert_message, setalert_message] = useState(""); + const [alert_type, setalert_type] = useState(""); + + function clear_alert_message() { + setalert_message(""); + } + function clear_alert_type() { + setalert_type(""); + } + return (
+ + {display_alert_mysy && String(display_alert_mysy) === "1" && + + } + MySy Training, ajout article diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 7dd7b05..47c7e65 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -1654,10 +1654,10 @@ const AddClassManual = (props) => { const editorRef_zone_diffusion = useRef(null); const editorRef_date_lieu = useRef(null); + const [waiting_before_redirect, setwaiting_before_redirect] = React.useState(true); function RecordTraining(event) { - var code = document.getElementsByName("external_code")[0].value; if (code.length < 1) { @@ -1698,9 +1698,6 @@ const AddClassManual = (props) => { var mycategorie = mytrainingcategorie; var version = p_detail_version_catalogue; - - - var mynote = document.getElementsByName("note")[0].value; var localmycpf = mycpf; var mycertif = mycertif; @@ -1714,8 +1711,6 @@ const AddClassManual = (props) => { pourqui = editorRef_pourqui.current.getContent(); } - - var objectif = ""; if (editorRef_objectif.current) { objectif = editorRef_objectif.current.getContent(); @@ -1740,8 +1735,6 @@ const AddClassManual = (props) => { } } - - var methode_pedago = ""; if (editorRef_methode_pedago.current) { methode_pedago = editorRef_methode_pedago.current.getContent(); @@ -1752,7 +1745,6 @@ const AddClassManual = (props) => { } } - var handicap = ""; if (editorRef_handicap.current) { handicap = editorRef_handicap.current.getContent(); @@ -1764,7 +1756,6 @@ const AddClassManual = (props) => { } - var suivi_eval = ""; if (editorRef_suivi_eval.current) { suivi_eval = editorRef_suivi_eval.current.getContent(); @@ -1776,9 +1767,6 @@ const AddClassManual = (props) => { } - - - var prerequis = ""; if (editorRef_prerequis.current) { prerequis = editorRef_prerequis.current.getContent(); @@ -1968,7 +1956,7 @@ const AddClassManual = (props) => { ) .then((response) => response.json()) .then((result) => { - console.log('Success:', result['message'], "result['status'] = ", result['status'], "result['class_id'] = ", result['class_id']); + //console.log('Success:', result['message'], "result['status'] = ", result['status'], "result['class_id'] = ", result['class_id']); setLoading(false); setimportmessage(result['message']); setmyApiResponse(result['status']); @@ -1976,6 +1964,7 @@ const AddClassManual = (props) => { if (String(result['status']) === "true") { + var myclass_id = String(result['class_id']); @@ -1986,15 +1975,41 @@ const AddClassManual = (props) => { //alert(result['status'] + " -- " + myApiResponse + ' mess = ' + result['message']); if (String(result['status']) === "true") { - alert(" La formation a été correctement ajoutée / mise à jour. Vous allez être redirigé vers la liste des formations."); - history.push({ - pathname: "/Partner/", - state: { - current_pack: props.currentpack, local_sub_menu: 'affichage', price: "", - period: "", new_pack: "" - } - }); - window.location.reload(); + + + var txt = "La formation a été correctement ajoutée / mise à jour."; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("success"); + + // alert(" La formation a été correctement ajoutée / mise à jour. Vous allez être redirigé vers la liste des formations."); + /* + if (waiting_before_redirect === false) { + history.push({ + pathname: "/Partner/", + state: { + current_pack: props.currentpack, local_sub_menu: 'affichage', price: "", + period: "", new_pack: "" + } + }); + window.location.reload(); + }*/ + + + /* history.push({ + pathname: "/Partner/", + state: { + current_pack: props.currentpack, local_sub_menu: 'affichage', price: "", + period: "", new_pack: "" + } + }); + window.location.reload();*/ + } + + else{ + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("error"); } }) .catch((error) => { @@ -3134,7 +3149,7 @@ const AddClassManual = (props) => { var file_name = event.target.id; } - + const [Get_List_Of_All_PJ_api, setGet_List_Of_All_PJ_api] = useState(); const [Get_List_Of_All_PJ_result, setGet_List_Of_All_PJ_result] = useState(); const [Get_List_Of_All_PJ_message, setGet_List_Of_All_PJ_message] = useState(); @@ -3827,14 +3842,37 @@ const AddClassManual = (props) => { DataUpdated(); } - + const [Dialog_mysy_ia_open, setDialog_mysy_ia_open] = React.useState(false); + + const [display_alert_mysy, setdisplay_alert_mysy] = useState(""); + const [alert_message, setalert_message] = useState(""); + const [alert_type, setalert_type] = useState(""); + + function clear_alert_message() { + setalert_message(""); + } + function clear_alert_type() { + setalert_type(""); + } + return (
{isLoading &&
} + {/*** Affichage des messages d'alerte*/} + {display_alert_mysy && String(display_alert_mysy) === "1" && + + } + {/*** FIN Affichage des messages d'alerte*/} + + {/*** GESTION IA */} { desableSessionFields(); Getall_TrainingSession(); GetCurrentSession(selected_session_id, selected_internal_url); - alert(String(res.data.message)); + // alert(String(res.data.message)); + + setdisplay_alert_mysy("1"); + setalert_message(String(res.data.message)); + setalert_type("success"); + } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -5146,7 +5152,12 @@ const DisplayPartnerSession = (props) => { else { setCreateSessionFormation_api("false"); setCreateSessionFormation_message(res.data.message); - alert(String(res.data.message)); + //alert(String(res.data.message)); + + setdisplay_alert_mysy("1"); + setalert_message(String(res.data.message)); + setalert_type("error"); + } }).catch((error) => { @@ -5382,7 +5393,12 @@ const DisplayPartnerSession = (props) => { setselected_code_session(); setsubmenu(); - alert(res.data.message); + // alert(res.data.message); + + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); + //GetCurrentSession(p_one_code_session, one_selected_internal_url); } else if (String(res.data.status) === String("Err_Connexion")) { @@ -5392,7 +5408,12 @@ const DisplayPartnerSession = (props) => { else { setone_CreateSessionFormation_api("false"); setone_CreateSessionFormation_message(res.data.message); - alert("Erreur : " + res.data.message); + // alert("Erreur : " + res.data.message); + + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } }).catch((error) => { @@ -12057,6 +12078,16 @@ const DisplayPartnerSession = (props) => { }) } + const [display_alert_mysy, setdisplay_alert_mysy] = useState(""); + const [alert_message, setalert_message] = useState(""); + const [alert_type, setalert_type] = useState(""); + + function clear_alert_message() { + setalert_message(""); + } + function clear_alert_type() { + setalert_type(""); + } return (
@@ -12065,6 +12096,16 @@ const DisplayPartnerSession = (props) => {
} + {/*** Affichage des messages d'alerte*/} + {display_alert_mysy && String(display_alert_mysy) === "1" && + + } + {/*** FIN Affichage des messages d'alerte*/} + { /******** Dialog de comment emargement */} diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index 3ffa112..5dee75e 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -65,6 +65,8 @@ import Menu from '@mui/material/Menu'; //import MenuItem from '@mui/material/MenuItem'; import MoreVertIcon from '@mui/icons-material/MoreVert'; +import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; + function PaperComponent(props) { return ( { } function closeTrainingForm() { + GetAllClass_new(); setupdatetraining(false); } @@ -2278,6 +2281,7 @@ const DistplayPartnerTraningsPage = (props) => {
} + { className="disabled_style" options={New_option_group_by} onChange={(event, value) => { - + if (value && value.value) { setdata_row_grouped_by(value.value); setdata_row_grouped_field(value.value); @@ -3061,7 +3065,7 @@ const DistplayPartnerTraningsPage = (props) => { onSelectionModelChange={(newSelectionModel) => { setSelectionModel(newSelectionModel); - // console.log("ch selected--" + newSelectionModel); + // console.log("ch selected--" + newSelectionModel); }} selectionModel={selectionModel} localeText={frFR.components.MuiDataGrid.defaultProps.localeText} diff --git a/src/components/Module_Alert_Confirmation.js b/src/components/Module_Alert_Confirmation.js index 43a5f78..85f0c48 100644 --- a/src/components/Module_Alert_Confirmation.js +++ b/src/components/Module_Alert_Confirmation.js @@ -4,31 +4,24 @@ import Stack from '@mui/material/Stack'; const Module_Alert_Confirmation = (props) => { - const [showElement,setShowElement] = React.useState(true); - - useEffect(()=>{ - setTimeout(function() { - setShowElement(false) - }, 4000); - }, - []) - + const [showElement, setShowElement] = React.useState(true); + + useEffect(() => { + setTimeout(function () { + setShowElement(false) + }, 4000); + }, + []) + return (
- {showElement && props.alert_message && String(props.alert_type) === "1" && - {props.alert_message} - {props.alert_message} - {props.alert_message} - {props.alert_message} - } - - - {showElement && props.alert_message && String(props.alert_type) === "success" &&
{props.alert_message} @@ -38,31 +31,34 @@ const Module_Alert_Confirmation = (props) => { - {showElement && props.alert_message && String(props.alert_type) === "error" &&
- + {props.alert_message}
} - {showElement && props.alert_message && String(props.alert_type) === "info" &&
- - {props.alert_message} + + {props.alert_message}
} - {showElement && props.alert_message && String(props.alert_type) === "warning" &&
- - {props.alert_message} + + {props.alert_message}
} diff --git a/src/styles/components/_module_alert_confirmation.scss b/src/styles/components/_module_alert_confirmation.scss index cec0a17..711a192 100644 --- a/src/styles/components/_module_alert_confirmation.scss +++ b/src/styles/components/_module_alert_confirmation.scss @@ -3107,7 +3107,11 @@ // end media - + .MuiPaper-root { + border-radius: 0px !important; + background: unset !important; + max-width: none !important; + } .display_screen_600_901 { width: 95%;