diff --git a/projects/ui/src/lib/Txn/FormTxn/FormTxnBundler.ts b/projects/ui/src/lib/Txn/FormTxn/FormTxnBundler.ts index 49577eb792..c343ecf04f 100644 --- a/projects/ui/src/lib/Txn/FormTxn/FormTxnBundler.ts +++ b/projects/ui/src/lib/Txn/FormTxn/FormTxnBundler.ts @@ -44,7 +44,7 @@ type FormTxnFarmStep = * - it is intended for this to be called in an 'onSubmit' function where the user * has confirmed which FarmSteps they want to perform. * - setFarmSteps() deduplicates any FarmSteps that are implied by other FarmSteps - * as welll as any FarmSteps that are excluded by the form. + * as well as any FarmSteps that are excluded by the form. * * 3. Call build() to perform the bundling of FarmSteps into a single, executable Workflow. * - It is assumed every FarmStep added to have previous been 'built'. @@ -70,12 +70,6 @@ export class FormTxnBundler { private after: Partial>; - // FormTxns that imply other FormTxns when added - static implied: Partial = { - [FormTxn.ENROOT]: FormTxn.MOW, - [FormTxn.PLANT]: FormTxn.MOW, - }; - static presets = presets; constructor( @@ -189,14 +183,13 @@ export class FormTxnBundler { /** * @param data - * deduplicate farm steps & remove implicit actions. + * deduplicate farm steps. */ private static deduplicateFarmSteps(data: FormTxnBundlerInterface) { const before = new Set(data.primary || []); const after = new Set(data.secondary || []); const allActions = new Set([...before, ...after]); - /// deduplicate // if an action is in both primary and secondary, remove it from secondary [...before].forEach((action) => { @@ -205,24 +198,6 @@ export class FormTxnBundler { } }); - /// deduplicate implied actions - [...allActions].forEach((action) => { - const implied = FormTxnBundler.implied[action]; - if (implied) { - allActions.has(implied) && allActions.delete(implied); - before.has(implied) && before.delete(implied); - after.has(implied) && after.delete(implied); - } - }); - - const removeItems = [...(data.exclude || []), ...(data.implied || [])]; - - removeItems.forEach((toRemove) => { - allActions.has(toRemove) && allActions.delete(toRemove); - before.has(toRemove) && before.delete(toRemove); - after.has(toRemove) && after.delete(toRemove); - }); - return { before: [...before], after: [...after],