mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
fix(m2m-array): issue where select component for a m2m array field has only one option (#5544)
This commit is contained in:
parent
4bb9cdd141
commit
cf0a62a502
@ -48,3 +48,5 @@ export * from './nanoid';
|
||||
export * from './unixTimestamp';
|
||||
export * from './dateOnly';
|
||||
export * from './datetimeNoTz';
|
||||
|
||||
export { getUniqueKeyFromCollection } from './utils';
|
||||
|
@ -8,14 +8,10 @@
|
||||
*/
|
||||
|
||||
import { ISchema } from '@formily/react';
|
||||
import { Collection, CollectionFieldInterface } from '@nocobase/client';
|
||||
import { CollectionFieldInterface, getUniqueKeyFromCollection } from '@nocobase/client';
|
||||
import { tval } from '@nocobase/utils/client';
|
||||
import { NAMESPACE } from './locale';
|
||||
|
||||
function getUniqueKeyFromCollection(collection: Collection) {
|
||||
return collection?.filterTargetKey?.[0] || collection?.filterTargetKey || collection?.getPrimaryKey() || 'id';
|
||||
}
|
||||
|
||||
export class MBMFieldInterface extends CollectionFieldInterface {
|
||||
name = 'mbm';
|
||||
type = 'object';
|
||||
|
Loading…
x
Reference in New Issue
Block a user