Skip to content

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

TSN333-Add "ShowInFileManager" in the location context menu (#1010)

mladensap50e9192d4551
diff --git a/app/components/LocationManager.js b/app/components/LocationManager.js
index b22574945..4b3ed583e 100644
--- a/app/components/LocationManager.js
+++ b/app/components/LocationManager.js
@@ -45,6 +45,7 @@ import CloseIcon from '@material-ui/icons/Close';
import DefaultLocationIcon from '@material-ui/icons/Highlight';
import ArrowDownwardIcon from '@material-ui/icons/ArrowDownward';
import ArrowUpwardIcon from '@material-ui/icons/ArrowUpward';
+import OpenFolderNativelyIcon from '@material-ui/icons/Launch';
import styles from './SidePanels.css';
import DirectoryMenu from './menus/DirectoryMenu';
import EditLocationDialog from './dialogs/EditLocationDialog';
@@ -347,6 +348,11 @@ class LocationManager extends React.Component<Props, State> {
}
};
+ showInFileManager = () => {
+ this.handleRequestCloseContextMenus();
+ this.props.openDirectory(this.state.selectedLocation.paths[0]);
+ };
+
closeLocation = () => {
this.handleRequestCloseContextMenus();
if (this.state.selectedLocation && this.state.selectedLocation.uuid) {
@@ -768,6 +774,15 @@ class LocationManager extends React.Component<Props, State> {
</ListItemIcon>
<ListItemText primary={i18n.t('core:removeLocation')} />
</MenuItem>
+ <MenuItem
+ data-tid="showInFileManager"
+ onClick={this.showInFileManager}
+ >
+ <ListItemIcon>
+ <OpenFolderNativelyIcon />
+ </ListItemIcon>
+ <ListItemText primary={i18n.t('core:showInFileManager')} />
+ </MenuItem>
<MenuItem
data-tid="removeLocation"
onClick={this.closeLocation}
diff --git a/app/components/menus/DirectoryMenu.js b/app/components/menus/DirectoryMenu.js
index 6756f2cdf..237a65b4b 100644
--- a/app/components/menus/DirectoryMenu.js
+++ b/app/components/menus/DirectoryMenu.js
@@ -358,8 +358,7 @@ const DirectoryMenu = (props: Props) => {
<ListItemIcon>
<OpenFolderNativelyIcon />
</ListItemIcon>
- <ListItemText primary={i18n.t('core:showInFileManager')}
- />
+ <ListItemText primary={i18n.t('core:showInFileManager')} />
</MenuItem>
)}
{!props.perspectiveMode && (