Merge branch 'main' into next

This commit is contained in:
nocobase[bot] 2025-02-27 08:44:55 +00:00
commit 04deacc470
2 changed files with 11 additions and 3 deletions

View File

@ -92,7 +92,6 @@ const RenderRecord = React.memo(
const needWaitForFieldSchemaUpdatedRef = useRef(false);
const fieldSchemaRef = useRef(fieldSchema);
fieldSchemaRef.current = fieldSchema;
const getCustomActionSchema = useCallback(() => {
return fieldSchemaRef.current;
}, []);
@ -322,7 +321,14 @@ export const ReadPrettyInternalViewer: React.FC<ReadPrettyInternalViewerProps> =
// The recordData here is only provided when the popup is opened, not the current row record
<VariablePopupRecordProvider>
<WithoutTableFieldResource.Provider value={true}>
<NocoBaseRecursionField schema={fieldSchema} onlyRenderProperties basePath={field.address} />
<NocoBaseRecursionField
schema={fieldSchema}
onlyRenderProperties
basePath={field.address}
filterProperties={(v) => {
return v['x-component'] !== 'Action';
}}
/>
</WithoutTableFieldResource.Provider>
</VariablePopupRecordProvider>
);

View File

@ -306,6 +306,7 @@ export interface DataBlockInitializerProps {
/** 用于更改 Other records 的文案 */
otherText?: string;
children?: React.ReactNode;
alwaysRenderMenu?: boolean; //总是渲染为 SchemaInitializerMenu
}
export const DataBlockInitializer: FC<DataBlockInitializerProps> = (props) => {
@ -328,6 +329,7 @@ export const DataBlockInitializer: FC<DataBlockInitializerProps> = (props) => {
filterOtherRecordsCollection,
currentText,
otherText,
alwaysRenderMenu,
} = props;
const { insert, setVisible } = useSchemaInitializer();
const compile = useCompile();
@ -398,7 +400,7 @@ export const DataBlockInitializer: FC<DataBlockInitializerProps> = (props) => {
] as MenuProps['items'];
}, [searchedChildren, hideChildrenIfSingleCollection, name, compile, title, icon, onClick, props]);
if (childItems.length > 1 || (childItems.length === 1 && childItems[0]?.children?.length > 0)) {
if (childItems.length > 1 || (childItems.length === 1 && childItems[0]?.children?.length > 0) || alwaysRenderMenu) {
return (
<SchemaInitializerMenu
onOpenChange={(keys) => {