fix: some field parameters should be disabled when editing
This commit is contained in:
parent
b45a5d57ea
commit
0ab0d3ed46
@ -142,7 +142,7 @@ export const AddFieldAction = () => {
|
||||
{t('Add field')}
|
||||
</Button>
|
||||
</Dropdown>
|
||||
<SchemaComponent schema={schema} components={{ ArrayTable }} scope={{ useCreateCollectionField }} />
|
||||
<SchemaComponent schema={schema} components={{ ArrayTable }} scope={{ createOnly: true, useCreateCollectionField }} />
|
||||
</ActionContext.Provider>
|
||||
);
|
||||
};
|
||||
|
@ -134,7 +134,7 @@ export const AddSubFieldAction = () => {
|
||||
</Button>
|
||||
</Dropdown>
|
||||
<RecordProvider record={{}}>
|
||||
<SchemaComponent schema={schema} components={{ ArrayTable }} scope={{ useCreateSubField }} />
|
||||
<SchemaComponent schema={schema} components={{ ArrayTable }} scope={{ createOnly: true, useCreateSubField }} />
|
||||
</RecordProvider>
|
||||
</ActionContext.Provider>
|
||||
);
|
||||
|
@ -83,10 +83,12 @@ export const linkTo: IField = {
|
||||
'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
'x-disabled': '{{ !createOnly }}',
|
||||
},
|
||||
through: {
|
||||
type: 'string',
|
||||
title: '{{t("Junction collection")}}',
|
||||
'x-disabled': '{{ !createOnly }}',
|
||||
'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
|
@ -192,7 +192,7 @@ export const defaultProps = {
|
||||
type: 'string',
|
||||
title: '{{t("Field name")}}',
|
||||
required: true,
|
||||
// 'x-disabled': true,
|
||||
'x-disabled': '{{ !createOnly }}',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Input',
|
||||
description:
|
||||
|
Loading…
Reference in New Issue
Block a user