TagSpaces is an offline, open source, document manager with tagging support
polish: saved searches
Ilian Sapundshievc687f69e6e5b
diff --git a/app/components/Search.tsx b/app/components/Search.tsxindex 9e89f3b99..2ad1d483c 100644--- a/app/components/Search.tsx+++ b/app/components/Search.tsx@@ -244,6 +244,9 @@ const Search = (props: Props) => {const { value } = target;const savedSearch = props.searches.find(search => search.uuid === value);+ if (!savedSearch) {+ return true;+ }textQuery.current = savedSearch.textQuery;fileTypes.current = savedSearch.fileTypes;lastModified.current = savedSearch.lastModified;@@ -1101,6 +1104,9 @@ const Search = (props: Props) => {value={props.searchQuery.uuid ? props.searchQuery.uuid : -1}><MenuItem value={-1} style={{ display: 'none' }} />+ {props.searches.length < 1 && (+ <MenuItem>{i18n.t('noSearchesFound')}</MenuItem>+ )}{props.searches.map(search => (<MenuItem key={search.uuid} value={search.uuid}><span style={{ width: '100%' }}>{search.title}</span>diff --git a/app/components/dialogs/GenericDialog.tsx b/app/components/dialogs/GenericDialog.tsxdeleted file mode 100644index 61fee4a3c..000000000--- a/app/components/dialogs/GenericDialog.tsx+++ /dev/null@@ -1,67 +0,0 @@-/**- * TagSpaces - universal file and folder organizer- * Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)- *- * This program is free software: you can redistribute it and/or modify- * it under the terms of the GNU Affero General Public License (version 3) as- * published by the Free Software Foundation.- *- * This program is distributed in the hope that it will be useful,- * but WITHOUT ANY WARRANTY; without even the implied warranty of- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- * GNU Affero General Public License for more details.- *- * You should have received a copy of the GNU Affero General Public License- * along with this program. If not, see <https://www.gnu.org/licenses/>.- *- */--import React from 'react';-import Dialog from '@material-ui/core/Dialog';-import Slide from '@material-ui/core/Slide';--export function DialogTransition(props: any) {- return <Slide direction="down" {...props} />;-}--interface Props {- open: boolean;- fullScreen?: boolean;- onClose: () => void;- onBackdropClick?: () => void;- onEnterKey?: () => void;- renderTitle?: () => Object;- renderContent: () => Object;- renderActions?: () => Object;-}--export function onEnterKeyHandler(event: any, confirmFunction: () => void) {- if (event.key === 'Enter' || event.keyCode === 13) {- confirmFunction();- }-}--const GenericDialog = (props: Props) => {- const { fullScreen, open, onEnterKey, onClose, onBackdropClick } = props;- return (- <Dialog- fullScreen={fullScreen}- open={open}- TransitionComponent={DialogTransition}- keepMounted- scroll="paper"- onClose={onClose}- onBackdropClick={onBackdropClick && onClose}- // onEscapeKeyDown={onClose}- onKeyDown={- onEnterKey || (event => onEnterKeyHandler(event, props.onClose))- }- >- {props.renderTitle && props.renderTitle()}- {props.renderContent && props.renderContent()}- {props.renderActions && props.renderActions()}- </Dialog>- );-};--export default GenericDialog;diff --git a/app/locales/en/core.json b/app/locales/en/core.jsonindex 9e74eea9c..0af6b1ff2 100644--- a/app/locales/en/core.json+++ b/app/locales/en/core.json@@ -543,6 +543,7 @@"importSavedSearch": "Import Saved Searches","exportSearchesTitle": "Export Searches","selectAllSearches": "Select All Searches",+ "noSavedSearches": "No saved searches found","notImportedSearches": "Searches will not be imported","searchExist": "Search already exist, it will be replaced with this one","searchSaveBtn": "Save Search",