Skip to content

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

Tsn369 migrate Genericdialog to Dialog (#1049)

mladensape277bca26ee5
diff --git a/app/components/dialogs/AboutDialog.js b/app/components/dialogs/AboutDialog.js
index 671551dc6..8315a1cce 100644
--- a/app/components/dialogs/AboutDialog.js
+++ b/app/components/dialogs/AboutDialog.js
@@ -24,8 +24,8 @@ import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import withMobileDialog from '@material-ui/core/withMobileDialog';
+import Dialog from '@material-ui/core/Dialog';
import semver from 'semver';
-import GenericDialog from './GenericDialog';
import LogoIcon from '../../assets/images/icon100x100.svg';
import i18n from '../../services/i18n';
import versionMeta from '../../version.json';
@@ -53,6 +53,7 @@ document.title = productName + ' ' + versionMeta.version;
const AboutDialog = (props: Props) => {
const [updateAvailable, setUpdateAvailable] = useState(false);
const [newVersion, setNewVersion] = useState('');
+ const { open, onClose, fullScreen } = props;
function checkForUpdates() {
if (updateAvailable) {
@@ -81,161 +82,150 @@ const AboutDialog = (props: Props) => {
}
}
- function renderTitle() {
- return (
- <DialogTitle>{productName}</DialogTitle>
- );
- }
-
- function renderContent() {
- return (
- <DialogContent>
- <img
- alt="TagSpaces logo"
- src={LogoIcon}
- style={{ float: 'left', marginRight: 10, width: 120, height: 120 }}
- />
- <Typography
- variant="subtitle1"
- title={'Build on: ' + versionMeta.buildTime + '\nPlatform: ' + navigator.appVersion}
- >
- Version: {versionMeta.version} / BuildID: {buildID}
- </Typography>
- <br />
- <Typography id="aboutContent" variant="body1">
- <strong>{productName}</strong> is made possible by the
- TagSpaces(github.com/tagspaces) open source project and other{' '}
- <Button
- size="small"
- color="primary"
- onClick={props.toggleThirdPartyLibsDialog}
- >
- open source software
- </Button>
- .
- <br />
- {!Pro && (
- <span>
- 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.
- </span>
- )}
- <br />
- 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 License for
- more details.
- <br />
- <br />
- <Button
- size="small"
- color="primary"
- onClick={() => {
- PlatformIO.openUrl(AppConfig.links.imprintURL);
- }}
- >
- Imprint
- </Button>
- <Button
- size="small"
- color="primary"
- onClick={() => {
- PlatformIO.openUrl(AppConfig.links.privacyURL);
- }}
- >
- Privacy Policy
- </Button>
- <Button
- size="small"
- color="primary"
- onClick={() => {
- PlatformIO.openUrl(AppConfig.links.changelogURL);
- }}
- >
- Changelog
- </Button>
- <Button
- size="small"
- color="primary"
- data-tid="openLicenseDialog"
- onClick={props.toggleLicenseDialog}
- >
- License Agreement
- </Button>
- </Typography>
- </DialogContent>
- );
- }
+ // function confirmFunction(event) {
+ // if (event.key === 'Enter' || event.keyCode === 13) {
+ // props.onClose();
+ // event.stopPropagation();
+ // }
+ // }
- function renderActions() {
- let versionInfo = 'Check for updates';
+ let versionInfo = 'Check for updates';
if (newVersion && newVersion.length > 1) {
if (updateAvailable) {
versionInfo = i18n.t('getNewVersion', { newVersion });
- } else {
- versionInfo = i18n.t('latestVersion', { productName });
- }
+ } else {
+ versionInfo = i18n.t('latestVersion', { productName });
}
+ }
- return (
- <DialogActions>
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ // onKeyDown={confirmFunction}
+ >
+ <DialogTitle>{productName}</DialogTitle>
+ <DialogContent>
+ <img
+ alt="TagSpaces logo"
+ src={LogoIcon}
+ style={{ float: 'left', marginRight: 10, width: 120, height: 120 }}
+ />
+ <Typography
+ variant="subtitle1"
+ title={'Build on: ' + versionMeta.buildTime + '\nPlatform: ' + navigator.appVersion}
+ >
+ Version: {versionMeta.version} / BuildID: {buildID}
+ </Typography>
+ <br />
+ <Typography id="aboutContent" variant="body1">
+ <strong>{productName}</strong> is made possible by the
+ TagSpaces(github.com/tagspaces) open source project and other{' '}
+ <Button
+ size="small"
+ color="primary"
+ onClick={props.toggleThirdPartyLibsDialog}
+ >
+ open source software
+ </Button>
+ .
+ <br />
{!Pro && (
- <Button
- data-tid="checkForUpdates"
- title={i18n.t('core:checkForNewVersion')}
- onClick={() => {
- PlatformIO.openUrl(AppConfig.links.productsOverview);
- }}
- color="primary"
- >
- Upgrade to PRO
- </Button>
+ <span>
+ 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.
+ </span>
)}
+ <br />
+ 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 License for
+ more details.
+ <br />
+ <br />
<Button
- data-tid="checkForUpdates"
- title={i18n.t('core:checkForNewVersion')}
- onClick={checkForUpdates}
+ size="small"
color="primary"
+ onClick={() => {
+ PlatformIO.openUrl(AppConfig.links.imprintURL);
+ }}
>
- {versionInfo}
+ Imprint
</Button>
- {/* <Button
- data-tid="openLicenseDialog"
- onClick={this.props.toggleLicenseDialog}
+ <Button
+ size="small"
+ color="primary"
+ onClick={() => {
+ PlatformIO.openUrl(AppConfig.links.privacyURL);
+ }}
>
- {i18n.t('core:license')}
+ Privacy Policy
</Button>
<Button
- data-tid="openThirdPartyLibsDialog"
- onClick={this.props.toggleThirdPartyLibsDialog}
+ size="small"
+ color="primary"
+ onClick={() => {
+ PlatformIO.openUrl(AppConfig.links.changelogURL);
+ }}
>
- {i18n.t('core:thirdPartyLibs')}
- </Button> */}
+ Changelog
+ </Button>
<Button
- data-tid="closeAboutDialog"
- onClick={props.onClose}
+ size="small"
color="primary"
+ data-tid="openLicenseDialog"
+ onClick={props.toggleLicenseDialog}
>
- {i18n.t('core:ok')}
+ License Agreement
</Button>
- </DialogActions>
- );
- }
-
- const {
- fullScreen, open, onClose
- } = props;
-
- return (
- <GenericDialog
- fullScreen={fullScreen}
- open={open}
- onClose={onClose}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ </Typography>
+ </DialogContent>
+ <DialogActions>
+ {!Pro && (
+ <Button
+ data-tid="checkForUpdates"
+ title={i18n.t('core:checkForNewVersion')}
+ onClick={() => {
+ PlatformIO.openUrl(AppConfig.links.productsOverview);
+ }}
+ color="primary"
+ >
+ Upgrade to PRO
+ </Button>
+ )}
+ <Button
+ data-tid="checkForUpdates"
+ title={i18n.t('core:checkForNewVersion')}
+ onClick={checkForUpdates}
+ color="primary"
+ >
+ {versionInfo}
+ </Button>
+ {/* <Button
+ data-tid="openLicenseDialog"
+ onClick={this.props.toggleLicenseDialog}
+ >
+ {i18n.t('core:license')}
+ </Button>
+ <Button
+ data-tid="openThirdPartyLibsDialog"
+ onClick={this.props.toggleThirdPartyLibsDialog}
+ >
+ {i18n.t('core:thirdPartyLibs')}
+ </Button> */}
+ <Button
+ data-tid="closeAboutDialog"
+ onClick={props.onClose}
+ color="primary"
+ >
+ {i18n.t('core:ok')}
+ </Button>
+ </DialogActions>
+ </Dialog>
);
};
diff --git a/app/components/dialogs/ColorPickerDialog.js b/app/components/dialogs/ColorPickerDialog.js
index e473dfa56..250ec893b 100644
--- a/app/components/dialogs/ColorPickerDialog.js
+++ b/app/components/dialogs/ColorPickerDialog.js
@@ -23,8 +23,8 @@ import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import { withStyles } from '@material-ui/core/styles';
+import Dialog from '@material-ui/core/Dialog';
import { SketchPicker } from 'react-color';
-import GenericDialog from './GenericDialog';
import i18n from '../../services/i18n';
const presetColors = ['#ffffff', '#000000', '#ac725e', '#d06b64', '#f83a22', '#fa573c',
@@ -52,6 +52,10 @@ const styles = {
const ColorPickerDialog = (props: Props) => {
const [color, setColor] = useState(undefined);
const [colorHex, setColorHex] = useState(undefined);
+ const {
+ open = false,
+ onClose
+ } = props;
function onConfirm() {
if (color && colorHex) {
@@ -66,16 +70,16 @@ const ColorPickerDialog = (props: Props) => {
setColorHex(newColor.hex);
}
- function renderTitle() {
- return (
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ keepMounted
+ scroll="paper"
+ >
<DialogTitle data-tid="colorPickerDialogTitle" >
{i18n.t('core:colorPickerDialogTitle')}
</DialogTitle>
- );
- }
-
- function renderContent() {
- return (
<DialogContent
style={{
marginLeft: 'auto',
@@ -90,11 +94,6 @@ const ColorPickerDialog = (props: Props) => {
onChangeComplete={handleChangeComplete}
/>
</DialogContent>
- );
- }
-
- function renderActions() {
- return (
<DialogActions>
<Button
data-tid="colorPickerCloseDialog"
@@ -111,21 +110,7 @@ const ColorPickerDialog = (props: Props) => {
{i18n.t('core:ok')}
</Button>
</DialogActions>
- );
- }
-
- const {
- open = false,
- onClose
- } = props;
- return (
- <GenericDialog
- open={open}
- onClose={onClose}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ </Dialog>
);
};
diff --git a/app/components/dialogs/ConfirmDialog.js b/app/components/dialogs/ConfirmDialog.js
index 170e87fcc..c310801bc 100644
--- a/app/components/dialogs/ConfirmDialog.js
+++ b/app/components/dialogs/ConfirmDialog.js
@@ -25,7 +25,7 @@ import DialogTitle from '@material-ui/core/DialogTitle';
import DialogContentText from '@material-ui/core/DialogContentText';
import ListItem from '@material-ui/core/ListItem';
import Typography from '@material-ui/core/Typography';
-import GenericDialog from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
type Props = {
@@ -41,56 +41,49 @@ type Props = {
};
const ConfirmDialog = (props: Props) => {
+ const { open, onClose } = props;
+
function onConfirm(result) {
props.confirmCallback(result);
props.onClose();
}
- function renderTitle() {
- return (<DialogTitle>{props.title}</DialogTitle>);
- }
-
- function renderContent() {
- return (<DialogContent>
- <DialogContentText data-tid={props.confirmDialogContentTID}>
- {props.content}
- {props.list && props.list.map((listItem) => (
- <ListItem title={listItem}>
- <Typography variant="inherit" noWrap>{listItem}</Typography>
- </ListItem>
- ))}
- </DialogContentText>
- </DialogContent>);
- }
-
- function renderActions() {
- return (<DialogActions>
- <Button
- onClick={() => onConfirm(false)}
- color="primary"
- data-tid={props.cancelDialogTID}
- >
- {i18n.t('core:no')}
- </Button>
- <Button
- data-tid={props.confirmDialogTID}
- onClick={() => onConfirm(true)}
- color="primary"
- >
- {i18n.t('core:yes')}
- </Button>
- </DialogActions>);
- }
-
return (
- <GenericDialog
- open={props.open}
- onClose={props.onClose}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
- );
+ <Dialog
+ open={open}
+ onClose={onClose}
+ keepMounted
+ scroll="paper"
+ >
+ <DialogTitle>{props.title}</DialogTitle>
+ <DialogContent>
+ <DialogContentText data-tid={props.confirmDialogContentTID}>
+ {props.content}
+ {props.list && props.list.map((listItem) => (
+ <ListItem title={listItem}>
+ <Typography variant="inherit" noWrap>{listItem}</Typography>
+ </ListItem>
+ ))}
+ </DialogContentText>
+ </DialogContent>
+ <DialogActions>
+ <Button
+ onClick={() => onConfirm(false)}
+ color="primary"
+ data-tid={props.cancelDialogTID}
+ >
+ {i18n.t('core:no')}
+ </Button>
+ <Button
+ data-tid={props.confirmDialogTID}
+ onClick={() => onConfirm(true)}
+ color="primary"
+ >
+ {i18n.t('core:yes')}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ )
};
ConfirmDialog.defaultProps = {
diff --git a/app/components/dialogs/CreateDirectoryDialog.js b/app/components/dialogs/CreateDirectoryDialog.js
index 9353b4a22..ccb913378 100644
--- a/app/components/dialogs/CreateDirectoryDialog.js
+++ b/app/components/dialogs/CreateDirectoryDialog.js
@@ -27,7 +27,7 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import AppConfig from '../../config';
import { actions as AppActions } from '../../reducers/app';
@@ -43,6 +43,7 @@ const CreateDirectoryDialog = (props: Props) => {
const [inputError, setInputError] = useState(false);
const [disableConfirmButton, setDisableConfirmButton] = useState(true);
const [name, setName] = useState('');
+ const { open, onClose, fullScreen } = props;
useEffect(() => {
handleValidation();
@@ -80,14 +81,16 @@ const CreateDirectoryDialog = (props: Props) => {
setDisableConfirmButton(true);
}
- function renderTitle() {
- return (
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ // onKeyDown={confirmFunction} TODO
+ >
<DialogTitle>{i18n.t('core:createNewDirectoryTitle')}</DialogTitle>
- );
- }
-
- function renderContent() {
- return (
<DialogContent>
<FormControl
fullWidth={true}
@@ -111,11 +114,6 @@ const CreateDirectoryDialog = (props: Props) => {
<FormHelperText>{i18n.t('core:directoryNameHelp')}</FormHelperText>
</FormControl>
</DialogContent>
- );
- }
-
- function renderActions() {
- return (
<DialogActions>
<Button
data-tid="closeCreateNewDirectory"
@@ -134,18 +132,7 @@ const CreateDirectoryDialog = (props: Props) => {
{i18n.t('core:ok')}
</Button>
</DialogActions>
- );
- }
-
- return (
- <GenericDialog
- open={props.open}
- onClose={onCancel}
- onEnterKey={(event) => onEnterKeyHandler(event, onConfirm)}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ </Dialog>
);
};
diff --git a/app/components/dialogs/CreateFileDialog.js b/app/components/dialogs/CreateFileDialog.js
index f9047966b..169cb006c 100644
--- a/app/components/dialogs/CreateFileDialog.js
+++ b/app/components/dialogs/CreateFileDialog.js
@@ -36,7 +36,7 @@ import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import InputAdornment from '@material-ui/core/InputAdornment';
import withMobileDialog from '@material-ui/core/withMobileDialog';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { formatDateTime4Tag } from '../../utils/misc';
import AppConfig from '../../config';
@@ -82,6 +82,8 @@ type State = {
fileType: string
};
+const { open, onClose, fullScreen } = props;
+
class CreateFileDialog extends React.Component<Props, State> {
state = {
errorTextName: false,
@@ -157,133 +159,117 @@ class CreateFileDialog extends React.Component<Props, State> {
}
};
- renderTitle = () => (
- <DialogTitle>{i18n.t('core:createFileTitle')}</DialogTitle>
- );
-
- renderContent = () => (
- <DialogContent data-tid="createFileDialog">
- <FormControl
- fullWidth={true}
- error={this.state.errorTextName}
- >
- <TextField
+ return = () => {
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ // onKeyDown={confirmFunction}
+ >
+ <DialogTitle>{i18n.t('core:createFileTitle')}</DialogTitle>
+ <DialogContent data-tid="createFileDialog">
+ <FormControl
fullWidth={true}
error={this.state.errorTextName}
- autoFocus
- margin="dense"
- name="fileName"
- label={i18n.t('core:fileName')}
- inputRef={(ref) => { this.fileName = ref; }}
- onChange={this.handleInputChange}
- value={this.state.fileName}
- data-tid="createFileDialog_fileName"
- />
- {this.state.errorTextName && <FormHelperText>{i18n.t('core:fileNameHelp')}</FormHelperText>}
- </FormControl>
- <FormControl fullWidth={true}>
- <TextField
- id="textarea"
- placeholder="Enter the content of your file / note"
- multiline
- name="fileContent"
- value={this.state.fileContent}
- onChange={this.handleInputChange}
- onKeyDown={this.handleKeyPress}
- margin="normal"
- fullWidth={true}
- rows={4}
- rowsMax={10}
- />
- </FormControl>
- <ListItem>
- <Radio
- checked={this.state.fileType === 'txt'}
- onChange={this.handleTypeChange}
- value="txt"
- name="type"
- aria-label={i18n.t('core:createTextFile')}
- />
- <FormHelperText>{i18n.t('core:createTextFile')}</FormHelperText>
- <Radio
- checked={this.state.fileType === 'md'}
- onChange={this.handleTypeChange}
- value="md"
- name="type"
- aria-label={i18n.t('core:createMarkdown')}
- />
- <FormHelperText>{i18n.t('core:createMarkdown')}</FormHelperText>
- <Radio
- checked={this.state.fileType === 'html'}
- onChange={this.handleTypeChange}
- value="html"
- name="html"
- aria-label={i18n.t('core:createRichTextFile')}
- />
- <FormHelperText>{i18n.t('core:createRichTextFile')}</FormHelperText>
- </ListItem>
- <FormControl fullWidth={true}>
- <InputLabel htmlFor="name">{i18n.t('core:filePath')}</InputLabel>
- <Input
- required
- margin="dense"
- name="selectedDirectoryPath"
- label={i18n.t('core:filePath')}
- fullWidth={true}
- data-tid="createFileDialog_filePath"
- value={this.state.selectedDirectoryPath}
- onChange={this.handleInputChange}
- endAdornment={
- PlatformIO.haveObjectStoreSupport() ? undefined :
- (<InputAdornment position="end" style={{ height: 32 }}>
- <IconButton onClick={this.openFolderChooser}>
- <FolderIcon />
- </IconButton>
- </InputAdornment>)
- }
- />
- {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
- </FormControl>
- </DialogContent>
- );
-
- renderActions = () => (
- <DialogActions>
- <Button
- data-tid="closeCreateFileDialog"
- onClick={this.props.onClose}
- color="primary"
- >
- {i18n.t('core:cancel')}
- </Button>
- <Button
- disabled={this.state.disableConfirmButton}
- onClick={this.onConfirm}
- data-tid="confirmCreateFileDialog"
- color="primary"
- >
- {i18n.t('core:ok')}
- </Button>
- </DialogActions>
- );
-
- render() {
- const {
- fullScreen,
- open,
- onClose
- } = this.props;
- return (
- <GenericDialog
- fullScreen={fullScreen}
- open={open}
- onClose={onClose}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
- );
+ >
+ <TextField
+ fullWidth={true}
+ error={this.state.errorTextName}
+ autoFocus
+ margin="dense"
+ name="fileName"
+ label={i18n.t('core:fileName')}
+ inputRef={(ref) => { this.fileName = ref; }}
+ onChange={this.handleInputChange}
+ value={this.state.fileName}
+ data-tid="createFileDialog_fileName"
+ />
+ {this.state.errorTextName && <FormHelperText>{i18n.t('core:fileNameHelp')}</FormHelperText>}
+ </FormControl>
+ <FormControl fullWidth={true}>
+ <TextField
+ id="textarea"
+ placeholder="Enter the content of your file / note"
+ multiline
+ name="fileContent"
+ value={this.state.fileContent}
+ onChange={this.handleInputChange}
+ onKeyDown={this.handleKeyPress}
+ margin="normal"
+ fullWidth={true}
+ rows={4}
+ rowsMax={10}
+ />
+ </FormControl>
+ <ListItem>
+ <Radio
+ checked={this.state.fileType === 'txt'}
+ onChange={this.handleTypeChange}
+ value="txt"
+ name="type"
+ aria-label={i18n.t('core:createTextFile')}
+ />
+ <FormHelperText>{i18n.t('core:createTextFile')}</FormHelperText>
+ <Radio
+ checked={this.state.fileType === 'md'}
+ onChange={this.handleTypeChange}
+ value="md"
+ name="type"
+ aria-label={i18n.t('core:createMarkdown')}
+ />
+ <FormHelperText>{i18n.t('core:createMarkdown')}</FormHelperText>
+ <Radio
+ checked={this.state.fileType === 'html'}
+ onChange={this.handleTypeChange}
+ value="html"
+ name="html"
+ aria-label={i18n.t('core:createRichTextFile')}
+ />
+ <FormHelperText>{i18n.t('core:createRichTextFile')}</FormHelperText>
+ </ListItem>
+ <FormControl fullWidth={true}>
+ <InputLabel htmlFor="name">{i18n.t('core:filePath')}</InputLabel>
+ <Input
+ required
+ margin="dense"
+ name="selectedDirectoryPath"
+ label={i18n.t('core:filePath')}
+ fullWidth={true}
+ data-tid="createFileDialog_filePath"
+ value={this.state.selectedDirectoryPath}
+ onChange={this.handleInputChange}
+ endAdornment={
+ PlatformIO.haveObjectStoreSupport() ? undefined :
+ (<InputAdornment position="end" style={{ height: 32 }}>
+ <IconButton onClick={this.openFolderChooser}>
+ <FolderIcon />
+ </IconButton>
+ </InputAdornment>)
+ }
+ />
+ {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ </DialogContent>
+ <DialogActions>
+ <Button
+ data-tid="closeCreateFileDialog"
+ onClick={this.props.onClose}
+ color="primary"
+ >
+ {i18n.t('core:cancel')}
+ </Button>
+ <Button
+ disabled={this.state.disableConfirmButton}
+ onClick={this.onConfirm}
+ data-tid="confirmCreateFileDialog"
+ color="primary"
+ >
+ {i18n.t('core:ok')}
+ </Button>
+ </DialogActions>
+ </Dialog>
}
}
diff --git a/app/components/dialogs/CreateLocationDialog.js b/app/components/dialogs/CreateLocationDialog.js
index 86f6f8577..70bceccde 100644
--- a/app/components/dialogs/CreateLocationDialog.js
+++ b/app/components/dialogs/CreateLocationDialog.js
@@ -33,7 +33,7 @@ import Grid from '@material-ui/core/Grid';
import Radio from '@material-ui/core/Radio';
import RadioGroup from '@material-ui/core/RadioGroup';
import { Typography } from '@material-ui/core';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { type Location, locationType } from '../../reducers/locations';
import { Pro } from '../../pro';
@@ -276,19 +276,31 @@ class CreateLocationDialog extends React.Component<Props, State> {
this.props.resetState('createLocationDialogKey');
}
- renderTitle = () => (
- <DialogTitle>{i18n.t('core:createLocationTitle')}</DialogTitle>
- );
+ render() {
+ const {
+ fullScreen,
+ open,
+ onClose
+ } = this.props;
- renderContent = () => {
// const { classes } = this.props;
let content;
if (this.state.type === locationType.TYPE_CLOUD) {
- content = (<ObjectStoreForm handleInputChange={this.handleInputChange} handleChange={this.handleChange} state={this.state} />);
+ content = (<ObjectStoreForm handleInputChange={this.handleInputChange} handleChange={this.handleChange} state={this.state} />)
} else {
- content = (<LocalForm showSelectDirectoryDialog={this.props.showSelectDirectoryDialog} handleInputChange={this.handleInputChange} handleChange={this.handleChange} state={this.state} />);
+ content = (<LocalForm showSelectDirectoryDialog={this.props.showSelectDirectoryDialog} handleInputChange={this.handleInputChange} handleChange={this.handleChange} state={this.state} />)
}
+
return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ // onKeyDown={confirmFunction}
+ >
+ <DialogTitle>{i18n.t('core:createLocationTitle')}</DialogTitle>
<DialogContent>
<Grid container spacing={2}>
<Grid item xs={2} style={{ marginTop: 13, textAlign: 'left' }}>
@@ -374,44 +386,23 @@ class CreateLocationDialog extends React.Component<Props, State> {
/>
</FormGroup>
</DialogContent>
- );
- };
-
- renderActions = () => (
- <DialogActions>
- <Button
- onClick={this.onCancel}
- color="primary"
- >
- {i18n.t('core:cancel')}
- </Button>
- <Button
- disabled={this.state.disableConfirmButton}
- onClick={this.onConfirm}
- data-tid="confirmLocationCreation"
- color="primary"
- >
- {i18n.t('core:ok')}
- </Button>
- </DialogActions>
- );
-
- render() {
- const {
- fullScreen,
- open,
- onClose
- } = this.props;
- return (
- <GenericDialog
- open={open}
- onClose={onClose}
- fullScreen={fullScreen}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ <DialogActions>
+ <Button
+ onClick={this.onCancel}
+ color="primary"
+ >
+ {i18n.t('core:cancel')}
+ </Button>
+ <Button
+ disabled={this.state.disableConfirmButton}
+ onClick={this.onConfirm}
+ data-tid="confirmLocationCreation"
+ color="primary"
+ >
+ {i18n.t('core:ok')}
+ </Button>
+ </DialogActions>
+ </Dialog>
);
}
}
diff --git a/app/components/dialogs/CreateTagGroupDialog.js b/app/components/dialogs/CreateTagGroupDialog.js
index 02bd44428..af5a12ea6 100644
--- a/app/components/dialogs/CreateTagGroupDialog.js
+++ b/app/components/dialogs/CreateTagGroupDialog.js
@@ -25,7 +25,7 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import ColorPickerDialog from './ColorPickerDialog';
import { type TagGroup } from '../../reducers/taglibrary';
import i18n from '../../services/i18n';
@@ -119,11 +119,13 @@ class CreateTagGroupDialog extends React.Component<Props, State> {
this.setState({ textcolor: color });
};
- renderTitle = () => (
- <DialogTitle>{i18n.t('core:createTagGroupTitle')}</DialogTitle>
- );
+ render() {
+ const {
+ fullScreen,
+ open,
+ onClose
+ } = this.props;
- renderContent = () => {
const styles = {
color: {
width: '100%',
@@ -154,101 +156,95 @@ class CreateTagGroupDialog extends React.Component<Props, State> {
marginBottom: '5px',
fontSize: '1rem'
},
- };
+ }
return (
- <DialogContent>
- <FormControl
- fullWidth={true}
- error={this.state.inputError}
- >
- <TextField
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ // onKeyDown={confirmFunction}
+ >
+ <DialogTitle>{i18n.t('core:createTagGroupTitle')}</DialogTitle>
+ <DialogContent>
+ <FormControl
fullWidth={true}
error={this.state.inputError}
- autoFocus
- name="title"
- label={i18n.t('core:createTagGroupName')}
- value={this.state.title}
- onChange={this.handleInputChange}
- data-tid="createTagGroupInput"
- />
- {this.state.inputError && <FormHelperText>{i18n.t('core:taggroupTitleHelper')}</FormHelperText>}
- </FormControl>
- <FormControl
- fullWidth={true}
- >
- <FormHelperText style={styles.helpText}>{i18n.t('core:tagBackgroundColor')}</FormHelperText>
- <TransparentBackground>
- <Button
- onClick={this.toggleDefaultTagBackgroundColorPicker}
- data-tid="createTagGroupBackgroundColor"
- style={styles.color}
- role="presentation"
- >&nbsp;
- </Button>
- </TransparentBackground>
- <ColorPickerDialog
- open={this.state.displayColorPicker}
- setColor={this.handleChangeColor}
- onClose={this.toggleDefaultTagBackgroundColorPicker}
- color={this.state.color}
- />
- </FormControl>
- <FormControl
- fullWidth={true}
- >
- <FormHelperText style={styles.helpText}>{i18n.t('core:tagForegroundColor')}</FormHelperText>
- <TransparentBackground>
- <Button
- onClick={this.toggleDefaultTagTextColorPicker}
- data-tid="createTagGroupForegroundColor"
- style={styles.textcolor}
- role="presentation"
- >&nbsp;
- </Button>
- </TransparentBackground>
- <ColorPickerDialog
- open={this.state.displayTextColorPicker}
- setColor={this.handleChangeTextColor}
- onClose={this.toggleDefaultTagTextColorPicker}
- color={this.state.textcolor}
- />
- </FormControl>
- </DialogContent>
- );
- };
-
- renderActions = () => (
- <DialogActions>
- <Button
- onClick={this.props.onClose}
- color="primary"
- >
- {i18n.t('core:cancel')}
- </Button>
- <Button
- disabled={this.state.disableConfirmButton}
- onClick={this.onConfirm}
- data-tid="createTagGroupConfirmButton"
- color="primary"
- >
- {i18n.t('core:ok')}
- </Button>
- </DialogActions>
- );
-
- render() {
- return (
- <GenericDialog
- open={this.props.open}
- onClose={this.props.onClose}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ >
+ <TextField
+ fullWidth={true}
+ error={this.state.inputError}
+ autoFocus
+ name="title"
+ label={i18n.t('core:createTagGroupName')}
+ value={this.state.title}
+ onChange={this.handleInputChange}
+ data-tid="createTagGroupInput"
+ />
+ {this.state.inputError && <FormHelperText>{i18n.t('core:taggroupTitleHelper')}</FormHelperText>}
+ </FormControl>
+ <FormControl
+ fullWidth={true}
+ >
+ <FormHelperText style={styles.helpText}>{i18n.t('core:tagBackgroundColor')}</FormHelperText>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagBackgroundColorPicker}
+ data-tid="createTagGroupBackgroundColor"
+ style={styles.color}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
+ <ColorPickerDialog
+ open={this.state.displayColorPicker}
+ setColor={this.handleChangeColor}
+ onClose={this.toggleDefaultTagBackgroundColorPicker}
+ color={this.state.color}
+ />
+ </FormControl>
+ <FormControl
+ fullWidth={true}
+ >
+ <FormHelperText style={styles.helpText}>{i18n.t('core:tagForegroundColor')}</FormHelperText>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagTextColorPicker}
+ data-tid="createTagGroupForegroundColor"
+ style={styles.textcolor}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
+ <ColorPickerDialog
+ open={this.state.displayTextColorPicker}
+ setColor={this.handleChangeTextColor}
+ onClose={this.toggleDefaultTagTextColorPicker}
+ color={this.state.textcolor}
+ />
+ </FormControl>
+ </DialogContent>
+ <DialogActions>
+ <Button
+ onClick={this.props.onClose}
+ color="primary"
+ >
+ {i18n.t('core:cancel')}
+ </Button>
+ <Button
+ disabled={this.state.disableConfirmButton}
+ onClick={this.onConfirm}
+ data-tid="createTagGroupConfirmButton"
+ color="primary"
+ >
+ {i18n.t('core:ok')}
+ </Button>
+ </DialogActions>
+ </Dialog>
);
- }
+ }
}
export default CreateTagGroupDialog;
diff --git a/app/components/dialogs/CreateTagsDialog.js b/app/components/dialogs/CreateTagsDialog.js
index 13d5a53dc..da3b31cc5 100644
--- a/app/components/dialogs/CreateTagsDialog.js
+++ b/app/components/dialogs/CreateTagsDialog.js
@@ -25,7 +25,7 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { type TagGroup } from '../../reducers/taglibrary';
@@ -33,6 +33,7 @@ type Props = {
open: boolean,
onClose: () => void,
addTag: (tags: string, uuid: string) => void,
+ fullScreen: boolean,
selectedTagGroupEntry: TagGroup
};
@@ -62,7 +63,7 @@ class CreateTagsDialog extends React.Component<Props, State> {
};
handleValidation() {
- const tagCheck = RegExp(/^[^\#\/\\ \[\]]{1,}$/);
+ const tagCheck = RegExp(/^[^\#\/\\[\]]{1,}$/);
if (this.state.tagTitle && tagCheck.test(this.state.tagTitle)) {
this.setState({ inputError: false, disableConfirmButton: false });
} else {
@@ -78,62 +79,57 @@ class CreateTagsDialog extends React.Component<Props, State> {
}
};
- renderTitle = () => (
- <DialogTitle>{i18n.t('core:addTagsToGroupTitle')}</DialogTitle>
- );
-
- renderContent = () => (
- <DialogContent style={{ minWidth: 400 }}>
- <FormControl
- fullWidth={true}
- error={this.state.inputError}
- >
- <TextField
- error={this.state.inputError}
- name="tagTitle"
- autoFocus
- label={i18n.t('core:addTagsToGroupTagsPlaceholder')}
- onChange={this.handleInputChange}
- value={this.state.tagTitle}
- data-tid="addTagsInput"
- fullWidth={true}
- />
- {this.state.inputError && <FormHelperText>{i18n.t('core:tagTitleHelper')}</FormHelperText>}
- </FormControl>
-
- </DialogContent>
- );
-
- renderActions = () => (
- <DialogActions>
- <Button
- onClick={this.props.onClose}
- color="primary"
- >
- {i18n.t('core:cancel')}
- </Button>
- <Button
- disabled={this.state.disableConfirmButton}
- onClick={this.onConfirm}
- data-tid="createTagsConfirmButton"
- color="primary"
- >
- {i18n.t('core:ok')}
- </Button>
- </DialogActions>
- );
-
render() {
+ const {
+ fullScreen,
+ open,
+ onClose
+ } = this.props;
+
return (
- <GenericDialog
- open={this.props.open}
- onClose={this.props.onClose}
- autoFocus
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ >
+ <DialogTitle>{i18n.t('core:addTagsToGroupTitle')}</DialogTitle>
+ <DialogContent style={{ minWidth: 400 }}>
+ <FormControl
+ fullWidth={true}
+ error={this.state.inputError}
+ >
+ <TextField
+ error={this.state.inputError}
+ name="tagTitle"
+ autoFocus
+ label={i18n.t('core:addTagsToGroupTagsPlaceholder')}
+ onChange={this.handleInputChange}
+ value={this.state.tagTitle}
+ data-tid="addTagsInput"
+ fullWidth={true}
+ />
+ {this.state.inputError && <FormHelperText>{i18n.t('core:tagTitleHelper')}</FormHelperText>}
+ </FormControl>
+ </DialogContent>
+ <DialogActions>
+ <Button
+ onClick={this.props.onClose}
+ color="primary"
+ >
+ {i18n.t('core:cancel')}
+ </Button>
+ <Button
+ disabled={this.state.disableConfirmButton}
+ onClick={this.onConfirm}
+ data-tid="createTagsConfirmButton"
+ color="primary"
+ >
+ {i18n.t('core:ok')}
+ </Button>
+ </DialogActions>
+ </Dialog>
);
}
}
diff --git a/app/components/dialogs/EditEntryTagDialog.js b/app/components/dialogs/EditEntryTagDialog.js
index ed177b9f3..9dc519a64 100644
--- a/app/components/dialogs/EditEntryTagDialog.js
+++ b/app/components/dialogs/EditEntryTagDialog.js
@@ -29,7 +29,7 @@ import DialogTitle from '@material-ui/core/DialogTitle';
import { withStyles } from '@material-ui/core/styles';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { isPlusCode } from '../../utils/misc';
import { type Tag } from '../../reducers/taglibrary';
@@ -64,6 +64,7 @@ const EditEntryTagDialog = (props: Props) => {
const [disableConfirmButton, setDisableConfirmButton] = useState(true);
const [errorTag, setErrorTag] = useState(false);
const [title, setTitle] = useState(props.selectedTag && props.selectedTag.title);
+ const { onClose, open, fullScreen } = props;
useEffect(() => {
handleValidation();
@@ -164,15 +165,16 @@ const EditEntryTagDialog = (props: Props) => {
}
return (
- <GenericDialog
- open={props.open}
- fullScreen={props.fullScreen}
- onClose={props.onClose}
- onEnterKey={(event) => onEnterKeyHandler(event, onConfirm)}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ <Dialog
+ open={open}
+ fullScreen={fullScreen}
+ onClose={onClose}
+ // onEnterKey={(event) => onEnterKeyHandler(event, onConfirm)}
+ >
+ {renderTitle()}
+ {renderContent()}
+ {renderActions()}
+ </Dialog>
);
};
diff --git a/app/components/dialogs/EditLocationDialog.js b/app/components/dialogs/EditLocationDialog.js
index 5feddc2e3..24b1281ca 100644
--- a/app/components/dialogs/EditLocationDialog.js
+++ b/app/components/dialogs/EditLocationDialog.js
@@ -31,7 +31,7 @@ import Grid from '@material-ui/core/Grid';
import Radio from '@material-ui/core/Radio';
import RadioGroup from '@material-ui/core/RadioGroup';
import { Typography } from '@material-ui/core';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { extractDirectoryName } from '../../utils/paths';
import { type Location, locationType } from '../../reducers/locations';
@@ -47,7 +47,8 @@ type Props = {
location: Location | null,
editLocation: (location: Location) => void,
showSelectDirectoryDialog: () => void,
- selectedDirectoryPath: string | null
+ selectedDirectoryPath: string | null,
+ onCancel: () => void
};
type State = {
@@ -399,19 +400,22 @@ class EditLocationDialog extends React.Component<Props, State> {
render() {
const {
- fullScreen,
open,
+ // onClose,
+ fullScreen,
+ onCancel
} = this.props;
return (
- <GenericDialog
+ <Dialog
open={open}
- onClose={this.onCancel}
+ onClose={onCancel}
fullScreen={fullScreen}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
+ >
+ {this.renderTitle()}
+ {this.renderContent()}
+ {this.renderActions()}
+ </Dialog>
);
}
}
diff --git a/app/components/dialogs/EditTagDialog.js b/app/components/dialogs/EditTagDialog.js
index fbe176920..2619c94da 100644
--- a/app/components/dialogs/EditTagDialog.js
+++ b/app/components/dialogs/EditTagDialog.js
@@ -26,7 +26,7 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import ColorPickerDialog from './ColorPickerDialog';
import TransparentBackground from '../TransparentBackground';
import i18n from '../../services/i18n';
@@ -131,13 +131,13 @@ class EditTagDialog extends React.Component<Props, State> {
this.setState({ textcolor: color });
};
- renderTitle = () => (
- <DialogTitle style={{ overflow: 'visible' }}>{i18n.t('core:editTagTitle')}{` '${this.state.title}'`}</DialogTitle>
- );
-
- renderContent = () => {
+ render() {
const { color, textcolor, modifiedDate } = this.state;
-
+ const {
+ fullScreen,
+ open,
+ onClose
+ } = this.props;
const styles = {
color: {
width: '100%',
@@ -166,107 +166,101 @@ class EditTagDialog extends React.Component<Props, State> {
};
return (
- <DialogContent style={{ overflow: 'visible' }}>
- <FormControl
- fullWidth={true}
- error={this.state.inputError}
- style={{ overflow: 'visible' }}
- >
- {modifiedDate && (
- <div className="tag-date" style={{ fontSize: 12, position: 'relative', bottom: 20, color: '#808080' }}>
- <span className="text" style={{ fontWeight: 600 }}>{`${i18n.t('core:modifiedDate')}: `}</span>
- <time>{format(new Date(modifiedDate), 'yyyy-mm-dd')}</time>
- </div>
- )}
- <TextField
+ <Dialog
+ open={open}
+ fullScreen={fullScreen}
+ onClose={onClose}
+ keepMounted
+ scroll="paper"
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.addTags)}
+ >
+ <DialogTitle style={{ overflow: 'visible' }}>{i18n.t('core:editTagTitle')}{` '${this.state.title}'`}</DialogTitle>
+ <DialogContent style={{ overflow: 'visible' }}>
+ <FormControl
+ fullWidth={true}
error={this.state.inputError}
- margin="dense"
- name="title"
- autoFocus
- label={i18n.t('core:editTag')}
- onChange={this.handleInputChange}
- value={this.state.title}
- data-tid="editTagInput"
+ style={{ overflow: 'visible' }}
+ >
+ {modifiedDate && (
+ <div className="tag-date" style={{ fontSize: 12, position: 'relative', bottom: 20, color: '#808080' }}>
+ <span className="text" style={{ fontWeight: 600 }}>{`${i18n.t('core:modifiedDate')}: `}</span>
+ <time>{format(new Date(modifiedDate), 'yyyy-mm-dd')}</time>
+ </div>
+ )}
+ <TextField
+ error={this.state.inputError}
+ margin="dense"
+ name="title"
+ autoFocus
+ label={i18n.t('core:editTag')}
+ onChange={this.handleInputChange}
+ value={this.state.title}
+ data-tid="editTagInput"
+ fullWidth={true}
+ />
+ {this.state.inputError && <FormHelperText style={styles.helpText}>{i18n.t('core:tagTitleHelper')}</FormHelperText>}
+ </FormControl>
+ <FormControl
fullWidth={true}
- />
- {this.state.inputError && <FormHelperText style={styles.helpText}>{i18n.t('core:tagTitleHelper')}</FormHelperText>}
- </FormControl>
- <FormControl
- fullWidth={true}
- >
- <FormHelperText style={styles.helpText}>{i18n.t('core:tagBackgroundColor')}</FormHelperText>
- <TransparentBackground>
- <Button
- onClick={this.toggleDefaultTagBackgroundColorPicker}
- data-tid="tagBackgroundColorEditTagDialog"
- style={styles.color}
- role="presentation"
- >&nbsp;
- </Button>
- </TransparentBackground>
- <ColorPickerDialog
- open={this.state.displayColorPicker}
- setColor={this.handleChangeColor}
- onClose={this.toggleDefaultTagBackgroundColorPicker}
- color={this.state.color}
- />
- </FormControl>
- <FormControl
- fullWidth={true}
- >
- <FormHelperText style={styles.helpText}>{i18n.t('core:tagForegroundColor')}</FormHelperText>
- <TransparentBackground>
- <Button
- onClick={this.toggleDefaultTagTextColorPicker}
- data-tid="tagForegroundColorEditTagDialog"
- style={styles.textcolor}
- role="presentation"
- >&nbsp;
- </Button>
- </TransparentBackground>
- <ColorPickerDialog
- open={this.state.displayTextColorPicker}
- setColor={this.handleChangeTextColor}
- onClose={this.toggleDefaultTagTextColorPicker}
- color={this.state.textcolor}
- />
- </FormControl>
- </DialogContent>
- );
- };
-
- renderActions = () => (
- <DialogActions>
- <Button
- onClick={this.props.onClose}
- data-tid="closeEditTagDialog"
- color="primary"
- >
- {i18n.t('core:cancel')}
- </Button>
- <Button
- disabled={this.state.disableConfirmButton}
- onClick={this.onConfirm}
- data-tid="editTagConfirm"
- color="primary"
- >
- {i18n.t('core:ok')}
- </Button>
- </DialogActions>
- );
-
- render() {
- return (
- <GenericDialog
- open={this.props.open}
- onClose={this.props.onClose}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ >
+ <FormHelperText style={styles.helpText}>{i18n.t('core:tagBackgroundColor')}</FormHelperText>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagBackgroundColorPicker}
+ data-tid="tagBackgroundColorEditTagDialog"
+ style={styles.color}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
+ <ColorPickerDialog
+ open={this.state.displayColorPicker}
+ setColor={this.handleChangeColor}
+ onClose={this.toggleDefaultTagBackgroundColorPicker}
+ color={this.state.color}
+ />
+ </FormControl>
+ <FormControl
+ fullWidth={true}
+ >
+ <FormHelperText style={styles.helpText}>{i18n.t('core:tagForegroundColor')}</FormHelperText>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagTextColorPicker}
+ data-tid="tagForegroundColorEditTagDialog"
+ style={styles.textcolor}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
+ <ColorPickerDialog
+ open={this.state.displayTextColorPicker}
+ setColor={this.handleChangeTextColor}
+ onClose={this.toggleDefaultTagTextColorPicker}
+ color={this.state.textcolor}
+ />
+ </FormControl>
+ </DialogContent>
+ <DialogActions>
+ <Button
+ onClick={this.props.onClose}
+ data-tid="closeEditTagDialog"
+ color="primary"
+ >
+ {i18n.t('core:cancel')}
+ </Button>
+ <Button
+ disabled={this.state.disableConfirmButton}
+ onClick={this.onConfirm}
+ data-tid="editTagConfirm"
+ color="primary"
+ >
+ {i18n.t('core:ok')}
+ </Button>
+ </DialogActions>
+ </Dialog>
);
- }
+ }
}
export default EditTagDialog;
diff --git a/app/components/dialogs/EditTagGroupDialog.js b/app/components/dialogs/EditTagGroupDialog.js
index e3aac172e..1bee0d4e5 100644
--- a/app/components/dialogs/EditTagGroupDialog.js
+++ b/app/components/dialogs/EditTagGroupDialog.js
@@ -27,7 +27,7 @@ import DialogTitle from '@material-ui/core/DialogTitle';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Switch from '@material-ui/core/Switch';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import ColorPickerDialog from './ColorPickerDialog';
import { type TagGroup } from '../../reducers/taglibrary';
import i18n from '../../services/i18n';
@@ -271,15 +271,18 @@ class EditTagGroupDialog extends React.Component<Props, State> {
);
render() {
+ const { onClose, open, fullScreen } = this.props;
return (
- <GenericDialog
- open={this.props.open}
- onClose={this.props.onClose}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ <Dialog
+ open={open}
+ fullScreen={fullScreen}
+ onClose={onClose}
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
+ >
+ {this.renderTitle()}
+ {this.renderContent()}
+ {this.renderActions()}
+ </Dialog>
);
}
}
diff --git a/app/components/dialogs/ImportExportTagGroupsDialog.js b/app/components/dialogs/ImportExportTagGroupsDialog.js
index 0f522d9db..2d70202a9 100644
--- a/app/components/dialogs/ImportExportTagGroupsDialog.js
+++ b/app/components/dialogs/ImportExportTagGroupsDialog.js
@@ -28,7 +28,7 @@ import FormControl from '@material-ui/core/FormControl';
import FormGroup from '@material-ui/core/FormGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import TagGroupContainer from '../TagGroupContainer';
import TagContainer from '../TagContainer';
import i18n from '../../services/i18n';
@@ -249,16 +249,18 @@ class ImportExportTagGroupsDialog extends React.Component<Props, State> {
);
render() {
+ const { onClose, open, fullScreen } = this.props;
return (
- <GenericDialog
- open={this.props.open}
- fullScreen={this.props.fullScreen}
- onClose={this.props.onClose}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ <Dialog
+ open={open}
+ fullScreen={fullScreen}
+ onClose={onClose}
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
+ >
+ {this.renderTitle()}
+ {this.renderContent()}
+ {this.renderActions()}
+ </Dialog>
);
}
}
diff --git a/app/components/dialogs/KeyboardDialog.js b/app/components/dialogs/KeyboardDialog.js
index fd084d44d..0b7bd6c1c 100644
--- a/app/components/dialogs/KeyboardDialog.js
+++ b/app/components/dialogs/KeyboardDialog.js
@@ -29,7 +29,7 @@ import ListItem from '@material-ui/core/ListItem';
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
import ListItemText from '@material-ui/core/ListItemText';
import { withStyles } from '@material-ui/core/styles';
-import GenericDialog from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { getKeyBindingObject } from '../../reducers/settings';
@@ -55,12 +55,16 @@ type Props = {
};
const KeyboardDialog = (props: Props) => {
- function renderTitle() {
- return (<DialogTitle>{i18n.t('core:shortcutKeys')}</DialogTitle>);
- }
-
- function renderContent() {
- return (
+ const { open, onClose, fullScreen } = props;
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ >
+ <DialogTitle>{i18n.t('core:shortcutKeys')}</DialogTitle>
<DialogContent className={props.classes.root} data-tid="keyboardShortCutsDialog">
<List dense={false}>
{props.keyBindings && Object.keys(props.keyBindings).map((shortcutKey) => (
@@ -73,11 +77,6 @@ const KeyboardDialog = (props: Props) => {
))}
</List>
</DialogContent>
- );
- }
-
- function renderActions() {
- return (
<DialogActions>
<Button
data-tid="closeKeyboardDialog"
@@ -87,18 +86,7 @@ const KeyboardDialog = (props: Props) => {
{i18n.t('core:ok')}
</Button>
</DialogActions>
- );
- }
-
- return (
- <GenericDialog
- open={props.open}
- onClose={props.onClose}
- fullScreen={props.fullScreen}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ </Dialog>
);
};
diff --git a/app/components/dialogs/LicenseDialog.js b/app/components/dialogs/LicenseDialog.js
index 06474f5ee..1b7064cac 100644
--- a/app/components/dialogs/LicenseDialog.js
+++ b/app/components/dialogs/LicenseDialog.js
@@ -23,7 +23,7 @@ import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import withMobileDialog from '@material-ui/core/withMobileDialog';
-import GenericDialog from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { Pro } from '../../pro';
import AppConfig from '../../config';
@@ -50,18 +50,22 @@ type Props = {
// }
const LicenseDialog = (props: Props) => {
+ const { fullScreen, open, onClose } = props;
// let licenseElement;
// function printLicense() {
// // printElem(licenseElement);
// window.print();
// }
- function renderTitle() {
- return <DialogTitle>{i18n.t('core:license')}</DialogTitle>;
- }
-
- function renderContent() {
- return (
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ keepMounted
+ fullScreen={fullScreen}
+ scroll="paper"
+ >
+ <DialogTitle>{i18n.t('core:license')}</DialogTitle>
<DialogContent
// inputRef={ref => {
// licenseElement = ref;
@@ -72,11 +76,6 @@ const LicenseDialog = (props: Props) => {
{Pro ? Pro.EULAContent : LicenseContent}
</pre>
</DialogContent>
- );
- }
-
- function renderActions() {
- return (
<DialogActions>
{/* <Button
onClick={printLicense}
@@ -99,20 +98,7 @@ const LicenseDialog = (props: Props) => {
{i18n.t('core:agreeLicense')}
</Button>
</DialogActions>
- );
- }
-
- const { fullScreen, open, onClose } = props;
- return (
- <GenericDialog
- open={open}
- onClose={onClose}
- onBackdropClick={() => {}}
- fullScreen={fullScreen}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ </Dialog>
);
};
diff --git a/app/components/dialogs/MoveCopyFilesDialog.js b/app/components/dialogs/MoveCopyFilesDialog.js
index a760ad64f..a4b2e8058 100644
--- a/app/components/dialogs/MoveCopyFilesDialog.js
+++ b/app/components/dialogs/MoveCopyFilesDialog.js
@@ -37,7 +37,7 @@ import DialogTitle from '@material-ui/core/DialogTitle';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Typography from '@material-ui/core/Typography';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
// import { extractContainingDirectoryPath } from '../../utils/paths';
import PlatformIO from '../../services/platform-io';
@@ -59,6 +59,7 @@ const MoveCopyFilesDialog = (props: Props) => {
const [inputError, setInputError] = useState(false);
const [disableConfirmButton, setDisableConfirmButton] = useState(true);
const [targetPath, setTargetPath] = useState('');
+ const { open, onClose, fullScreen } = props;
useEffect(() => {
handleValidation();
@@ -108,14 +109,16 @@ const MoveCopyFilesDialog = (props: Props) => {
}
}
- function renderTitle() {
- return (
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ keepMounted
+ scroll="paper"
+ fullScreen={fullScreen}
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.addTags)}
+ >
<DialogTitle>{i18n.t('core:copyMoveFilesTitle')}</DialogTitle>
- );
- }
-
- function renderContent() {
- return (
<DialogContent>
<List dense style={{ width: 550 }}>
{props.selectedFiles && props.selectedFiles.length > 0 && props.selectedFiles.map(path => (
@@ -156,11 +159,6 @@ const MoveCopyFilesDialog = (props: Props) => {
{inputError && <FormHelperText>Empty Input Field</FormHelperText>}
</FormControl>
</DialogContent>
- );
- }
-
- function renderActions() {
- return (
<DialogActions>
<Button
data-tid="closeMoveCopyDialog"
@@ -185,21 +183,9 @@ const MoveCopyFilesDialog = (props: Props) => {
{i18n.t('core:copyFilesButton')}
</Button>
</DialogActions>
- );
- }
-
- return (
- <GenericDialog
- open={props.open}
- onClose={props.onClose}
- fullScreen={props.fullScreen}
- // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ </Dialog>
);
-};
+}
function mapActionCreatorsToProps(dispatch) {
return bindActionCreators({
diff --git a/app/components/dialogs/OnboardingDialog.js b/app/components/dialogs/OnboardingDialog.js
index b49b8c70f..412a0a1b5 100644
--- a/app/components/dialogs/OnboardingDialog.js
+++ b/app/components/dialogs/OnboardingDialog.js
@@ -17,7 +17,7 @@
* @flow
*/
-import React from 'react';
+import React, { useState } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import SwipeableViews from 'react-swipeable-views';
@@ -34,7 +34,7 @@ import withMobileDialog from '@material-ui/core/withMobileDialog';
import ToggleButton from '@material-ui/lab/ToggleButton';
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
import MobileStepper from '@material-ui/core/MobileStepper';
-import GenericDialog from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import NavigationV3 from '../../assets/images/navigation-v3.png';
import BrowserExtension from '../../assets/images/collecting-undraw.svg';
import WizardFinished from '../../assets/images/balloons-undraw.svg';
@@ -51,6 +51,7 @@ import { actions as AppActions } from '../../reducers/app';
import AppConfig from '../../config';
type Props = {
+ classes: Object,
open: boolean,
isPersistTagsInSidecar: boolean,
fullScreen: boolean,
@@ -62,52 +63,48 @@ type Props = {
onClose: () => void
};
-type State = {
- activeStep: number
-};
-
-class OnboardingDialog extends React.Component<Props, State> {
- state = {
- activeStep: 0,
- isPersistTagsInSidecar: false
- };
-
- maxSteps = 5;
+const OnboardingDialog = (props: Props) => {
+ const [activeStep, setActiveStep] = useState(0);
+ const [isPersistTagsInSidecar, setIsPersistTagInSidecar] = useState(false);
+ const {
+ fullScreen,
+ open,
+ onClose
+ } = props;
- handleNext = () => {
- this.setState(prevState => ({
- activeStep: prevState.activeStep + 1
- }));
- };
-
- handleBack = () => {
- this.setState(prevState => ({
- activeStep: prevState.activeStep - 1
- }));
- };
+ let maxSteps = 5;
- handleStepChange = activeStep => {
- this.setState({ activeStep });
- };
+ function handleNext() {
+ setActiveStep(activeStep => activeStep + 1)
+ }
- toggleTaggingType = () => {
- this.props.setPersistTagsInSidecarFile(!this.props.isPersistTagsInSidecar);
- };
+ function handleBack() {
+ setActiveStep(activeStep => activeStep - 1)
+ }
- renderTitle = () => (
- <DialogTitle style={{ justifyContent: 'center', textAlign: 'center' }}>
- Welcome to TagSpaces
- </DialogTitle>
- );
+ function handleStepChange(activeStep) {
+ setActiveStep({ activeStep });
+ }
- renderContent = () => {
- const { activeStep } = this.state;
+ function toggleTaggingType() {
+ props.setPersistTagsInSidecarFile(!props.isPersistTagsInSidecar);
+ }
- return (
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ keepMounted
+ fullScreen={fullScreen}
+ scroll="paper"
+ >
+ <DialogTitle style={{ justifyContent: 'center', textAlign: 'center' }}>
+ Welcome to TagSpaces
+ </DialogTitle>
<DialogContent style={{ marginTop: 20 }}>
<SwipeableViews
index={activeStep}
- onChangeIndex={this.handleStepChange}
+ onChangeIndex={handleStepChange}
enableMouseEvents
>
<div
@@ -125,9 +122,9 @@ class OnboardingDialog extends React.Component<Props, State> {
<Typography variant="h6">Try our interface themes</Typography>
<Typography variant="h6">&nbsp;</Typography>
<ToggleButtonGroup
- value={this.props.currentTheme}
+ value={props.currentTheme}
exclusive
- onChange={(event, theme) => { this.props.setCurrentTheme(theme); }}
+ onChange={(event, theme) => { props.setCurrentTheme(theme); }}
style={{ boxShadow: 'none' }}
>
<ToggleButton value="light">
@@ -164,12 +161,12 @@ class OnboardingDialog extends React.Component<Props, State> {
aria-label="Gender"
name="isPersistTagsInSidecar"
// value={this.props.isPersistTagsInSidecar}
- onChange={this.toggleTaggingType}
+ onChange={toggleTaggingType}
>
<FormControlLabel
value="false"
control={
- <Radio checked={!this.props.isPersistTagsInSidecar} />
+ <Radio checked={!props.isPersistTagsInSidecar} />
}
label={
<Typography variant="subtitle1" style={{ textAlign: 'left' }}>
@@ -185,7 +182,7 @@ class OnboardingDialog extends React.Component<Props, State> {
style={{ marginTop: 20 }}
value="true"
control={
- <Radio checked={this.props.isPersistTagsInSidecar} />
+ <Radio checked={props.isPersistTagsInSidecar} />
}
label={
<Typography variant="subtitle1" style={{ textAlign: 'left' }}>
@@ -222,7 +219,7 @@ class OnboardingDialog extends React.Component<Props, State> {
<Button
style={{ marginTop: 20 }}
onClick={() => {
- this.props.openURLExternally(AppConfig.links.webClipper);
+ props.openURLExternally(AppConfig.links.webClipper);
}}
variant="contained"
color="primary"
@@ -247,58 +244,43 @@ class OnboardingDialog extends React.Component<Props, State> {
</div>
</SwipeableViews>
</DialogContent>
- );
- };
-
- renderActions = () => (
- <DialogActions style={{ justifyContent: 'center' }}>
- <MobileStepper
- style={{ marginTop: 10, backgroundColor: 'transparent' }}
- steps={this.maxSteps}
- position="static"
- activeStep={this.state.activeStep}
- nextButton={
- (this.state.activeStep === this.maxSteps - 1) ? (
- <Button
- size="small"
- onClick={this.props.onClose}
- variant="contained"
- color="primary"
- data-tid="startTagSpacesAfterOnboarding"
- >Start using TagSpaces
- </Button>
- ) : (
+ <DialogActions style={{ justifyContent: 'center' }}>
+ <MobileStepper
+ style={{ marginTop: 10, backgroundColor: 'transparent' }}
+ steps={maxSteps}
+ position="static"
+ activeStep={activeStep}
+ nextButton={
+ (activeStep === maxSteps - 1) ? (
+ <Button
+ size="small"
+ onClick={props.onClose}
+ variant="contained"
+ color="primary"
+ style={{ marginLeft: 5 }}
+ data-tid="startTagSpacesAfterOnboarding"
+ >Start using TagSpaces
+ </Button>
+ ) : (
+ <Button
+ size="small"
+ onClick={handleNext}
+ data-tid="nextStepOnboarding"
+ >{i18n.t('core:next')}</Button>
+ )
+ }
+ backButton={
<Button
size="small"
- onClick={this.handleNext}
- data-tid="nextStepOnboarding"
- >{i18n.t('core:next')}</Button>
- )
- }
- backButton={
- <Button
- size="small"
- onClick={this.handleBack}
- disabled={this.state.activeStep === 0}
- >{i18n.t('core:prev')}</Button>
- }
- />
- </DialogActions>
+ onClick={handleBack}
+ disabled={activeStep === 0}
+ >{i18n.t('core:prev')}</Button>
+ }
+ />
+ </DialogActions>
+ </Dialog>
);
-
- render() {
- const { fullScreen, open, onClose } = this.props;
- return (
- <GenericDialog
- fullScreen={fullScreen}
- open={open}
- onClose={onClose}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
- );
- }
-}
+};
function mapStateToProps(state) {
return {
diff --git a/app/components/dialogs/ProTeaserDialog.js b/app/components/dialogs/ProTeaserDialog.js
index 1e88b3d7f..b0dbb0bab 100644
--- a/app/components/dialogs/ProTeaserDialog.js
+++ b/app/components/dialogs/ProTeaserDialog.js
@@ -26,7 +26,7 @@ import DialogContent from '@material-ui/core/DialogContent';
import Typography from '@material-ui/core/Typography';
import withMobileDialog from '@material-ui/core/withMobileDialog';
import MobileStepper from '@material-ui/core/MobileStepper';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import DecideImage from '../../assets/images/decide-undraw.svg';
import ThumbsImage from '../../assets/images/thumbnails-undraw.svg';
import CloudImage from '../../assets/images/cloud-undraw.svg';
@@ -71,254 +71,245 @@ class ProTeaserDialog extends React.Component<Props, State> {
this.setState({ activeStep });
};
- // renderTitle = () => (
- // <DialogTitle style={{ justifyContent: 'center', textAlign: 'center' }}>
- // TagSpaces Pro Features
- // </DialogTitle>
- // );
-
- renderContent = () => {
+ render() {
const { activeStep } = this.state;
const slideStyles = {
padding: 5,
textAlign: 'left'
};
+ const {
+ fullScreen,
+ open,
+ onClose
+ } = this.props;
return (
- <DialogContent
- style={{ paddingBottom: 0 }}
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
>
- <SwipeableViews
- index={activeStep}
- onChangeIndex={this.handleStepChange}
- enableMouseEvents
+ <DialogContent
+ style={{ paddingBottom: 0 }}
>
- <div style={slideStyles}>
- <Typography variant="h5" style={{ textAlign: 'center' }}>TagSpaces Pro - Key Features</Typography>
- <br />
- <Typography variant="subtitle1">&#x2605; Connect AWS S3 object storages (buckets) as locations</Typography>
- <Typography variant="subtitle1">&#x2605; Advanced search with full text support for some file types</Typography>
- <Typography variant="subtitle1">&#x2605; Description and custom thumbnails for files and folder</Typography>
- <Typography variant="subtitle1">&#x2605; Custom background color for folders</Typography>
- <Typography variant="subtitle1">&#x2605; Advanced tagging with geo location support</Typography>
- <Typography variant="subtitle1">&#x2605; Generating persistent thumbnails</Typography>
- <Typography variant="subtitle1">&nbsp;</Typography>
- <div style={{ textAlign: 'center' }}>
- <img
- style={{
- maxHeight: 150,
- marginTop: 15,
- marginBottom: 15,
- }}
- src={DecideImage}
- alt=""
- />
+ <SwipeableViews
+ index={activeStep}
+ onChangeIndex={this.handleStepChange}
+ enableMouseEvents
+ >
+ <div style={slideStyles}>
+ <Typography variant="h5" style={{ textAlign: 'center' }}>TagSpaces Pro - Key Features</Typography>
<br />
- <Button
- onClick={() => { this.props.openURLExternally(AppConfig.links.productsOverview); }}
- variant="contained"
- color="primary"
- >Open Product Comparison</Button>
+ <Typography variant="subtitle1">&#x2605; Connect AWS S3 object storages (buckets) as locations</Typography>
+ <Typography variant="subtitle1">&#x2605; Advanced search with full text support for some file types</Typography>
+ <Typography variant="subtitle1">&#x2605; Description and custom thumbnails for files and folder</Typography>
+ <Typography variant="subtitle1">&#x2605; Custom background color for folders</Typography>
+ <Typography variant="subtitle1">&#x2605; Advanced tagging with geo location support</Typography>
+ <Typography variant="subtitle1">&#x2605; Generating persistent thumbnails</Typography>
+ <Typography variant="subtitle1">&nbsp;</Typography>
+ <div style={{ textAlign: 'center' }}>
+ <img
+ style={{
+ maxHeight: 150,
+ marginTop: 15,
+ marginBottom: 15,
+ }}
+ src={DecideImage}
+ alt=""
+ />
+ <br />
+ <Button
+ onClick={() => { this.props.openURLExternally(AppConfig.links.productsOverview); }}
+ variant="contained"
+ color="primary"
+ >Open Product Comparison</Button>
+ </div>
</div>
- </div>
- <div style={slideStyles}>
- <Typography variant="h5" style={{ textAlign: 'center' }}>Advanced Search Options</Typography>
- <br />
- <Typography variant="h6">Full text search</Typography>
- <Typography variant="subtitle1">&#x2605; Keywords from your text files will be included in the index</Typography>
- <Typography variant="subtitle1">&#x2605; Currently we support TXT, MD and HTML files</Typography>
- <Typography variant="h6">Filter by file type</Typography>
- <Typography variant="subtitle1">&#x2605; Documents, Notes, Audio files, Video files, Archives, Bookmarks, eBooks</Typography>
- <Typography variant="subtitle1">&#x2605; Filter for files, folders and untagged files</Typography>
- <Typography variant="h6">Filter by size, date and gps-coordinates</Typography>
- <div style={{ textAlign: 'center' }}>
- <img
- style={{
- maxHeight: 150,
- marginTop: 15,
- marginBottom: 15,
- }}
- src={SearchImage}
- alt=""
- />
+ <div style={slideStyles}>
+ <Typography variant="h5" style={{ textAlign: 'center' }}>Advanced Search Options</Typography>
<br />
- <Button
- onClick={() => this.props.openURLExternally(AppConfig.links.productProAdvancedSearch)}
- variant="contained"
- color="primary"
- >Learn more</Button>
+ <Typography variant="h6">Full text search</Typography>
+ <Typography variant="subtitle1">&#x2605; Keywords from your text files will be included in the index</Typography>
+ <Typography variant="subtitle1">&#x2605; Currently we support TXT, MD and HTML files</Typography>
+ <Typography variant="h6">Filter by file type</Typography>
+ <Typography variant="subtitle1">&#x2605; Documents, Notes, Audio files, Video files, Archives, Bookmarks, eBooks</Typography>
+ <Typography variant="subtitle1">&#x2605; Filter for files, folders and untagged files</Typography>
+ <Typography variant="h6">Filter by size, date and gps-coordinates</Typography>
+ <div style={{ textAlign: 'center' }}>
+ <img
+ style={{
+ maxHeight: 150,
+ marginTop: 15,
+ marginBottom: 15,
+ }}
+ src={SearchImage}
+ alt=""
+ />
+ <br />
+ <Button
+ onClick={() => this.props.openURLExternally(AppConfig.links.productProAdvancedSearch)}
+ variant="contained"
+ color="primary"
+ >Learn more</Button>
+ </div>
</div>
- </div>
- <div style={slideStyles}>
- <Typography variant="h5" style={{ textAlign: 'center' }}>Connect S3 object storages as locations</Typography>
- <br />
- <Typography variant="subtitle1">With this feature, TagSpaces Pro supports the AWS S3 buckets as file storage. In general it enables you to creating a location pointing to a remote object storages also knows as buckets on AWS S3 infrastructure. By doing this, you get a full-fledged <strong>file organizer, browser and navigator for AWS buckets</strong>, directly in TagSpaces. You do not have to download every file separately and eventually upload it back in order to preview, edit or annotate it.
- </Typography>
- <div style={{ textAlign: 'center' }}>
- <img
- style={{
- maxHeight: 120,
- marginTop: 15,
- marginBottom: 15,
- }}
- src={CloudImage}
- alt=""
- /><br />
- <Button
- onClick={() => this.props.openURLExternally(AppConfig.links.productProObjectStore)}
- variant="contained"
- color="primary"
- >Learn more</Button>
+ <div style={slideStyles}>
+ <Typography variant="h5" style={{ textAlign: 'center' }}>Connect S3 object storages as locations</Typography>
+ <br />
+ <Typography variant="subtitle1">With this feature, TagSpaces Pro supports the AWS S3 buckets as file storage. In general it enables you to creating a location pointing to a remote object storages also knows as buckets on AWS S3 infrastructure. By doing this, you get a full-fledged <strong>file organizer, browser and navigator for AWS buckets</strong>, directly in TagSpaces. You do not have to download every file separately and eventually upload it back in order to preview, edit or annotate it.
+ </Typography>
+ <div style={{ textAlign: 'center' }}>
+ <img
+ style={{
+ maxHeight: 120,
+ marginTop: 15,
+ marginBottom: 15,
+ }}
+ src={CloudImage}
+ alt=""
+ /><br />
+ <Button
+ onClick={() => this.props.openURLExternally(AppConfig.links.productProObjectStore)}
+ variant="contained"
+ color="primary"
+ >Learn more</Button>
+ </div>
</div>
- </div>
- <div style={slideStyles}>
- <Typography variant="h5" style={{ textAlign: 'center' }}>Annotate your files and folders visually</Typography>
- <br />
- <Typography variant="subtitle1">&#x2605; Add <b>custom description</b> to every document, photo or folder</Typography>
- <Typography variant="subtitle1">&#x2605; The description can be in markdown allowing images and links</Typography>
- <Typography variant="subtitle1">&#x2605; Set a <b>custom thumbnail</b> for every file or folder</Typography>
- <Typography variant="subtitle1">&#x2605; Set a <b>custom background color</b> to folders</Typography>
- <Typography variant="subtitle1">These features will enable you to find with ease your documents via the build-in search or just visually.</Typography>
- <div style={{ textAlign: 'center' }}>
- <img
- style={{
- maxHeight: 200,
- marginTop: 15,
- marginBottom: 15,
- }}
- src={AnnotateImage}
- alt=""
- /><br />
- <Button
- onClick={() => this.props.openURLExternally(AppConfig.links.productProFileFolderMeta)}
- variant="contained"
- color="primary"
- >Learn more</Button>
+ <div style={slideStyles}>
+ <Typography variant="h5" style={{ textAlign: 'center' }}>Annotate your files and folders visually</Typography>
+ <br />
+ <Typography variant="subtitle1">&#x2605; Add <b>custom description</b> to every document, photo or folder</Typography>
+ <Typography variant="subtitle1">&#x2605; The description can be in markdown allowing images and links</Typography>
+ <Typography variant="subtitle1">&#x2605; Set a <b>custom thumbnail</b> for every file or folder</Typography>
+ <Typography variant="subtitle1">&#x2605; Set a <b>custom background color</b> to folders</Typography>
+ <Typography variant="subtitle1">These features will enable you to find with ease your documents via the build-in search or just visually.</Typography>
+ <div style={{ textAlign: 'center' }}>
+ <img
+ style={{
+ maxHeight: 200,
+ marginTop: 15,
+ marginBottom: 15,
+ }}
+ src={AnnotateImage}
+ alt=""
+ /><br />
+ <Button
+ onClick={() => this.props.openURLExternally(AppConfig.links.productProFileFolderMeta)}
+ variant="contained"
+ color="primary"
+ >Learn more</Button>
+ </div>
</div>
- </div>
- <div style={slideStyles}>
- <Typography variant="h5" style={{ textAlign: 'center' }}>Tag with geo coordinates</Typography>
- <br />
- <Typography variant="subtitle1">&#x2605; This feature can be used to add geo coordinates to every file or folder. </Typography>
- <Typography variant="subtitle1">&#x2605; Dedicated perspective for showing geo-tags on a build-in map</Typography>
- <Typography variant="subtitle1">&#x2605; Extract geo location data from EXIF in JPGs files.</Typography>
- <Typography variant="subtitle1">&#x2605; Useful for planing or documenting trips and vacations.</Typography>
- <Typography variant="subtitle1">&#x2605; Useful for adding annotations for places on a map.</Typography>
- <div style={{ textAlign: 'center' }}>
- <img
- style={{
- maxHeight: 200,
- marginTop: 15,
- marginBottom: 15,
- }}
- src={MapImage}
- alt=""
- /><br />
- <Button
- onClick={() => this.props.openURLExternally(AppConfig.links.productProGeoTagging)}
- variant="contained"
- color="primary"
- >Learn more</Button>
+ <div style={slideStyles}>
+ <Typography variant="h5" style={{ textAlign: 'center' }}>Tag with geo coordinates</Typography>
+ <br />
+ <Typography variant="subtitle1">&#x2605; This feature can be used to add geo coordinates to every file or folder. </Typography>
+ <Typography variant="subtitle1">&#x2605; Dedicated perspective for showing geo-tags on a build-in map</Typography>
+ <Typography variant="subtitle1">&#x2605; Extract geo location data from EXIF in JPGs files.</Typography>
+ <Typography variant="subtitle1">&#x2605; Useful for planing or documenting trips and vacations.</Typography>
+ <Typography variant="subtitle1">&#x2605; Useful for adding annotations for places on a map.</Typography>
+ <div style={{ textAlign: 'center' }}>
+ <img
+ style={{
+ maxHeight: 200,
+ marginTop: 15,
+ marginBottom: 15,
+ }}
+ src={MapImage}
+ alt=""
+ /><br />
+ <Button
+ onClick={() => this.props.openURLExternally(AppConfig.links.productProGeoTagging)}
+ variant="contained"
+ color="primary"
+ >Learn more</Button>
+ </div>
</div>
- </div>
- <div style={slideStyles}>
- <Typography variant="h5" style={{ textAlign: 'center' }}>Generating persistent thumbnails</Typography>
- <br />
- <Typography variant="subtitle1">TagSpaces Pro generates persistent thumbnails for many file type such as: images, videos, notes, source code, office documents, bookmarks, ebooks, archives and PDFs.</Typography>
- <div style={{ textAlign: 'center' }}>
- <img
- style={{
- maxHeight: 200,
- marginTop: 15,
- marginBottom: 15,
- }}
- src={ThumbsImage}
- alt=""
- /><br />
- <Button
- onClick={() => this.props.openURLExternally(AppConfig.links.productProThumbnailsGeneration)}
- variant="contained"
- color="primary"
- >Learn more</Button>
+ <div style={slideStyles}>
+ <Typography variant="h5" style={{ textAlign: 'center' }}>Generating persistent thumbnails</Typography>
+ <br />
+ <Typography variant="subtitle1">TagSpaces Pro generates persistent thumbnails for many file type such as: images, videos, notes, source code, office documents, bookmarks, ebooks, archives and PDFs.</Typography>
+ <div style={{ textAlign: 'center' }}>
+ <img
+ style={{
+ maxHeight: 200,
+ marginTop: 15,
+ marginBottom: 15,
+ }}
+ src={ThumbsImage}
+ alt=""
+ /><br />
+ <Button
+ onClick={() => this.props.openURLExternally(AppConfig.links.productProThumbnailsGeneration)}
+ variant="contained"
+ color="primary"
+ >Learn more</Button>
+ </div>
</div>
- </div>
- <div style={slideStyles}>
- <Typography variant="h5" style={{ textAlign: 'center' }}>TagSpaces Enterprise</Typography>
- <br />
- <Typography variant="subtitle1">&#x2605; On-prem web based version of TagSpaces Pro</Typography>
- <Typography variant="subtitle1">&#x2605; PWA version of TagSpaces Pro optimized for use om mobile devices</Typography>
- <Typography variant="subtitle1">&#x2605; White label packages, with custom colors and logo</Typography>
- <Typography variant="subtitle1">&#x2605; Development of custom viewers for file (e.g. 3D-assets, medical data ...)</Typography>
- <Typography variant="subtitle1">&#x2605; Development of custom perspectives for folders (e.g. graphs, maps, trees)</Typography>
- <Typography variant="subtitle1">&#x2605; Premium technical support and signed installers</Typography>
- <div style={{ textAlign: 'center' }}>
- <img
- style={{
- maxHeight: 200,
- marginTop: 15,
- marginBottom: 15,
- }}
- src={EnterpriseImage}
- alt=""
- /><br />
- <Button
- onClick={() => this.props.openURLExternally(AppConfig.links.productsOverview)}
- variant="outlined"
- color="primary"
- >Product Landscape</Button>&nbsp;
- <Button
- onClick={() => this.props.openURLExternally('mailto:[email protected]')}
- variant="outlined"
- color="primary"
- >{i18n.t('core:emailContact')}</Button>
+ <div style={slideStyles}>
+ <Typography variant="h5" style={{ textAlign: 'center' }}>TagSpaces Enterprise</Typography>
+ <br />
+ <Typography variant="subtitle1">&#x2605; On-prem web based version of TagSpaces Pro</Typography>
+ <Typography variant="subtitle1">&#x2605; PWA version of TagSpaces Pro optimized for use om mobile devices</Typography>
+ <Typography variant="subtitle1">&#x2605; White label packages, with custom colors and logo</Typography>
+ <Typography variant="subtitle1">&#x2605; Development of custom viewers for file (e.g. 3D-assets, medical data ...)</Typography>
+ <Typography variant="subtitle1">&#x2605; Development of custom perspectives for folders (e.g. graphs, maps, trees)</Typography>
+ <Typography variant="subtitle1">&#x2605; Premium technical support and signed installers</Typography>
+ <div style={{ textAlign: 'center' }}>
+ <img
+ style={{
+ maxHeight: 200,
+ marginTop: 15,
+ marginBottom: 15,
+ }}
+ src={EnterpriseImage}
+ alt=""
+ /><br />
+ <Button
+ onClick={() => this.props.openURLExternally(AppConfig.links.productsOverview)}
+ variant="outlined"
+ color="primary"
+ >Product Landscape</Button>&nbsp;
+ <Button
+ onClick={() => this.props.openURLExternally('mailto:[email protected]')}
+ variant="outlined"
+ color="primary"
+ >{i18n.t('core:emailContact')}</Button>
+ </div>
</div>
- </div>
- </SwipeableViews>
- </DialogContent>
- );
- };
- renderActions = () => (
- <DialogActions style={{ justifyContent: 'center' }}>
- <MobileStepper
- style={{ marginTop: 10, backgroundColor: 'transparent' }}
- steps={this.maxSteps}
- position="static"
- activeStep={this.state.activeStep}
- nextButton={
- (this.state.activeStep === this.maxSteps - 1) ? (
- <Button
- size="small"
- onClick={this.props.onClose}
- >{i18n.t('core:closeButton')}</Button>
- ) : (
- <Button
- size="small"
- onClick={this.handleNext}
- >{i18n.t('core:next')}</Button>
- )
- }
- backButton={
- <Button
- size="small"
- onClick={this.handleBack}
- disabled={this.state.activeStep === 0}
- >{i18n.t('core:prev')}</Button>
- }
- />
- </DialogActions>
- );
-
- render() {
- const { fullScreen, open, onClose } = this.props;
- return (
- <GenericDialog
- fullScreen={fullScreen}
- open={open}
- onClose={onClose}
- // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ </SwipeableViews>
+ </DialogContent>
+ <DialogActions style={{ justifyContent: 'center' }}>
+ <MobileStepper
+ style={{ marginTop: 10, backgroundColor: 'transparent' }}
+ steps={this.maxSteps}
+ position="static"
+ activeStep={this.state.activeStep}
+ nextButton={
+ (this.state.activeStep === this.maxSteps - 1) ? (
+ <Button
+ size="small"
+ onClick={this.props.onClose}
+ >{i18n.t('core:closeButton')}</Button>
+ ) : (
+ <Button
+ size="small"
+ onClick={this.handleNext}
+ >{i18n.t('core:next')}</Button>
+ )
+ }
+ backButton={
+ <Button
+ size="small"
+ onClick={this.handleBack}
+ disabled={this.state.activeStep === 0}
+ >{i18n.t('core:prev')}</Button>
+ }
+ />
+ </DialogActions>
+ </Dialog>
);
}
}
diff --git a/app/components/dialogs/RenameDirectoryDialog.js b/app/components/dialogs/RenameDirectoryDialog.js
index 1a228e391..0bbb2114e 100644
--- a/app/components/dialogs/RenameDirectoryDialog.js
+++ b/app/components/dialogs/RenameDirectoryDialog.js
@@ -27,7 +27,7 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import { extractDirectoryName } from '../../utils/paths';
import { actions as AppActions } from '../../reducers/app';
@@ -42,8 +42,7 @@ type Props = {
type State = {
inputError: boolean,
disableConfirmButton: boolean,
- name: string,
- length: string
+ name: string
};
class RenameDirectoryDialog extends React.Component<Props, State> {
@@ -85,64 +84,58 @@ class RenameDirectoryDialog extends React.Component<Props, State> {
}
};
- renderTitle = () => (
- <DialogTitle>{i18n.t('core:renameDirectory')}</DialogTitle>
- );
-
- renderContent = () => (
- <DialogContent>
- <FormControl
- fullWidth={true}
- error={this.state.inputError}
- >
- <TextField
- fullWidth={true}
- autoFocus
- required
- error={this.state.inputError}
- margin="dense"
- name="name"
- label={i18n.t('core:renameDirectoryTitleName')}
- onChange={this.handleInputChange}
- value={this.state.name}
- data-tid="renameDirectoryDialogInput"
- />
- <FormHelperText>{i18n.t('core:directoryNameHelp')}</FormHelperText>
- </FormControl>
- </DialogContent>
- );
-
- renderActions = () => (
- <DialogActions>
- <Button
- data-tid="closeRenameDirectoryDialog"
- onClick={this.props.onClose}
- color="primary"
- >
- {i18n.t('core:cancel')}
- </Button>
- <Button
- disabled={this.state.disableConfirmButton}
- onClick={this.onConfirm}
- data-tid="confirmRenameDirectory"
- color="primary"
- >
- {i18n.t('core:ok')}
- </Button>
- </DialogActions>
- );
-
render() {
+ const {
+ open,
+ onClose
+ } = this.props;
+
return (
- <GenericDialog
- open={this.props.open}
- onClose={this.props.onClose}
- autoFocus
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ <Dialog
+ open={open}
+ onClose={onClose}
+ keepMounted
+ scroll="paper"
+ >
+ <DialogTitle>{i18n.t('core:renameDirectory')}</DialogTitle>
+ <DialogContent>
+ <FormControl
+ fullWidth={true}
+ error={this.state.inputError}
+ >
+ <TextField
+ fullWidth={true}
+ autoFocus
+ required
+ error={this.state.inputError}
+ margin="dense"
+ name="name"
+ label={i18n.t('core:renameDirectoryTitleName')}
+ onChange={this.handleInputChange}
+ value={this.state.name}
+ data-tid="renameDirectoryDialogInput"
+ />
+ <FormHelperText>{i18n.t('core:directoryNameHelp')}</FormHelperText>
+ </FormControl>
+ </DialogContent>
+ <DialogActions>
+ <Button
+ data-tid="closeRenameDirectoryDialog"
+ onClick={this.props.onClose}
+ color="primary"
+ >
+ {i18n.t('core:cancel')}
+ </Button>
+ <Button
+ disabled={this.state.disableConfirmButton}
+ onClick={this.onConfirm}
+ data-tid="confirmRenameDirectory"
+ color="primary"
+ >
+ {i18n.t('core:ok')}
+ </Button>
+ </DialogActions>
+ </Dialog>
);
}
}
diff --git a/app/components/dialogs/SelectDirectoryDialog.js b/app/components/dialogs/SelectDirectoryDialog.js
index 18ad887f5..4d674b4d5 100644
--- a/app/components/dialogs/SelectDirectoryDialog.js
+++ b/app/components/dialogs/SelectDirectoryDialog.js
@@ -32,7 +32,7 @@ import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import AppConfig from '../../config';
import PlatformIO from '../../services/platform-io';
@@ -185,111 +185,109 @@ class SelectDirectoryDialog extends React.Component<Props, State> {
</div>
);
- renderTitle = () => (
- <DialogTitle>{i18n.t('core:selectDialogTitle')}</DialogTitle>
- );
+ render() {
+ const {
+ fullScreen,
+ open,
+ onClose
+ } = this.props;
- renderContent = () => (
- <DialogContent>
- <FormControl
- fullWidth={true}
- error={this.props.errorTextPath}
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ // onKeyDown={confirmFunction}
>
- <InputLabel htmlFor="name">{i18n.t('core:selectDialogCurrentPath')}</InputLabel>
- <Input
- fullWidth={true}
- required
- margin="dense"
- name="path"
- onChange={this.handleInputChange}
- label={i18n.t('core:selectDialogCurrentPath')}
- data-tid="selectDirectoryDialogInput"
- value={this.state.currentPath}
- disabled={AppConfig.isWin}
- />
- {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
- </FormControl>
- {AppConfig.isWin ? (
- <FormControl
- fullWidth={true}
- >
- <Select
- data-tid="selectDirectoryDialogSelect"
- native
- autoWidth
- name="choosePath"
- value={this.state.choosePath}
- onChange={this.handleInputChange}
- input={<Input id="choosePath" />}
+ <DialogTitle>{i18n.t('core:selectDialogTitle')}</DialogTitle>
+ <DialogContent>
+ <FormControl
+ fullWidth={true}
+ error={this.props.errorTextPath}
>
- {drives.map((drive) => (<option key={drive} value={drive}>{drive}</option>))}
- </Select>
- </FormControl>
- ) : null
- }
- <FormControl
- fullWidth={true}
- >
- <Paper elevation={2}>
+ <InputLabel htmlFor="name">{i18n.t('core:selectDialogCurrentPath')}</InputLabel>
+ <Input
+ fullWidth={true}
+ required
+ margin="dense"
+ name="path"
+ onChange={this.handleInputChange}
+ label={i18n.t('core:selectDialogCurrentPath')}
+ data-tid="selectDirectoryDialogInput"
+ value={this.state.currentPath}
+ disabled={AppConfig.isWin}
+ />
+ {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ {AppConfig.isWin ? (
+ <FormControl
+ fullWidth={true}
+ >
+ <Select
+ data-tid="selectDirectoryDialogSelect"
+ native
+ autoWidth
+ name="choosePath"
+ value={this.state.choosePath}
+ onChange={this.handleInputChange}
+ input={<Input id="choosePath" />}
+ >
+ {drives.map((drive) => (<option key={drive} value={drive}>{drive}</option>))}
+ </Select>
+ </FormControl>
+ ) : null
+ }
+ <FormControl
+ fullWidth={true}
+ >
+ <Paper elevation={2}>
+ <Button
+ data-tid="onBackButtonSelectDirectoryDialog"
+ onClick={e => this.onBackButton(e)}
+ >
+ <UndoIcon />
+ </Button>
+ <Button
+ data-tid="createNewFolderSelectDirectoryDialog"
+ onClick={e => this.createNewFolder(e)}
+ >
+ <CreateFolderIcon className={this.props.classes.folderIcon} />
+ {i18n.t('core:createDirectory')}
+ </Button>
+ </Paper>
+ <Paper elevation={2} className={this.props.classes.contentFolder} >
+ {this.state.subFolders.length === 0 ?
+ (
+ <div className={this.props.classes.alertWarning}>
+ {i18n.t('core:noSubfoldersFound')}
+ </div>
+ )
+ :
+ this.state.subFolders.map(this.renderDriveSuggestions)
+ }
+ </Paper>
+ </FormControl>
+ </DialogContent>
+ <DialogActions>
<Button
- data-tid="onBackButtonSelectDirectoryDialog"
- onClick={e => this.onBackButton(e)}
+ onClick={this.props.onClose}
+ color="primary"
>
- <UndoIcon />
+ {i18n.t('core:cancel')}
</Button>
<Button
- data-tid="createNewFolderSelectDirectoryDialog"
- onClick={e => this.createNewFolder(e)}
+ onClick={this.onConfirm}
+ data-tid="confirmSelectDirectoryDialog"
+ color="primary"
>
- <CreateFolderIcon className={this.props.classes.folderIcon} />
- {i18n.t('core:createDirectory')}
+ {i18n.t('core:ok')}
</Button>
- </Paper>
- <Paper elevation={2} className={this.props.classes.contentFolder} >
- {this.state.subFolders.length === 0 ?
- (
- <div className={this.props.classes.alertWarning}>
- {i18n.t('core:noSubfoldersFound')}
- </div>
- )
- :
- this.state.subFolders.map(this.renderDriveSuggestions)
- }
- </Paper>
- </FormControl>
- </DialogContent>
- );
-
- renderActions = () => (
- <DialogActions>
- <Button
- onClick={this.props.onClose}
- color="primary"
- >
- {i18n.t('core:cancel')}
- </Button>
- <Button
- onClick={this.onConfirm}
- data-tid="confirmSelectDirectoryDialog"
- color="primary"
- >
- {i18n.t('core:ok')}
- </Button>
- </DialogActions>
- );
-
- render() {
- return (
- <GenericDialog
- open={this.props.open}
- onClose={this.props.onClose}
- onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
- renderTitle={this.renderTitle}
- renderContent={this.renderContent}
- renderActions={this.renderActions}
- />
+ </DialogActions>
+ </Dialog>
);
- }
+ }
}
export default withStyles(styles)(SelectDirectoryDialog);
diff --git a/app/components/dialogs/ThirdPartyLibsDialog.js b/app/components/dialogs/ThirdPartyLibsDialog.js
index 0269fc409..109845679 100644
--- a/app/components/dialogs/ThirdPartyLibsDialog.js
+++ b/app/components/dialogs/ThirdPartyLibsDialog.js
@@ -23,30 +23,30 @@ import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import withMobileDialog from '@material-ui/core/withMobileDialog';
-import GenericDialog from './GenericDialog';
+import Dialog from '@material-ui/core/Dialog';
import i18n from '../../services/i18n';
import ThirdPartyLibs from '../../third-party.txt';
type Props = {
open: boolean,
- onClose: () => void
+ onClose: () => void,
+ fullScreen: boolean
};
const ThirdPartyLibsDialog = (props: Props) => {
- function renderTitle() {
- return (<DialogTitle>{i18n.t('core:thirdPartyLibs')}</DialogTitle>);
- }
-
- function renderContent() {
- return (
+ const { open, onClose, fullScreen } = props;
+ return (
+ <Dialog
+ open={open}
+ onClose={onClose}
+ fullScreen={fullScreen}
+ keepMounted
+ scroll="paper"
+ >
+ <DialogTitle>{i18n.t('core:thirdPartyLibs')}</DialogTitle>
<DialogContent style={{ overflowX: 'auto' }}>
<pre style={{ whiteSpace: 'pre-wrap' }}>{ ThirdPartyLibs }</pre>
</DialogContent>
- );
- }
-
- function renderActions() {
- return (
<DialogActions>
<Button
data-tid="confirmThirdPartyLibsDialog"
@@ -56,17 +56,7 @@ const ThirdPartyLibsDialog = (props: Props) => {
{i18n.t('core:ok')}
</Button>
</DialogActions>
- );
- }
-
- return (
- <GenericDialog
- open={props.open}
- onClose={props.onClose}
- renderTitle={renderTitle}
- renderContent={renderContent}
- renderActions={renderActions}
- />
+ </Dialog>
);
};
diff --git a/app/containers/MainPage.js b/app/containers/MainPage.js
index 361c08787..b1eda3dac 100644
--- a/app/containers/MainPage.js
+++ b/app/containers/MainPage.js
@@ -321,7 +321,9 @@ class MainPage extends Component<Props, State> {
nextProps.isPerspectivesPanelOpened ||
nextProps.isHelpFeedbackPanelOpened) {
this.setManagementPanelVisibility(true);
- this.showDrawer();
+ if (!nextProps.isDesktopMode) {
+ this.showDrawer();
+ }
}
if (!nextProps.isLocationManagerPanelOpened &&
@@ -371,14 +373,17 @@ class MainPage extends Component<Props, State> {
};
hideDrawer = () => {
- this.props.closeAllVerticalPanels();
this.setState({
isDrawerOpened: false
});
};
showDrawer = () => {
- if (!this.props.isLocationManagerPanelOpened && !this.props.isSearchPanelOpened && !this.props.isTagLibraryPanelOpened) {
+ if (
+ !this.props.isLocationManagerPanelOpened &&
+ !this.props.isSearchPanelOpened &&
+ !this.props.isTagLibraryPanelOpened
+ ) {
this.props.openLocationManagerPanel();
}
this.setState({
diff --git a/app/reducers/taglibrary.js b/app/reducers/taglibrary.js
index 6c85e6454..0af4bf1a9 100644
--- a/app/reducers/taglibrary.js
+++ b/app/reducers/taglibrary.js
@@ -180,7 +180,10 @@ export default (state: Array<TagGroup> = defaultTagLibrary, action: Object) => {
});
if (indexForEditing >= 0) {
- let tags = action.tag.split(',');
+ let tags = action.tag.split(' ').join(',').split(','); // handle spaces around commas
+ tags = [...new Set(tags)]; // remove duplicates
+ tags = tags.filter(tag => tag.length > 0); // zero length tags
+
const taggroupTags = state[indexForEditing].children;
taggroupTags.forEach(tag => { // filter out duplicated tags
tags = tags.filter(e => e !== tag.title);
@@ -189,7 +192,7 @@ export default (state: Array<TagGroup> = defaultTagLibrary, action: Object) => {
...state.slice(0, indexForEditing),
{
...state[indexForEditing],
- children: taggroupTags.concat(tags.map((tagTitle) => ({
+ children: taggroupTags.concat(tags.map(tagTitle => ({
id: uuidv1(),
type: taggroupTags.length > 0 ? taggroupTags[0].type : 'sidecar',
title: tagTitle.trim(),