Skip to content

Commit

Permalink
Created a confirmation box when deleting or archiving data
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Jul 7, 2023
1 parent 6ea02db commit ae46b9f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/org/computate/frFR/java/ConfigCles.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class ConfigCles {
public static final String str_API = "str_API";
public static final String str_chemin_absolu = "str_chemin_absolu";
public static final String str_chemin_absolu_url = "str_chemin_absolu_url";
public static final String str_confirmer_supprimer = "str_confirmer_supprimer";
public static final String str_confirmer_archiver = "str_confirmer_archiver";
public static final String str_créé_nouveau = "str_créé_nouveau";
public static final String str_Creer_ = "str_Creer_";
public static final String str__dans_Solr = "str__dans_Solr";
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/org/computate/frFR/java/EcrireGenClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -5666,7 +5666,19 @@ else if("Boolean".equals(entiteNomSimple)) {
tl(2, "{{/eq}}");
tl(1, "{{/eq}}");
tl(1, "{{#eq 'Page' ", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}");
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, "')); }); \"");
t(15, "onchange=\"");
if(
entiteVar.equals(langueConfig.getString(ConfigCles.var_supprime))
|| entiteVar.equals(langueConfig.getString(ConfigCles.var_archive))
) {
s("var confirmResponse = confirm('", langueConfig.getString(entiteVar.equals(langueConfig.getString(ConfigCles.var_supprime)) ? ConfigCles.str_confirmer_supprimer : ConfigCles.str_confirmer_archiver), "'); ");
s("if(confirmResponse) { ");
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, "')); }); ");
s("}");
} else {
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, "')); }); ");
}
l("\"");
tl(1, "{{/eq}}");

tl(1, "{{#eq 'Page' ", langueConfig.getString(ConfigCles.var_classeApiMethodeMethode), "}}");
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/org/computate/i18n/i18n_enUS.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
str_confirmer_supprimer: "Are you sure you want to delete that?"
str_confirmer_archiver: "Are you sure you want to archive that?"
str_a_démarré: "started"
str_a_échoué: "failed"
str_a_réussi: "succeeded"
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/org/computate/i18n/i18n_frFR.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
str_confirmer_supprimer: "Voulez-vous vraiment supprimer cela ?"
str_confirmer_archiver: "Voulez-vous vraiment archiver cela ?"
str_a_démarré: "a démarré"
str_a_échoué: "a échoué"
str_a_réussi: "a réussi"
Expand Down

0 comments on commit ae46b9f

Please sign in to comment.