diff --git a/package-lock.json b/package-lock.json index 81977b9..d48e97c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,6 +54,7 @@ "js-cookie": "^3.0.1", "js-file-download": "^0.4.12", "js-video-url-parser": "^0.5.1", + "lucide-react": "^0.263.1", "moment": "^2.29.4", "mui-datatables": "^4.3.0", "mui-daterange-picker": "^1.0.5", @@ -24453,6 +24454,14 @@ "es5-ext": "~0.10.2" } }, + "node_modules/lucide-react": { + "version": "0.263.1", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.263.1.tgz", + "integrity": "sha512-keqxAx97PlaEN89PXZ6ki1N8nRjGWtDa4021GFYLNj0RgruM5odbpl8GHTExj0hhPq3sF6Up0gnxt6TSHu+ovw==", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/lz-string": { "version": "1.4.4", "license": "WTFPL", @@ -61957,6 +61966,12 @@ "es5-ext": "~0.10.2" } }, + "lucide-react": { + "version": "0.263.1", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.263.1.tgz", + "integrity": "sha512-keqxAx97PlaEN89PXZ6ki1N8nRjGWtDa4021GFYLNj0RgruM5odbpl8GHTExj0hhPq3sF6Up0gnxt6TSHu+ovw==", + "requires": {} + }, "lz-string": { "version": "1.4.4" }, diff --git a/package.json b/package.json index 80211f7..c4ba273 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "js-cookie": "^3.0.1", "js-file-download": "^0.4.12", "js-video-url-parser": "^0.5.1", + "lucide-react": "^0.263.1", "moment": "^2.29.4", "mui-datatables": "^4.3.0", "mui-daterange-picker": "^1.0.5", diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index 243a2ea..927a703 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -16,7 +16,10 @@ import parse from 'html-react-parser' import { BsEye, BsFileText } from "react-icons/bs"; import { useHistory } from "react-router-dom"; import axios from "axios"; -import { CiCoffeeBean } from "react-icons/ci"; +import { CiCoffeeBean, CiDesktop, CiFileOff } from "react-icons/ci"; +import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; + +//import { LuScreenShare, LuScreenShareOff } from "react-icons/lu"; const DistplayPartnerTraningsPage = (props) => { @@ -28,10 +31,6 @@ const DistplayPartnerTraningsPage = (props) => { { value: 'title', label: 'Titre' }, { value: 'certif', label: 'Certification' } ] - - - - const [selectedfilt1, setselectedfilt1] = useState(""); const [selectedfilt2, setselectedfilt2] = useState(""); const [selectedfilt3, setselectedfilt3] = useState(""); @@ -186,6 +185,7 @@ const DistplayPartnerTraningsPage = (props) => { } 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 }, @@ -253,56 +253,64 @@ const DistplayPartnerTraningsPage = (props) => { field: "push_to_lms", headerName: 'Push Elearning', renderCell: (cellValues) => { return ( + ); } @@ -649,12 +657,22 @@ const DistplayPartnerTraningsPage = (props) => { } + const [isLoading, setLoading] = useState(); + + const [handlepush_to_lms_api, sethandlepush_to_lms_api] = useState(""); const [handlepush_to_lms_result, sethandlepush_to_lms_result] = useState(""); const [handlepush_to_lms_message, sethandlepush_to_lms_message] = useState(""); function handlepush_to_lms(event, cellValues) { + if (cellValues.row.lms_class_code && String(cellValues.row.lms_class_code).length > 2) { + alert(" Cette formation est déjà publiée sur la plateforme de E-Learning"); + return; + } + + setLoading(true); + //console.log(" ### event.target.value = ", event.target.value); const formData = new FormData(); const url = process.env.REACT_APP_API_URL + "myclass/api/Push_Class_To_MySy_LMS/"; @@ -671,8 +689,9 @@ const DistplayPartnerTraningsPage = (props) => { sethandlepush_to_lms_api("true"); sethandlepush_to_lms_result(res.data.message); - alert(res.data.message ); - + setLoading(false); + alert(res.data.message); + } else if (String(res.data.status) === String("Err_Connexion")) { @@ -684,12 +703,14 @@ const DistplayPartnerTraningsPage = (props) => { sethandlepush_to_lms_api("false"); sethandlepush_to_lms_message(res.data.message); - alert("Erreur : "+res.data.message ); + setLoading(false); + alert("Erreur : " + res.data.message); } }).catch((error) => { console.warn('Erro handlepush_to_lms = ', error); sethandlepush_to_lms_api("false"); + setLoading(false); }) } @@ -697,13 +718,9 @@ const DistplayPartnerTraningsPage = (props) => { return (
- {/*String(myApiResponse) === String("False") &&
- -
Impossible de contacter l'hote distant
- -
- - */} + {isLoading &&
+
+
} {updatetraining &&
@@ -838,6 +855,7 @@ const DistplayPartnerTraningsPage = (props) => { price: JSON.parse(item).price, description: parse((JSON.parse(item).description).replace(/(<([^>]+)>)/ig, '')), published: JSON.parse(item).published, + lms_class_code: JSON.parse(item).lms_class_code, } ))} diff --git a/src/components/Partner.js b/src/components/Partner.js index 75621cf..bd28adb 100644 --- a/src/components/Partner.js +++ b/src/components/Partner.js @@ -36,7 +36,8 @@ import Pricing from "./Pricing"; import { FcHome, FcButtingIn, FcDepartment, FcBullish, FcAddDatabase, FcFolder, FcList, FcGraduationCap, FcMultipleDevices, FcCurrencyExchange, - FcMoneyTransfer, FcFeedback, FcKey, FcVideoCall, FcSettings + FcMoneyTransfer, FcFeedback, FcKey, FcVideoCall, FcSettings, + FcBusinesswoman, FcServices, FcCollect, FcCandleSticks } from "react-icons/fc"; //import { FcHome} from "react-icons/fc"; @@ -177,7 +178,7 @@ const Partner = (props) => { const [isimage, setisimage] = useState(); function getImage(e) { - var myurl = process.env.REACT_APP_API_URL + "myclass/api/getRecodedImage/"; + var myurl = process.env.REACT_APP_API_URL + "myclass/api/getRecodedImage/"; var form = new FormData(); form.append("token", stored_cookie); form.append("type", "partner"); @@ -689,66 +690,45 @@ const Partner = (props) => { {String(menu) !== "statistique" &&
STATISTIQUES
} {String(menu) === "statistique" &&
STATISTIQUES
}
+
Mes Clients
-
- {String(deplie_mes_clients) === "1" &&
- Mes Clients + +
+
+ {String(menu) !== "mes_clients" &&
   MES CLIENTS
} + {String(menu) === "mes_clients" &&
    MES CLIENTS
} +
+ +
+
+ {String(menu) !== "mes_devis" &&
   MES DEVIS
} + {String(menu) === "mes_devis" &&
    MES DEVIS
} +
+ +
+
+ {String(menu) !== "mes_cmd" &&
   MES COMMANDES
} + {String(menu) === "mes_cmd" &&
    MES COMMANDES
} +
+ + +
Espace E-Learning
+ + + {String(has_partner_lms_url) === "1" &&
{ + e.preventDefault(); + window.open( + partner_lms_url, + '_blank' + ); + }}>   MON HEBERGEMENT
} + + {String(has_partner_lms_url) === "1" &&
+
+ {String(menu) !== "statistique" &&
   CONFIGURATION
} + {String(menu) === "statistique" &&
    CONFIGURATION
}
} -
- - {String(deplie_mes_clients) !== "1" && -
- -
- -
-
- {String(menu) !== "mes_clients" &&
   MES CLIENTS
} - {String(menu) === "mes_clients" &&
    MES CLIENTS
} -
- -
-
- {String(menu) !== "mes_devis" &&
   MES DEVIS
} - {String(menu) === "mes_devis" &&
    MES DEVIS
} -
- -
-
- {String(menu) !== "mes_cmd" &&
   MES COMMANDES
} - {String(menu) === "mes_cmd" &&
    MES COMMANDES
} -
-
} - - -
- - {String(deplie_hebergement) === "1" &&
- Espace E-Learning -
} - -
- - {String(deplie_hebergement) !== "1" && -
- -
- - {String(has_partner_lms_url) === "1" &&
{ - e.preventDefault(); - window.open( - partner_lms_url, - '_blank' - ); - }}>   MON HEBERGEMENT
} - - {String(has_partner_lms_url) === "1" &&
-
- {String(menu) !== "statistique" &&
   CONFIGURATION
} - {String(menu) === "statistique" &&
    CONFIGURATION
} -
} -
}
diff --git a/src/components/Partner_Client.js b/src/components/Partner_Client.js index 4d26674..87e1b1a 100644 --- a/src/components/Partner_Client.js +++ b/src/components/Partner_Client.js @@ -197,6 +197,15 @@ const Partner_Client = (props) => {
+ + +