mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:17:23 +00:00
fix(collection-manager): filter out empty
This commit is contained in:
parent
0832a56868
commit
186da56bdc
@ -19,11 +19,11 @@ export const useCollectionManager = () => {
|
||||
},
|
||||
[],
|
||||
);
|
||||
return inheritedFields;
|
||||
return inheritedFields.filter(Boolean);
|
||||
};
|
||||
|
||||
const getCollectionFields = (name: string): CollectionFieldOptions[] => {
|
||||
const currentFields = collections?.find((collection) => collection.name === name)?.fields;
|
||||
const currentFields = collections?.find((collection) => collection.name === name)?.fields || [];
|
||||
const inheritedFields = getInheritedFields(name);
|
||||
const totalFields = unionBy(currentFields?.concat(inheritedFields) || [], 'name').filter((v: any) => {
|
||||
return !v.isForeignKey;
|
||||
@ -174,8 +174,8 @@ export const useCollectionManager = () => {
|
||||
return templates[name] ? clone(templates[name] || templates['general']) : null;
|
||||
},
|
||||
getParentCollectionFields: (parentCollection, currentCollection) => {
|
||||
const currentFields = collections?.find((collection) => collection.name === currentCollection)?.fields;
|
||||
const parentFields = collections?.find((collection) => collection.name === parentCollection)?.fields;
|
||||
const currentFields = collections?.find((collection) => collection.name === currentCollection)?.fields || [];
|
||||
const parentFields = collections?.find((collection) => collection.name === parentCollection)?.fields || [];
|
||||
const inheritKeys = getInheritCollections(currentCollection);
|
||||
const index = inheritKeys.indexOf(parentCollection);
|
||||
let filterFields = currentFields;
|
||||
|
Loading…
Reference in New Issue
Block a user