Co-authored-by: sealday <sealday@gmail.com> Reviewed-on: daoyoucloud/tachybase#1045
92 lines
2.3 KiB
TypeScript
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,
|
|
);
|