fix: create or delete collection error (#501)
This commit is contained in:
parent
3496126102
commit
05d315115f
@ -1,10 +1,15 @@
|
||||
import { ISchema } from '@formily/react';
|
||||
import { ISchema, Schema } from '@formily/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { i18n } from '../../../i18n';
|
||||
import { useRecord } from '../../../record-provider';
|
||||
import { useCompile } from '../../../schema-component';
|
||||
import { CollectionOptions } from '../../types';
|
||||
import { collectionFieldSchema } from './collectionFields';
|
||||
|
||||
const compile = (source) => {
|
||||
return Schema.compile(source, { t: i18n.t });
|
||||
}
|
||||
|
||||
const collection: CollectionOptions = {
|
||||
name: 'collections',
|
||||
filterTargetKey: 'name',
|
||||
@ -203,8 +208,9 @@ export const collectionSchema: ISchema = {
|
||||
'x-reactions': (field) => {
|
||||
const i = field.path.segments[1];
|
||||
const table = field.form.getValuesIn(`table.${i}`);
|
||||
const compile = useCompile();
|
||||
if (table) {
|
||||
field.title = `${compile(table.title)} - ${compile('{{ t("Configure fields") }}')}`;
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
collectionFieldSchema,
|
||||
|
Loading…
Reference in New Issue
Block a user