feat(plugin-workflow): add filter button for workflows list (#2555)
This commit is contained in:
parent
1a82e92ae3
commit
5411faf9d4
@ -2,6 +2,7 @@ import {
|
|||||||
CollectionManagerContext,
|
CollectionManagerContext,
|
||||||
PluginManagerContext,
|
PluginManagerContext,
|
||||||
SchemaComponent,
|
SchemaComponent,
|
||||||
|
SchemaComponentContext,
|
||||||
SettingsCenterProvider,
|
SettingsCenterProvider,
|
||||||
} from '@nocobase/client';
|
} from '@nocobase/client';
|
||||||
import { Card, Tooltip } from 'antd';
|
import { Card, Tooltip } from 'antd';
|
||||||
@ -26,19 +27,22 @@ export function useWorkflowContext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function WorkflowPane() {
|
function WorkflowPane() {
|
||||||
|
const ctx = useContext(SchemaComponentContext);
|
||||||
return (
|
return (
|
||||||
<Card bordered={false}>
|
<Card bordered={false}>
|
||||||
<SchemaComponent
|
<SchemaComponentContext.Provider value={{ ...ctx, designable: false }}>
|
||||||
schema={workflowSchema}
|
<SchemaComponent
|
||||||
components={{
|
schema={workflowSchema}
|
||||||
Tooltip,
|
components={{
|
||||||
WorkflowLink,
|
Tooltip,
|
||||||
ExecutionResourceProvider,
|
WorkflowLink,
|
||||||
ExecutionLink,
|
ExecutionResourceProvider,
|
||||||
OpenDrawer,
|
ExecutionLink,
|
||||||
ExecutionStatusSelect,
|
OpenDrawer,
|
||||||
}}
|
ExecutionStatusSelect,
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</SchemaComponentContext.Provider>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ const collection = {
|
|||||||
{
|
{
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
name: 'enabled',
|
name: 'enabled',
|
||||||
interface: 'radio',
|
interface: 'radioGroup',
|
||||||
uiSchema: {
|
uiSchema: {
|
||||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -159,6 +159,20 @@ export const workflowSchema: ISchema = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
|
filter: {
|
||||||
|
type: 'void',
|
||||||
|
title: '{{ t("Filter") }}',
|
||||||
|
default: {
|
||||||
|
$and: [{ title: { $includes: '' } }],
|
||||||
|
},
|
||||||
|
'x-action': 'filter',
|
||||||
|
'x-component': 'Filter.Action',
|
||||||
|
'x-component-props': {
|
||||||
|
icon: 'FilterOutlined',
|
||||||
|
useProps: '{{ cm.useFilterActionProps }}',
|
||||||
|
},
|
||||||
|
'x-align': 'left',
|
||||||
|
},
|
||||||
create: {
|
create: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
title: '{{t("Add new")}}',
|
title: '{{t("Add new")}}',
|
||||||
|
Loading…
Reference in New Issue
Block a user