Skip to content

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

fix: added no items for the history and other small ui changes

Ilian Sapundshiev89ee247bccab
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index af330e389..9b902b588 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -123,7 +123,7 @@ const styles: any = (theme: any) => ({
fileBadge: {
color: 'white',
backgroundColor: AppConfig.defaultFileColor,
- padding: 5,
+ padding: 3,
textShadow: '1px 1px #8f8f8f',
fontSize: 13,
marginLeft: 3,
diff --git a/app/components/StoredSearches.tsx b/app/components/StoredSearches.tsx
index 561a6f6f4..0a0202078 100644
--- a/app/components/StoredSearches.tsx
+++ b/app/components/StoredSearches.tsx
@@ -155,18 +155,6 @@ function StoredSearches(props: Props) {
...savedSearch,
showUnixHiddenEntries: props.showUnixHiddenEntries
});
-
- /* if (savedSearch.searchBoxing === 'global') {
- props.searchAllLocations({
- ...savedSearch,
- showUnixHiddenEntries: props.showUnixHiddenEntries
- });
- } else {
- props.searchLocationIndex({
- ...savedSearch,
- showUnixHiddenEntries: props.showUnixHiddenEntries
- });
- } */
};
function handleFileInputChange(selection: any) {
@@ -185,16 +173,24 @@ function StoredSearches(props: Props) {
const bookmarkItems: Array<TS.BookmarkItem> = Pro
? Pro.bookmarks.getBookmarks()
- : undefined;
+ : [];
const fileOpenHistoryItems: Array<TS.HistoryItem> = Pro
? Pro.history.getHistory(historyKeys.fileOpenKey)
- : undefined;
+ : [];
const fileEditHistoryItems: Array<TS.HistoryItem> = Pro
? Pro.history.getHistory(historyKeys.fileEditKey)
- : undefined;
+ : [];
const folderOpenHistoryItems: Array<TS.HistoryItem> = Pro
? Pro.history.getHistory(historyKeys.folderOpenKey)
- : undefined;
+ : [];
+
+ const bookmarksAvailable = bookmarkItems && bookmarkItems.length > 0;
+ const openedFilesAvailable =
+ fileOpenHistoryItems && fileOpenHistoryItems.length > 0;
+ const editedFilesAvailable =
+ fileEditHistoryItems && fileEditHistoryItems.length > 0;
+ const openedFoldersAvailable =
+ folderOpenHistoryItems && folderOpenHistoryItems.length > 0;
const renderItem = (
key,
@@ -372,7 +368,9 @@ function StoredSearches(props: Props) {
<Grid container direction="row">
{props.storedSearchesVisible && noSearchesFound && (
<Grid item xs={12} style={{ display: 'flex', padding: 10 }}>
- {i18n.t('noSavedSearches')}
+ <Typography variant="caption">
+ {i18n.t('noSavedSearches')}
+ </Typography>
</Grid>
)}
</Grid>
@@ -439,6 +437,13 @@ function StoredSearches(props: Props) {
</IconButton>
</Grid>
</Grid>
+ <Grid container direction="row">
+ {props.showBookmarks && !bookmarksAvailable && (
+ <Grid item xs={12} style={{ textAlign: 'center' }}>
+ <Typography variant="caption">{i18n.t('noItems')}</Typography>
+ </Grid>
+ )}
+ </Grid>
{Pro &&
props.showBookmarks &&
renderItem(Pro.bookmarks.bookmarksKey, bookmarkItems)}
@@ -473,6 +478,13 @@ function StoredSearches(props: Props) {
</IconButton>
</Grid>
</Grid>
+ <Grid container direction="row">
+ {props.fileOpenHistory && !openedFilesAvailable && (
+ <Grid item xs={12} style={{ textAlign: 'center' }}>
+ <Typography variant="caption">{i18n.t('noItems')}</Typography>
+ </Grid>
+ )}
+ </Grid>
{props.fileOpenHistory &&
renderItem(historyKeys.fileOpenKey, fileOpenHistoryItems)}
<Grid container direction="row">
@@ -507,6 +519,13 @@ function StoredSearches(props: Props) {
</IconButton>
</Grid>
</Grid>
+ <Grid container direction="row">
+ {props.fileEditHistory && !editedFilesAvailable && (
+ <Grid item xs={12} style={{ textAlign: 'center' }}>
+ <Typography variant="caption">{i18n.t('noItems')}</Typography>
+ </Grid>
+ )}
+ </Grid>
{props.fileEditHistory &&
renderItem(historyKeys.fileEditKey, fileEditHistoryItems)}
<Grid container direction="row">
@@ -568,6 +587,13 @@ function StoredSearches(props: Props) {
forceUpdate();
}}
/>
+ <Grid container direction="row">
+ {props.folderOpenHistory && !openedFoldersAvailable && (
+ <Grid item xs={12} style={{ textAlign: 'center' }}>
+ <Typography variant="caption">{i18n.t('noItems')}</Typography>
+ </Grid>
+ )}
+ </Grid>
{props.folderOpenHistory &&
renderItem(historyKeys.folderOpenKey, folderOpenHistoryItems)}
{SaveSearchDialog && saveSearchDialogOpened !== undefined && (
diff --git a/app/locales/en/core.json b/app/locales/en/core.json
index 808411ca2..47731a505 100644
--- a/app/locales/en/core.json
+++ b/app/locales/en/core.json
@@ -676,5 +676,6 @@
"folderWithCustomPerspectiveSetting": "Current folder has custom settings for this perspective",
"cancelSubscription": "Cancel Subscription",
"toggleBookmark": "Toggle Bookmark",
+ "noItems": "No items found",
"-": "-"
}
diff --git a/app/perspectives/grid-perspective/components/styles.css.tsx b/app/perspectives/grid-perspective/components/styles.css.tsx
index f297f11e6..429786147 100644
--- a/app/perspectives/grid-perspective/components/styles.css.tsx
+++ b/app/perspectives/grid-perspective/components/styles.css.tsx
@@ -90,13 +90,14 @@ export default (theme: any): any => ({
display: 'block'
},
gridFileExtension: {
- padding: 5,
paddingTop: 1,
paddingBottom: 7,
+ paddingLeft: 3,
+ paddingRight: 3,
fontSize: 13,
marginRight: 5,
marginTop: 7,
- minWidth: 40,
+ minWidth: 30,
height: 16,
color: 'white',
borderRadius: 3,
@@ -104,11 +105,9 @@ export default (theme: any): any => ({
},
rowFileExtension: {
flex: 1,
- padding: 5,
- paddingTop: 7,
- width: 35,
+ padding: 4,
+ // width: 35,
maxWidth: 60,
- minHeight: 15,
borderWidth: 1,
color: 'white',
textTransform: 'uppercase',