mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:17:23 +00:00
chore: remove link to field and association fields filter
This commit is contained in:
parent
390c12ab2d
commit
be50cb5929
@ -1,6 +1,6 @@
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { ArrayTable } from '@formily/antd';
|
||||
import { useForm, useField } from '@formily/react';
|
||||
import { useField, useForm } from '@formily/react';
|
||||
import { uid } from '@formily/shared';
|
||||
import { Button, Dropdown, Menu } from 'antd';
|
||||
import { cloneDeep } from 'lodash';
|
||||
@ -9,11 +9,11 @@ import { useTranslation } from 'react-i18next';
|
||||
import { useRequest } from '../../api-client';
|
||||
import { RecordProvider, useRecord } from '../../record-provider';
|
||||
import { ActionContext, SchemaComponent, useActionContext, useCompile } from '../../schema-component';
|
||||
import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider';
|
||||
import { useCancelAction } from '../action-hooks';
|
||||
import { useCollectionManager } from '../hooks';
|
||||
import { useOptions } from '../hooks/useOptions';
|
||||
import { IField } from '../interfaces/types';
|
||||
import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider';
|
||||
import * as components from './components';
|
||||
import { getOptions } from './interfaces';
|
||||
|
||||
@ -249,7 +249,7 @@ export const AddFieldAction = (props) => {
|
||||
option.children.length > 0 && (
|
||||
<Menu.ItemGroup key={option.label} title={compile(option.label)}>
|
||||
{option.children
|
||||
.filter((child) => !['o2o', 'subTable'].includes(child.name))
|
||||
.filter((child) => !['o2o', 'subTable', 'linkTo'].includes(child.name))
|
||||
.map((child) => {
|
||||
return (
|
||||
<Menu.Item key={child.name} data-targetScope={child.targetScope}>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Schema, useFieldSchema } from '@formily/react';
|
||||
import { useFieldSchema } from '@formily/react';
|
||||
import { useCollection } from '../../';
|
||||
|
||||
// 表格操作配置
|
||||
@ -81,33 +81,33 @@ export const TableActionInitializers = {
|
||||
return (collection as any).template !== 'view';
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'item',
|
||||
title: "{{t('Association fields filter')}}",
|
||||
component: 'ActionBarAssociationFilterAction',
|
||||
schema: {
|
||||
'x-align': 'left',
|
||||
},
|
||||
find: (schema: Schema) => {
|
||||
const resultSchema = Object.entries(schema.parent.properties).find(
|
||||
([, value]) => value['x-component'] === 'AssociationFilter',
|
||||
)?.[1];
|
||||
return resultSchema;
|
||||
},
|
||||
visible: () => {
|
||||
const collection = useCollection();
|
||||
const schema = useFieldSchema();
|
||||
return (collection as any).template !== 'view' && schema['x-initializer'] !== 'GanttActionInitializers';
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
visible: () => {
|
||||
const collection = useCollection();
|
||||
const schema = useFieldSchema();
|
||||
return (collection as any).template !== 'view' && schema['x-initializer'] !== 'GanttActionInitializers';
|
||||
},
|
||||
},
|
||||
// {
|
||||
// type: 'item',
|
||||
// title: "{{t('Association fields filter')}}",
|
||||
// component: 'ActionBarAssociationFilterAction',
|
||||
// schema: {
|
||||
// 'x-align': 'left',
|
||||
// },
|
||||
// find: (schema: Schema) => {
|
||||
// const resultSchema = Object.entries(schema.parent.properties).find(
|
||||
// ([, value]) => value['x-component'] === 'AssociationFilter',
|
||||
// )?.[1];
|
||||
// return resultSchema;
|
||||
// },
|
||||
// visible: () => {
|
||||
// const collection = useCollection();
|
||||
// const schema = useFieldSchema();
|
||||
// return (collection as any).template !== 'view' && schema['x-initializer'] !== 'GanttActionInitializers';
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// type: 'divider',
|
||||
// visible: () => {
|
||||
// const collection = useCollection();
|
||||
// const schema = useFieldSchema();
|
||||
// return (collection as any).template !== 'view' && schema['x-initializer'] !== 'GanttActionInitializers';
|
||||
// },
|
||||
// },
|
||||
{
|
||||
type: 'subMenu',
|
||||
title: '{{t("Customize")}}',
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { Schema } from '@formily/react';
|
||||
|
||||
// 操作记录表格操作配置
|
||||
export const AuditLogsTableActionInitializers = {
|
||||
@ -30,22 +29,22 @@ export const AuditLogsTableActionInitializers = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
type: 'item',
|
||||
title: "{{t('Association fields filter')}}",
|
||||
component: 'ActionBarAssociationFilterAction',
|
||||
schema: {
|
||||
'x-align': 'left',
|
||||
},
|
||||
find: (schema: Schema) => {
|
||||
const resultSchema = Object.entries(schema.parent.properties).find(
|
||||
([, value]) => value['x-component'] === 'AssociationFilter',
|
||||
)?.[1];
|
||||
return resultSchema;
|
||||
},
|
||||
},
|
||||
// {
|
||||
// type: 'divider',
|
||||
// },
|
||||
// {
|
||||
// type: 'item',
|
||||
// title: "{{t('Association fields filter')}}",
|
||||
// component: 'ActionBarAssociationFilterAction',
|
||||
// schema: {
|
||||
// 'x-align': 'left',
|
||||
// },
|
||||
// find: (schema: Schema) => {
|
||||
// const resultSchema = Object.entries(schema.parent.properties).find(
|
||||
// ([, value]) => value['x-component'] === 'AssociationFilter',
|
||||
// )?.[1];
|
||||
// return resultSchema;
|
||||
// },
|
||||
// },
|
||||
],
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user