From 06f99ca5e6a682e8c48972337592aa0f767b02b4 Mon Sep 17 00:00:00 2001 From: cherif Date: Mon, 29 Jul 2024 13:19:26 +0200 Subject: [PATCH] 29/07/2024 - 12h --- src/components/Module_Email_Management.js | 344 +++++++++++++----- src/components/Partner_Commande.js | 1 - src/components/TestUrl_new.js | 23 +- .../components/_module_email_management.scss | 17 +- 4 files changed, 288 insertions(+), 97 deletions(-) diff --git a/src/components/Module_Email_Management.js b/src/components/Module_Email_Management.js index 601db94..5a50479 100644 --- a/src/components/Module_Email_Management.js +++ b/src/components/Module_Email_Management.js @@ -97,6 +97,7 @@ const Module_Email_Management = (props) => { }; const Dialog_1_handleClose_buton = () => { + setselected_courrier_template_id(""); setDialog_1_open(false); }; @@ -151,15 +152,20 @@ const Module_Email_Management = (props) => { const [one_field_corp_mail_initial_value, setone_field_corp_mail_initial_value] = useState(""); const one_editorRef_programme = useRef(null); + const [one_editorRef_programme_limite, setone_editorRef_programme_limite] = useState(1000); + const [field_programme, setfield_programme] = useState(""); const [field_programme_initial_value, setfield_programme_initial_value] = useState(""); const [one_field_programme, setone_field_programme] = useState(""); const [one_field_programme_initial_value, setone_field_programme_initial_value] = useState(""); + const one_editorRef_corp_mail = useRef(null); + const [one_editorRef_corp_mail_limite, setone_editorRef_corp_mail_limite] = useState(1000); + const [partner_document_data_changed, setpartner_document_data_changed] = useState(""); const [New_Get_Partner_List_SendEmail_Document_result, setNew_Get_Partner_List_SendEmail_Document_result] = useState([]); @@ -201,6 +207,7 @@ const Module_Email_Management = (props) => { var local_type_doc = JSON.parse(x).type_doc; var local_cible = JSON.parse(x).cible; var local_joint_pdf = JSON.parse(x).joint_pdf; + var local_contenu_doc = JSON.parse(x).contenu_doc; @@ -215,11 +222,12 @@ const Module_Email_Management = (props) => { "type_doc": local_type_doc, "cible": local_cible, "joint_pdf": local_joint_pdf, + "contenu_doc": local_contenu_doc, }; new_data2.push(node); - console.log(" ## node = ", node) + // console.log(" ## node = ", node) }); if (new_data2.length > 0) @@ -260,7 +268,7 @@ const Module_Email_Management = (props) => { if (String(res.data.status) === "true") { //console.log(" In Get_Given_Partner_Document_Data_By_id res.data.status = " + res.data.status); - console.log(" In Get_Given_Partner_Document_Data_By_id res.data.message r_class = " + res.data.message); + // console.log(" In Get_Given_Partner_Document_Data_By_id res.data.message r_class = " + res.data.message); setLoading(false); setGet_Given_Partner_Document_Data_By_id_api("true"); setGet_Given_Partner_Document_Data_By_id_result(res.data.message); @@ -324,16 +332,21 @@ const Module_Email_Management = (props) => { setfield_programme(""); + // set_field_corp_mail(""); if (mylocal_document.contenu_doc) { setone_field_programme(String(mylocal_document.contenu_doc)); setone_field_programme_initial_value(String(mylocal_document.contenu_doc)); + set_field_corp_mail(String(mylocal_document.contenu_doc)); + one_editorRef_programme.current.insertContent(String(mylocal_document.contenu_doc)); + + } - set_field_corp_mail(""); - if (mylocal_document.corps_mail) { - setone_field_corp_mail(String(mylocal_document.corps_mail)); - setone_field_corp_mail_initial_value(String(mylocal_document.corps_mail)); - } + /* set_field_corp_mail(""); + if (mylocal_document.corps_mail) { + setone_field_corp_mail(String(mylocal_document.corps_mail)); + setone_field_corp_mail_initial_value(String(mylocal_document.corps_mail)); + }*/ if (document.getElementById('myRef')) { @@ -375,10 +388,33 @@ const Module_Email_Management = (props) => { useEffect(() => { Get_Partner_List_SendEmail_Document("SENDEMAIL_MODELE"); + if( props.email_destinataire){ + setemail_destinataire(props.email_destinataire) + } + + if( props.email_cc){ + setemail_cc(props.email_cc) + } + + if( props.email_bcc){ + setemail_bcc(props.email_bcc) + } }, []) + const [selected_courrier_template_id, setselected_courrier_template_id] = useState(""); + + const editorRef_programme = useRef(null); + const [editorRef_programme_limite, seteditorRef_programme] = useState(1000); + + + const [email_destinataire, setemail_destinataire] = useState(""); + const [email_cc, setemail_cc] = useState(""); + const [email_bcc, setemail_bcc] = useState(""); + + const [email_sujet, setemail_sujet] = useState(""); + return ( @@ -387,96 +423,240 @@ const Module_Email_Management = (props) => {
} -

Module gestion email

-
-
+ Choisir un modèle de courrier - {New_Get_Partner_List_SendEmail_Document_result && - fullWidth + + + + {Dialog_1_message} + - options={New_Get_Partner_List_SendEmail_Document_result} + - onChange={(event, value) => { + +
+
+ +
+
+ +
+
- /> +
+ +
+ + +
+
Gestion Email
+
Choisir un modèle de courrier + {New_Get_Partner_List_SendEmail_Document_result && { + + if (value && value._id) { + setselected_courrier_template_id(value._id); + var msg = "Vous allez modifier le coprs de l'email ! "; + setDialog_1_message(msg); + setDialog_1_open(true); + } else { + setselected_courrier_template_id(""); + var msg = "Vous allez modifier le coprs de l'email ! "; + setDialog_1_message(msg); + setDialog_1_open(true); } - />} -
-
-
- Email -
+ }} -
- -
-
+ renderInput={(params) => -
- Corps Email -
-
- -
-
- editorRef_suivi_eval.current = editor} - initialValue={field_programme} - onKeyUp={editor_keyup} - onEditorChange={(newValue, editor) => { - if (String(editor_tochange) === "1") { - //alert(" change"); - DataUpdated(); - seteditor_tochange(""); - } - }} - init={{ - resize: false, - height: 300, - - menubar: false, - - plugins: [ - 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview', - 'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen', - 'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount' - ], - toolbar: 'undo redo | blocks | ' + - 'bold italic forecolor | alignleft aligncenter ' + - 'alignright alignjustify | bullist numlist outdent indent | ' + - 'removeformat | help', - content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }' - }} - - /> - -
-
- - - + /> + } + />}
-
+ +
+
+ Email +
+ +
+ + { + setemail_destinataire(e.target.value); + + } + } + /> + +
+
+
+
+ CC +
+ +
+ { + setemail_cc(e.target.value); + + } + } + /> +
+
+ +
+
+ BCC +
+ +
+ { + setemail_bcc(e.target.value); + + } + } + /> +
+
+ +
+
+ Sujet +
+ +
+ { + setemail_sujet(e.target.value); + + } + } + /> +
+
+ + +
+
+ + one_editorRef_programme.current = editor} + //initialValue={field_programme_initial_value} + + onKeyUp={editor_keyup} + value={field_programme} + onEditorChange={(newValue, editor) => { + setfield_programme(one_editorRef_programme.current.getContent()); + setpartner_document_data_changed("1"); + + }} + init={{ + resize: false, + height: 500, + menubar: true, + plugins: [ + 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace', + 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount', + 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks', + + ], + toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' + + 'alignleft aligncenter alignright alignjustify | ' + + 'bullist numlist checklist outdent indent | removeformat | a11ycheck code table help', + + content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px; }' + }} + /> + +
+
+ + +
+
+ +
+
+ +
+
+ + diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index e8b29ea..6697599 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -5043,7 +5043,6 @@ const Partner_Commande = (props) => {
Description
{ { /********* Dialog email */} - MySy Information - + + {Dialog_1_message} - + - + {/*
@@ -686,7 +691,7 @@ const TestUrl_New = (props) => {
-
+
*/}
{ /********* Dialog email */} diff --git a/src/styles/components/_module_email_management.scss b/src/styles/components/_module_email_management.scss index eb95b3b..4a98093 100644 --- a/src/styles/components/_module_email_management.scss +++ b/src/styles/components/_module_email_management.scss @@ -1,5 +1,6 @@ .module_email_management { + .test01 { font-size: 3rem; // color: red; @@ -2500,7 +2501,8 @@ .DialogContent_width { - width: 600px !important; + width: 1500px !important; + max-width: 1500px !important; } .DialogContent_width_session { @@ -2509,14 +2511,15 @@ .div_row_gauche_dialog_session { - width: 30%; + width: 20%; float: left; font-weight: 700; } .div_row_droite_dialog_session { - width: 69%; + width: 79%; float: right; + text-align: left; } // end media @@ -2532,11 +2535,11 @@ .session_caract_Dialog { width: 100%; - padding: 5px; + padding: 2px; float: left; text-align: left; font-size: small; - margin-bottom: 1rem !important; + margin-bottom: 0px !important; } .session_caract_Dialog_comment_2_lines { @@ -2655,4 +2658,8 @@ .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input { padding-left: 5px !important; padding-right: 1rem !important; +} + +.tox-promotion { + display: none !important; } \ No newline at end of file