mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-06 05:59:25 +08:00
fix(client): fix the issue where adding block templates in the popup does not display (#4531)
* chore: avoid crashing * fix(client): fix the issue where adding block templates in the popup does not display
This commit is contained in:
parent
d83c102492
commit
803ea80e4b
@ -230,7 +230,6 @@ const SortableRow = (props) => {
|
|||||||
? classObj.topActiveClass
|
? classObj.topActiveClass
|
||||||
: classObj.bottomActiveClass;
|
: classObj.bottomActiveClass;
|
||||||
|
|
||||||
console.log('active?.id !== id', active?.id, id, active?.id !== id);
|
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
ref={active?.id !== id ? setNodeRef : null}
|
ref={active?.id !== id ? setNodeRef : null}
|
||||||
|
@ -65,6 +65,9 @@ interface RecursiveRemoveOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const generateUid = (s: ISchema) => {
|
const generateUid = (s: ISchema) => {
|
||||||
|
if (!s) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!s['x-uid']) {
|
if (!s['x-uid']) {
|
||||||
s['x-uid'] = uid();
|
s['x-uid'] = uid();
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ function useRecordBlocks() {
|
|||||||
if (fromOthersInPopup) {
|
if (fromOthersInPopup) {
|
||||||
return templateWrapCollection(templateSchema, { item, fromOthersInPopup });
|
return templateWrapCollection(templateSchema, { item, fromOthersInPopup });
|
||||||
}
|
}
|
||||||
templateWrap(templateSchema, { item });
|
return templateWrap(templateSchema, { item });
|
||||||
},
|
},
|
||||||
showAssociationFields: true,
|
showAssociationFields: true,
|
||||||
};
|
};
|
||||||
|
@ -42,7 +42,7 @@ export const gridRowColWrap = (schema: ISchema) => {
|
|||||||
type: 'void',
|
type: 'void',
|
||||||
'x-component': 'Grid.Col',
|
'x-component': 'Grid.Col',
|
||||||
properties: {
|
properties: {
|
||||||
[schema.name || uid()]: schema,
|
[schema?.name || uid()]: schema,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -968,13 +968,14 @@ export const useCollectionDataSourceItems = ({
|
|||||||
// 目的是使点击无效
|
// 目的是使点击无效
|
||||||
onClick() {},
|
onClick() {},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
...dataBlockInitializerProps,
|
||||||
icon: null,
|
icon: null,
|
||||||
title: otherText || t('Other records'),
|
title: otherText || t('Other records'),
|
||||||
name: 'otherRecords',
|
name: 'otherRecords',
|
||||||
showAssociationFields: false,
|
showAssociationFields: false,
|
||||||
onlyCurrentDataSource: false,
|
onlyCurrentDataSource: false,
|
||||||
hideChildrenIfSingleCollection: false,
|
hideChildrenIfSingleCollection: false,
|
||||||
onCreateBlockSchema: dataBlockInitializerProps.onCreateBlockSchema,
|
fromOthersInPopup: true,
|
||||||
componentType: componentTypeMap[componentName] || componentName,
|
componentType: componentTypeMap[componentName] || componentName,
|
||||||
filter({ collection, associationField }) {
|
filter({ collection, associationField }) {
|
||||||
if (filterOtherRecordsCollection) {
|
if (filterOtherRecordsCollection) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user