From 5c48aa91fca3061492ae16a650ac9c8f92580994 Mon Sep 17 00:00:00 2001 From: shanghaikid Date: Tue, 28 Mar 2023 18:42:09 +0800 Subject: [PATCH 1/2] fix import dialog disable button --- client/src/pages/collections/Types.ts | 6 ------ client/src/pages/dialogs/ImportSampleDialog.tsx | 2 +- client/src/pages/dialogs/Types.ts | 7 ++++++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/src/pages/collections/Types.ts b/client/src/pages/collections/Types.ts index 86b34883..38327f25 100644 --- a/client/src/pages/collections/Types.ts +++ b/client/src/pages/collections/Types.ts @@ -146,9 +146,3 @@ export enum TAB_EMUM { 'data-preview', 'data-query', } - -export interface LoadSampleParam { - collection_name: string; - // e.g. [{vector: [1,2,3], age: 10}] - size: string; -} diff --git a/client/src/pages/dialogs/ImportSampleDialog.tsx b/client/src/pages/dialogs/ImportSampleDialog.tsx index 3d24b29a..9e8b6c19 100644 --- a/client/src/pages/dialogs/ImportSampleDialog.tsx +++ b/client/src/pages/dialogs/ImportSampleDialog.tsx @@ -129,7 +129,7 @@ const ImportSampleDialog: FC<{ collection: string }> = props => { : insertStatus } handleConfirm={handleNext} - confirmDisabled={false} + confirmDisabled={insertStatus === InsertStatusEnum.loading} showActions={true} showCancel={false} // don't show close icon when insert not finish diff --git a/client/src/pages/dialogs/Types.ts b/client/src/pages/dialogs/Types.ts index 843cf9e1..e3886ca0 100644 --- a/client/src/pages/dialogs/Types.ts +++ b/client/src/pages/dialogs/Types.ts @@ -25,4 +25,9 @@ export interface CreateAliasProps { export interface RenameCollectionProps { collectionName: string; cb?: () => void; -} \ No newline at end of file +} +export interface LoadSampleParam { + collection_name: string; + // e.g. [{vector: [1,2,3], age: 10}] + size: string; +} From f8fb010fe91680caed130a5b640062bf58a7c48b Mon Sep 17 00:00:00 2001 From: shanghaikid Date: Tue, 28 Mar 2023 18:51:38 +0800 Subject: [PATCH 2/2] fix --- client/src/pages/dialogs/LoadCollectionDialog.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client/src/pages/dialogs/LoadCollectionDialog.tsx b/client/src/pages/dialogs/LoadCollectionDialog.tsx index 174a4fa8..80d2f19e 100644 --- a/client/src/pages/dialogs/LoadCollectionDialog.tsx +++ b/client/src/pages/dialogs/LoadCollectionDialog.tsx @@ -47,7 +47,7 @@ const LoadCollectionDialog = (props: any) => { const { t: warningTrans } = useTranslation('warning'); const { handleCloseDialog } = useContext(rootContext); const [form, setForm] = useState({ - replica: 0, + replica: 1, }); const [enableRelica, setEnableRelica] = useState(false); const [replicaToggle, setReplicaToggle] = useState(false); @@ -78,9 +78,6 @@ const LoadCollectionDialog = (props: any) => { // only show replica toggle in distributed mode && query node > 1 if (enableRelica && queryNodes.length > 1) { - setForm({ - replica: queryNodes.length, - }); setMaxQueryNode(queryNodes.length); setEnableRelica(enableRelica); } @@ -156,7 +153,7 @@ const LoadCollectionDialog = (props: any) => { const handleChange = () => { setReplicaToggle(!replicaToggle); if (!replicaToggle === false) { - setForm({ replica: 0 }); + setForm({ replica: 1 }); } };