394 lines
18 KiB
JavaScript
394 lines
18 KiB
JavaScript
import React, { useState, useEffect, lazy, Suspense } from "react";
|
|
|
|
import { BrowserRouter, Route, Switch, useHistory } from "react-router-dom";
|
|
|
|
import './App.css';
|
|
import NotFound from './pages/NotFound'
|
|
import Contact from './pages/Contact'
|
|
import Connexion from './pages/Connexion'
|
|
|
|
/*// ---
|
|
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 Mon_Intranet_Public from "./pages/mon_intranet_public";
|
|
import Mon_Ent_Student from "./pages/mon_ent_student";
|
|
import TestUrl from "./pages/testurl";
|
|
import Account from "./pages/account";
|
|
import Student_Account from "./pages/student_account";
|
|
|
|
//---------*/
|
|
/*
|
|
import Display_Partner_Catalog_DetailClass_new_v2 from "./pages/display_partner_catalog_detailclass_new_v2"
|
|
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 AccountUserActivated from "./pages/accountuseractivated";
|
|
import ProduitsService from "./pages/produitservice";
|
|
import Recherche_new from "./pages/recherche_new";
|
|
import UserSignFirst from "./pages/usersigninfirst";
|
|
import Emargement from "./pages/emargementOk";
|
|
*/
|
|
|
|
/*
|
|
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 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";
|
|
*/
|
|
/*
|
|
// New Design 2025
|
|
import New_Sign_In_2025 from "./pages/new_p_sign_in_2025";
|
|
import New_Sign_Up_2025 from "./pages/new_p_sign_up_2025";
|
|
import New_Tarif_2025 from "./pages/new_p_tarif_2025";
|
|
import New_Contact_2025 from "./pages/new_p_contact_2025";
|
|
import New_Article_Detail_2025 from "./pages/new_p_article_detail_2025";
|
|
|
|
import New_Formation_Detail_2025 from "./pages/new_p_detail_formation_2025";
|
|
//import New_Marktplace_2025 from "./pages/new_p_marketplace_2025";
|
|
import New_Fonctionnalite_2025 from "./pages/new_p_fonctionnalite_2025";
|
|
|
|
import New_A_Propos_2025 from "./pages/new_p_a_propos_2025";
|
|
import New_Home_Page_2025 from "./pages/new_p_home_page_2025";
|
|
|
|
import Jmjformation_catalogue from "./pages/jmjformation_catalogue_public";
|
|
|
|
import New_Test_Header_Footer_2025 from "./pages/new_p_test_header_footer_2025";
|
|
*/
|
|
import img_loading_spin from "./mysy_img/mysy_spin_loading.gif";
|
|
|
|
function App() {
|
|
|
|
const New_Marktplace_2025 = lazy(() => import("./pages/new_p_marketplace_2025"));
|
|
const New_Test_Header_Footer_2025 = lazy(() => import("./pages/new_p_test_header_footer_2025"));
|
|
const Jmjformation_catalogue = lazy(() => import("./pages/jmjformation_catalogue_public"));
|
|
const New_Home_Page_2025 = lazy(() => import("./pages/new_p_home_page_2025"));
|
|
const New_A_Propos_2025 = lazy(() => import("./pages/new_p_a_propos_2025"));
|
|
const New_Fonctionnalite_2025 = lazy(() => import("./pages/new_p_fonctionnalite_2025"));
|
|
const New_Formation_Detail_2025 = lazy(() => import("./pages/new_p_detail_formation_2025"));
|
|
const New_Article_Detail_2025 = lazy(() => import("./pages/new_p_article_detail_2025"));
|
|
const New_Contact_2025 = lazy(() => import("./pages/new_p_contact_2025"));
|
|
const New_Tarif_2025 = lazy(() => import("./pages/new_p_tarif_2025"));
|
|
const New_Sign_Up_2025 = lazy(() => import("./pages/new_p_sign_up_2025"));
|
|
const New_Sign_In_2025 = lazy(() => import("./pages/new_p_sign_in_2025"));
|
|
const Student_Account = lazy(() => import("./pages/student_account"));
|
|
const Student_Planning = lazy(() => import("./pages/mon_ent_student_planning"));
|
|
|
|
|
|
const Account = lazy(() => import("./pages/account"));
|
|
const TestUrl = lazy(() => import("./pages/testurl"));
|
|
const Mon_Ent_Student = lazy(() => import("./pages/mon_ent_student"));
|
|
|
|
const Mon_Intranet_Public = lazy(() => import("./pages/mon_intranet_public"));
|
|
const Mon_Catalogue_Public = lazy(() => import("./pages/mon_catalogue_public"));
|
|
const Recherche_new_v4 = lazy(() => import("./pages/recherche_new_v4"));
|
|
const Recherche_new_v3 = lazy(() => import("./pages/recherche_new_v3"));
|
|
const Recherche_new_v2 = lazy(() => import("./pages/recherche_new_v2"));
|
|
const Subdomain_Recherche_new_v2 = lazy(() => import("./pages/subdomain_recherche_new_v2"));
|
|
const Maintenance = lazy(() => import("./pages/maintenance_page"));
|
|
const MySyIA = lazy(() => import("./pages/iamysy"));
|
|
const AutomaticQuotation = lazy(() => import("./pages/automaticquotation"));
|
|
const Emarge_QR_Code = lazy(() => import("./pages/emarge_qr_code"));
|
|
|
|
const Survey_Eval_QR_Code = lazy(() => import("./pages/survey_eval_qr_code"));
|
|
|
|
|
|
const UpdateAttendeeList = lazy(() => import("./pages/updateattendeelist"));
|
|
const SurveyDocument = lazy(() => import("./pages/surveydocument"));
|
|
const SurveyDocument_Qr_Code = lazy(() => import("./pages/surveydocument_qr_code"));
|
|
|
|
const ESignDiplayDignedDocument = lazy(() => import("./pages/edigndiplaydigneddocument"));
|
|
const ESign = lazy(() => import("./pages/eSigne"));
|
|
const Test_Drag_Drop2 = lazy(() => import("./pages/test_dnd"));
|
|
const Test_Drag_Drop = lazy(() => import("./pages/test_drag_drop"));
|
|
const TestUrl_New = lazy(() => import("./pages/testurl_new"));
|
|
const Training_Inactive_Or_Not_Found = lazy(() => import("./pages/Traning_Inactif_Or_Not_Exist"));
|
|
const OrderConfirmation_3DS = lazy(() => import("./pages/orderconfirmation_3DS"));
|
|
const SeDesabonner = lazy(() => import("./pages/sedesabonner"));
|
|
const Emargement = lazy(() => import("./pages/emargementOk"));
|
|
const UserSignFirst = lazy(() => import("./pages/usersigninfirst"));
|
|
const Recherche_new = lazy(() => import("./pages/recherche_new"));
|
|
const ProduitsService = lazy(() => import("./pages/produitservice"));
|
|
const AccountUserActivated = lazy(() => import("./pages/accountuseractivated"));
|
|
const DeleteUserAccount = lazy(() => import("./pages/deleteuseraccount"));
|
|
const ResetUserPwd = lazy(() => import("./pages/resetuserpwd"));
|
|
const AddArticle = lazy(() => import("./pages/addarticle"));
|
|
const RechecheArticles = lazy(() => import("./pages/recherchearticles"));
|
|
const PartnerLogin1 = lazy(() => import("./pages/partnerlogin1"));
|
|
const PartnerLogin0 = lazy(() => import("./pages/partnerlogin0"));
|
|
const PartnerLogin = lazy(() => import("./pages/partnerlogin"));
|
|
const CreateAccount = lazy(() => import("./pages/createaccount"));
|
|
const Partner = lazy(() => import("./pages/partner"));
|
|
const Acceuil = lazy(() => import("./pages/acceuil"));
|
|
const AddArticleAvis = lazy(() => import("./pages/addarticleavis"));
|
|
|
|
const Display_Partner_Catalog_DetailClass_new_v2 = lazy(() => import("./pages/display_partner_catalog_detailclass_new_v2"));
|
|
|
|
|
|
const [screenSizeh, getDimension] = useState({
|
|
dynamicWidth: window.innerHeight
|
|
});
|
|
|
|
|
|
const getSubdomain = url => {
|
|
let domain = url;
|
|
if (url.includes("://")) {
|
|
domain = url.split('://')[1];
|
|
}
|
|
const subdomain = domain.split('.')[0];
|
|
return subdomain;
|
|
};
|
|
|
|
const history = useHistory();
|
|
|
|
|
|
const [isLoading, setLoading] = useState();
|
|
|
|
|
|
const [mysy_domain, setmysy_domain] = useState(window.location.hostname.split('.')[0]);
|
|
|
|
|
|
useEffect(() => {
|
|
setLoading(true);
|
|
let myurl = window.location.host;
|
|
let myurl_pathname = window.location.pathname;
|
|
|
|
// console.log(" ### mysy_domain =", mysy_domain)
|
|
|
|
// console.log(" ### myurl =", myurl)
|
|
// console.log(" ### window.location.hostname =", window.location.hostname)
|
|
|
|
var domain = myurl;
|
|
if (domain.includes('://')) {
|
|
domain = myurl.split('://')[1];
|
|
}
|
|
|
|
var tab_split = domain.split('.');
|
|
|
|
const subdomain = domain.split('.')[0];
|
|
|
|
var tab_reserved_subdomain = ['/dev', '/demo', 'demo', 'dev'];
|
|
|
|
if (tab_split.length > 1 && myurl_pathname && !tab_reserved_subdomain.includes(subdomain)) {
|
|
|
|
var tab_myurl_pathname = myurl_pathname.split('/');
|
|
|
|
var tab_action = ['/moncatalog', '/Display-Partner-Catalog-Detail-formation', 'Display-Partner-Catalog-Detail-formation', 'moncatalog'];
|
|
|
|
|
|
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";
|
|
}
|
|
}
|
|
|
|
|
|
setLoading(false);
|
|
|
|
}, []);
|
|
|
|
|
|
return (
|
|
<div>
|
|
<div className="App">
|
|
|
|
{isLoading && <div className="loader-container">
|
|
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
|
</div>}
|
|
|
|
|
|
{/*API DEV = {process.env.REACT_APP_API_URL_DEV} <br/>
|
|
API REC = {process.env.REACT_APP_API_URL_REC}<br/>
|
|
API URL = {process.env.REACT_APP_API_URL}<br/>
|
|
*/}
|
|
|
|
|
|
<div className="main_haut">
|
|
<Suspense fallback={<div>Loading...</div>}>
|
|
<BrowserRouter>
|
|
<scrollToTop />
|
|
<Switch>
|
|
|
|
<Route path="/v3" exact component={Recherche_new_v3} />
|
|
<Route path="/v4" exact component={Recherche_new_v4} />
|
|
|
|
<Route path="/subdomain" exact component={Subdomain_Recherche_new_v2} />
|
|
|
|
<Route path="/moncatalog" exact component={Mon_Catalogue_Public} />
|
|
<Route path="/intranet" exact component={Mon_Intranet_Public} />
|
|
|
|
<Route path="/ent_student" exact component={Mon_Ent_Student} />
|
|
|
|
|
|
<Route path="/acceuil" exact component={Acceuil} />
|
|
|
|
<Route path="/maintenance" exact component={Maintenance} />
|
|
|
|
|
|
<Route path="/markeplace" exact component={Contact} />
|
|
|
|
<Route path="/create_account" exact component={CreateAccount} />
|
|
<Route path="/user-connexion" exact component={Connexion} />
|
|
|
|
|
|
<Route path="/testurl/:course/:tab" exact component={TestUrl} />
|
|
<Route path="/testurl_new/:courseid/:tabid" exact component={TestUrl_New} />
|
|
|
|
<Route path="/ajout-article" exact component={AddArticleAvis} />
|
|
|
|
|
|
<Route path="/Display-Partner-Catalog-Detail-formation/:classId" exact component={Display_Partner_Catalog_DetailClass_new_v2} />
|
|
<Route path="/Display-Partner-Catalog-Detail-formation/:classId/:action" exact component={Display_Partner_Catalog_DetailClass_new_v2} />
|
|
|
|
|
|
<Route path="/mysy-account-activated/" exact component={AccountUserActivated} />
|
|
{/* <Route path="/Produits-Services/" exact component={ProduitsService} />*/}
|
|
<Route path="/tarifs_produits_services/" exact component={ProduitsService} />
|
|
<Route path="/Recherche_new/" exact component={Recherche_new} />
|
|
<Route path="/Recherche_new/:type/:categorie" exact component={Recherche_new} />
|
|
|
|
<Route path="/Connexion-utilisateur-0/" exact component={UserSignFirst} />
|
|
<Route path="/Emargement/" exact component={Emargement} />
|
|
|
|
<Route path="/Test_DragDrop/" exact component={Test_Drag_Drop} />
|
|
<Route path="/Test_DragDrop2/" exact component={Test_Drag_Drop2} />
|
|
<Route path="/Recherche_new_v2/" exact component={Recherche_new_v2} />
|
|
<Route path="/Recherche_new_v2/:type/:categorie" exact component={Recherche_new_v2} />
|
|
<Route path="/unsubscribe/" exact component={SeDesabonner} />
|
|
<Route path="/OrderConfirmation_3DS/:orderid/:packs" exact component={OrderConfirmation_3DS} />
|
|
<Route path="/page-inconnue/" exact component={NotFound} />
|
|
<Route path="/formation-inconnue/" exact component={Training_Inactive_Or_Not_Found} />
|
|
|
|
<Route path="/qr_emargement/:session_id/:partner_owner_recid/:my_safe_token" exact component={Emarge_QR_Code} />
|
|
|
|
<Route path="/qr_survey_eval/:session_id/:survey_type/:qr_code_safe_token" exact component={Survey_Eval_QR_Code} />
|
|
|
|
<Route path="/E_Signature/:document_id" exact component={ESign} />
|
|
<Route path="/E_Document/:document_id/:partner_owner_recid/:secret_key_signature" exact component={ESignDiplayDignedDocument} />
|
|
|
|
<Route path="/Survey/:survey_id/" exact component={SurveyDocument} />
|
|
<Route path="/Survey/qrcode/:survey_id/" exact component={SurveyDocument_Qr_Code} />
|
|
<Route path="/UpadateAttendeeList/:client_id/:session_id/:partner_owner_recid/" exact component={UpdateAttendeeList} />
|
|
|
|
<Route path="/automatic-quotation/:partner_owner_recid/:objid/" exact component={AutomaticQuotation} />
|
|
|
|
<Route path="/intelligence-artificielle-mysy-training/" exact component={MySyIA} />
|
|
|
|
{/**** New design 2025 */}
|
|
<Route path="/signin/" exact component={New_Sign_In_2025} />
|
|
<Route path="/signup/" exact component={New_Sign_Up_2025} />
|
|
<Route path="/tarif/" exact component={New_Tarif_2025} />
|
|
<Route path="/contact/" exact component={New_Contact_2025} />
|
|
|
|
{/*
|
|
|
|
09/03/25 : un redirection a été faite dans cloudflaire pour les lignes ci-dessous
|
|
|
|
<Route path="/ContactezNous" exact component={New_Contact_2025} />
|
|
|
|
*/}
|
|
|
|
|
|
|
|
<Route path="/display-detail-article/:articleId" exact component={New_Article_Detail_2025} />
|
|
<Route path="/Display-Detail-Article/:articleId" exact component={New_Article_Detail_2025} />
|
|
|
|
<Route path="/detail-formation/:classId" exact component={New_Formation_Detail_2025} />
|
|
{/* ex : http://localhost:3009/detail-formation/habilitation-electrique-882*/}
|
|
|
|
<Route path="/marketplace/" exact component={New_Marktplace_2025} />
|
|
<Route path="/fonctionnalites/" exact component={New_Fonctionnalite_2025} />
|
|
|
|
<Route path="/apropos/" exact component={New_A_Propos_2025} />
|
|
{/*
|
|
|
|
09/03/25 : un redirection a été faite dans cloudflaire pour les lignes ci-dessous
|
|
<Route path="/QuiSommesNous" exact component={New_A_Propos_2025} />
|
|
<Route path="/QuiSommesNous_v3" exact component={New_A_Propos_2025} />
|
|
<Route path="/qui-sommes-nous" exact component={New_A_Propos_2025} />
|
|
|
|
*/}
|
|
|
|
|
|
<Route path="/" exact component={New_Home_Page_2025} />
|
|
|
|
<Route path="/jmjformation" exact component={Jmjformation_catalogue} />
|
|
<Route path="/jmjcatalogue" exact component={Jmjformation_catalogue} />
|
|
|
|
{/* Debut Migration */}
|
|
<Route path="/Partner/:action/:orderid/:packs" exact component={Partner} />
|
|
<Route path="/Partner/:action/:orderid" exact component={Partner} />
|
|
<Route path="/Partner/:action" exact component={Partner} />
|
|
<Route path="/Partner" exact component={Partner} />
|
|
<Route path="/recherche-formation" exact component={New_Marktplace_2025} />
|
|
<Route path="/recherche-formation/ref/:NewSearchText" exact component={New_Marktplace_2025} />
|
|
<Route path="/mysy-training-login/:obj/:objid" exact component={New_Sign_In_2025} />
|
|
<Route path="/Connexion" exact component={New_Sign_In_2025} />
|
|
<Route path="/Recherche-Article-formation" exact component={RechecheArticles} />
|
|
|
|
<Route path="/Display-Detail-formation_v3/:classId" exact component={New_Formation_Detail_2025} />
|
|
<Route path="/Display-Detail-formation/:classId" exact component={New_Formation_Detail_2025} />
|
|
<Route path="/Display-Detail-formation/:classId/:action" exact component={New_Formation_Detail_2025} />
|
|
<Route path="/Display-Detail-formation_old/:classId/:action" exact component={New_Formation_Detail_2025} />
|
|
|
|
<Route path="/PartnerLogin" exact component={PartnerLogin} />
|
|
<Route path="/PartnerLogin0" exact component={PartnerLogin0} />
|
|
<Route path="/PartnerLogin1" exact component={PartnerLogin1} />
|
|
|
|
<Route path="/mysy-user-account" exact component={Account} />
|
|
<Route path="/Ajout-Article-formation" exact component={AddArticle} />
|
|
<Route path="/ResetUserPwd/:token/:accounttype" exact component={ResetUserPwd} />
|
|
|
|
|
|
<Route path="/DeleteUserAccount/:token" exact component={DeleteUserAccount} />
|
|
|
|
<Route path="/mysy-student-account" exact component={Student_Account} />
|
|
<Route path="/mysy-student-planning" exact component={Student_Planning} />
|
|
|
|
{/* Fin Migration */}
|
|
|
|
|
|
|
|
<Route path="/new_header_footer/" exact component={New_Test_Header_Footer_2025} />
|
|
|
|
<Route component={NotFound} />
|
|
</Switch>
|
|
</BrowserRouter>
|
|
|
|
</Suspense>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
);
|
|
}
|
|
|
|
|
|
export default App;
|