Merge branch 'main' into next

This commit is contained in:
GitHub Actions Bot 2024-08-01 03:46:48 +00:00
commit a0e42a027f
3 changed files with 12 additions and 3 deletions

View File

@ -58,6 +58,14 @@ const getSchema = (schema: IField, record: any, compile, getContainer): ISchema
title: '{{ t("Edit collection") }}',
properties: {
...properties,
filterTargetKey: {
title: `{{ t("Record unique key")}}`,
type: 'single',
description: `{{t( "If a collection lacks a primary key, you must configure a unique record key to locate row records within a block, failure to configure this will prevent the creation of data blocks for the collection.")}}`,
'x-decorator': 'FormItem',
'x-component': 'Select',
'x-reactions': ['{{useAsyncDataSource(loadFilterTargetKeys)}}'],
},
footer: {
type: 'void',
'x-component': 'Action.Drawer.Footer',

View File

@ -78,7 +78,6 @@ const getSchema = (schema: IField, record: any, compile, getContainer): ISchema
'x-decorator': 'FormItem',
'x-component': 'Select',
enum: '{{filterTargetKeyOptions}}',
'x-visible': '{{!!isView}}',
},
footer: {
type: 'void',

View File

@ -29,6 +29,7 @@ import {
FieldSummary,
TemplateSummary,
useRequest,
useCollectionRecordData,
} from '@nocobase/client';
import { CollectionFields } from './CollectionFields';
import { collectionSchema } from './schemas/collections';
@ -101,7 +102,7 @@ const useNewId = (prefix) => {
export const ConfigurationTable = () => {
const { t } = useTranslation();
const { interfaces, getCollections } = useCollectionManager_deprecated();
const { interfaces, getCollections, getCollection } = useCollectionManager_deprecated();
const {
data: { database },
} = useCurrentAppInfo();
@ -163,7 +164,8 @@ export const ConfigurationTable = () => {
};
const loadFilterTargetKeys = async (field) => {
const { fields } = field.form.values;
const { name } = field.form.values;
const { fields } = getCollection(name);
return Promise.resolve({
data: fields,
}).then(({ data }) => {