The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Serve the core workflow show page at /workflow/:id (#26788)
Thomas Trompette27bcd4080d2e
diff --git a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.tsindex e126a173951..2e19e8e696f 100644--- a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts+++ b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts@@ -370,16 +370,6 @@ const testCases: {{ loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.INVITE_TEAM, res: AppPath.InviteTeam },{ loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.BOOK_CALL, res: AppPath.BookCall },{ loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.WorkspaceActivation },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.SYNC_EMAIL, res: AppPath.SyncEmails },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.APPS_INSTALLATION, res: AppPath.InstallApps },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.INVITE_TEAM, res: AppPath.InviteTeam },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.BOOK_CALL, res: AppPath.BookCall },- { loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },{ loc: AppPath.PageLayoutPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },{ loc: AppPath.PageLayoutPage, isLogged: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.PageLayoutPage, isLogged: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },diff --git a/packages/twenty-front/src/modules/app/components/WorkspaceApp.tsx b/packages/twenty-front/src/modules/app/components/WorkspaceApp.tsxindex 939f0bcb28f..dcf9c4f6160 100644--- a/packages/twenty-front/src/modules/app/components/WorkspaceApp.tsx+++ b/packages/twenty-front/src/modules/app/components/WorkspaceApp.tsx@@ -3,8 +3,6 @@ import { RouterProvider } from 'react-router-dom';import { useCreateWorkspaceAppRouter } from '@/app/hooks/useCreateWorkspaceAppRouter';import { currentUserState } from '@/auth/states/currentUserState';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';-import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';-import { FeatureFlagKey } from '~/generated-metadata/graphql';export const WorkspaceApp = () => {const currentUser = useAtomStateValue(currentUserState);@@ -13,17 +11,10 @@ export const WorkspaceApp = () => {(currentUser?.canImpersonate || currentUser?.canAccessFullAdminPanel) ??false;- const isWorkflowCoreIndexPageEnabled = useIsFeatureEnabled(- FeatureFlagKey.IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED,- );-return (<RouterProvideruseTransitions={false}- router={useCreateWorkspaceAppRouter({- isAdminPageEnabled,- isWorkflowCoreIndexPageEnabled,- })}+ router={useCreateWorkspaceAppRouter({ isAdminPageEnabled })}/>);};diff --git a/packages/twenty-front/src/modules/app/hooks/useCreateWorkspaceAppRouter.tsx b/packages/twenty-front/src/modules/app/hooks/useCreateWorkspaceAppRouter.tsxindex ebd4a9c67c3..88bb9a3e331 100644--- a/packages/twenty-front/src/modules/app/hooks/useCreateWorkspaceAppRouter.tsx+++ b/packages/twenty-front/src/modules/app/hooks/useCreateWorkspaceAppRouter.tsx@@ -102,16 +102,13 @@ const preloadOnboardingPages = () => {type CreateWorkspaceAppRouterArgs = {isAdminPageEnabled?: boolean;- isWorkflowCoreIndexPageEnabled?: boolean;};const createWorkspaceAppRouter = ({isAdminPageEnabled,- isWorkflowCoreIndexPageEnabled,}: CreateWorkspaceAppRouterArgs) => {const workspaceRouteObjects = createWorkspaceRouteObjects({isAdminPageEnabled,- isWorkflowCoreIndexPageEnabled,});return createBrowserRouter([@@ -276,13 +273,8 @@ const createWorkspaceAppRouter = ({export const useCreateWorkspaceAppRouter = ({isAdminPageEnabled,- isWorkflowCoreIndexPageEnabled,}: CreateWorkspaceAppRouterArgs) =>useMemo(- () =>- createWorkspaceAppRouter({- isAdminPageEnabled,- isWorkflowCoreIndexPageEnabled,- }),- [isAdminPageEnabled, isWorkflowCoreIndexPageEnabled],+ () => createWorkspaceAppRouter({ isAdminPageEnabled }),+ [isAdminPageEnabled],);diff --git a/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsx b/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsxindex 89248f7ee1f..a0ceac2749d 100644--- a/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsx+++ b/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsx@@ -81,32 +81,6 @@ describe('workspace route objects', () => {expect(matchRoutes(mainRoutes, '/settings/billing')).not.toBeNull();});- it('hosts the specialized workflow index on both surfaces', () => {- const routeObjects = createWorkspaceRouteObjects({- isWorkflowCoreIndexPageEnabled: true,- });-- expect(- isWorkspaceLocationAvailableOnSurface(- routeObjects,- 'side-panel',- '/objects/workflows',- ),- ).toBe(true);- expect(- getWorkspaceRouteObjectsForSurface(routeObjects, 'side-panel').map(- ({ path }) => path,- ),- ).toContain(AppPath.WorkflowCoreIndexPage);- expect(- isWorkspaceLocationAvailableOnSurface(- routeObjects,- 'side-panel',- '/objects/companies',- ),- ).toBe(true);- });-it.each(['/settings/objects','/settings/objects/companies',@@ -179,13 +153,11 @@ describe('workspace route objects', () => {).toBe(false);});- it('allows the specialized workflow index to expand', () => {+ it('allows the core workflow show page to expand', () => {expect(isWorkspaceLocationExpandableFromSidePanel(- createWorkspaceRouteObjects({- isWorkflowCoreIndexPageEnabled: true,- }),- '/objects/workflows',+ createWorkspaceRouteObjects({}),+ '/workflow/core-workflow-id',),).toBe(true);});diff --git a/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx b/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsxindex 03ffc0ab5cf..02fbd66d59c 100644--- a/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx+++ b/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx@@ -11,12 +11,6 @@ import {import { type WorkspaceRouteObject } from '@/app/routing/types/WorkspaceRouteObject';import { RecordIndexSkeletonLoader } from '@/object-record/record-index/components/RecordIndexSkeletonLoader';-const WorkflowCoreIndexPage = lazy(() =>- import('~/pages/object-core/WorkflowCoreIndexPage').then((module) => ({- default: module.WorkflowCoreIndexPage,- })),-);-const WorkflowCoreShowPage = lazy(() =>import('~/pages/object-core/WorkflowCoreShowPage').then((module) => ({default: module.WorkflowCoreShowPage,@@ -61,7 +55,6 @@ const NotFound = lazy(() =>type CreateWorkspaceRouteObjectsArgs = {isAdminPageEnabled?: boolean;- isWorkflowCoreIndexPageEnabled?: boolean;};const MAIN_AND_SIDE_PANEL = ['main', 'side-panel'] as const;@@ -69,7 +62,6 @@ const SETTINGS_ROOT_PATH = AppPath.SettingsCatchAll.replace('/*', '');export const createWorkspaceRouteObjects = ({isAdminPageEnabled,- isWorkflowCoreIndexPageEnabled,}: CreateWorkspaceRouteObjectsArgs): WorkspaceRouteObject[] => {const settingsRouteObjects = createSettingsRouteObjects({isAdminPageEnabled,@@ -88,22 +80,6 @@ export const createWorkspaceRouteObjects = ({isLocationExpandableFromSidePanel: true,},},- ...(isWorkflowCoreIndexPageEnabled- ? [- {- path: AppPath.WorkflowCoreIndexPage,- element: (- <LazyRoute>- <WorkflowCoreIndexPage />- </LazyRoute>- ),- handle: {- workspaceSurfaces: MAIN_AND_SIDE_PANEL,- isLocationExpandableFromSidePanel: true,- },- } satisfies WorkspaceRouteObject,- ]- : []),{path: AppPath.Index,element: <RecordIndexSkeletonLoader />,diff --git a/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsx b/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsxindex dceaa941222..ad046ed6079 100644--- a/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsx+++ b/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsx@@ -55,13 +55,10 @@ const getViewId = ({export const RouteContextStoreProvider = () => {const location = useLocation();const routeObjects = useWorkspaceRouteObjects();- const isCoreWorkflowIndexPage = isMatchingLocation(+ const isRecordIndexPage = isMatchingLocation(location,- AppPath.WorkflowCoreIndexPage,+ AppPath.RecordIndexPage,);- const isRecordIndexPage =- isCoreWorkflowIndexPage ||- isMatchingLocation(location, AppPath.RecordIndexPage);const isCoreWorkflowShowPage = isMatchingLocation(location,AppPath.WorkflowCoreShowPage,@@ -75,8 +72,7 @@ export const RouteContextStoreProvider = () => {const routeParams = matchRoutes(routeObjects, location)?.at(-1)?.params;const objectNamePlural = routeParams?.objectNamePlural;- const isCoreWorkflowPage = isCoreWorkflowIndexPage || isCoreWorkflowShowPage;- const objectNameSingular = isCoreWorkflowPage+ const objectNameSingular = isCoreWorkflowShowPage? CoreObjectNameSingular.Workflow: routeParams?.objectNameSingular;@@ -155,7 +151,7 @@ export const RouteContextStoreProvider = () => {return (<RouteContextStoreProviderEffect- viewId={isCoreWorkflowPage ? undefined : viewId}+ viewId={isCoreWorkflowShowPage ? undefined : viewId}objectMetadataItem={objectMetadataItem}isRecordIndexPage={isRecordIndexPage}isRecordShowPage={isRecordShowPage}diff --git a/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsx b/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsxindex a06e82d83c0..15d18d25370 100644--- a/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsx+++ b/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsx@@ -103,7 +103,7 @@ const routeObjects: WorkspaceRouteObject[] = [handle: { workspaceSurfaces: MAIN_AND_SIDE_PANEL },},{- path: AppPath.WorkflowCoreIndexPage,+ path: AppPath.WorkflowCoreShowPage,element: null,handle: { workspaceSurfaces: MAIN_AND_SIDE_PANEL },},@@ -177,8 +177,8 @@ describe('RouteContextStoreProvider', () => {);});- it('provides workflow index context on the standalone core route', () => {- renderAt('/workflow-core', <MainSurfaceRoutes />);+ it('provides workflow context on the core workflow show page', () => {+ renderAt('/workflow/core-workflow-id', <MainSurfaceRoutes />);expect(screen.getByTestId('route-context-store')).toHaveAttribute('data-object-metadata-id',@@ -186,7 +186,7 @@ describe('RouteContextStoreProvider', () => {);expect(screen.getByTestId('route-context-store')).toHaveAttribute('data-is-record-index-page',- 'true',+ 'false',);});diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/DeleteCoreWorkflowsCommand.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/DeleteCoreWorkflowsCommand.tsxindex f038c2a5e36..3a24911d771 100644--- a/packages/twenty-front/src/modules/object-core/workflows/components/DeleteCoreWorkflowsCommand.tsx+++ b/packages/twenty-front/src/modules/object-core/workflows/components/DeleteCoreWorkflowsCommand.tsx@@ -3,6 +3,7 @@ import { isNonEmptyArray } from 'twenty-shared/utils';import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';import { useDeleteSelectedCoreWorkflows } from '@/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows';+import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';import { useNavigateApp } from '~/hooks/useNavigateApp';@@ -23,7 +24,9 @@ export const DeleteCoreWorkflowsCommand = () => {return;}closeSidePanelMenu();- navigate(AppPath.WorkflowCoreIndexPage);+ navigate(AppPath.RecordIndexPage, {+ objectNamePlural: CoreObjectNamePlural.Workflow,+ });};return <HeadlessEngineCommandWrapperEffect execute={execute} />;diff --git a/packages/twenty-front/src/modules/object-core/workflows/docs/rollout.md b/packages/twenty-front/src/modules/object-core/workflows/docs/rollout.mdindex 64f786bf38d..5e3117b1bf3 100644--- a/packages/twenty-front/src/modules/object-core/workflows/docs/rollout.md+++ b/packages/twenty-front/src/modules/object-core/workflows/docs/rollout.md@@ -4,7 +4,7 @@ This frontend uses the core-ID API merged through #26068, and this branch is reb## Definition ownership and rollback-With the flag enabled, workflow routes use `/workflow-core/:coreWorkflowId`. Version selectors, diagrams, draft editing, output-schema keys, command-menu actions and definition mutations use core IDs. The existing workspace route resolves its mirror's core ID and redirects. A failed core query shows an error; it never loads a workspace definition as a fallback.+With the flag enabled, the workflow show page uses `/workflow/:coreWorkflowId` and the index stays at `/objects/workflows`. Version selectors, diagrams, draft editing, output-schema keys, command-menu actions and definition mutations use core IDs. The existing workspace route resolves its mirror's core ID and redirects. A failed core query shows an error; it never loads a workspace definition as a fallback.With the flag disabled, the workspace index, show page and mutation paths remain available. A core direct link resolves its workspace mirror and redirects. The backend's core-authoritative writes and rollback mirrors must remain deployed, including the legacy-write-to-core synchronization provided by #26068. Disabling the UI flag does not roll back database migrations.diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsxindex 1fd425d8bc0..7c3f1c04add 100644--- a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx@@ -20,6 +20,7 @@ import { useListenToCoreWorkflowEvents } from '@/object-core/workflows/hooks/useimport { useCoreWorkflowVersions } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersions';import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';+import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';import { useObjectPermissionsForObject } from '@/object-record/hooks/useObjectPermissionsForObject';import { RecordShowPageResourceEffect } from '@/object-record/record-show/components/RecordShowPageResourceEffect';@@ -134,7 +135,9 @@ const CoreWorkflowShowContent = ({links={[{children: t`Workflows`,- href: getAppPath(AppPath.WorkflowCoreIndexPage),+ href: getAppPath(AppPath.RecordIndexPage, {+ objectNamePlural: CoreObjectNamePlural.Workflow,+ }),},{ children: record.name ?? '' },]}diff --git a/packages/twenty-shared/src/types/AppPath.ts b/packages/twenty-shared/src/types/AppPath.tsindex 2986825c724..d6329500e5d 100644--- a/packages/twenty-shared/src/types/AppPath.ts+++ b/packages/twenty-shared/src/types/AppPath.ts@@ -27,8 +27,7 @@ export enum AppPath {RecordIndexPage = '/objects/:objectNamePlural',RecordShowPage = '/object/:objectNameSingular/:objectRecordId',PageLayoutPage = '/page/:pageLayoutId',- WorkflowCoreIndexPage = '/workflow-core',- WorkflowCoreShowPage = '/workflow-core/:coreWorkflowId',+ WorkflowCoreShowPage = '/workflow/:coreWorkflowId',Settings = `settings`,SettingsCatchAll = `/${Settings}/*`,