swarm-ui: give the new-flow draft a route no flow id can take, and drop the dead hit-count rule
/notifications/new could be a saved flow's own page, so the draft now opens at /notifications/draft/new, which has a segment more than any flow's route. The placeholder id no longer needs reserving. The .notify-node-hits rule styled the removed tree rows; nothing renders it.
This commit is contained in:
parent
d0a55502a8
commit
6e7b5f84e9
1 changed files with 21 additions and 28 deletions
|
|
@ -356,16 +356,15 @@ export function duplicateFlow(
|
|||
});
|
||||
}
|
||||
|
||||
// The id of a flow nobody has saved yet. It is the editor's route for one, so
|
||||
// no saved flow may take it.
|
||||
// The editor's route for a flow nobody has saved yet. It has a segment more
|
||||
// than a flow's own route, so no flow's id can reach it.
|
||||
export const NEW_FLOW_PATH = "/notifications/draft/new";
|
||||
|
||||
// The id a draft carries until it is saved (see `savedAs`).
|
||||
export const NEW_FLOW_ID = "new";
|
||||
|
||||
function savedIds(view: FlowsView): string[] {
|
||||
return [
|
||||
NEW_FLOW_ID,
|
||||
...view.builtins.map((f) => f.id),
|
||||
...view.flows.map((f) => f.id),
|
||||
];
|
||||
return [...view.builtins.map((f) => f.id), ...view.flows.map((f) => f.id)];
|
||||
}
|
||||
|
||||
// The draft the editor opens for a flow not saved yet: an empty one, or a copy
|
||||
|
|
|
|||
Loading…
Reference in a new issue