Skip to content

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

chore: fixing e2e, draggable, maclike back button issues

Ilian Sapundshiev2636eb4c2773
diff --git a/src/renderer/components/dialogs/AboutDialog.tsx b/src/renderer/components/dialogs/AboutDialog.tsx
index 98574f258..6cacf7146 100644
--- a/src/renderer/components/dialogs/AboutDialog.tsx
+++ b/src/renderer/components/dialogs/AboutDialog.tsx
@@ -114,15 +114,15 @@ function AboutDialog(props: Props) {
}
const theme = useTheme();
- const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
+ const smallScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
<TranslucentDialog
open={open}
onClose={onClose}
- fullScreen={fullScreen}
+ fullScreen={smallScreen}
keepMounted
scroll="paper"
- PaperComponent={fullScreen ? Paper : DraggablePaper}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
aria-labelledby="draggable-dialog-title"
>
<TsDialogTitle
diff --git a/src/renderer/components/dialogs/CreateDirectoryDialog.tsx b/src/renderer/components/dialogs/CreateDirectoryDialog.tsx
index 4720429fb..f9c0db2c7 100644
--- a/src/renderer/components/dialogs/CreateDirectoryDialog.tsx
+++ b/src/renderer/components/dialogs/CreateDirectoryDialog.tsx
@@ -27,9 +27,11 @@ import {
inputBaseClasses,
useMediaQuery,
Box,
+ Paper,
} from '@mui/material';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import DraggablePaper from '-/components/DraggablePaper';
import SetBackgroundIcon from '@mui/icons-material/OpacityOutlined';
import { joinPaths } from '@tagspaces/tagspaces-common/paths';
import TsTextField from '-/components/TsTextField';
@@ -178,6 +180,7 @@ function CreateDirectoryDialog(props: Props) {
open={open}
onClose={onClose}
fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
keepMounted
scroll="paper"
onKeyDown={(event) => {
diff --git a/src/renderer/components/dialogs/Dialogs.css.tsx b/src/renderer/components/dialogs/Dialogs.css.tsx
deleted file mode 100644
index 0c3af94e0..000000000
--- a/src/renderer/components/dialogs/Dialogs.css.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * TagSpaces - universal file and folder organizer
- * Copyright (C) 2017-present TagSpaces GmbH
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License (version 3) as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-export default (theme: any) => ({
- panel: {
- height: '100%',
- maxHeight: '100%',
- padding: 5,
- overflowY: 'hidden',
- backgroundColor: theme.palette.background.default,
- },
-});
diff --git a/src/renderer/components/dialogs/DownloadUrlDialog.tsx b/src/renderer/components/dialogs/DownloadUrlDialog.tsx
index 9514d79fa..a59fd41b3 100644
--- a/src/renderer/components/dialogs/DownloadUrlDialog.tsx
+++ b/src/renderer/components/dialogs/DownloadUrlDialog.tsx
@@ -166,7 +166,7 @@ function DownloadUrlDialog(props: Props) {
>
<TsDialogTitle
dialogTitle={t('core:downloadLink')}
- closeButtonTestId="closeCreateDialogTID"
+ closeButtonTestId="closeDownloadURLDialogTID"
onClose={onClose}
actionSlot={okButton}
/>
diff --git a/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsx b/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsx
index aec747cf5..10aef10c2 100644
--- a/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsx
+++ b/src/renderer/components/dialogs/ImportExportTagGroupsDialog.tsx
@@ -20,6 +20,7 @@ import React, { useRef, useState } from 'react';
import TsButton from '-/components/TsButton';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import DraggablePaper from '-/components/DraggablePaper';
import DialogContent from '@mui/material/DialogContent';
import FormControl from '@mui/material/FormControl';
import FormGroup from '@mui/material/FormGroup';
@@ -35,6 +36,7 @@ import useMediaQuery from '@mui/material/useMediaQuery';
import { exportTagGroups } from '-/services/taglibrary-utils';
import { useTranslation } from 'react-i18next';
import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
+import Paper from '@mui/material/Paper';
interface Props {
open: boolean;
@@ -140,6 +142,7 @@ function ImportExportTagGroupsDialog(props: Props) {
open={open}
fullScreen={smallScreen}
onClose={onClose}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
// onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
>
<TsDialogTitle
diff --git a/src/renderer/components/dialogs/KeyboardDialog.tsx b/src/renderer/components/dialogs/KeyboardDialog.tsx
index 4f739d974..e0e9b4b6f 100644
--- a/src/renderer/components/dialogs/KeyboardDialog.tsx
+++ b/src/renderer/components/dialogs/KeyboardDialog.tsx
@@ -21,6 +21,7 @@ import { useSelector } from 'react-redux';
import TsButton from '-/components/TsButton';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
+import DraggablePaper from '-/components/DraggablePaper';
import DialogContent from '@mui/material/DialogContent';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
@@ -32,6 +33,7 @@ import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTranslation } from 'react-i18next';
import AppConfig from '-/AppConfig';
+import Paper from '@mui/material/Paper';
export function adjustKeyBinding(keyBinding: string) {
if (!keyBinding || !keyBinding.length) return '';
@@ -85,6 +87,7 @@ function KeyboardDialog(props: Props) {
open={open}
onClose={onClose}
fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
keepMounted
scroll="paper"
>
diff --git a/src/renderer/components/dialogs/NewAudioDialog.tsx b/src/renderer/components/dialogs/NewAudioDialog.tsx
index 2df5ac621..63d95db68 100644
--- a/src/renderer/components/dialogs/NewAudioDialog.tsx
+++ b/src/renderer/components/dialogs/NewAudioDialog.tsx
@@ -63,7 +63,7 @@ function NewAudioDialog(props: Props) {
>
<TsDialogTitle
dialogTitle={t('core:audioRecorder')}
- closeButtonTestId="closeCreateDialogTID"
+ closeButtonTestId="closeNewAudioDialogTID"
onClose={() => {
intOnClose(undefined, 'escapeKeyDown');
}}
diff --git a/src/renderer/components/dialogs/NewFileDialog.tsx b/src/renderer/components/dialogs/NewFileDialog.tsx
index fbf25451d..19b53a17f 100644
--- a/src/renderer/components/dialogs/NewFileDialog.tsx
+++ b/src/renderer/components/dialogs/NewFileDialog.tsx
@@ -26,7 +26,6 @@ import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
import Dialog from '@mui/material/Dialog';
import Paper from '@mui/material/Paper';
import DraggablePaper from '-/components/DraggablePaper';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import CreateFile from '-/components/dialogs/components/CreateFile';
@@ -144,7 +143,7 @@ function NewFileDialog(props: Props) {
<TsDialogTitle
dialogTitle={getFileType()}
onClose={onClose}
- closeButtonTestId="closeCreateDialogTID"
+ closeButtonTestId="closeNewFileDialogTID"
actionSlot={okButton}
></TsDialogTitle>
<DialogContent
diff --git a/src/renderer/components/dialogs/OnboardingDialog.tsx b/src/renderer/components/dialogs/OnboardingDialog.tsx
index 3cdf73aca..3da5d2ddb 100644
--- a/src/renderer/components/dialogs/OnboardingDialog.tsx
+++ b/src/renderer/components/dialogs/OnboardingDialog.tsx
@@ -39,7 +39,6 @@ import {
getPersistTagsInSidecarFile,
actions as SettingsActions,
} from '-/reducers/settings';
-import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import Links from 'assets/links';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
@@ -123,8 +122,9 @@ function OnboardingDialog(props: Props) {
>
<TsDialogTitle
dialogTitle={''}
+ style={{ height: 25 }}
onClose={onClose}
- closeButtonTestId="closeOnboardingDialog"
+ closeButtonTestId={'closeOnboardingDialog'}
/>
<DialogContent
style={{
diff --git a/src/renderer/components/dialogs/components/TsDialogTitle.tsx b/src/renderer/components/dialogs/components/TsDialogTitle.tsx
index d352c4f66..7dd33a0d1 100644
--- a/src/renderer/components/dialogs/components/TsDialogTitle.tsx
+++ b/src/renderer/components/dialogs/components/TsDialogTitle.tsx
@@ -43,6 +43,7 @@ function TsDialogTitle(props: TSDialogTitle) {
closeButtonTestId,
children,
actionSlot,
+ ...rest
} = props;
const { t } = useTranslation();
const desktopMode = useSelector(isDesktopMode);
@@ -58,6 +59,7 @@ function TsDialogTitle(props: TSDialogTitle) {
tabIndex={-1}
style={{
float: 'left',
+ marginLeft: AppConfig.isMacLike && desktopMode ? 40 : 0,
}}
data-tid={closeButtonTestId && closeButtonTestId}
onClick={onClose}
@@ -69,13 +71,13 @@ function TsDialogTitle(props: TSDialogTitle) {
return (
<DialogTitle
id={smallScreen ? '' : 'draggable-dialog-title'}
- {...props}
+ {...rest}
style={{
cursor: smallScreen ? 'unset' : 'move',
...style,
}}
>
- {smallScreen ? (
+ {smallScreen ? ( // && !desktopMode
<>
<div style={{ display: 'flex' }}>
{backButton}