mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-02 04:07:50 +08:00
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,
|
||||
PluginManagerContext,
|
||||
SchemaComponent,
|
||||
SchemaComponentContext,
|
||||
SettingsCenterProvider,
|
||||
} from '@nocobase/client';
|
||||
import { Card, Tooltip } from 'antd';
|
||||
@ -26,19 +27,22 @@ export function useWorkflowContext() {
|
||||
}
|
||||
|
||||
function WorkflowPane() {
|
||||
const ctx = useContext(SchemaComponentContext);
|
||||
return (
|
||||
<Card bordered={false}>
|
||||
<SchemaComponent
|
||||
schema={workflowSchema}
|
||||
components={{
|
||||
Tooltip,
|
||||
WorkflowLink,
|
||||
ExecutionResourceProvider,
|
||||
ExecutionLink,
|
||||
OpenDrawer,
|
||||
ExecutionStatusSelect,
|
||||
}}
|
||||
/>
|
||||
<SchemaComponentContext.Provider value={{ ...ctx, designable: false }}>
|
||||
<SchemaComponent
|
||||
schema={workflowSchema}
|
||||
components={{
|
||||
Tooltip,
|
||||
WorkflowLink,
|
||||
ExecutionResourceProvider,
|
||||
ExecutionLink,
|
||||
OpenDrawer,
|
||||
ExecutionStatusSelect,
|
||||
}}
|
||||
/>
|
||||
</SchemaComponentContext.Provider>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ const collection = {
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'enabled',
|
||||
interface: 'radio',
|
||||
interface: 'radioGroup',
|
||||
uiSchema: {
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
@ -159,6 +159,20 @@ export const workflowSchema: ISchema = {
|
||||
},
|
||||
},
|
||||
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: {
|
||||
type: 'void',
|
||||
title: '{{t("Add new")}}',
|
||||
|
Loading…
Reference in New Issue
Block a user