fix: Task-Typen und Export für App-Kompatibilität korrigiert
Historische Typnummern angeglichen und base_type für benutzerdefinierte Tasks ergänzt. React im Vaadin-Dev-Modus deaktiviert und Lockdatei bereinigt. Version auf 0.9.3 und Docker-Image auf wfe aktualisiert sowie Windows-Zeilenenden im Maven-Wrapper übernommen.
This commit is contained in:
1 parent
525e775d1c
commit
93ba40c476
9 files changed
+54
-915
No files matched your search
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
readonly SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
readonly SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
readonly REGISTRY_IMAGE="registry.assecutor.org/ait"
|
readonly REGISTRY_IMAGE="registry.assecutor.org/wfe"
|
||||||
readonly BACKEND_DIR="${SCRIPT_DIR}"
|
readonly BACKEND_DIR="${SCRIPT_DIR}"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
|||||||
Generated
-893
File diff suppressed because it is too large.
Load diff
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<groupId>de.assecutor</groupId>
|
<groupId>de.assecutor</groupId>
|
||||||
<artifactId>tasklist-editor</artifactId>
|
<artifactId>tasklist-editor</artifactId>
|
||||||
<version>0.9.2</version>
|
<version>0.9.3</version>
|
||||||
<name>TaskList Editor</name>
|
<name>TaskList Editor</name>
|
||||||
<description>n8n-inspired editor for task list workflows</description>
|
<description>n8n-inspired editor for task list workflows</description>
|
||||||
|
|
||||||
|
|||||||
@@ -55,13 +55,17 @@ public class BlockTypeRegistry {
|
|||||||
List.of()
|
List.of()
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// Die Typnummern 2–11 entsprechen der historischen Task-Typ-Belegung
|
||||||
|
// der stadtbote-App (2 = Unterschrift, 3 = Ankunft, 4 = Fotos,
|
||||||
|
// 5 = Barcode, 7–9 = Texteingaben, 11 = Statusauswahl). Neue, im
|
||||||
|
// Editor eingeführte Typen werden ab 12 aufsteigend nummeriert.
|
||||||
register(new BlockType(
|
register(new BlockType(
|
||||||
"ankunft-melden",
|
"ankunft-melden",
|
||||||
"Ankunft melden",
|
"Ankunft melden",
|
||||||
"Erfasst die Ankunft am Einsatzort (Bestätigungsschaltfläche).",
|
"Erfasst die Ankunft am Einsatzort (Bestätigungsschaltfläche).",
|
||||||
"vaadin:map-marker",
|
"vaadin:map-marker",
|
||||||
"#2563eb",
|
"#2563eb",
|
||||||
1,
|
3,
|
||||||
1, 1,
|
1, 1,
|
||||||
List.of(
|
List.of(
|
||||||
PropertyDefinition.bool("track", "GPS-Position erfassen", true),
|
PropertyDefinition.bool("track", "GPS-Position erfassen", true),
|
||||||
@@ -92,7 +96,7 @@ public class BlockTypeRegistry {
|
|||||||
"Nimmt eine Anzahl von Fotos auf.",
|
"Nimmt eine Anzahl von Fotos auf.",
|
||||||
"vaadin:camera",
|
"vaadin:camera",
|
||||||
"#059669",
|
"#059669",
|
||||||
3,
|
4,
|
||||||
1, 1,
|
1, 1,
|
||||||
List.of(
|
List.of(
|
||||||
PropertyDefinition.number("min", "Mindestanzahl Fotos", 1),
|
PropertyDefinition.number("min", "Mindestanzahl Fotos", 1),
|
||||||
@@ -155,7 +159,7 @@ public class BlockTypeRegistry {
|
|||||||
"Einfache Bestätigung per Häkchen ohne weitere Eingabe.",
|
"Einfache Bestätigung per Häkchen ohne weitere Eingabe.",
|
||||||
"vaadin:check-square-o",
|
"vaadin:check-square-o",
|
||||||
"#16a34a",
|
"#16a34a",
|
||||||
6,
|
12,
|
||||||
1, 1,
|
1, 1,
|
||||||
List.of(
|
List.of(
|
||||||
PropertyDefinition.bool("opt", "Optionale Aufgabe", false),
|
PropertyDefinition.bool("opt", "Optionale Aufgabe", false),
|
||||||
@@ -194,17 +198,16 @@ public class BlockTypeRegistry {
|
|||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Listen-Tasks: erfassen mehrerer gleichartiger Werte. Die Anzahl wird
|
// Listen-Tasks: erfassen mehrerer gleichartiger Werte über
|
||||||
// analog zu "Fotos aufnehmen" über min/max gesteuert. Diese Typen haben
|
// vordefinierte Eingabefelder. Wie alle im Editor neu eingeführten
|
||||||
// (noch) keinen Handler in der stadtbote-App und liegen daher oberhalb
|
// Typen liegen sie oberhalb des historischen App-Bereichs (2–11).
|
||||||
// des dort genutzten Bereichs (1–11).
|
|
||||||
register(new BlockType(
|
register(new BlockType(
|
||||||
"text-liste-erfassen",
|
"text-liste-erfassen",
|
||||||
"Liste von Texten erfassen",
|
"Liste von Texten erfassen",
|
||||||
"Erfasst mehrere Texteinträge über vordefinierte Eingabefelder.",
|
"Erfasst mehrere Texteinträge über vordefinierte Eingabefelder.",
|
||||||
"vaadin:lines-list",
|
"vaadin:lines-list",
|
||||||
"#4338ca",
|
"#4338ca",
|
||||||
12,
|
13,
|
||||||
1, 1,
|
1, 1,
|
||||||
List.of(
|
List.of(
|
||||||
PropertyDefinition.fieldList("fields", "Textfelder (Titel + Platzhalter)"),
|
PropertyDefinition.fieldList("fields", "Textfelder (Titel + Platzhalter)"),
|
||||||
@@ -218,7 +221,7 @@ public class BlockTypeRegistry {
|
|||||||
"Erfasst mehrere numerische Werte über vordefinierte Eingabefelder.",
|
"Erfasst mehrere numerische Werte über vordefinierte Eingabefelder.",
|
||||||
"vaadin:list-ol",
|
"vaadin:list-ol",
|
||||||
"#0369a1",
|
"#0369a1",
|
||||||
13,
|
14,
|
||||||
1, 1,
|
1, 1,
|
||||||
List.of(
|
List.of(
|
||||||
PropertyDefinition.fieldList("fields", "Zahlenfelder (Titel + Platzhalter)"),
|
PropertyDefinition.fieldList("fields", "Zahlenfelder (Titel + Platzhalter)"),
|
||||||
@@ -232,7 +235,7 @@ public class BlockTypeRegistry {
|
|||||||
"Lässt mehrere vordefinierte Optionen per Checkbox ankreuzen.",
|
"Lässt mehrere vordefinierte Optionen per Checkbox ankreuzen.",
|
||||||
"vaadin:tasks",
|
"vaadin:tasks",
|
||||||
"#15803d",
|
"#15803d",
|
||||||
14,
|
15,
|
||||||
1, 1,
|
1, 1,
|
||||||
List.of(
|
List.of(
|
||||||
PropertyDefinition.nameList("entries", "Name der Checkboxen"),
|
PropertyDefinition.nameList("entries", "Name der Checkboxen"),
|
||||||
@@ -266,7 +269,7 @@ public class BlockTypeRegistry {
|
|||||||
return Optional.ofNullable(types.get(id));
|
return Optional.ofNullable(types.get(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Die festen Standard-Typen (Typnummer 1–8), auf denen eigene Typen aufbauen. */
|
/** Die festen Standard-Typen (Typnummer < 1000), auf denen eigene Typen aufbauen. */
|
||||||
public List<BlockType> baseTypes() {
|
public List<BlockType> baseTypes() {
|
||||||
return types.values().stream()
|
return types.values().stream()
|
||||||
.filter(t -> t.taskType() >= 1 && t.taskType() < CUSTOM_TYPE_START)
|
.filter(t -> t.taskType() >= 1 && t.taskType() < CUSTOM_TYPE_START)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
* erscheinen.
|
* erscheinen.
|
||||||
*/
|
*/
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@JsonPropertyOrder({"s_id", "type", "topic", "opt", "reenter", "min", "max",
|
@JsonPropertyOrder({"s_id", "type", "base_type", "topic", "opt", "reenter", "min", "max",
|
||||||
"max_len", "rt", "track", "txt", "task_arrival", "task_fin_work", "entries", "choices", "fields", "script"})
|
"max_len", "rt", "track", "txt", "task_arrival", "task_fin_work", "entries", "choices", "fields", "script"})
|
||||||
public class TaskDto {
|
public class TaskDto {
|
||||||
|
|
||||||
@@ -25,6 +25,15 @@ public class TaskDto {
|
|||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Typnummer des Basis-Typs bei benutzerdefinierten Typen
|
||||||
|
* ({@code type >= }{@link BlockTypeRegistry#CUSTOM_TYPE_START}); die App
|
||||||
|
* stellt solche Tasks wie ihren Basis-Typ dar. Bei Standard-Typen
|
||||||
|
* {@code null} und damit nicht im JSON enthalten.
|
||||||
|
*/
|
||||||
|
@JsonProperty("base_type")
|
||||||
|
private Integer baseType;
|
||||||
|
|
||||||
private String topic;
|
private String topic;
|
||||||
|
|
||||||
private Boolean opt;
|
private Boolean opt;
|
||||||
@@ -47,10 +56,10 @@ public class TaskDto {
|
|||||||
|
|
||||||
private List<TaskEntryDto> entries;
|
private List<TaskEntryDto> entries;
|
||||||
|
|
||||||
/** Auswahloptionen eines Status-Tasks (Typ 6). */
|
/** Auswahloptionen eines Status-Tasks (Typ 11). */
|
||||||
private List<ChoiceDto> choices;
|
private List<ChoiceDto> choices;
|
||||||
|
|
||||||
/** Eingabefelder eines Listen-Text-Tasks (Typ 12). */
|
/** Eingabefelder einer Text-/Zahlen-Liste (Typ 13/14). */
|
||||||
private List<FieldDto> fields;
|
private List<FieldDto> fields;
|
||||||
|
|
||||||
/** Logik-Graph eines Script-Blocks (Drawflow-Definition als JSON). */
|
/** Logik-Graph eines Script-Blocks (Drawflow-Definition als JSON). */
|
||||||
@@ -72,6 +81,14 @@ public class TaskDto {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getBaseType() {
|
||||||
|
return baseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaseType(Integer baseType) {
|
||||||
|
this.baseType = baseType;
|
||||||
|
}
|
||||||
|
|
||||||
public String getTopic() {
|
public String getTopic() {
|
||||||
return topic;
|
return topic;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,11 @@ import java.util.Set;
|
|||||||
public class TaskListExporter {
|
public class TaskListExporter {
|
||||||
|
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
|
private final BlockTypeRegistry registry;
|
||||||
|
|
||||||
public TaskListExporter(ObjectMapper objectMapper) {
|
public TaskListExporter(ObjectMapper objectMapper, BlockTypeRegistry registry) {
|
||||||
this.objectMapper = objectMapper;
|
this.objectMapper = objectMapper;
|
||||||
|
this.registry = registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TaskDto> export(String drawflowJson, Map<Integer, BlockInstance> instances) {
|
public List<TaskDto> export(String drawflowJson, Map<Integer, BlockInstance> instances) {
|
||||||
@@ -225,6 +227,13 @@ public class TaskListExporter {
|
|||||||
private TaskDto toTask(BlockInstance instance) {
|
private TaskDto toTask(BlockInstance instance) {
|
||||||
TaskDto task = new TaskDto();
|
TaskDto task = new TaskDto();
|
||||||
task.setType(instance.type().taskType());
|
task.setType(instance.type().taskType());
|
||||||
|
// Benutzerdefinierte Typen verhalten sich in der App wie ihr
|
||||||
|
// Basis-Typ; dessen Typnummer wird als base_type mit exportiert.
|
||||||
|
if (instance.type().taskType() >= BlockTypeRegistry.CUSTOM_TYPE_START
|
||||||
|
&& instance.type().baseTypeId() != null) {
|
||||||
|
registry.find(instance.type().baseTypeId())
|
||||||
|
.ifPresent(base -> task.setBaseType(base.taskType()));
|
||||||
|
}
|
||||||
String topic = instance.topic();
|
String topic = instance.topic();
|
||||||
task.setTopic(topic == null || topic.isBlank() ? instance.type().label() : topic);
|
task.setTopic(topic == null || topic.isBlank() ? instance.type().label() : topic);
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class TaskListImporter {
|
|||||||
private Map<String, Object> valuesFor(BlockType type, TaskDto task) {
|
private Map<String, Object> valuesFor(BlockType type, TaskDto task) {
|
||||||
Map<String, Object> values = new LinkedHashMap<>();
|
Map<String, Object> values = new LinkedHashMap<>();
|
||||||
for (PropertyDefinition def : type.properties()) {
|
for (PropertyDefinition def : type.properties()) {
|
||||||
// Listen-Eigenschaften (Typ 12–14) werden anhand ihres
|
// Listen-Eigenschaften (Typ 13–15) werden anhand ihres
|
||||||
// Property-Typs in die vom Zeilen-Editor erwartete Struktur
|
// Property-Typs in die vom Zeilen-Editor erwartete Struktur
|
||||||
// (Liste aus {title}/{title,placeholder}-Maps) zurückgewandelt.
|
// (Liste aus {title}/{title,placeholder}-Maps) zurückgewandelt.
|
||||||
Object value = switch (def.type()) {
|
Object value = switch (def.type()) {
|
||||||
@@ -95,7 +95,7 @@ public class TaskListImporter {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@code fields}-Array (Typ 12/13) zurück in Zeilen mit Titel + Platzhalter. */
|
/** {@code fields}-Array (Typ 13/14) zurück in Zeilen mit Titel + Platzhalter. */
|
||||||
private List<Map<String, Object>> fieldRows(TaskDto task) {
|
private List<Map<String, Object>> fieldRows(TaskDto task) {
|
||||||
List<Map<String, Object>> rows = new ArrayList<>();
|
List<Map<String, Object>> rows = new ArrayList<>();
|
||||||
if (task.getFields() == null) {
|
if (task.getFields() == null) {
|
||||||
@@ -111,7 +111,7 @@ public class TaskListImporter {
|
|||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@code entries}-Array (Typ 14) zurück in Zeilen mit Namen ({@code title}). */
|
/** {@code entries}-Array (Typ 15) zurück in Zeilen mit Namen ({@code title}). */
|
||||||
private List<Map<String, Object>> entryRows(TaskDto task) {
|
private List<Map<String, Object>> entryRows(TaskDto task) {
|
||||||
List<Map<String, Object>> rows = new ArrayList<>();
|
List<Map<String, Object>> rows = new ArrayList<>();
|
||||||
if (task.getEntries() == null) {
|
if (task.getEntries() == null) {
|
||||||
|
|||||||
@@ -230,9 +230,9 @@ public class WorkflowAssistantService {
|
|||||||
(boolean) erlaubt erneutes Bearbeiten.
|
(boolean) erlaubt erneutes Bearbeiten.
|
||||||
- Listenfelder:
|
- Listenfelder:
|
||||||
* "fields": Array aus {"title": "...", "placeholder": "...", "required": true|false}
|
* "fields": Array aus {"title": "...", "placeholder": "...", "required": true|false}
|
||||||
(Text-/Zahlenlisten, Typ 12/13).
|
(Text-/Zahlenlisten, Typ 13/14).
|
||||||
* "entries": Array aus {"code": <fortlaufend ab 1>, "text": "...", "required": true|false}
|
* "entries": Array aus {"code": <fortlaufend ab 1>, "text": "...", "required": true|false}
|
||||||
(Checkbox-Liste, Typ 14).
|
(Checkbox-Liste, Typ 15).
|
||||||
* "choices": Array aus {"txt": "...", "ret": <fortlaufend ab 1>}
|
* "choices": Array aus {"txt": "...", "ret": <fortlaufend ab 1>}
|
||||||
(Statusauswahl, Typ 11).
|
(Statusauswahl, Typ 11).
|
||||||
Kennzeichne Einträge nur dann mit "required": true, wenn der Benutzer sie
|
Kennzeichne Einträge nur dann mit "required": true, wenn der Benutzer sie
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ tasklist.app-version=@project.version@
|
|||||||
|
|
||||||
vaadin.launch-browser=true
|
vaadin.launch-browser=true
|
||||||
vaadin.allowed-packages=de.assecutor.tasklisteditor
|
vaadin.allowed-packages=de.assecutor.tasklisteditor
|
||||||
|
# Lit-/Router-Modus statt React (muss zum reactEnable=false im pom.xml passen,
|
||||||
|
# damit der Dev-Modus beim IDE-Start kein React-Frontend generiert).
|
||||||
|
vaadin.react.enable=false
|
||||||
|
|
||||||
management.endpoints.web.exposure.include=health,info
|
management.endpoints.web.exposure.include=health,info
|
||||||
management.endpoint.health.probes.enabled=true
|
management.endpoint.health.probes.enabled=true
|
||||||
|
|||||||
Reference in new issue
Block a user