swarm-ui: edit a notification flow on a canvas
A custom flow opens at /notifications/<id>: its nodes drawn left to right (source, then matches, then todos), and a panel to edit the picked node: the source's events, a match's conditions, a todo's recipients, op, key and text. Add a match or todo below a node, move a branch under another match, or remove it; an edit the controller would refuse (a todo with children, a second parent, a cycle, over the node or depth cap) is turned away with the reason. Edits stay in a draft until save, which sends the whole document at the revision read. A stale revision is told apart from a refused document: the editor offers to reload or to keep the draft on top of the latest. The form choices come from the controller's schema when it sends one. The list page gains edit and duplicate on custom flows, duplicate on the built-ins, and a new-flow box; a new flow's id avoids the built-ins' too.
This commit is contained in:
parent
c00fd99112
commit
f28e1e9063
13 changed files with 1209 additions and 6 deletions
|
|
@ -4,10 +4,12 @@ import { test } from "node:test";
|
|||
import {
|
||||
addChild,
|
||||
blankNode,
|
||||
DEFAULT_LIMITS,
|
||||
depthOf,
|
||||
duplicateFlow,
|
||||
heightBelow,
|
||||
isDirty,
|
||||
limitsOf,
|
||||
newFlow,
|
||||
newNodeId,
|
||||
removeNode,
|
||||
|
|
@ -233,3 +235,11 @@ test("saveOutcome tells a stale revision from a refused document", () => {
|
|||
assert.equal(saveOutcome(503), "error");
|
||||
assert.equal(saveOutcome(500), "error");
|
||||
});
|
||||
|
||||
test("limitsOf takes the controller's caps and falls back to today's", () => {
|
||||
assert.deepEqual(
|
||||
limitsOf({ limits: { max_nodes: 5, max_depth: 3, max_flows: 9 } }),
|
||||
{ maxNodes: 5, maxDepth: 3, maxFlows: 9 },
|
||||
);
|
||||
assert.deepEqual(limitsOf(undefined), DEFAULT_LIMITS);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue