Browse Source

clean ui console errors (#414)

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
ryjiang 1 năm trước cách đây
mục cha
commit
d24a3f6242

+ 1 - 1
client/src/components/customSelector/Types.ts

@@ -20,7 +20,7 @@ export type CustomSelectorType = SelectProps & {
   variant?: 'filled' | 'outlined' | 'standard';
   labelClass?: string;
   wrapperClass?: string;
-  hiddenlabel?: boolean;
+  hiddenlabel?: string;
   size?: 'small' | 'medium' | undefined;
 };
 

+ 4 - 1
client/src/pages/collections/Collections.tsx

@@ -234,7 +234,10 @@ const Collections = () => {
                 }
                 // user can't select partition on collection page, so default value is ''
                 defaultSelectedPartition={''}
-                onInsert={() => {}}
+                onInsert={async () => {
+                  await fetchCollections();
+                  setSelectedCollections([]);
+                }}
               />
             ),
           },

+ 1 - 1
client/src/pages/collections/Types.ts

@@ -14,7 +14,7 @@ export interface CollectionCreateParam {
 }
 
 export interface CreateField {
-  name: string;
+  name: string | null;
   data_type: DataTypeEnum;
   is_primary_key: boolean;
   is_partition_key?: boolean;

+ 1 - 1
client/src/pages/dialogs/CreateCollectionDialog.tsx

@@ -302,7 +302,7 @@ const CreateCollectionDialog: FC<CollectionCreateProps> = ({ onCreate }) => {
             onChange={(e: React.ChangeEvent<{ value: unknown }>) => {
               setConsistencyLevel(e.target.value as ConsistencyLevelEnum);
             }}
-            hiddenlabel={true}
+            hiddenlabel={'true'}
             value={consistencyLevel}
             variant="filled"
           />

+ 2 - 2
client/src/pages/dialogs/insert/Dialog.tsx

@@ -134,7 +134,7 @@ const InsertContainer: FC<InsertContentProps> = ({
     if (collectionValue) {
       const partitions = await PartitionService.getPartitions(collectionValue);
       const partitionOptions: Option[] = partitions.map(p => ({
-        label: p.name,
+        label: p.name === '_default' ? insertTrans('defaultPartition') : p.name,
         value: p.name,
       }));
       setPartitionOptions(partitionOptions);
@@ -183,7 +183,7 @@ const InsertContainer: FC<InsertContentProps> = ({
         cancel: btnTrans('cancel'),
       },
       [InsertStepperEnum.preview]: {
-        confirm: btnTrans('insert'),
+        confirm: btnTrans('importFile'),
         cancel: (
           <>
             <BackIcon classes={{ root: classes.icon }} />

+ 2 - 2
client/src/pages/dialogs/insert/Import.tsx

@@ -117,7 +117,7 @@ const InsertImport: FC<InsertImportProps> = ({
         {insertTrans('targetTip')}
       </Typography>
 
-      <form className={classes.selectors}>
+      <section className={classes.selectors}>
         <div className="selectorWrapper">
           <CustomSelector
             options={collectionOptions}
@@ -148,7 +148,7 @@ const InsertImport: FC<InsertImportProps> = ({
             }}
           />
         </div>
-      </form>
+      </section>
 
       <div className={classes.uploadWrapper}>
         <Typography className="text file" variant="body1">