From 7b84b93fbf0fedf36137511c00c960f7dffdcdbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=A0Ja=CC=81n=20Mikla=CC=81s=CC=8C?= Date: Thu, 19 Sep 2024 22:15:43 +0200 Subject: [PATCH] Pass next step to flow separator [MAILPOET-6230] --- .../components/automation/flow-ending.tsx | 15 ++++++++++++--- .../components/automation/flow-separator.tsx | 9 +++++++-- .../editor/components/automation/flow.tsx | 17 ++++++++++++++--- .../tabs/automation-flow/hooks/index.tsx | 7 ++++++- .../automation-flow/statistic-separator.tsx | 2 ++ .../assets/js/src/automation/types/filters.ts | 3 ++- 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/mailpoet/assets/js/src/automation/editor/components/automation/flow-ending.tsx b/mailpoet/assets/js/src/automation/editor/components/automation/flow-ending.tsx index f01623f9b0..3847ffcbad 100644 --- a/mailpoet/assets/js/src/automation/editor/components/automation/flow-ending.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/automation/flow-ending.tsx @@ -3,14 +3,23 @@ import { FlowSeparator } from './flow-separator'; import { Step as StepData } from './types'; type Props = { - stepData: StepData; + previousStepData: StepData; index: number; + nextStepData?: StepData; }; -export function FlowEnding({ stepData, index }: Props): JSX.Element { +export function FlowEnding({ + previousStepData, + index, + nextStepData, +}: Props): JSX.Element { return (
- + - {row > 0 && } + {row > 0 && ( + + )}
) : ( - // eslint-disable-next-line react/no-array-index-key - + ); })} diff --git a/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/hooks/index.tsx b/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/hooks/index.tsx index 8e73f35dd1..670d566fd0 100644 --- a/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/hooks/index.tsx +++ b/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/hooks/index.tsx @@ -50,6 +50,7 @@ export function initHooks() { return function StatisticSeparatorWrapper( previousStepData: StepData, index: number, + nextStepData: StepData, ) { return ( <> @@ -62,7 +63,11 @@ export function initHooks() { } /> )} - + ); }; diff --git a/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/statistic-separator.tsx b/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/statistic-separator.tsx index db3c467a32..3fe229c10b 100644 --- a/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/statistic-separator.tsx +++ b/mailpoet/assets/js/src/automation/integrations/mailpoet/analytics/components/tabs/automation-flow/statistic-separator.tsx @@ -8,11 +8,13 @@ import { Step } from '../../../../../../editor/components/automation/types'; type Props = { previousStep: Step; index: number; + nextStep?: Step; }; export function StatisticSeparator({ previousStep, index, + nextStep, }: Props): JSX.Element | null { const { section, stepType } = useSelect( (s) => ({ diff --git a/mailpoet/assets/js/src/automation/types/filters.ts b/mailpoet/assets/js/src/automation/types/filters.ts index 835220104c..4b3430b8d7 100644 --- a/mailpoet/assets/js/src/automation/types/filters.ts +++ b/mailpoet/assets/js/src/automation/types/filters.ts @@ -37,8 +37,9 @@ export type RenderStepFooterType = JSX.Element | null; // mailpoet.automation.render_step_separator export type RenderStepSeparatorType = ( - step: Step, + previousStep: Step, index: number, + nextStep?: Step, ) => JSX.Element; // mailpoet.automation.editor.create_store