added initial pre-validation per node

This commit is contained in:
ari committed 2022-05-18 22:23:57 -04:00
1 parent 621f43e5c8
commit 40690293a8
31 files changed
+519 -167

No files matched your search

+11
View File
@@ -2,6 +2,7 @@ import { AutomationSequenceNode } from "types/automations";
import { ChooseAction } from "types/automations/actions";
import { AutomationCondition } from "types/automations/conditions";
import { UpdateModalState } from "./types";
import { getNodeType } from '../../utils/automations';
export type SequenceUpdater = ReturnType<typeof makeSequenceUpdater>;
@@ -114,6 +115,16 @@ export const makeSequenceUpdater = (
})
}
},
makeOnEditForBadNode(i: number) {
const node = sequence[i];
return () => openModal({
single: true,
isError: true,
node,
allowedTypes: [getNodeType(node)],
update: n => this.updateNode(i, n),
})
}
});