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