mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 01:36:52 +00:00
feat(plugin-workflow): allow to delete execution in list (#5135)
* refactor(plugin-workflow): allow to delete execution in list * fix(plugin-workflow): fix mistake import
This commit is contained in:
parent
67d2f85a99
commit
3809108afa
@ -13,9 +13,9 @@ import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { message } from 'antd';
|
||||
|
||||
import { useActionContext, useRecord, useResourceActionContext, useResourceContext } from '@nocobase/client';
|
||||
import { useActionContext, useResourceActionContext, useResourceContext } from '@nocobase/client';
|
||||
|
||||
import { ExecutionStatusOptions } from '../constants';
|
||||
import { ExecutionStatusOptions, EXECUTION_STATUS } from '../constants';
|
||||
import { NAMESPACE } from '../locale';
|
||||
import { getWorkflowDetailPath } from '../utils';
|
||||
|
||||
@ -116,6 +116,19 @@ export const executionSchema = {
|
||||
icon: 'ReloadOutlined',
|
||||
},
|
||||
},
|
||||
delete: {
|
||||
type: 'void',
|
||||
title: '{{t("Delete")}}',
|
||||
'x-component': 'Action',
|
||||
'x-component-props': {
|
||||
icon: 'DeleteOutlined',
|
||||
useAction: '{{ cm.useBulkDestroyAction }}',
|
||||
confirm: {
|
||||
title: "{{t('Delete record')}}",
|
||||
content: "{{t('Are you sure you want to delete it?')}}",
|
||||
},
|
||||
},
|
||||
},
|
||||
clear: {
|
||||
type: 'void',
|
||||
title: '{{t("Clear")}}',
|
||||
@ -148,6 +161,9 @@ export const executionSchema = {
|
||||
'x-component': 'Table.Void',
|
||||
'x-component-props': {
|
||||
rowKey: 'id',
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
},
|
||||
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
||||
},
|
||||
properties: {
|
||||
@ -220,6 +236,28 @@ export const executionSchema = {
|
||||
type: 'void',
|
||||
'x-component': 'ExecutionLink',
|
||||
},
|
||||
delete: {
|
||||
type: 'void',
|
||||
title: '{{ t("Delete") }}',
|
||||
'x-component': 'Action.Link',
|
||||
'x-component-props': {
|
||||
confirm: {
|
||||
title: "{{t('Delete record')}}",
|
||||
content: "{{t('Are you sure you want to delete it?')}}",
|
||||
},
|
||||
useAction: '{{ cm.useDestroyActionAndRefreshCM }}',
|
||||
},
|
||||
'x-reactions': [
|
||||
{
|
||||
dependencies: ['..status'],
|
||||
fulfill: {
|
||||
state: {
|
||||
visible: `{{ $deps[0] !== ${EXECUTION_STATUS.STARTED} }}`,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user