소스 검색

Merge pull request #594 from zilliztech/attu-583

update: hide import file/insert sample data/empty data actions button if there is a selection
ryjiang 1 년 전
부모
커밋
04865a0965
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      client/src/pages/databases/collections/data/CollectionData.tsx

+ 3 - 1
client/src/pages/databases/collections/data/CollectionData.tsx

@@ -177,6 +177,7 @@ const CollectionData = (props: CollectionDataProps) => {
       btnColor: 'secondary',
       label: btnTrans('importFile'),
       tooltip: btnTrans('importFileTooltip'),
+      disabled: () => selectedData?.length > 0,
       onClick: () => {
         setDialog({
           open: true,
@@ -219,6 +220,7 @@ const CollectionData = (props: CollectionDataProps) => {
       label: btnTrans('importSampleData'),
       icon: 'add',
       // tooltip: collectionTrans('deleteTooltip'),
+      disabled: () => selectedData?.length > 0,
     },
     {
       icon: 'deleteOutline',
@@ -245,9 +247,9 @@ const CollectionData = (props: CollectionDataProps) => {
           },
         });
       },
-      disabled: () => total == 0,
       label: btnTrans('empty'),
       tooltip: btnTrans('emptyTooltip'),
+      disabled: () => selectedData?.length > 0 ||  total == 0,
     },
     {
       type: 'button',