tachybase_todo/packages/plugins/@tachybase/plugin-kanban/src/client/KanbanActionInitializers.tsx
sealday ede7ead8b1 chore(version): release v0.21.34 (#1045)
Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#1045
2024-05-24 01:06:06 +08:00

92 lines
2.3 KiB
TypeScript

import { CompatibleSchemaInitializer, useCollection_deprecated } from '@tachybase/client';
/**
* @deprecated
*/
export const kanbanActionInitializers_deprecated = new CompatibleSchemaInitializer({
name: 'KanbanActionInitializers',
title: "{{t('Configure actions')}}",
icon: 'SettingOutlined',
style: {
marginLeft: 8,
},
items: [
{
type: 'itemGroup',
title: "{{t('Enable actions')}}",
name: 'enableActions',
children: [
{
name: 'filter',
title: "{{t('Filter')}}",
Component: 'FilterActionInitializer',
schema: {
'x-align': 'left',
},
},
{
name: 'addNew',
title: "{{t('Add new')}}",
Component: 'CreateActionInitializer',
schema: {
'x-align': 'right',
'x-decorator': 'ACLActionProvider',
'x-acl-action-props': {
skipScopeCheck: true,
},
},
useVisible() {
const collection = useCollection_deprecated();
return (collection as any).template !== 'view' || collection?.writableView;
},
},
],
},
],
});
export const kanbanActionInitializers = new CompatibleSchemaInitializer(
{
name: 'kanban:configureActions',
title: "{{t('Configure actions')}}",
icon: 'SettingOutlined',
style: {
marginLeft: 8,
},
items: [
{
type: 'itemGroup',
title: "{{t('Enable actions')}}",
name: 'enableActions',
children: [
{
name: 'filter',
title: "{{t('Filter')}}",
Component: 'FilterActionInitializer',
schema: {
'x-align': 'left',
},
},
{
name: 'addNew',
title: "{{t('Add new')}}",
Component: 'CreateActionInitializer',
schema: {
'x-align': 'right',
'x-decorator': 'ACLActionProvider',
'x-acl-action-props': {
skipScopeCheck: true,
},
},
useVisible() {
const collection = useCollection_deprecated();
return (collection as any).template !== 'view' || collection?.writableView;
},
},
],
},
],
},
kanbanActionInitializers_deprecated,
);