Skip to content

Commit ae46b9f

Browse files
committed
Created a confirmation box when deleting or archiving data
1 parent 6ea02db commit ae46b9f

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/main/java/org/computate/frFR/java/ConfigCles.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class ConfigCles {
2121
public static final String str_API = "str_API";
2222
public static final String str_chemin_absolu = "str_chemin_absolu";
2323
public static final String str_chemin_absolu_url = "str_chemin_absolu_url";
24+
public static final String str_confirmer_supprimer = "str_confirmer_supprimer";
25+
public static final String str_confirmer_archiver = "str_confirmer_archiver";
2426
public static final String str_créé_nouveau = "str_créé_nouveau";
2527
public static final String str_Creer_ = "str_Creer_";
2628
public static final String str__dans_Solr = "str__dans_Solr";

src/main/java/org/computate/frFR/java/EcrireGenClasse.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5666,7 +5666,19 @@ else if("Boolean".equals(entiteNomSimple)) {
56665666
tl(2, "{{/eq}}");
56675667
tl(1, "{{/eq}}");
56685668
tl(1, "{{#eq 'Page' ", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}");
5669-
tl(15, "onchange=\"patch{{", langueConfig.getString(ConfigCles.var_classeNomSimple), "}}Val([{ name: 'softCommit', value: 'true' }, { name: 'fq', value: '", classeModele ? classeVarClePrimaire : classeVarCleUnique, ":{{", classeModele ? classeVarClePrimaire : classeVarCleUnique, "}}' }], 'set", entiteVarCapitalise, "', $(this).prop('checked'), function() { ", langueConfig.getString(ConfigCles.var_ajouterLueur), "($('#{{", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}_", entiteVar, "')); }, function() { ", langueConfig.getString(ConfigCles.var_ajouterErreur), "($('#{{", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}_", entiteVar, "')); }); \"");
5669+
t(15, "onchange=\"");
5670+
if(
5671+
entiteVar.equals(langueConfig.getString(ConfigCles.var_supprime))
5672+
|| entiteVar.equals(langueConfig.getString(ConfigCles.var_archive))
5673+
) {
5674+
s("var confirmResponse = confirm('", langueConfig.getString(entiteVar.equals(langueConfig.getString(ConfigCles.var_supprime)) ? ConfigCles.str_confirmer_supprimer : ConfigCles.str_confirmer_archiver), "'); ");
5675+
s("if(confirmResponse) { ");
5676+
s("patch{{", langueConfig.getString(ConfigCles.var_classeNomSimple), "}}Val([{ name: 'softCommit', value: 'true' }, { name: 'fq', value: '", classeModele ? classeVarClePrimaire : classeVarCleUnique, ":{{", classeModele ? classeVarClePrimaire : classeVarCleUnique, "}}' }], 'set", entiteVarCapitalise, "', $(this).prop('checked'), function() { ", langueConfig.getString(ConfigCles.var_ajouterLueur), "($('#{{", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}_", entiteVar, "')); }, function() { ", langueConfig.getString(ConfigCles.var_ajouterErreur), "($('#{{", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}_", entiteVar, "')); }); ");
5677+
s("}");
5678+
} else {
5679+
s("patch{{", langueConfig.getString(ConfigCles.var_classeNomSimple), "}}Val([{ name: 'softCommit', value: 'true' }, { name: 'fq', value: '", classeModele ? classeVarClePrimaire : classeVarCleUnique, ":{{", classeModele ? classeVarClePrimaire : classeVarCleUnique, "}}' }], 'set", entiteVarCapitalise, "', $(this).prop('checked'), function() { ", langueConfig.getString(ConfigCles.var_ajouterLueur), "($('#{{", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}_", entiteVar, "')); }, function() { ", langueConfig.getString(ConfigCles.var_ajouterErreur), "($('#{{", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}_", entiteVar, "')); }); ");
5680+
}
5681+
l("\"");
56705682
tl(1, "{{/eq}}");
56715683

56725684
tl(1, "{{#eq 'Page' ", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}");

src/main/resources/org/computate/i18n/i18n_enUS.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
str_confirmer_supprimer: "Are you sure you want to delete that?"
2+
str_confirmer_archiver: "Are you sure you want to archive that?"
13
str_a_démarré: "started"
24
str_a_échoué: "failed"
35
str_a_réussi: "succeeded"

src/main/resources/org/computate/i18n/i18n_frFR.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
str_confirmer_supprimer: "Voulez-vous vraiment supprimer cela ?"
2+
str_confirmer_archiver: "Voulez-vous vraiment archiver cela ?"
13
str_a_démarré: "a démarré"
24
str_a_échoué: "a échoué"
35
str_a_réussi: "a réussi"

0 commit comments

Comments
 (0)