Skip to content

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

added help button to the taglibrary menu

Ilian Sapundshiev136ba9c8c3ff
diff --git a/app/components/TagLibrary.js b/app/components/TagLibrary.js
index 3efaa44d3..cf603737f 100644
--- a/app/components/TagLibrary.js
+++ b/app/components/TagLibrary.js
@@ -55,7 +55,7 @@ import {
import TaggingActions from '../reducers/tagging-actions';
import i18n from '../services/i18n';
import { getTagColor, getTagTextColor } from '../reducers/settings';
-import { getSelectedEntries, isReadOnlyMode } from '../reducers/app';
+import { actions as AppActions, getSelectedEntries, isReadOnlyMode } from '../reducers/app';
import SmartTags from '../reducers/smart-tags';
const isTagLibraryReadOnly = (window.ExtTagLibrary && window.ExtTagLibrary.length > 0);
@@ -68,6 +68,7 @@ type Props = {
tagBackgroundColor: string,
tagGroups: Array<TagGroup>,
allTags: Array<Tag>,
+ openFileNatively: (path: string) => void,
toggleTagGroup: (expanded: boolean, uuid: string) => void,
removeTagGroup: (uuid: string) => void,
moveTagGroupUp: (uuid: string) => void,
@@ -370,6 +371,7 @@ class TagLibrary extends React.Component<Props, State> {
importTagGroups={this.props.importTagGroups}
exportTagGroups={this.props.exportTagGroups}
showCreateTagGroupDialog={this.showCreateTagGroupDialog}
+ openFileNatively={this.props.openFileNatively}
/>
<TagMenu
anchorEl={this.state.tagMenuAnchorEl}
@@ -404,7 +406,8 @@ function mapDispatchToProps(dispatch) {
return bindActionCreators({
...TagLibraryActions, // TODO connect only the really needed
addTags: TaggingActions.addTags,
- collectTagsFromLocation: TaggingActions.collectTagsFromLocation
+ collectTagsFromLocation: TaggingActions.collectTagsFromLocation,
+ openFileNatively: AppActions.openFileNatively,
}, dispatch);
}
diff --git a/app/components/menus/TagLibraryMenu.js b/app/components/menus/TagLibraryMenu.js
index dd7a25100..1b5e2ae33 100644
--- a/app/components/menus/TagLibraryMenu.js
+++ b/app/components/menus/TagLibraryMenu.js
@@ -23,6 +23,7 @@ import ListItemIcon from '@material-ui/core/ListItemIcon';
import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem';
import ImportExportIcon from '@material-ui/icons/ImportExport';
+import HelpIcon from '@material-ui/icons/Help';
import AddIcon from '@material-ui/icons/Add';
import ImportExportTagGroupsDialog from '../dialogs/ImportExportTagGroupsDialog';
import SelectDirectoryDialog from '../dialogs/SelectDirectoryDialog';
@@ -33,6 +34,7 @@ type Props = {
classes: Object,
anchorEl: Object,
tagGroups: Array<Object>,
+ openFileNatively: (path: string) => void,
open: boolean,
onClose: () => void,
importTagGroups: () => void,
@@ -159,6 +161,18 @@ const TagLibraryMenu = (props: Props) => {
</ListItemIcon>
<ListItemText primary={i18n.t('core:exportTagGroupsButton')} />
</MenuItem>
+ <MenuItem
+ data-tid="tablibraryHelp"
+ onClick={() => {
+ props.onClose();
+ props.openFileNatively(AppConfig.documentationLinks.taglibrary)
+ }}
+ >
+ <ListItemIcon>
+ <HelpIcon />
+ </ListItemIcon>
+ <ListItemText primary={i18n.t('core:help')} />
+ </MenuItem>
</Menu>
<input
style={{ display: 'none' }}