mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:15:11 +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 { useTranslation } from 'react-i18next';
|
||||||
import { message } from 'antd';
|
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 { NAMESPACE } from '../locale';
|
||||||
import { getWorkflowDetailPath } from '../utils';
|
import { getWorkflowDetailPath } from '../utils';
|
||||||
|
|
||||||
@ -116,6 +116,19 @@ export const executionSchema = {
|
|||||||
icon: 'ReloadOutlined',
|
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: {
|
clear: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
title: '{{t("Clear")}}',
|
title: '{{t("Clear")}}',
|
||||||
@ -148,6 +161,9 @@ export const executionSchema = {
|
|||||||
'x-component': 'Table.Void',
|
'x-component': 'Table.Void',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
|
rowSelection: {
|
||||||
|
type: 'checkbox',
|
||||||
|
},
|
||||||
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
@ -220,6 +236,28 @@ export const executionSchema = {
|
|||||||
type: 'void',
|
type: 'void',
|
||||||
'x-component': 'ExecutionLink',
|
'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