diff --git a/src/components/Article.js b/src/components/Article.js index d153138..accfed0 100644 --- a/src/components/Article.js +++ b/src/components/Article.js @@ -289,6 +289,10 @@ const Article = (props) => { const Dialog_article_avis_handleClose_buton = () => { setDialog_article_avis_open(false); + sethandleSubmission_img_article_message(""); + setlogo_file_name(""); + setimg_img_article_file(""); + setimg_img_article_file2(""); clear_article_avis_fields(); }; @@ -487,7 +491,8 @@ const Article = (props) => { } //image/png - if (String(file_type) !== "image/png") { + if (String(file_type) !== "image/png" && String(file_type) !== "image/jpg" && + String(file_type) !== "image/jpeg") { alert("Le fichier n'est pas au format PNG"); return; } @@ -507,8 +512,8 @@ const Article = (props) => { _URL.revokeObjectURL(objectUrl); console.log(" img_width = ", img_width, " img_height = ", img_height) - if (parseFloat(img_width) > 130 && parseFloat(img_width) < 1000 && - parseFloat(img_height) > 130 && parseFloat(img_height) < 1000) { + if (parseFloat(img_width) > 130 && parseFloat(img_width) < 1100 && + parseFloat(img_height) > 130 && parseFloat(img_height) < 1100) { //console.log(" img_height est = ", img_height, " < à 1500 "); // Verification que le nom du fichier est alpha numerique @@ -849,7 +854,7 @@ const Article = (props) => { "background": "#c8cfd5", "minWidth": "15rem", "color": "black", "width": "auto" }} - id='menu_import_formation' name='menu_import_formation'>Choisir une image  
+ id='menu_import_formation' name='menu_import_formation'>Choisir une image  
diff --git a/src/components/RechercheArticles_new_v2.js b/src/components/RechercheArticles_new_v2.js index 129e352..577aa44 100644 --- a/src/components/RechercheArticles_new_v2.js +++ b/src/components/RechercheArticles_new_v2.js @@ -762,8 +762,14 @@ const RechercheArticles_new_v2 = (props) => { const Dialog_article_avis_handleClose_buton = () => { setDialog_article_avis_open(false); + sethandleSubmission_img_article_message(""); + setlogo_file_name(""); + setimg_img_article_file(""); + setimg_img_article_file2(""); clear_article_avis_fields(); + + }; function clear_article_avis_fields() { @@ -931,9 +937,11 @@ const RechercheArticles_new_v2 = (props) => { return; } + //image/png - if (String(file_type) !== "image/png") { - alert("Le fichier n'est pas au format PNG"); + if (String(file_type) !== "image/png" && String(file_type) !== "image/jpg" && + String(file_type) !== "image/jpeg") { + alert("Le fichier n'est pas au format PNG, String(file_type)" + String(file_type)); return; } @@ -952,8 +960,8 @@ const RechercheArticles_new_v2 = (props) => { _URL.revokeObjectURL(objectUrl); console.log(" img_width = ", img_width, " img_height = ", img_height) - if (parseFloat(img_width) > 130 && parseFloat(img_width) < 1000 && - parseFloat(img_height) > 130 && parseFloat(img_height) < 1000) { + if (parseFloat(img_width) > 130 && parseFloat(img_width) < 1100 && + parseFloat(img_height) > 130 && parseFloat(img_height) < 1100) { //console.log(" img_height est = ", img_height, " < à 1500 "); // Verification que le nom du fichier est alpha numerique @@ -1295,7 +1303,7 @@ const RechercheArticles_new_v2 = (props) => { "background": "#c8cfd5", "minWidth": "15rem", "color": "black", "width": "auto" }} - id='menu_import_formation' name='menu_import_formation'>Choisir une image  
+ id='menu_import_formation' name='menu_import_formation'>Choisir une image