Skip to content

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

TSN162 - refactoring dialogs

Mladen Sapundshiev2d0eb32eeea7
diff --git a/app/components/dialogs/EditEntryTagDialog.js b/app/components/dialogs/EditEntryTagDialog.js
index 1697d7c33..e0ed69469 100644
--- a/app/components/dialogs/EditEntryTagDialog.js
+++ b/app/components/dialogs/EditEntryTagDialog.js
@@ -27,7 +27,7 @@ import {
} from 'material-ui/Dialog';
import { withStyles } from 'material-ui/styles/index';
import { FormControl, FormHelperText } from 'material-ui/Form';
-import GenericDialog from './GenericDialog';
+import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import i18n from '../../services/i18n';
import { type Tag } from '../../reducers/taglibrary';
@@ -56,7 +56,7 @@ type State = {
disableConfirmButton: boolean
};
-class EditEntryTagDialog extends GenericDialog<Props, State> {
+class EditEntryTagDialog extends React.Component<Props, State> {
state = {
disableConfirmButton: true,
errorTag: true,
@@ -138,6 +138,19 @@ class EditEntryTagDialog extends GenericDialog<Props, State> {
</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}
+ />
+ );
+ }
}
export default withStyles(styles)(EditEntryTagDialog);
diff --git a/app/components/dialogs/KeyboardDialog.js b/app/components/dialogs/KeyboardDialog.js
index 8f76f04a3..761a70ede 100644
--- a/app/components/dialogs/KeyboardDialog.js
+++ b/app/components/dialogs/KeyboardDialog.js
@@ -32,7 +32,7 @@ import {
} from 'material-ui/List';
import { FormControl } from 'material-ui/Form';
import { withStyles } from 'material-ui/styles/index';
-import GenericDialog from './GenericDialog';
+import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import i18n from '../../services/i18n';
import { getKeyBindingObject } from '../../reducers/settings';
@@ -101,6 +101,7 @@ class KeyboardDialog extends React.Component<Props> {
<GenericDialog
open={this.props.open}
onClose={this.props.onClose}
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
renderTitle={this.renderTitle}
renderContent={this.renderContent}
renderActions={this.renderActions}
diff --git a/app/components/dialogs/LicenseDialog.js b/app/components/dialogs/LicenseDialog.js
index 95e9cf786..9dedcb9d1 100644
--- a/app/components/dialogs/LicenseDialog.js
+++ b/app/components/dialogs/LicenseDialog.js
@@ -25,7 +25,7 @@ import {
DialogTitle,
withMobileDialog
} from 'material-ui/Dialog';
-import GenericDialog from './GenericDialog';
+import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import i18n from '../../services/i18n';
import { loadFileContentPromise } from '../../services/utils-io';
import { Pro } from '../../pro';
@@ -84,6 +84,7 @@ class LicenseDialog extends React.Component<Props, State> {
<GenericDialog
open={this.props.open}
onClose={this.props.onClose}
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
renderTitle={this.renderTitle}
renderContent={this.renderContent}
renderActions={this.renderActions}
diff --git a/app/components/dialogs/MoveCopyFilesDialog.js b/app/components/dialogs/MoveCopyFilesDialog.js
index b0563d022..692b4218d 100644
--- a/app/components/dialogs/MoveCopyFilesDialog.js
+++ b/app/components/dialogs/MoveCopyFilesDialog.js
@@ -31,7 +31,7 @@ import {
DialogTitle
} from 'material-ui/Dialog';
import { FormControl, FormHelperText } from 'material-ui/Form';
-import GenericDialog from './GenericDialog';
+import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import i18n from '../../services/i18n';
// import { extractContainingDirectoryPath } from '../../utils/paths';
import PlatformIO from '../../services/platform-io';
@@ -193,6 +193,7 @@ class MoveCopyFilesDialog extends React.Component<Props, State> {
<GenericDialog
open={this.props.open}
onClose={this.props.onClose}
+ // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}
renderTitle={this.renderTitle}
renderContent={this.renderContent}
renderActions={this.renderActions}