diff --git a/src/App.js b/src/App.js
index 40148ad..5b440d6 100644
--- a/src/App.js
+++ b/src/App.js
@@ -70,34 +70,60 @@ function App() {
dynamicWidth: window.innerHeight
});
-/*
+
+ const getSubdomain = url => {
+ let domain = url;
+ if (url.includes("://")) {
+ domain = url.split('://')[1];
+ }
+ const subdomain = domain.split('.')[0];
+ return subdomain;
+ };
+
+
useEffect(() => {
- // Verifier s'il y a un sous domaine
- var tab_split_sous_domain = window.location.host.split(".");
+ let myurl = window.location.host;
+ let myurl_pathname = window.location.pathname;
- console.log(" yaaaaaaaaaa tab_split_sous_domain = ", tab_split_sous_domain);
+ //console.log(" url 12 = ", myurl);
- console.log("process.env.REACT_APP_FRONT_URL_CANONICAL = ", process.env.REACT_APP_FRONT_URL_CANONICAL);
+ //console.log(" action 12 = ", window.location.pathname);
- if(String(tab_split_sous_domain[0]) !== String(process.env.REACT_APP_FRONT_URL_CANONICAL) ){
- console.log(" La racine n'est pas normal, on redirige");
- var new_url = process.env.REACT_APP_FRONT_URL_CANONICAL_BASE + tab_split_sous_domain[0] + "." + process.env.REACT_APP_FRONT_URL_CANONICAL + "moncatalog";
+ var domain = myurl;
+ if (domain.includes('://')) {
+ domain = myurl.split('://')[1];
+ }
- console.log(" La racine n'est pas normal, on redirige vers : ");
+ var tab_split = domain.split('.');
- console.log(" new_url = ", new_url);
+ const subdomain = domain.split('.')[0];
+ // console.log(" subdomain 12 = ", subdomain);
- window.open( String(new_url),
+ if (tab_split.length > 1 && myurl_pathname) {
+
+ //console.log(" on est dans myurl_pathname = ", myurl_pathname);
+
+ var tab_action = ['/moncatalog', '/Display-Partner-Catalog-Detail-formation'];
+
+ if (!tab_action.includes(myurl_pathname)) {
+ console.log(' le traitement a faire est : ', myurl_pathname);
+ var new_url = window.location.protocol + "//" + domain.split('.')[0] + "." + domain.split('.')[1] + "/moncatalog";
+ //console.log(' new_url =', new_url);
+
+ window.open(
+ new_url,
'_self'
- );
+ );
+
+ }
- return;
}
- }, []);*/
+
+ }, []);
return (
diff --git a/src/components/Display_Partner_Catalog_DetailClass_new_v2.js b/src/components/Display_Partner_Catalog_DetailClass_new_v2.js
index 5241866..dba2aeb 100644
--- a/src/components/Display_Partner_Catalog_DetailClass_new_v2.js
+++ b/src/components/Display_Partner_Catalog_DetailClass_new_v2.js
@@ -126,7 +126,7 @@ const Display_Partner_Catalog_DetailClass_new_v2 = (props) => {
useEffect(() => {
- Get_Subdomain_Partner_Data(window.location.host.split(".")[0])
+ Get_Subdomain_Partner_Data(window.location.host);
async function funclocaltoken() {
@@ -1176,9 +1176,14 @@ const Display_Partner_Catalog_DetailClass_new_v2 = (props) => {
const [Get_Subdomain_Partner_Data_result, setGet_Subdomain_Partner_Data_result] = useState();
function Get_Subdomain_Partner_Data(local_url_subdomain) {
- var form = new FormData();
+ let domain = local_url_subdomain;
+ if (domain.includes("://")) {
+ domain = domain.split('://')[1];
+ }
+ const subdomain = domain.split('.')[0];
- form.append("subdomain", local_url_subdomain);
+ var form = new FormData();
+ form.append("subdomain", subdomain);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Data_From_Subdomain/";
@@ -1924,7 +1929,7 @@ const Display_Partner_Catalog_DetailClass_new_v2 = (props) => {
-
+
diff --git a/src/components/Mon_Catalogue_Public.js b/src/components/Mon_Catalogue_Public.js
index bb6949d..6ab4780 100644
--- a/src/components/Mon_Catalogue_Public.js
+++ b/src/components/Mon_Catalogue_Public.js
@@ -951,7 +951,10 @@ const Mon_Catalogue_Public = () => {
var ip = "";
- Get_Subdomain_Partner_Data(window.location.host.split(".")[0])
+ Get_Subdomain_Partner_Data(window.location.host)
+
+
+
async function fetchData() {
// const result = await axios('https://geolocation-db.com/json/',);
@@ -1499,7 +1502,7 @@ const Mon_Catalogue_Public = () => {
myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login/";
form.append("subdomain", window.location.host.split(".")[0]);
- console.log(" ######### laaaaaaaaaaaaa subdomain = ", window.location.host.split(".")[0])
+ //console.log(" ######### laaaaaaaaaaaaa subdomain = ", window.location.host.split(".")[0])
} else {
@@ -2597,9 +2600,16 @@ const Mon_Catalogue_Public = () => {
const [Get_Subdomain_Partner_Data_result, setGet_Subdomain_Partner_Data_result] = useState();
function Get_Subdomain_Partner_Data(local_url_subdomain) {
+ let domain = local_url_subdomain;
+ if (local_url_subdomain.includes("://")) {
+ domain = url.split('://')[1];
+ }
+
+ const subdomain = domain.split('.')[0];
+
var form = new FormData();
- form.append("subdomain", local_url_subdomain);
+ form.append("subdomain", subdomain);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Data_From_Subdomain/";
@@ -2607,7 +2617,7 @@ const Mon_Catalogue_Public = () => {
if (String(res.data.status) === "true") {
//console.log(" In Get_Subdomain_Partner_Data res.data.status = " + res.data.status);
- // console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message);
+ // console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message);
setGet_Subdomain_Partner_Data_api("true");
setGet_Subdomain_Partner_Data_result(res.data.message);
@@ -2630,6 +2640,10 @@ const Mon_Catalogue_Public = () => {
if (JSON.parse(x).catalog_pub_message_2_txt)
catalog_pub_message_2_txt = JSON.parse(x).catalog_pub_message_2_txt;
+ var catalog_pub_message_3_txt = ""
+ if (JSON.parse(x).catalog_pub_message_3_txt)
+ catalog_pub_message_3_txt = JSON.parse(x).catalog_pub_message_3_txt;
+
var catalog_pub_theme_id = JSON.parse(x).catalog_pub_theme_id;
@@ -2646,6 +2660,7 @@ const Mon_Catalogue_Public = () => {
"catalog_pub_banniere_img": catalog_pub_banniere_img,
"catalog_pub_message_1_txt": catalog_pub_message_1_txt,
"catalog_pub_message_2_txt": catalog_pub_message_2_txt,
+ "catalog_pub_message_3_txt": catalog_pub_message_3_txt,
"catalog_pub_theme_id": catalog_pub_theme_id,
"theme_code": theme_code,
@@ -2703,7 +2718,7 @@ const Mon_Catalogue_Public = () => {
{/******* Gestion du THEME "MySy_Theme3" */}
{New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
&& String(New_Get_Subdomain_Partner_Data_result[0].theme_code) === "MySy_Theme3" &&
-
+
{New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
&& New_Get_Subdomain_Partner_Data_result[0].catalog_pub_banniere_img &&

@@ -3417,127 +3432,6 @@ const Mon_Catalogue_Public = () => {
}
- {/*
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
*/}
-
- {/*
*/}
-
-
-
-
}
@@ -3858,18 +3752,11 @@ const Mon_Catalogue_Public = () => {
- {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
- && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_3_txt &&
toooooo }
-
-
-
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_3_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_3_txt} }
+
diff --git a/src/components/UpdatePartnerInfo.js b/src/components/UpdatePartnerInfo.js
index 7849f37..64b69d6 100644
--- a/src/components/UpdatePartnerInfo.js
+++ b/src/components/UpdatePartnerInfo.js
@@ -504,117 +504,22 @@ function UpdateParnterInfo(props) {
async function desablefield1() {
setdatamodification();
+ await sleep(20);
+ const list_fields = ['adr_city', 'adr_zip', 'adr_country',
+ 'telephone', 'siret', 'num_nda',
+ 'link_facebook', 'link_linkedin', 'link_twitter',
+ 'adr_street', 'nom', 'contact_tel',
+ 'contact_nom', 'contact_prenom', 'contact_mail',
+ 'email', 'website', 'website',
+ 'isqualiopi', 'iscertifvoltaire',]
- if (document.getElementsByName("adr_city")[0]) {
- document.getElementsByName("adr_city")[0].disabled = true;
- document.getElementsByName("adr_city")[0].style.backgroundColor = "#ECEFF1";
- }
+ for (let i = 0; i < list_fields.length; i++) {
+ if (document.getElementsByName(String(list_fields[i])) && document.getElementsByName(String(list_fields[i]))[0]) {
+ document.getElementsByName(String(list_fields[i]))[0].disabled = true;
+ document.getElementsByName(String(list_fields[i]))[0].style.backgroundColor = "#ECEFF1";
- if (document.getElementsByName("adr_zip")[0]) {
- document.getElementsByName("adr_zip")[0].disabled = true;
- document.getElementsByName("adr_zip")[0].style.backgroundColor = "#ECEFF1";
- }
-
-
-
- if (document.getElementsByName("adr_country")[0]) {
- document.getElementsByName("adr_country")[0].disabled = true;
- document.getElementsByName("adr_country")[0].style.backgroundColor = "#ECEFF1";
- }
- if (document.getElementsByName("telephone")[0]) {
- document.getElementsByName("telephone")[0].disabled = true;
- document.getElementsByName("telephone")[0].style.backgroundColor = "#ECEFF1";
- }
-
-
- if (document.getElementsByName("siret") && document.getElementsByName("siret")[0]) {
- document.getElementsByName("siret")[0].disabled = true;
- document.getElementsByName("siret")[0].style.backgroundColor = "#ECEFF1";
- } else {
- // 18/04/2024 - un truc bizarre, parfois il faut attendre un peu avant que l'objet ne soit créé, d'ou ce wait si l'objet n'existe pas
- await sleep(20);
- document.getElementsByName("siret")[0].disabled = true;
- document.getElementsByName("siret")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("num_nda") && document.getElementsByName("num_nda")[0]) {
- document.getElementsByName("num_nda")[0].disabled = true;
- document.getElementsByName("num_nda")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("link_facebook")[0]) {
- document.getElementsByName("link_facebook")[0].disabled = true;
- document.getElementsByName("link_facebook")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("link_linkedin")[0]) {
- document.getElementsByName("link_linkedin")[0].disabled = true;
- document.getElementsByName("link_linkedin")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("link_twitter")[0]) {
- document.getElementsByName("link_twitter")[0].disabled = true;
- document.getElementsByName("link_twitter")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("adr_street")[0]) {
- document.getElementsByName("adr_street")[0].disabled = true;
- document.getElementsByName("adr_street")[0].style.backgroundColor = "#ECEFF1";
-
- }
-
- if (document.getElementsByName("nom")[0]) {
- document.getElementsByName("nom")[0].disabled = true;
- document.getElementsByName("nom")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("contact_tel")[0]) {
- document.getElementsByName("contact_tel")[0].disabled = true;
- document.getElementsByName("contact_tel")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("contact_nom")[0]) {
- document.getElementsByName("contact_nom")[0].disabled = true;
- document.getElementsByName("contact_nom")[0].style.backgroundColor = "#ECEFF1";
- }
-
-
- if (document.getElementsByName("contact_prenom")[0]) {
- document.getElementsByName("contact_prenom")[0].disabled = true;
- document.getElementsByName("contact_prenom")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("contact_mail")[0]) {
- document.getElementsByName("contact_mail")[0].disabled = true;
- document.getElementsByName("contact_mail")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("email")[0]) {
- document.getElementsByName("email")[0].disabled = true;
- document.getElementsByName("email")[0].style.backgroundColor = "#ECEFF1";
- }
-
-
- if (document.getElementsByName("website")[0]) {
- document.getElementsByName("website")[0].disabled = true;
- document.getElementsByName("website")[0].style.backgroundColor = "#ECEFF1";
- }
-
-
- if (document.getElementsByName("isdatadock")[0]) {
- document.getElementsByName("isdatadock")[0].disabled = true;
- document.getElementsByName("isdatadock")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("isqualiopi")[0]) {
- document.getElementsByName("isqualiopi")[0].disabled = true;
- document.getElementsByName("isqualiopi")[0].style.backgroundColor = "#ECEFF1";
- }
-
- if (document.getElementsByName("iscertifvoltaire")[0]) {
- document.getElementsByName("iscertifvoltaire")[0].disabled = true;
- document.getElementsByName("iscertifvoltaire")[0].style.backgroundColor = "#ECEFF1";
+ }
}
setfields1desabled(true);
@@ -625,122 +530,23 @@ function UpdateParnterInfo(props) {
setuserformedited("1");
+ const list_fields = ['adr_city', 'adr_zip', 'adr_country',
+ 'telephone', 'siret', 'num_nda',
+ 'link_facebook', 'link_linkedin', 'link_twitter',
+ 'adr_street', 'nom', 'contact_tel',
+ 'contact_nom', 'contact_prenom', 'contact_mail',
+ 'email', 'website', 'website',
+ 'isqualiopi', 'iscertifvoltaire',]
- if (document.getElementsByName("adr_city")[0]) {
- document.getElementsByName("adr_city")[0].disabled = false;
- document.getElementsByName("adr_city")[0].style.backgroundColor = "#FFFFFF";
- }
+ for (let i = 0; i < list_fields.length; i++) {
+ if (document.getElementsByName(String(list_fields[i])) && document.getElementsByName(String(list_fields[i]))[0]) {
+ document.getElementsByName(String(list_fields[i]))[0].disabled = false;
+ document.getElementsByName(String(list_fields[i]))[0].style.backgroundColor = "#FFFFFF";
- if (document.getElementsByName("adr_zip")[0]) {
- document.getElementsByName("adr_zip")[0].disabled = false;
- document.getElementsByName("adr_zip")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
-
- if (document.getElementsByName("adr_country")[0]) {
- document.getElementsByName("adr_country")[0].disabled = false;
- document.getElementsByName("adr_country")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("telephone")[0]) {
- document.getElementsByName("telephone")[0].disabled = false;
- document.getElementsByName("telephone")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("siret")[0]) {
- document.getElementsByName("siret")[0].disabled = false;
- document.getElementsByName("siret")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("num_nda")[0]) {
- document.getElementsByName("num_nda")[0].disabled = false;
- document.getElementsByName("num_nda")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("link_facebook")[0]) {
- document.getElementsByName("link_facebook")[0].disabled = false;
- document.getElementsByName("link_facebook")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("link_linkedin")[0]) {
- document.getElementsByName("link_linkedin")[0].disabled = false;
- document.getElementsByName("link_linkedin")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("link_twitter")[0]) {
- document.getElementsByName("link_twitter")[0].disabled = false;
- document.getElementsByName("link_twitter")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("adr_street")[0]) {
- document.getElementsByName("adr_street")[0].disabled = false;
- document.getElementsByName("adr_street")[0].style.backgroundColor = "#FFFFFF";
- }
-
- if (String(is_partner_admin_account) === "1") {
- if (document.getElementsByName("nom")[0]) {
- document.getElementsByName("nom")[0].disabled = false;
- document.getElementsByName("nom")[0].style.backgroundColor = "#FFFFFF";
}
}
- if (document.getElementsByName("contact_tel")[0]) {
- document.getElementsByName("contact_tel")[0].disabled = false;
- document.getElementsByName("contact_tel")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("contact_nom")[0]) {
- document.getElementsByName("contact_nom")[0].disabled = false;
- document.getElementsByName("contact_nom")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("contact_prenom")[0]) {
- document.getElementsByName("contact_prenom")[0].disabled = false;
- document.getElementsByName("contact_prenom")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("contact_mail")[0]) {
- document.getElementsByName("contact_mail")[0].disabled = false;
- document.getElementsByName("contact_mail")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
-
- if (document.getElementsByName("website")[0]) {
- document.getElementsByName("website")[0].disabled = false;
- document.getElementsByName("website")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("isdatadock")[0]) {
- document.getElementsByName("isdatadock")[0].disabled = false;
- document.getElementsByName("isdatadock")[0].style.backgroundColor = "#FFFFFF";
- }
-
-
- if (document.getElementsByName("isqualiopi")[0]) {
- document.getElementsByName("isqualiopi")[0].disabled = false;
- document.getElementsByName("isqualiopi")[0].style.backgroundColor = "#FFFFFF";
-
- }
-
- if (document.getElementsByName("iscertifvoltaire")[0]) {
- document.getElementsByName("iscertifvoltaire")[0].disabled = false;
- document.getElementsByName("iscertifvoltaire")[0].style.backgroundColor = "#FFFFFF";
- }
-
setfields1desabled(false);
window.scrollTo({
top: 0,
@@ -1006,6 +812,7 @@ function UpdateParnterInfo(props) {
form.append("theme_id", selected_catalog_pub_theme_id);
form.append("message_1_txt", p_catalog_pub_message_1_txt);
form.append("message_2_txt", p_catalog_pub_message_2_txt);
+ form.append("message_3_txt", p_catalog_pub_message_3_txt);
form.append("_id", selected_catalog_pub_config_id);
@@ -1024,6 +831,7 @@ function UpdateParnterInfo(props) {
setAdd_Update_Catalog_Pub_Theme_api("true");
setAdd_Update_Catalog_Pub_Theme_result(res.data.message);
+ Get_Partner_Catalog_Pub_Config();
alert(res.data.message);
}
@@ -1793,6 +1601,11 @@ function UpdateParnterInfo(props) {
const [submenu_catalog_pub, setsubmenu_catalog_pub] = useState("design");
function submenu_catalog_pub_design() {
setsubmenu_catalog_pub("design");
+
+ if (String(catalog_pub_config_edit) !== "1") {
+ disable_catalog_pub_fields();
+ }
+
}
function submenu_catalog_pub_logo() {
@@ -1898,8 +1711,12 @@ function UpdateParnterInfo(props) {
const [selected_catalog_pub_theme_preview, setselected_catalog_pub_theme_preview] = useState("");
const [p_catalog_pub_message_1_txt, setp_catalog_pub_message_1_txt] = useState("");
const [p_catalog_pub_message_2_txt, setp_catalog_pub_message_2_txt] = useState("");
+ const [p_catalog_pub_message_3_txt, setp_catalog_pub_message_3_txt] = useState("");
+ const [catalog_pub_config_edit, setcatalog_pub_config_edit] = useState("");
+ const [catalog_pub_config_changed, setcatalog_pub_config_changed] = useState("");
+
const [Add_Update_Partner_Catalog_Pub_Config_api, setAdd_Update_Partner_Catalog_Pub_Config_api] = useState();
@@ -1991,7 +1808,11 @@ function UpdateParnterInfo(props) {
setp_catalog_pub_message_2_txt(JSON.parse(res.data.message).message_2_txt);
- setPartner_Catalog_Pub_theme_id(JSON.parse(res.data.message).theme_id);
+ setp_catalog_pub_message_3_txt(JSON.parse(res.data.message).message_3_txt);
+
+ setPartner_Catalog_Pub_theme_id(JSON.parse(res.data.message).theme_id);
+
+ disable_catalog_pub_fields();
}
else {
@@ -2030,7 +1851,7 @@ function UpdateParnterInfo(props) {
let file_type = event.target.files[0].type;
sethandleSubmission_bg_message("");
-
+
sethandleSubmission_bg_api("");
console.log("file_size = ", file_size, " file_type = ", file_type, " naturalWidth = ", fileUploaded.naturalWidth);
@@ -2087,12 +1908,12 @@ function UpdateParnterInfo(props) {
setimg_bg_file2(event.target.files[0]);
reader(event.target.files[0], (err, res) => {
- // console.log("#### res === ", res); // Base64 `data:image/...` String result.
+ // console.log("#### res === ", res); // Base64 `data:image/...` String result.
setimg_bg_file(res);
- });
+ });
+
-
} else {
@@ -2116,7 +1937,7 @@ function UpdateParnterInfo(props) {
fr.onload = () => callback(null, fr.result);
fr.onerror = (err) => callback(err);
fr.readAsDataURL(file);
-}
+ }
@@ -2296,13 +2117,13 @@ function UpdateParnterInfo(props) {
}
setlogo_file_name(event.target.files[0].name);
- // setimg_logo_file(URL.createObjectURL(event.target.files[0]));
+ // setimg_logo_file(URL.createObjectURL(event.target.files[0]));
setimg_logo_file2(event.target.files[0]);
reader(event.target.files[0], (err, res) => {
// console.log("#### res === ", res); // Base64 `data:image/...` String result.
setimg_logo_file(res);
- });
+ });
} else {
@@ -2332,7 +2153,7 @@ function UpdateParnterInfo(props) {
form.append("token", stored_cookie);
form.append("_id", selected_catalog_pub_config_id);
form.append("banniere_img", "");
-
+
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Catalog_Pub_Config/";
@@ -2378,7 +2199,7 @@ function UpdateParnterInfo(props) {
form.append("token", stored_cookie);
form.append("_id", selected_catalog_pub_config_id);
form.append("logo", "");
-
+
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Catalog_Pub_Config/";
@@ -2424,7 +2245,7 @@ function UpdateParnterInfo(props) {
form.append("token", stored_cookie);
form.append("_id", selected_catalog_pub_config_id);
form.append("banniere_img", img_bg_file);
-
+
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Catalog_Pub_Config/";
@@ -2471,7 +2292,7 @@ function UpdateParnterInfo(props) {
form.append("token", stored_cookie);
form.append("_id", selected_catalog_pub_config_id);
form.append("logo", img_logo_file);
-
+
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Catalog_Pub_Config/";
@@ -2506,6 +2327,54 @@ function UpdateParnterInfo(props) {
})
}
+
+
+ function Edit_Catalog_Config_Fields() {
+ setcatalog_pub_config_edit("1");
+ Enable_Suivi_Pedago_Fields();
+
+ }
+
+
+ function Annule_Edit_Catalog_Config_Fields() {
+ setcatalog_pub_config_edit("");
+ Get_Partner_Catalog_Pub_Config();
+ }
+
+
+ function disable_catalog_pub_fields() {
+
+ setcatalog_pub_config_edit("");
+ const list_fields = ['config_text_1', 'config_text_2', 'config_text_3',]
+
+ for (let i = 0; i < list_fields.length; i++) {
+ if (document.getElementsByName(String(list_fields[i])) && document.getElementsByName(String(list_fields[i]))[0]) {
+ document.getElementsByName(String(list_fields[i]))[0].disabled = true;
+ document.getElementsByName(String(list_fields[i]))[0].style.backgroundColor = "#ECEFF1";
+
+ }
+ }
+ }
+
+
+ function Enable_Suivi_Pedago_Fields() {
+ setcatalog_pub_config_edit("1");
+
+
+ const list_fields = ['config_text_1', 'config_text_2', 'config_text_3',]
+
+ for (let i = 0; i < list_fields.length; i++) {
+ if (document.getElementsByName(String(list_fields[i])) && document.getElementsByName(String(list_fields[i]))[0]) {
+ document.getElementsByName(String(list_fields[i]))[0].disabled = false;
+ document.getElementsByName(String(list_fields[i]))[0].style.backgroundColor = "#FFFFFF";
+
+ }
+ }
+ }
+
+
+
+
return (
@@ -2534,296 +2403,579 @@ function UpdateParnterInfo(props) {
}
{String(submenu).trim() === "submenu_donnee_catalog_pub" &&
-
Config. Catalog public
+
Configuration du Catalog public
-
-
-
- {String(submenu_catalog_pub) === String("design") &&
-
-
-
Choisir un exemple de thème :
-
-
(data)._id === String(selected_catalog_pub_theme_id))[0].label}
- onChange={(event, value) => {
- if (value && value._id) {
- setselected_catalog_pub_theme_id(value._id);
-
- var partner_logo_img = "data:image/png;base64," + value.theme_preview;
- setselected_catalog_pub_theme_preview(partner_logo_img);
+
- } else {
- setselected_catalog_pub_theme_id('');
- setselected_catalog_pub_theme_preview('')
- }
+ {String(submenu_catalog_pub) === String("design") &&
+
+
+
+
+
+
+ {String(catalog_pub_config_edit) === "1" &&
+
Choisir un exemple de thème :
+
+
(data)._id === String(selected_catalog_pub_theme_id))[0].label}
+ onChange={(event, value) => {
+ if (value && value._id) {
+ setselected_catalog_pub_theme_id(value._id);
+
+ var partner_logo_img = "data:image/png;base64," + value.theme_preview;
+ setselected_catalog_pub_theme_preview(partner_logo_img);
+
+
+ } else {
+ setselected_catalog_pub_theme_id('');
+ setselected_catalog_pub_theme_preview('')
+ }
+ }}
+ //value={p_one_detail_client_rattachement_nom}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+ {selected_catalog_pub_theme_preview &&
+

+
}
+
+
+
+
text 1
+ {
+ setp_catalog_pub_message_1_txt(e.target.value);
+
+ }
+ }
+ />
+
+
+
+
text 2
+ {
+ setp_catalog_pub_message_2_txt(e.target.value);
+
+ }
+ }
+ />
+
+
+
+
text 3
+ {
+ setp_catalog_pub_message_3_txt(e.target.value);
+
+ }
+ }
+ />
+
+
+
+
}
+
+ {String(catalog_pub_config_edit) !== "1" &&
+
+
Thème actuel
+ {selected_catalog_pub_theme_preview &&
+

+
}
+
+
+
+
text 1
+
+
+
+
+
text 2
+
+
+
+
+
text 3
+
+
+
+
+
}
+
+
+
+
+
+
+
+ {String(catalog_pub_config_edit) !== "1" &&
+
+
+
+
+
+
+
+
+
+
+
+
}
+
+
+
+ {String(catalog_pub_config_edit) === "1" &&
+
+
+
+
+
+
+
+
+
+
+
+
}
+
+
+
+
+
+
+
+
+
Gestion Bannière
+
+
+
+ {Partner_Catalog_Pub_banniere && String(Partner_Catalog_Pub_banniere).length > 20 &&
+ Bannière actuelle :
+

+
+
+
+
}
+
Import Bannière
+
+
+
+
+
+
-
-
- {selected_catalog_pub_theme_preview &&
-

-
}
-
+ {img_bg_file &&
Fichier à importer : {img_bg_file.name}
+
+
+
+ }
-
text 1
- La mise à jour a été correctement faite
}
+ {String(SendBackground_Img_api) === "false" &&
{SendBackground_Img_message}
}
- name="config_text_1"
- id="config_text_1"
- multiline
- rows={2}
- // className="disabled_style"
+ {String(handleSubmission_bg_api) === "false" &&
{handleSubmission_bg_message}
}
- value={p_catalog_pub_message_1_txt}
- onChange={(e) => {
- setp_catalog_pub_message_1_txt(e.target.value);
+
- }
- }
- />
+ {img_bg_file &&
+
+
+
+ {
-
+
+
+
-
text 2
- {
- setp_catalog_pub_message_2_txt(e.target.value);
-
- }
- }
- />
-
-
-
+
+
+
-
-
-
-
- {
+
}
+
+
+
-
-
-
-
-
-
-
-
-
-
-
}
-
-
+
}
+
+
+
+
+
Gestion LOGO
+
+
+
+ {Partner_Catalog_Pub_logo && String(Partner_Catalog_Pub_logo) !== "" &&
+ Logo actuel :
+

+
+
+
+
+
}
+
+
+
+
-
}
- {String(submenu_catalog_pub) === String("banniere") &&
- {Partner_Catalog_Pub_banniere && String(Partner_Catalog_Pub_banniere).length > 20 &&
- Bannière actuelle :
-

-
-
-
-
}
-
Import Bannière
-
-
-
+ }
-
-
-
- zzzz3
+