Test Suite / lint-backend (push) Waiting to run
Test Suite / compose-smoke (push) Waiting to run
Test Suite / k6 /api/health Baseline (push) Blocked by required conditions
Test Suite / playwright-smoke (push) Blocked by required conditions
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Has been cancelled
Macht den Zielzustands-Designer bedienbar: Overlay-Panel statt schmalem Split, Gate-Typ im Edit, Löschen mit Schutz für erreichte Gates, Kantentyp-Wechsel mit Legende und visuelle Kennzeichnung aktiv/blockiert/abgeschlossen. Co-authored-by: Cursor <cursoragent@cursor.com>
66 lines
2.1 KiB
JavaScript
66 lines
2.1 KiB
JavaScript
/**
|
|
* Kantentypen für Zielzustands-Graph — AP1.15c Topologie.
|
|
* OR-Alternativpfade bewusst nicht enthalten (PO-Deferral).
|
|
*/
|
|
|
|
/** Basis-Kanten im Designer */
|
|
export const DESIGNER_EDGE_KINDS = [
|
|
'requires',
|
|
'blocks',
|
|
'related',
|
|
'parallel_group',
|
|
'optional_branch',
|
|
]
|
|
|
|
/** Erfordert group_key bei Anlage */
|
|
export const EDGE_KINDS_REQUIRING_GROUP_KEY = ['parallel_group']
|
|
|
|
export const DESIGNER_EDGE_LABELS = {
|
|
requires: 'Voraussetzung',
|
|
blocks: 'Blockiert',
|
|
related: 'Bezug',
|
|
parallel_group: 'Parallelgruppe',
|
|
optional_branch: 'Optional',
|
|
}
|
|
|
|
/** Kurz-Erklärung der Kantentypen (Semantik from → to in der DB). */
|
|
export const DESIGNER_EDGE_DESCRIPTIONS = {
|
|
requires:
|
|
'Ziel-Gate benötigt Quell-Gate als erreicht (Voraussetzung). Join: alle Eingänge müssen erreicht sein.',
|
|
blocks:
|
|
'Quell-Gate blockiert Ziel-Gate, solange es noch aktiv ist (planned/active/at_risk).',
|
|
related: 'Informativer Bezug — keine Blockade im Graph.',
|
|
parallel_group:
|
|
'Markiert parallele Gates in einer Gruppe (group_key) — blockiert nicht, dient der Struktur.',
|
|
optional_branch:
|
|
'Wie Voraussetzung, aber optional — blockiert das Ziel-Gate nicht, wenn offen.',
|
|
}
|
|
|
|
/** @deprecated use DESIGNER_EDGE_KINDS */
|
|
export const DEFERRED_TOPOLOGY_EDGE_KINDS = ['parallel_group', 'optional_branch']
|
|
|
|
export function edgeKindNeedsGroupKey(kind) {
|
|
return EDGE_KINDS_REQUIRING_GROUP_KEY.includes(kind)
|
|
}
|
|
|
|
/**
|
|
* Kanten-Richtung beim Anlegen per Drag (Quelle → Ziel).
|
|
* requires: Ziel hängt von Quelle ab (from=Ziel, to=Quelle).
|
|
*/
|
|
export function resolveDependencyEndpoints(edgeKind, sourceId, targetId) {
|
|
if (edgeKind === 'requires') {
|
|
return { from_item_id: targetId, to_item_id: sourceId }
|
|
}
|
|
return { from_item_id: sourceId, to_item_id: targetId }
|
|
}
|
|
|
|
/**
|
|
* Visuelle Drag-Richtung (Quelle → Ziel) aus gespeicherter Abhängigkeit.
|
|
*/
|
|
export function dependencyVisualEndpoints(dep) {
|
|
if (dep.dependency_type === 'requires') {
|
|
return { sourceId: dep.to_item_id, targetId: dep.from_item_id }
|
|
}
|
|
return { sourceId: dep.from_item_id, targetId: dep.to_item_id }
|
|
}
|