Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix import dialog disable button #175

Merged
merged 2 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions client/src/pages/collections/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion client/src/pages/dialogs/ImportSampleDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions client/src/pages/dialogs/LoadCollectionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -156,7 +153,7 @@ const LoadCollectionDialog = (props: any) => {
const handleChange = () => {
setReplicaToggle(!replicaToggle);
if (!replicaToggle === false) {
setForm({ replica: 0 });
setForm({ replica: 1 });
}
};

Expand Down
7 changes: 6 additions & 1 deletion client/src/pages/dialogs/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ export interface CreateAliasProps {
export interface RenameCollectionProps {
collectionName: string;
cb?: () => void;
}
}
export interface LoadSampleParam {
collection_name: string;
// e.g. [{vector: [1,2,3], age: 10}]
size: string;
}