feat: workflow route provider
This commit is contained in:
parent
b59a239a82
commit
246e06eb7a
@ -26,10 +26,10 @@ import {
|
||||
SignupPage,
|
||||
SystemSettingsProvider,
|
||||
SystemSettingsShortcut,
|
||||
useRequest,
|
||||
useRoutes,
|
||||
WorkflowPage,
|
||||
WorkflowShortcut,
|
||||
useRoutes
|
||||
WorkflowRouteProvider,
|
||||
WorkflowShortcut
|
||||
} from '@nocobase/client';
|
||||
import { notification } from 'antd';
|
||||
import 'antd/dist/antd.css';
|
||||
@ -97,6 +97,7 @@ const providers = [
|
||||
],
|
||||
AntdSchemaComponentProvider,
|
||||
ChinaRegionProvider,
|
||||
WorkflowRouteProvider,
|
||||
[DocumentTitleProvider, { addonAfter: 'NocoBase' }],
|
||||
];
|
||||
|
||||
|
14
packages/client/src/workflow/WorkflowRouteProvider.tsx
Normal file
14
packages/client/src/workflow/WorkflowRouteProvider.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import React, { useContext } from 'react';
|
||||
import { RouteSwitchContext } from '../route-switch';
|
||||
|
||||
export const WorkflowRouteProvider = (props) => {
|
||||
const { routes, ...others } = useContext(RouteSwitchContext);
|
||||
routes[1].routes.unshift(
|
||||
{
|
||||
type: 'route',
|
||||
path: '/admin/workflows/:id',
|
||||
component: 'WorkflowPage',
|
||||
},
|
||||
);
|
||||
return <RouteSwitchContext.Provider value={{ ...others, routes }}>{props.children}</RouteSwitchContext.Provider>;
|
||||
};
|
@ -1,5 +1,7 @@
|
||||
export * from './WorkflowPage';
|
||||
export * from './WorkflowLink';
|
||||
export * from './WorkflowTable';
|
||||
export * from './WorkflowShortcut';
|
||||
export * from './ExecutionResourceProvider';
|
||||
export * from './WorkflowLink';
|
||||
export * from './WorkflowPage';
|
||||
export * from './WorkflowRouteProvider';
|
||||
export * from './WorkflowShortcut';
|
||||
export * from './WorkflowTable';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user