-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(web,dashboard): migrate dashboard v2 #7741
base: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,6 @@ export const MIXPANEL_KEY = import.meta.env.VITE_MIXPANEL_KEY; | |
|
||
export const LEGACY_DASHBOARD_URL = import.meta.env.VITE_LEGACY_DASHBOARD_URL; | ||
|
||
export const NEW_DASHBOARD_FEEDBACK_FORM_URL = import.meta.env.VITE_NEW_DASHBOARD_FEEDBACK_FORM_URL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed the google feedback form |
||
|
||
export const PLAIN_SUPPORT_CHAT_APP_ID = import.meta.env.VITE_PLAIN_SUPPORT_CHAT_APP_ID; | ||
|
||
export const ONBOARDING_DEMO_WORKFLOW_ID = 'onboarding-demo-workflow'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
import { PropsWithChildren, useLayoutEffect } from 'react'; | ||
import { PropsWithChildren, useEffect } from 'react'; | ||
import { NewDashboardOptInStatusEnum } from '@novu/shared'; | ||
import { useNewDashboardOptIn } from '@/hooks/use-new-dashboard-opt-in'; | ||
import { useSearchParams } from 'react-router-dom'; | ||
|
||
export const OptInProvider = (props: PropsWithChildren) => { | ||
const { children } = props; | ||
const { status, isLoaded, redirectToLegacyDashboard, optIn } = useNewDashboardOptIn(); | ||
const [searchParams] = useSearchParams(); | ||
const hasV2OptIn = searchParams.has('v2_opt_in'); | ||
|
||
useLayoutEffect(() => { | ||
if (isLoaded && status !== NewDashboardOptInStatusEnum.OPTED_IN) { | ||
if (hasV2OptIn) { | ||
(async () => { | ||
await optIn(); | ||
})(); | ||
} else { | ||
redirectToLegacyDashboard(); | ||
} | ||
} | ||
const { status, isLoaded, redirectToLegacyDashboard } = useNewDashboardOptIn(); | ||
|
||
useEffect(() => { | ||
// set light theme on the new domain for both legacy and new dashboard | ||
localStorage.setItem('mantine-theme', 'light'); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [status, redirectToLegacyDashboard, isLoaded, hasV2OptIn]); | ||
}, [status, redirectToLegacyDashboard, isLoaded]); | ||
|
||
if (isLoaded && status !== NewDashboardOptInStatusEnum.OPTED_IN) { | ||
redirectToLegacyDashboard(); | ||
|
||
return null; | ||
} | ||
|
||
Comment on lines
+14
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when the user is opted-out redirect him to the old dashboard with preserving the URL route and query params |
||
return <>{children}</>; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { DashboardLayout } from '@/components/dashboard-layout'; | ||
import { OptInModal } from '@/components/opt-in-modal'; | ||
import { PageMeta } from '@/components/page-meta'; | ||
import { Button } from '@/components/primitives/button'; | ||
import { ButtonGroupItem, ButtonGroupRoot } from '@/components/primitives/button-group'; | ||
|
@@ -120,7 +119,6 @@ export const WorkflowsPage = () => { | |
<> | ||
<PageMeta title="Workflows" /> | ||
<DashboardLayout headerStartItems={<h1 className="text-foreground-950 flex items-center gap-1">Workflows</h1>}> | ||
<OptInModal /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed opt-in modal |
||
<div className="h-full w-full"> | ||
<div className="flex justify-between px-2.5 py-2.5"> | ||
<Form {...form}> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,9 @@ import { ActivitiesPage } from './pages/activities/ActivitiesPage'; | |
import InvitationPage from './pages/auth/InvitationPage'; | ||
import LoginPage from './pages/auth/LoginPage'; | ||
import { PasswordResetPage } from './pages/auth/PasswordResetPage'; | ||
import QuestionnairePage from './pages/auth/QuestionnairePage'; | ||
import SignUpPage from './pages/auth/SignUpPage'; | ||
import { BrandingPage } from './pages/brand/BrandingPage'; | ||
import { PromoteChangesPage } from './pages/changes/PromoteChangesPage'; | ||
import { GetStartedPage } from './pages/get-started/GetStartedPage'; | ||
import HomePage from './pages/HomePage'; | ||
import { | ||
ApiKeysPage, | ||
|
@@ -28,12 +26,6 @@ import { IntegrationsListPage } from './pages/integrations/IntegrationsListPage' | |
import { UpdateProviderPage } from './pages/integrations/UpdateProviderPage'; | ||
import { MembersInvitePage } from './pages/invites/MembersInvitePage'; | ||
import { LinkVercelProjectPage } from './pages/partner-integrations/LinkVercelProjectPage'; | ||
import { DigestPreview } from './pages/quick-start/steps/DigestPreview'; | ||
import { FrameworkSetup } from './pages/quick-start/steps/FrameworkSetup'; | ||
import { GetStarted } from './pages/quick-start/steps/GetStarted'; | ||
import { InAppSuccess } from './pages/quick-start/steps/InAppSuccess'; | ||
import { NotificationCenter } from './pages/quick-start/steps/NotificationCenter'; | ||
import { Setup } from './pages/quick-start/steps/Setup'; | ||
import SubscribersList from './pages/subscribers/SubscribersListPage'; | ||
import { ChannelPreview } from './pages/templates/components/ChannelPreview'; | ||
import { ChannelStepEditor } from './pages/templates/components/ChannelStepEditor'; | ||
|
@@ -77,7 +69,6 @@ const AuthRoutes = () => { | |
<Route path={ROUTES.AUTH_RESET_REQUEST} element={<PasswordResetPage />} /> | ||
<Route path={ROUTES.AUTH_RESET_TOKEN} element={<PasswordResetPage />} /> | ||
<Route path={ROUTES.AUTH_INVITATION_TOKEN} element={<InvitationPage />} /> | ||
<Route path={ROUTES.AUTH_APPLICATION} element={<QuestionnairePage />} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the questionnaire page and all related code. All old/new users will sign-in/up through the new Dashboard and it's flow. |
||
</Route> | ||
); | ||
|
||
|
@@ -123,16 +114,6 @@ export const AppRoutes = () => { | |
<Route path="create" element={<CreateTenantPage />} /> | ||
<Route path=":identifier" element={<UpdateTenantPage />} /> | ||
</Route> | ||
{isV2Enabled ? ( | ||
<Route path={ROUTES.GET_STARTED} element={<GetStartedPage />} /> | ||
) : ( | ||
<Route path={ROUTES.GET_STARTED} element={<GetStarted />} /> | ||
)} | ||
<Route path={ROUTES.GET_STARTED_PREVIEW} element={<DigestPreview />} /> | ||
<Route path={ROUTES.QUICK_START_NOTIFICATION_CENTER} element={<NotificationCenter />} /> | ||
<Route path={ROUTES.QUICK_START_SETUP} element={<FrameworkSetup />} /> | ||
<Route path={ROUTES.QUICK_START_SETUP_FRAMEWORK} element={<Setup />} /> | ||
<Route path={ROUTES.QUICK_START_SETUP_SUCCESS} element={<InAppSuccess />} /> | ||
Comment on lines
-126
to
-135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed get started page and all related code |
||
<Route path={ROUTES.ACTIVITIES} element={<ActivitiesPage />} /> | ||
{!IS_EE_AUTH_ENABLED ? ( | ||
<Route path={ROUTES.SETTINGS} element={<SettingsPage />}> | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the opt-in logic is now handled with the Clerk webhook event: https://github.com/novuhq/packages-enterprise/pull/270
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be that there will be some delivery delay on their webhook? It happened before, and during that time our service might redirect the user to the wrong place. How can we ensure that by the time the user reaches the USECASE SELECT he already opted in?