From 11536cb0e071e10f20ab097796c9a153ca81d490 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 29 Mar 2024 12:14:10 +0800 Subject: [PATCH] fix(client): the reference template was deleted by mistake --- .../core/client/src/schema-settings/SchemaSettings.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-settings/SchemaSettings.tsx b/packages/core/client/src/schema-settings/SchemaSettings.tsx index b32307f7e9..c6e3e0e9e9 100644 --- a/packages/core/client/src/schema-settings/SchemaSettings.tsx +++ b/packages/core/client/src/schema-settings/SchemaSettings.tsx @@ -42,11 +42,11 @@ import { ActionContextProvider, AssociationOrCollectionProvider, CollectionFieldOptions_deprecated, + CollectionRecordProvider, DataSourceApplicationProvider, Designable, FormDialog, FormProvider, - CollectionRecordProvider, RemoteSchemaComponent, SchemaComponent, SchemaComponentContext, @@ -56,6 +56,7 @@ import { useAPIClient, useBlockRequestContext, useCollectionManager_deprecated, + useCollectionRecord, useCollection_deprecated, useCompile, useDataBlockProps, @@ -63,7 +64,6 @@ import { useFilterBlock, useGlobalTheme, useLinkageCollectionFilterOptions, - useCollectionRecord, useRecord, useSchemaSettingsItem, useSortFields, @@ -82,9 +82,9 @@ import { useFormActiveFields, } from '../block-provider/hooks'; import { SelectWithTitle, SelectWithTitleProps } from '../common/SelectWithTitle'; +import { useNiceDropdownMaxHeight } from '../common/useNiceDropdownHeight'; import { useDataSourceManager } from '../data-source/data-source/DataSourceManagerProvider'; import { useDataSourceKey } from '../data-source/data-source/DataSourceProvider'; -import { useNiceDropdownMaxHeight } from '../common/useNiceDropdownHeight'; import { FilterBlockType, getSupportFieldsByAssociation, @@ -572,7 +572,7 @@ export const SchemaSettingsRemove: FC = (props) => { field.required = false; fieldSchema['required'] = false; } - if (template && ctx?.dn) { + if (template && template.uid === fieldSchema['x-uid'] && ctx?.dn) { await ctx?.dn.remove(null, options); } else { await dn.remove(null, options);