fix: change plugin routes
This commit is contained in:
parent
be235786d0
commit
3735d71e70
@ -101,6 +101,9 @@ const InternalAdminLayout = (props: any) => {
|
||||
return filterByACL(data, ctx);
|
||||
}}
|
||||
onSuccess={(data) => {
|
||||
if (defaultSelectedUid && defaultSelectedUid.includes('/')) {
|
||||
return;
|
||||
}
|
||||
const schema = filterByACL(data?.data, ctx);
|
||||
if (defaultSelectedUid) {
|
||||
const s = findByUid(schema, defaultSelectedUid);
|
||||
|
@ -76,7 +76,7 @@ export const BlockTemplateDetails = () => {
|
||||
<div>
|
||||
<AntdPageHeader
|
||||
onBack={() => {
|
||||
history.push('/admin/block-templates');
|
||||
history.push('/admin/plugins/block-templates');
|
||||
}}
|
||||
ghost={false}
|
||||
title={<EditableTitle filterByTk={key} title={data?.data?.name} />}
|
||||
|
@ -15,12 +15,12 @@ const SchemaTemplateRouteProvider = (props) => {
|
||||
routes[1].routes.unshift(
|
||||
{
|
||||
type: 'route',
|
||||
path: '/admin/block-templates/:key',
|
||||
path: '/admin/plugins/block-templates/:key',
|
||||
component: 'BlockTemplateDetails',
|
||||
},
|
||||
{
|
||||
type: 'route',
|
||||
path: '/admin/block-templates',
|
||||
path: '/admin/plugins/block-templates',
|
||||
component: 'BlockTemplatePage',
|
||||
},
|
||||
);
|
||||
|
@ -12,7 +12,7 @@ export const SchemaTemplateShortcut = () => {
|
||||
icon={<LayoutOutlined />}
|
||||
title={t('Block templates')}
|
||||
onClick={() => {
|
||||
history.push('/admin/block-templates');
|
||||
history.push('/admin/plugins/block-templates');
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
@ -75,7 +75,7 @@ export const uiSchemaTemplatesSchema: ISchema = {
|
||||
'x-action': 'view',
|
||||
'x-component': 'RecordLink',
|
||||
'x-component-props': {
|
||||
to: '/admin/block-templates/${record.key}',
|
||||
to: '/admin/plugins/block-templates/${record.key}',
|
||||
},
|
||||
},
|
||||
edit: {
|
||||
|
@ -7,6 +7,6 @@ export const WorkflowLink = () => {
|
||||
const { id } = useRecord();
|
||||
const { setVisible } = useActionContext();
|
||||
return (
|
||||
<Link to={`/admin/workflows/${id}`} onClick={() => setVisible(false)}>流程配置</Link>
|
||||
<Link to={`/admin/plugins/workflows/${id}`} onClick={() => setVisible(false)}>流程配置</Link>
|
||||
);
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
import { cx } from '@emotion/css';
|
||||
import { ISchema } from '@formily/react';
|
||||
import React from 'react';
|
||||
import { useRouteMatch } from 'react-router-dom';
|
||||
import { ISchema } from '@formily/react';
|
||||
import { cx } from '@emotion/css';
|
||||
import { SchemaComponent } from '..';
|
||||
import { TriggerConfig } from './triggers';
|
||||
import { WorkflowCanvas } from './WorkflowCanvas'
|
||||
import { workflowPageClass } from './style';
|
||||
|
||||
|
||||
import { TriggerConfig } from './triggers';
|
||||
import { WorkflowCanvas } from './WorkflowCanvas';
|
||||
|
||||
const workflowCollection = {
|
||||
name: 'workflow',
|
||||
@ -22,12 +20,12 @@ const workflowCollection = {
|
||||
'x-component': 'Input',
|
||||
required: true,
|
||||
} as ISchema,
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const WorkflowPage = () => {
|
||||
const { params } = useRouteMatch();
|
||||
const { params } = useRouteMatch<any>();
|
||||
|
||||
return (
|
||||
<div className={cx(workflowPageClass)}>
|
||||
@ -36,7 +34,7 @@ export const WorkflowPage = () => {
|
||||
schema={{
|
||||
type: 'void',
|
||||
properties: {
|
||||
provider: {
|
||||
[`provider_${params.id}`]: {
|
||||
type: 'void',
|
||||
'x-decorator': 'ResourceActionProvider',
|
||||
'x-decorator-props': {
|
||||
@ -47,14 +45,14 @@ export const WorkflowPage = () => {
|
||||
action: 'get',
|
||||
params: {
|
||||
filter: params,
|
||||
appends: ['nodes']
|
||||
}
|
||||
}
|
||||
appends: ['nodes'],
|
||||
},
|
||||
},
|
||||
},
|
||||
properties: {
|
||||
trigger: {
|
||||
type: 'void',
|
||||
'x-component': 'TriggerConfig'
|
||||
'x-component': 'TriggerConfig',
|
||||
},
|
||||
nodes: {
|
||||
type: 'void',
|
||||
@ -70,7 +68,7 @@ export const WorkflowPage = () => {
|
||||
uiSchema: {
|
||||
title: '节点名称',
|
||||
type: 'string',
|
||||
'x-component': 'Input'
|
||||
'x-component': 'Input',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -82,23 +80,23 @@ export const WorkflowPage = () => {
|
||||
type: 'string',
|
||||
'x-component': 'Select',
|
||||
required: true,
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
'x-component': 'WorkflowCanvas',
|
||||
'x-component-props': {
|
||||
// nodes
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}}
|
||||
components={{
|
||||
TriggerConfig,
|
||||
WorkflowCanvas
|
||||
WorkflowCanvas,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
@ -3,12 +3,10 @@ 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',
|
||||
},
|
||||
);
|
||||
routes[1].routes.unshift({
|
||||
type: 'route',
|
||||
path: '/admin/plugins/workflows/:id',
|
||||
component: 'WorkflowPage',
|
||||
});
|
||||
return <RouteSwitchContext.Provider value={{ ...others, routes }}>{props.children}</RouteSwitchContext.Provider>;
|
||||
};
|
||||
|
@ -39,11 +39,11 @@ export class UiRoutesStoragePlugin extends Plugin {
|
||||
title: 'NocoBase Admin',
|
||||
routes: [
|
||||
// test...
|
||||
{
|
||||
type: 'route',
|
||||
path: '/admin/workflows/:id',
|
||||
component: 'WorkflowPage',
|
||||
},
|
||||
// {
|
||||
// type: 'route',
|
||||
// path: '/admin/workflows/:id',
|
||||
// component: 'WorkflowPage',
|
||||
// },
|
||||
// {
|
||||
// type: 'route',
|
||||
// path: '/admin/block-templates/:key',
|
||||
|
Loading…
Reference in New Issue
Block a user