diff --git a/.cursorignore b/.cursorignore new file mode 100644 index 00000000000..2dd13ae936b --- /dev/null +++ b/.cursorignore @@ -0,0 +1,2 @@ +# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv) +apps/api/src/metadata.ts diff --git a/apps/web/src/ee/clerk/EnterpriseAuthRoutes.tsx b/apps/web/src/ee/clerk/EnterpriseAuthRoutes.tsx index 261787caaa9..bb2e87b24d4 100644 --- a/apps/web/src/ee/clerk/EnterpriseAuthRoutes.tsx +++ b/apps/web/src/ee/clerk/EnterpriseAuthRoutes.tsx @@ -6,7 +6,7 @@ import OrganizationListPage from './pages/OrganizationListPage'; import QuestionnairePage from './pages/QuestionnairePage'; import SignInPage from './pages/SignInPage'; import SignUpPage from './pages/SignUpPage'; -import { useVercelIntegration, useVercelParams } from '../../hooks'; +import { useEffectOnce, useVercelIntegration, useVercelParams } from '../../hooks'; import { useEffect } from 'react'; export const EnterpriseAuthRoutes = () => { @@ -14,11 +14,11 @@ export const EnterpriseAuthRoutes = () => { const { startVercelSetup } = useVercelIntegration(); const { isFromVercel } = useVercelParams(); - useEffect(() => { + useEffectOnce(() => { if (isSignedIn && isFromVercel) { startVercelSetup(); } - }, [isSignedIn, isFromVercel, startVercelSetup]); + }, !!(isSignedIn && isFromVercel)); const EnterprisePublicAuthLayout = () => { return ( diff --git a/apps/web/src/ee/clerk/components/QuestionnaireForm.tsx b/apps/web/src/ee/clerk/components/QuestionnaireForm.tsx index 7ec04e1c4ea..1dad7db0529 100644 --- a/apps/web/src/ee/clerk/components/QuestionnaireForm.tsx +++ b/apps/web/src/ee/clerk/components/QuestionnaireForm.tsx @@ -37,15 +37,8 @@ export function QuestionnaireForm() { const { startVercelSetup } = useVercelIntegration(); const segment = useSegment(); const location = useLocation(); - const { initializeWebContainer } = useContainer(); const [_, setParams] = useSearchParams(); - useEffectOnce(() => { - if (isSupported) { - initializeWebContainer(); - } - }, isPlaygroundOnboardingEnabled); - const { mutateAsync: updateOrganizationMutation } = useMutation<{ _id: string }, IResponseError, any>( (data: UpdateExternalOrganizationDto) => updateClerkOrgMetadata(data) ); @@ -102,18 +95,28 @@ export function QuestionnaireForm() { setParams(searchParams); - setTimeout(() => { - startVercelSetup(); - }, 1000); - - return; + await new Promise((resolve) => { + setTimeout(async () => { + try { + await startVercelSetup(); + + return; + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } finally { + localStorage.removeItem('vercel_redirect_data'); + resolve(); + } + }, 1000); + }); } else { localStorage.removeItem('vercel_redirect_data'); } } if (isV2Enabled) { - navigate(ROUTES.DASHBOARD_ONBOARDING); + navigate(ROUTES.GET_STARTED); return; } diff --git a/apps/web/src/hooks/useVercelIntegration.ts b/apps/web/src/hooks/useVercelIntegration.ts index ec422fdf751..b248dae2321 100644 --- a/apps/web/src/hooks/useVercelIntegration.ts +++ b/apps/web/src/hooks/useVercelIntegration.ts @@ -17,7 +17,7 @@ export function useVercelIntegration() { const navigate = useNavigate(); - const { mutate, isLoading } = useMutation(vercelIntegrationSetup, { + const { mutateAsync, isLoading } = useMutation(vercelIntegrationSetup, { onSuccess: () => { if (next && configurationId) { navigate(`/partner-integrations/vercel/link-projects?configuration_id=${configurationId}&next=${next}`); @@ -30,13 +30,13 @@ export function useVercelIntegration() { }, }); - const startVercelSetup = useCallback(() => { + async function startVercelSetup() { if (!canStartSetup || !code || !configurationId) { return; } - mutate({ vercelIntegrationCode: code, configurationId }); - }, [canStartSetup, code, mutate, configurationId]); + await mutateAsync({ vercelIntegrationCode: code, configurationId }); + } return { isLoading, diff --git a/apps/web/src/pages/get-started/tabs/Setup.tsx b/apps/web/src/pages/get-started/tabs/Setup.tsx index 6ebaf2a9a8d..bacd2b34737 100644 --- a/apps/web/src/pages/get-started/tabs/Setup.tsx +++ b/apps/web/src/pages/get-started/tabs/Setup.tsx @@ -34,71 +34,6 @@ export const buildGuides = [ return ; }, }, - { - title: 'Create a workflow', - content: () => { - return ( -
- - To define a new workflow you will use the @novu/framework Typescript SDK. -
- In a new file let's define a workflow with a simple email step. -

-
- - {}} - code={`import { workflow } from '@novu/framework'; - -export const myWorkflow = workflow('my-workflow', async ({ step }) => { - await step.email('step', async (controls) => { - return { - subject: controls.subject, - body: '

Hello World

', - } - }, { - controlSchema: z.object({ - subject: z.string().default('Hello World'), - }) - }) -});`} - /> - - - - - Learn more on building workflows - - -
- ); - }, - }, - { - title: 'Expose your workflow', - content: () => { - return ( - <> - - Once a workflow has been created, we would need to expose it to the serve function so that - it will be visible on the Novu Studio. - -

- {}} - code={`import { serve } from '@novu/framework/next'; -import { myWorkflow } from '../../novu/workflows'; - -export const { GET, POST, OPTIONS } = serve({ workflows: [myWorkflow] });`} - /> - - ); - }, - }, { title: 'Run Novu Studio', content: () => { diff --git a/apps/web/src/pages/playground/onboarding/PlaygroundTourGuide.tsx b/apps/web/src/pages/playground/onboarding/PlaygroundTourGuide.tsx index 6fd1b9af92c..eb95050af64 100644 --- a/apps/web/src/pages/playground/onboarding/PlaygroundTourGuide.tsx +++ b/apps/web/src/pages/playground/onboarding/PlaygroundTourGuide.tsx @@ -49,7 +49,7 @@ export function TourGuideComponent({ SMS An SMS Step can be added to your workflow by using the following snippet: - + {`await step.sms('sms-step', () => { return { body: 'Hello, world!', @@ -62,7 +62,7 @@ export function TourGuideComponent({ Inbox An Inbox Step can be added to your workflow by using the following snippet: - + {`await step.inApp('inApp-step', () => { return { body: 'Hello, world!', @@ -75,7 +75,7 @@ export function TourGuideComponent({ Digest A Digest Step can be added to your workflow by using the following snippet: - + {`const { events } = await step.digest('digest-step', async () => { return { amount: 1, @@ -89,7 +89,7 @@ export function TourGuideComponent({ Delay A Delay Step can be added to your workflow by using the following snippet: - + {`await step.delay('delay-step', () => { return { amount: 1,