From 0ab0d3ed462acd4befeb85da65747f2965fbed36 Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 20 Apr 2022 22:23:52 +0800 Subject: [PATCH] fix: some field parameters should be disabled when editing --- .../src/collection-manager/Configuration/AddFieldAction.tsx | 2 +- .../src/collection-manager/Configuration/AddSubFieldAction.tsx | 2 +- .../core/client/src/collection-manager/interfaces/linkTo.ts | 2 ++ .../src/collection-manager/interfaces/properties/index.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/collection-manager/Configuration/AddFieldAction.tsx b/packages/core/client/src/collection-manager/Configuration/AddFieldAction.tsx index dd61ddb14..b136086aa 100644 --- a/packages/core/client/src/collection-manager/Configuration/AddFieldAction.tsx +++ b/packages/core/client/src/collection-manager/Configuration/AddFieldAction.tsx @@ -142,7 +142,7 @@ export const AddFieldAction = () => { {t('Add field')} - + ); }; diff --git a/packages/core/client/src/collection-manager/Configuration/AddSubFieldAction.tsx b/packages/core/client/src/collection-manager/Configuration/AddSubFieldAction.tsx index ebd2953b3..56f88441e 100644 --- a/packages/core/client/src/collection-manager/Configuration/AddSubFieldAction.tsx +++ b/packages/core/client/src/collection-manager/Configuration/AddSubFieldAction.tsx @@ -134,7 +134,7 @@ export const AddSubFieldAction = () => { - + ); diff --git a/packages/core/client/src/collection-manager/interfaces/linkTo.ts b/packages/core/client/src/collection-manager/interfaces/linkTo.ts index 0ea3a9dd5..aced110fb 100644 --- a/packages/core/client/src/collection-manager/interfaces/linkTo.ts +++ b/packages/core/client/src/collection-manager/interfaces/linkTo.ts @@ -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', diff --git a/packages/core/client/src/collection-manager/interfaces/properties/index.ts b/packages/core/client/src/collection-manager/interfaces/properties/index.ts index 7311149b5..1400fa967 100644 --- a/packages/core/client/src/collection-manager/interfaces/properties/index.ts +++ b/packages/core/client/src/collection-manager/interfaces/properties/index.ts @@ -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: