Skip to content

Commit

Permalink
Fixing bugs with default sort
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Nov 24, 2024
1 parent 681522c commit 2f1938d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/computate/frFR/java/EcrireApiClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -4195,6 +4195,7 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception {
String classeTriSuffixeType = classeTrisSuffixeType.get(i);
tl(4, i18nGlobale.getString(I18n.var_listeRecherche), ".sort(\"", classeTriVar, "_docvalues", classeTriSuffixeType, "\", \"", classeTriOrdre, "\");");
}
tl(4, i18nGlobale.getString(I18n.var_listeRecherche), ".setDefaultSort(true);");
}
else {
tl(4, i18nGlobale.getString(I18n.var_listeRecherche), ".sort(\"", classeVarCree, "_docvalues_date\", \"desc\");");
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/org/computate/frFR/java/EcrirePageClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -1930,12 +1930,14 @@ public void pageCodeClasseJava(String langueNom, JsonObject langueConfig) throws
if(classePageSuperNomSimple != null)
tl(1, "@Override");
tl(1, "protected void _default", langueConfig.getString(I18n.var_Tri), "Vars(List<String> l) {");
tl(2, "Optional.ofNullable(", langueConfig.getString(I18n.var_listeRecherche), classeApiClasseNomSimple, "_.getSorts()).orElse(Arrays.asList()).forEach(var", langueConfig.getString(I18n.var_Tri), "Str -> {");
tl(3, "String var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Parties), "[] = var", langueConfig.getString(I18n.var_Tri), "Str.split(\" \");");
tl(3, "String var", langueConfig.getString(I18n.var_Tri), " = ", classeNomSimple, ".", langueConfig.getString(I18n.var_recherche), "Var", classeNomSimple, "(var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Parties), "[0]);");
tl(3, "String var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Direction), " = var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Parties), "[1];");
tl(3, "l.add(String.format(\"%s %s\", var", langueConfig.getString(I18n.var_Tri), ", var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Direction), "));");
tl(2, "});");
tl(2, "if(!", langueConfig.getString(I18n.var_listeRecherche), classeApiClasseNomSimple, "_.getDefaultSort()) {");
tl(3, "Optional.ofNullable(", langueConfig.getString(I18n.var_listeRecherche), classeApiClasseNomSimple, "_.getSorts()).orElse(Arrays.asList()).forEach(var", langueConfig.getString(I18n.var_Tri), "Str -> {");
tl(4, "String var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Parties), "[] = var", langueConfig.getString(I18n.var_Tri), "Str.split(\" \");");
tl(4, "String var", langueConfig.getString(I18n.var_Tri), " = ", classeNomSimple, ".", langueConfig.getString(I18n.var_recherche), "Var", classeNomSimple, "(var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Parties), "[0]);");
tl(4, "String var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Direction), " = var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Parties), "[1];");
tl(4, "l.add(String.format(\"%s %s\", var", langueConfig.getString(I18n.var_Tri), ", var", langueConfig.getString(I18n.var_Tri), langueConfig.getString(I18n.var_Direction), "));");
tl(3, "});");
tl(2, "}");
tl(1, "}");
l();
if(classePageSuperNomSimple != null)
Expand Down

0 comments on commit 2f1938d

Please sign in to comment.