fix: adding inherited blocks in relation fields under edited operate should only display themselves (#1967)

This commit is contained in:
katherinehhh 2023-06-01 16:21:12 +08:00 committed by GitHub
parent a69e1acbf4
commit 1aad355950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 16 deletions

View File

@ -4,6 +4,7 @@ import { Input } from 'antd';
import React from 'react';
import { RemoteSelect, RemoteSelectProps } from '../remote-select';
import useServiceOptions from './hooks';
import { RecordProvider } from '../../../';
export type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
action?: string;
@ -30,14 +31,16 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => {
></RemoteSelect>
{isAllowAddNew && (
<RecursionField
onlyRenderProperties
basePath={field.address}
schema={fieldSchema}
filterProperties={(s) => {
return s['x-component'] === 'Action';
}}
/>
<RecordProvider record={null}>
<RecursionField
onlyRenderProperties
basePath={field.address}
schema={fieldSchema}
filterProperties={(s) => {
return s['x-component'] === 'Action';
}}
/>
</RecordProvider>
)}
</Input.Group>
</div>

View File

@ -19,6 +19,7 @@ import { ActionContext } from '../action';
import { useAssociationFieldContext, useFieldNames, useInsertSchema } from './hooks';
import schema from './schema';
import { flatData, getLabelFormatValue, useLabelUiSchema } from './util';
import { RecordProvider } from '../../../';
const useTableSelectorProps = () => {
const field: any = useField();
@ -159,14 +160,16 @@ export const InternalPicker = observer((props: any) => {
/>
</div>
{isAllowAddNew && (
<RecursionField
onlyRenderProperties
basePath={field.address}
schema={fieldSchema}
filterProperties={(s) => {
return s['x-component'] === 'Action';
}}
/>
<RecordProvider record={null}>
<RecursionField
onlyRenderProperties
basePath={field.address}
schema={fieldSchema}
filterProperties={(s) => {
return s['x-component'] === 'Action';
}}
/>
</RecordProvider>
)}
</Input.Group>
<ActionContext.Provider value={{ openMode: 'drawer', visible: visibleSelector, setVisible: setVisibleSelector }}>