Browse Source

update: hide import file/insert sample data/empty data action if there
is a selection

Signed-off-by: ryjiang <jiangruiyi@gmail.com>

ryjiang 11 months ago
parent
commit
d284058d41
1 changed files with 3 additions and 1 deletions
  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',
       btnColor: 'secondary',
       label: btnTrans('importFile'),
       label: btnTrans('importFile'),
       tooltip: btnTrans('importFileTooltip'),
       tooltip: btnTrans('importFileTooltip'),
+      disabled: () => selectedData?.length > 0,
       onClick: () => {
       onClick: () => {
         setDialog({
         setDialog({
           open: true,
           open: true,
@@ -219,6 +220,7 @@ const CollectionData = (props: CollectionDataProps) => {
       label: btnTrans('importSampleData'),
       label: btnTrans('importSampleData'),
       icon: 'add',
       icon: 'add',
       // tooltip: collectionTrans('deleteTooltip'),
       // tooltip: collectionTrans('deleteTooltip'),
+      disabled: () => selectedData?.length > 0,
     },
     },
     {
     {
       icon: 'deleteOutline',
       icon: 'deleteOutline',
@@ -245,9 +247,9 @@ const CollectionData = (props: CollectionDataProps) => {
           },
           },
         });
         });
       },
       },
-      disabled: () => total == 0,
       label: btnTrans('empty'),
       label: btnTrans('empty'),
       tooltip: btnTrans('emptyTooltip'),
       tooltip: btnTrans('emptyTooltip'),
+      disabled: () => selectedData?.length > 0 ||  total == 0,
     },
     },
     {
     {
       type: 'button',
       type: 'button',