Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: improvements in move entries dialogs

Ilian Sapundshiev21c69f7c410d
diff --git a/app/components/DirectoryListView.tsx b/app/components/DirectoryListView.tsx
index c4c2f5c3a..117216802 100644
--- a/app/components/DirectoryListView.tsx
+++ b/app/components/DirectoryListView.tsx
@@ -129,7 +129,7 @@ function DirectoryListView(props: Props) {
<div style={{ marginTop: 10 }}>
{getLocations()}
<Button
- variant="outlined"
+ variant="text"
startIcon={<ParentFolderIcon />}
style={{ backgroundColor: '#fefefe80', margin: 5 }}
onClick={() => {
@@ -145,7 +145,7 @@ function DirectoryListView(props: Props) {
{i18n.t('core:navigateToParentDirectory')}
</Button>
<Button
- variant="outlined"
+ variant="text"
startIcon={<NewFolderIcon />}
style={{ backgroundColor: '#fefefe80', margin: 5 }}
onClick={() => {
@@ -162,7 +162,7 @@ function DirectoryListView(props: Props) {
dense
style={{
borderRadius: 5,
- maxHeight: 400,
+ maxHeight: 300,
// @ts-ignore
overflowY: AppConfig.isFirefox ? 'auto' : 'overlay'
}}
diff --git a/app/components/dialogs/MoveCopyFilesDialog.tsx b/app/components/dialogs/MoveCopyFilesDialog.tsx
index 4c69edc3f..e0de75b7f 100644
--- a/app/components/dialogs/MoveCopyFilesDialog.tsx
+++ b/app/components/dialogs/MoveCopyFilesDialog.tsx
@@ -21,6 +21,8 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Progress } from 'aws-sdk/clients/s3';
import { formatBytes } from '@tagspaces/tagspaces-common/misc';
+import Box from '@mui/material/Box';
+import Paper from '@mui/material/Paper';
import Button from '@mui/material/Button';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
@@ -32,6 +34,7 @@ import DialogTitle from '@mui/material/DialogTitle';
import Typography from '@mui/material/Typography';
import Dialog from '@mui/material/Dialog';
import { FolderIcon, FileIcon } from '-/components/CommonIcons';
+import DraggablePaper from '-/components/DraggablePaper';
import i18n from '-/services/i18n';
import PlatformIO from '-/services/platform-facade';
import IOActions from '-/reducers/io-actions';
@@ -183,23 +186,26 @@ function MoveCopyFilesDialog(props: Props) {
onClose={onClose}
keepMounted
scroll="paper"
+ aria-labelledby="draggable-dialog-title"
+ PaperComponent={fullScreen ? Paper : DraggablePaper}
fullScreen={fullScreen}
>
- <DialogTitle>
- {i18n.t('core:copyMoveTitle')}
+ <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
+ {i18n.t('core:copyMoveEntriesTitle')}
<DialogCloseButton onClose={onCloseDialog} />
</DialogTitle>
- <DialogContent style={{ overflowX: 'hidden' }}>
+ <DialogContent style={{ overflow: 'hidden' }}>
<List
dense
- style={{ width: 550, marginLeft: -15, marginBottom: 20 }}
+ style={{
+ overflowY: 'auto',
+ width: 550,
+ maxHeight: 200,
+ marginLeft: -15,
+ marginBottom: 20
+ }}
subheader={
- <ListSubheader
- style={{ backgroundColor: 'transparent' }}
- component="div"
- >
- {i18n.t('selectedFilesAndFolders')}
- </ListSubheader>
+ <ListSubheader>{i18n.t('selectedFilesAndFolders')}</ListSubheader>
}
>
{props.selectedEntries &&
@@ -232,17 +238,22 @@ function MoveCopyFilesDialog(props: Props) {
)}
<DirectoryListView setTargetDir={setTargetPath} />
</DialogContent>
- <DialogActions>
+ <DialogActions
+ // style={{
+ // justifyContent: 'space-between'
+ // }}
+ >
<Button data-tid="closeMoveCopyDialog" onClick={() => props.onClose()}>
{i18n.t('core:cancel')}
</Button>
+ {/* <Box> */}
<Button
data-tid="confirmMoveFiles"
disabled={!targetPath}
onClick={handleMoveFiles}
color="primary"
>
- {i18n.t('core:moveFilesButton')}
+ {i18n.t('core:moveEntriesButton')}
</Button>
<Button
onClick={handleCopyFiles}
@@ -250,8 +261,9 @@ function MoveCopyFilesDialog(props: Props) {
disabled={!targetPath}
color="primary"
>
- {i18n.t('core:copyFilesButton')}
+ {i18n.t('core:copyEntriesButton')}
</Button>
+ {/* </Box> */}
</DialogActions>
</Dialog>
);
diff --git a/app/components/dialogs/MoveOrCopyFilesDialog.tsx b/app/components/dialogs/MoveOrCopyFilesDialog.tsx
index 5ef3bc69a..b3b41fb07 100644
--- a/app/components/dialogs/MoveOrCopyFilesDialog.tsx
+++ b/app/components/dialogs/MoveOrCopyFilesDialog.tsx
@@ -23,6 +23,7 @@
import React from 'react';
import Button from '@mui/material/Button';
+import Paper from '@mui/material/Paper';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
@@ -33,6 +34,7 @@ import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import Typography from '@mui/material/Typography';
import Dialog from '@mui/material/Dialog';
+import DraggablePaper from '-/components/DraggablePaper';
import i18n from '-/services/i18n';
import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import useTheme from '@mui/styles/useTheme';
@@ -57,10 +59,12 @@ function MoveOrCopyFilesDialog(props: Props) {
onClose={onClose}
keepMounted
scroll="paper"
+ aria-labelledby="draggable-dialog-title"
+ PaperComponent={fullScreen ? Paper : DraggablePaper}
fullScreen={fullScreen}
>
- <DialogTitle>
- {i18n.t('core:copyMoveFilesTitle')}
+ <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
+ {i18n.t('core:copyMoveEntriesTitle')}
<DialogCloseButton onClose={() => onClose()} />
</DialogTitle>
<DialogContent>
@@ -102,14 +106,14 @@ function MoveOrCopyFilesDialog(props: Props) {
data-tid="confirmMoveFilesTID"
color="primary"
>
- {i18n.t('core:moveFilesButton')}
+ {i18n.t('core:moveEntriesButton')}
</Button>
<Button
onClick={() => props.handleCopyFiles(props.selectedFiles)}
data-tid="confirmCopyFilesTID"
color="primary"
>
- {i18n.t('core:copyFilesButton')}
+ {i18n.t('core:copyEntriesButton')}
</Button>
</DialogActions>
</Dialog>