Browse Source

fix: copybtn not working after refactor

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 month ago
parent
commit
ff1c8bf793

+ 1 - 2
client/src/components/DataListView/DataListView.tsx

@@ -47,8 +47,7 @@ const DataListView = (props: DataListViewProps) => {
               >
               >
                 {name}
                 {name}
                 <CopyButton
                 <CopyButton
-                  value={row[name]}
-                  label={name}
+                  copyValue={row[name]}
                   sx={{ ml: 0, '& svg': { width: 15 } }}
                   sx={{ ml: 0, '& svg': { width: 15 } }}
                 />
                 />
               </Box>
               </Box>

+ 1 - 2
client/src/components/advancedSearch/Dialog.tsx

@@ -99,8 +99,7 @@ const AdvancedDialog = (props: DialogProps) => {
             {`${shouldSowPlaceholder ? 'Filter Expression' : filterExpression}`}
             {`${shouldSowPlaceholder ? 'Filter Expression' : filterExpression}`}
             {!shouldSowPlaceholder && (
             {!shouldSowPlaceholder && (
               <CopyBtn
               <CopyBtn
-                label="copy expression"
-                value={filterExpression}
+                copyValue={filterExpression}
                 sx={{
                 sx={{
                   padding: (theme: Theme) => theme.spacing(0.25, 0.5),
                   padding: (theme: Theme) => theme.spacing(0.25, 0.5),
                   '& svg': {
                   '& svg': {

+ 1 - 2
client/src/components/grid/Table.tsx

@@ -254,8 +254,7 @@ const EnhancedTable: FC<TableType> = props => {
 
 
                                   {needCopy && (
                                   {needCopy && (
                                     <CopyButton
                                     <CopyButton
-                                      label={commonTrans('copy.label')}
-                                      value={row[colDef.id]}
+                                      copyValue={row[colDef.id]}
                                       size="small"
                                       size="small"
                                       sx={theme => ({
                                       sx={theme => ({
                                         '& svg': {
                                         '& svg': {

+ 0 - 1
client/src/pages/databases/collections/schema/Schema.tsx

@@ -33,7 +33,6 @@ import CopyButton from '@/components/advancedSearch/CopyButton';
 import RefreshButton from '@/components/customButton/RefreshButton';
 import RefreshButton from '@/components/customButton/RefreshButton';
 import { CollectionService } from '@/http';
 import { CollectionService } from '@/http';
 import type { FieldObject } from '@server/types';
 import type { FieldObject } from '@server/types';
-import { DYNAMIC_FIELD } from '@/consts';
 
 
 const Overview = () => {
 const Overview = () => {
   const { fetchCollection, collections, loading, database } =
   const { fetchCollection, collections, loading, database } =