mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
04deacc470
@ -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>
|
||||
);
|
||||
|
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user