diff --git a/apps/dashboard/src/components/workflow-editor/nodes.tsx b/apps/dashboard/src/components/workflow-editor/nodes.tsx
index c24a4e7e7f7..9738a29f98b 100644
--- a/apps/dashboard/src/components/workflow-editor/nodes.tsx
+++ b/apps/dashboard/src/components/workflow-editor/nodes.tsx
@@ -12,7 +12,7 @@ import { STEP_TYPE_TO_COLOR } from '@/utils/color';
import { useWorkflow } from '@/components/workflow-editor/workflow-provider';
import { WorkflowOriginEnum } from '@novu/shared';
import { createStep } from '@/components/workflow-editor/steps/step-provider';
-import { getEncodedId, STEP_DIVIDER } from '@/utils/step';
+import { getWorkflowIdFromSlug, STEP_DIVIDER } from '@/utils/step';
export type NodeData = {
name?: string;
@@ -54,8 +54,8 @@ const StepNode = (props: StepNodeProps) => {
}>();
const isSelected =
- getEncodedId({ slug: stepSlug ?? '', divider: STEP_DIVIDER }) ===
- getEncodedId({ slug: data.stepSlug ?? '', divider: STEP_DIVIDER });
+ getWorkflowIdFromSlug({ slug: stepSlug ?? '', divider: STEP_DIVIDER }) ===
+ getWorkflowIdFromSlug({ slug: data.stepSlug ?? '', divider: STEP_DIVIDER });
return ;
};
diff --git a/apps/dashboard/src/components/workflow-editor/steps/step-provider.tsx b/apps/dashboard/src/components/workflow-editor/steps/step-provider.tsx
index 3f77bbf5560..b7d917ce3bc 100644
--- a/apps/dashboard/src/components/workflow-editor/steps/step-provider.tsx
+++ b/apps/dashboard/src/components/workflow-editor/steps/step-provider.tsx
@@ -6,7 +6,7 @@ import { StepDataDto, StepIssuesDto, StepTypeEnum } from '@novu/shared';
import { createContextHook } from '@/utils/context';
import { Step } from '@/utils/types';
import { STEP_DIVIDER } from '@/utils/step';
-import { getEncodedId } from '@/utils/step';
+import { getWorkflowIdFromSlug } from '@/utils/step';
import { useWorkflow } from '@/components/workflow-editor/workflow-provider';
export type StepEditorContextType = {
@@ -40,8 +40,8 @@ export const StepProvider = ({ children }: { children: ReactNode }) => {
const issues = useMemo(() => {
const newIssues = workflow?.steps.find(
(s) =>
- getEncodedId({ slug: s.slug, divider: STEP_DIVIDER }) ===
- getEncodedId({ slug: stepSlug, divider: STEP_DIVIDER })
+ getWorkflowIdFromSlug({ slug: s.slug, divider: STEP_DIVIDER }) ===
+ getWorkflowIdFromSlug({ slug: stepSlug, divider: STEP_DIVIDER })
)?.issues;
return { ...newIssues };
diff --git a/apps/dashboard/src/components/workflow-editor/test-workflow/test-workflow-tabs.tsx b/apps/dashboard/src/components/workflow-editor/test-workflow/test-workflow-tabs.tsx
index 2ededb1b148..5afa269efcd 100644
--- a/apps/dashboard/src/components/workflow-editor/test-workflow/test-workflow-tabs.tsx
+++ b/apps/dashboard/src/components/workflow-editor/test-workflow/test-workflow-tabs.tsx
@@ -1,25 +1,26 @@
import { useMemo } from 'react';
-import { Link, useParams } from 'react-router-dom';
-import { RiPlayCircleLine } from 'react-icons/ri';
import { useForm } from 'react-hook-form';
+import { RiPlayCircleLine } from 'react-icons/ri';
+import { Link, useParams } from 'react-router-dom';
// eslint-disable-next-line
// @ts-ignore
+import { ToastClose, ToastIcon } from '@/components/primitives/sonner';
+import { useFetchWorkflow } from '@/hooks/use-fetch-workflow';
+import { useTriggerWorkflow } from '@/hooks/use-trigger-workflow';
+import { buildRoute, LEGACY_ROUTES, ROUTES } from '@/utils/routes';
import { zodResolver } from '@hookform/resolvers/zod';
import type { WorkflowTestDataResponseDto } from '@novu/shared';
-import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../primitives/tabs';
-import { buildRoute, LEGACY_ROUTES, ROUTES } from '@/utils/routes';
-import { useFetchWorkflow } from '@/hooks/use-fetch-workflow';
-import { Form } from '../../primitives/form/form';
+import { toast } from 'sonner';
import { Button } from '../../primitives/button';
-import { useTriggerWorkflow } from '@/hooks/use-trigger-workflow';
+import { Form } from '../../primitives/form/form';
import { showToast } from '../../primitives/sonner-helpers';
+import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../primitives/tabs';
import { buildDynamicFormSchema, makeObjectFromSchema, TestWorkflowFormType } from '../schema';
import { TestWorkflowForm } from './test-workflow-form';
-import { toast } from 'sonner';
-import { ToastClose, ToastIcon } from '@/components/primitives/sonner';
export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataResponseDto }) => {
const { environmentSlug = '', workflowSlug = '' } = useParams<{ environmentSlug: string; workflowSlug: string }>();
+
const { workflow } = useFetchWorkflow({
workflowSlug,
});
@@ -37,8 +38,9 @@ export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataRespo
const form = useForm({
mode: 'onSubmit',
resolver: zodResolver(buildDynamicFormSchema({ to: testData?.to ?? {} })),
- defaultValues: { to, payload: JSON.stringify(payload, null, 2) },
+ values: { to, payload: JSON.stringify(payload, null, 2) },
});
+
const { handleSubmit } = form;
const { triggerWorkflow, isPending } = useTriggerWorkflow();
@@ -105,7 +107,7 @@ export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataRespo