mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:36:44 +00:00
chore: displayInAssociation
This commit is contained in:
parent
29ab715daa
commit
0289d9bdfd
@ -432,6 +432,21 @@ export class PluginDataSourceMainServer extends Plugin {
|
||||
}
|
||||
});
|
||||
|
||||
// set final options
|
||||
field.set('options', newOptions);
|
||||
} else {
|
||||
const collectionField = this.app.db.getCollection(field.get('collectionName'))?.getField(field.get('name'));
|
||||
const newOptions: any = {};
|
||||
// merge with current field options
|
||||
lodash.mergeWith(newOptions, field.get(), (objValue, srcValue) => {
|
||||
if (srcValue === null) {
|
||||
return objValue;
|
||||
}
|
||||
});
|
||||
|
||||
if (collectionField.options.displayInAssociation !== undefined) {
|
||||
newOptions.displayInAssociation = collectionField.options.displayInAssociation;
|
||||
}
|
||||
// set final options
|
||||
field.set('options', newOptions);
|
||||
}
|
||||
@ -448,12 +463,10 @@ export class PluginDataSourceMainServer extends Plugin {
|
||||
ctx.action.params?.paginate == 'false'
|
||||
) {
|
||||
for (const collection of ctx.body) {
|
||||
if (collection.get('view')) {
|
||||
const fields = collection.fields;
|
||||
handleFieldSource(fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//handle collections:fields:list
|
||||
if (ctx.action.resourceName == 'collections.fields' && ctx.action.actionName == 'list') {
|
||||
|
Loading…
Reference in New Issue
Block a user