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 needWaitForFieldSchemaUpdatedRef = useRef(false);
|
||||||
const fieldSchemaRef = useRef(fieldSchema);
|
const fieldSchemaRef = useRef(fieldSchema);
|
||||||
fieldSchemaRef.current = fieldSchema;
|
fieldSchemaRef.current = fieldSchema;
|
||||||
|
|
||||||
const getCustomActionSchema = useCallback(() => {
|
const getCustomActionSchema = useCallback(() => {
|
||||||
return fieldSchemaRef.current;
|
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
|
// The recordData here is only provided when the popup is opened, not the current row record
|
||||||
<VariablePopupRecordProvider>
|
<VariablePopupRecordProvider>
|
||||||
<WithoutTableFieldResource.Provider value={true}>
|
<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>
|
</WithoutTableFieldResource.Provider>
|
||||||
</VariablePopupRecordProvider>
|
</VariablePopupRecordProvider>
|
||||||
);
|
);
|
||||||
|
@ -306,6 +306,7 @@ export interface DataBlockInitializerProps {
|
|||||||
/** 用于更改 Other records 的文案 */
|
/** 用于更改 Other records 的文案 */
|
||||||
otherText?: string;
|
otherText?: string;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
alwaysRenderMenu?: boolean; //总是渲染为 SchemaInitializerMenu
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DataBlockInitializer: FC<DataBlockInitializerProps> = (props) => {
|
export const DataBlockInitializer: FC<DataBlockInitializerProps> = (props) => {
|
||||||
@ -328,6 +329,7 @@ export const DataBlockInitializer: FC<DataBlockInitializerProps> = (props) => {
|
|||||||
filterOtherRecordsCollection,
|
filterOtherRecordsCollection,
|
||||||
currentText,
|
currentText,
|
||||||
otherText,
|
otherText,
|
||||||
|
alwaysRenderMenu,
|
||||||
} = props;
|
} = props;
|
||||||
const { insert, setVisible } = useSchemaInitializer();
|
const { insert, setVisible } = useSchemaInitializer();
|
||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
@ -398,7 +400,7 @@ export const DataBlockInitializer: FC<DataBlockInitializerProps> = (props) => {
|
|||||||
] as MenuProps['items'];
|
] as MenuProps['items'];
|
||||||
}, [searchedChildren, hideChildrenIfSingleCollection, name, compile, title, icon, onClick, props]);
|
}, [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 (
|
return (
|
||||||
<SchemaInitializerMenu
|
<SchemaInitializerMenu
|
||||||
onOpenChange={(keys) => {
|
onOpenChange={(keys) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user