diff --git a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx index eab4803ba5..3aa6f932db 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx @@ -927,7 +927,7 @@ export const ActionDesigner = (props) => { {restProps.children} {isChildCollectionAction && } - {} + {fieldSchema?.['x-action-settings']?.removable !== false && } ); diff --git a/packages/core/client/src/schema-initializer/SchemaInitializer.tsx b/packages/core/client/src/schema-initializer/SchemaInitializer.tsx index dfcbc546ce..e400e4a37f 100644 --- a/packages/core/client/src/schema-initializer/SchemaInitializer.tsx +++ b/packages/core/client/src/schema-initializer/SchemaInitializer.tsx @@ -609,7 +609,8 @@ SchemaInitializer.SwitchItem = (props) => { return (
- {props.title} + +
); diff --git a/packages/core/client/src/schema-initializer/items/InitializerWithSwitch.tsx b/packages/core/client/src/schema-initializer/items/InitializerWithSwitch.tsx index e5ea105451..17878f4040 100644 --- a/packages/core/client/src/schema-initializer/items/InitializerWithSwitch.tsx +++ b/packages/core/client/src/schema-initializer/items/InitializerWithSwitch.tsx @@ -5,7 +5,7 @@ import { SchemaInitializer } from '..'; import { useCurrentSchema } from '../utils'; export const InitializerWithSwitch = (props) => { - const { type, schema, item, insert, remove: passInRemove } = props; + const { type, schema, item, insert, remove: passInRemove, disabled } = props; const { exists, remove } = useCurrentSchema( schema?.[type] || item?.schema?.[type], type, @@ -16,8 +16,12 @@ export const InitializerWithSwitch = (props) => { return ( { + if (disabled) { + return; + } if (exists) { return remove(); }