TagSpaces is an offline, open source, document manager with tagging support
chore: added icon for the location type in the breadcrumb component
Ilian Sapundshieva88a339d1894
diff --git a/app/components/CommonIcons.tsx b/app/components/CommonIcons.tsxindex 616fbe792..51bf98528 100644--- a/app/components/CommonIcons.tsx+++ b/app/components/CommonIcons.tsx@@ -54,6 +54,8 @@ export { default as CreateFileIcon } from '@mui/icons-material/Add';export { default as LocalLocationIcon } from '@mui/icons-material/WorkOutline';+export { default as CloudLocationIcon } from '@mui/icons-material/CloudQueue';+export { default as OpenLinkIcon } from '@mui/icons-material/Link';export { default as KeyShortcutsIcon } from '@mui/icons-material/Keyboard';diff --git a/app/components/EntryProperties.tsx b/app/components/EntryProperties.tsxindex 3cae84e77..e5cb2b8b1 100644--- a/app/components/EntryProperties.tsx+++ b/app/components/EntryProperties.tsx@@ -36,9 +36,7 @@ import Button from '@mui/material/Button';import InputAdornment from '@mui/material/InputAdornment';import QRCodeIcon from '@mui/icons-material/QrCode';import Tooltip from '-/components/Tooltip';-import LocationIcon from '@mui/icons-material/WorkOutline';-import EditIcon from '@mui/icons-material/Edit';-import CloudLocationIcon from '@mui/icons-material/CloudQueue';+import { LocalLocationIcon, CloudLocationIcon } from '-/components/CommonIcons';import Stack from '@mui/material/Stack';import SetBackgroundIcon from '@mui/icons-material/OpacityOutlined';import ClearBackgroundIcon from '@mui/icons-material/FormatColorResetOutlined';@@ -1036,7 +1034,7 @@ function EntryProperties(props: Props) {style={{ color: theme.palette.text.secondary }}/>) : (- <LocationIcon+ <LocalLocationIconstyle={{ color: theme.palette.text.secondary }}/>)}diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsxindex 73768a75f..826a90de5 100644--- a/app/components/FolderContainer.tsx+++ b/app/components/FolderContainer.tsx@@ -51,6 +51,7 @@ import {isSearchMode,getLastSearchTimestamp} from '../reducers/app';+import { getCurrentLocation } from '-/reducers/locations';import TaggingActions from '../reducers/tagging-actions';import LoadingLazy from '../components/LoadingLazy';import {@@ -199,6 +200,7 @@ interface Props {defaultPerspective: string;currentDirectoryPerspective: string;currentLocationPath: string;+ currentLocation: TS.Location;openedFiles: Array<OpenedEntry>;updateCurrentDirEntry: (path: string, entry: Object) => void;setCurrentDirectoryColor: (color: string) => void;@@ -289,6 +291,7 @@ function FolderContainer(props: Props) {theme,currentDirectoryPerspective,currentLocationPath,+ currentLocation,setSelectedEntries,openDirectory,reflectCreateEntry,@@ -619,6 +622,7 @@ function FolderContainer(props: Props) {openRenameDirectoryDialog={() =>setIsRenameEntryDialogOpened(true)}+ currentLocation={currentLocation}openMoveCopyFilesDialog={props.openMoveCopyFilesDialog}/></>@@ -682,6 +686,7 @@ function mapStateToProps(state) {searchQuery: getSearchQuery(state),defaultPerspective: getDefaultPerspective(state),editedEntryPaths: getEditedEntryPaths(state),+ currentLocation: getCurrentLocation(state),lastSearchTimestamp: getLastSearchTimestamp(state),isSearchMode: isSearchMode(state)};diff --git a/app/components/LocationView.tsx b/app/components/LocationView.tsxindex 12903952e..9c23c340d 100644--- a/app/components/LocationView.tsx+++ b/app/components/LocationView.tsx@@ -27,8 +27,7 @@ import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';import MoreVertIcon from '@mui/icons-material/MoreVert';import Typography from '@mui/material/Typography';import IconButton from '@mui/material/IconButton';-import LocationIcon from '@mui/icons-material/WorkOutline';-import CloudLocationIcon from '@mui/icons-material/CloudQueue';+import { LocalLocationIcon, CloudLocationIcon } from '-/components/CommonIcons';import DefaultLocationIcon from '@mui/icons-material/Highlight';import { Progress } from 'aws-sdk/clients/s3';import { locationType } from '@tagspaces/tagspaces-common/misc';@@ -305,7 +304,7 @@ function LocationView(props: Props) {className={props.classes.icon}/>) : (- <LocationIcon+ <LocalLocationIconstyle={{cursor: 'pointer'}}diff --git a/app/components/PathBreadcrumbs.tsx b/app/components/PathBreadcrumbs.tsxindex bb381b35b..813cbd249 100644--- a/app/components/PathBreadcrumbs.tsx+++ b/app/components/PathBreadcrumbs.tsx@@ -31,12 +31,14 @@ import {import i18n from '../services/i18n';import DirectoryMenu from './menus/DirectoryMenu';import { TS } from '-/tagspaces.namespace';+import { LocalLocationIcon, CloudLocationIcon } from '-/components/CommonIcons';+import { locationType } from '@tagspaces/tagspaces-common/misc';// @ts-ignoreconst StyledBreadcrumb = withStyles((theme: Theme) => ({root: {backgroundColor: emphasize(theme.palette.background.default, 0.06),- height: theme.spacing(3),+ // height: theme.spacing(3),color: theme.palette.text.primary,fontWeight: theme.typography.fontWeightRegular,'&:hover, &:focus': {@@ -54,6 +56,7 @@ const NoWrapBreadcrumb = withStyles({interface Props {currentDirectoryPath: string;currentLocationPath: string;+ currentLocation: TS.Location;loadDirectoryContent: (path: string,generateThumbnails: boolean,@@ -82,6 +85,7 @@ function PathBreadcrumbs(props: Props) {const {currentDirectoryPath,currentLocationPath,+ currentLocation,loadDirectoryContent,setSelectedEntries,openDirectory,@@ -108,18 +112,25 @@ function PathBreadcrumbs(props: Props) {currentDirectoryPath.split('\\').join('/'));+ const locationTypeIcon =+ currentLocation && currentLocation.type === locationType.TYPE_CLOUD ? (+ <CloudLocationIcon />+ ) : (+ <LocalLocationIcon />+ );++ let currentFolderChipIcon = undefined;+if (currentDirectoryPath) {// Make the path unix like ending always with /const addSlash = PlatformIO.haveObjectStoreSupport() ? '//' : '/';let normalizedCurrentPath =- addSlash +- normalizePath(props.currentDirectoryPath.split('\\').join('/'));+ addSlash + normalizePath(currentDirectoryPath.split('\\').join('/'));let normalizedCurrentLocationPath = '';if (currentLocationPath) {normalizedCurrentLocationPath =- addSlash +- normalizePath(props.currentLocationPath.split('\\').join('/'));+ addSlash + normalizePath(currentLocationPath.split('\\').join('/'));}while (@@ -138,6 +149,8 @@ function PathBreadcrumbs(props: Props) {);}+ currentFolderChipIcon = pathParts.length === 1 && locationTypeIcon;+if (pathParts.length >= 1) {pathParts = pathParts.slice(1, pathParts.length); // remove current directory}@@ -158,12 +171,12 @@ function PathBreadcrumbs(props: Props) {marginRight: -4}}>- /+ {'›'}</span>}>{pathParts.length > 0 &&- pathParts.map(pathPart => (+ pathParts.map((pathPart, index) => (<Tooltipkey={pathPart}title={i18n.t('core:navigateTo') + ' ' + pathPart}@@ -175,11 +188,12 @@ function PathBreadcrumbs(props: Props) {pathPart,PlatformIO.getDirSeparator())}+ icon={index === 0 && locationTypeIcon}onClick={() => loadDirectoryContent(pathPart, false, true)}/></Tooltip>))}- {props.currentDirectoryPath && (+ {currentDirectoryPath && (<Tooltiptitle={i18n.t('core:openDirectoryMenu') +@@ -193,6 +207,7 @@ function PathBreadcrumbs(props: Props) {normalizePath(normalizedCurrentDirPath),'/')}+ icon={currentFolderChipIcon}deleteIcon={<ExpandMoreIcon />}onDelete={openDirectoryMenu}onClick={openDirectoryMenu}diff --git a/app/components/menus/LocationMenu.tsx b/app/components/menus/LocationMenu.tsxindex c517ef142..c2f1fcd46 100644--- a/app/components/menus/LocationMenu.tsx+++ b/app/components/menus/LocationMenu.tsx@@ -21,8 +21,7 @@ import { connect } from 'react-redux';import { bindActionCreators } from 'redux';import Menu from '@mui/material/Menu';import MenuItem from '@mui/material/MenuItem';-import LocationIcon from '@mui/icons-material/WorkOutline';-import CloudLocationIcon from '@mui/icons-material/CloudQueue';+import { LocalLocationIcon, CloudLocationIcon } from '-/components/CommonIcons';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';import ListSubHeader from '@mui/material/ListSubheader';@@ -67,7 +66,7 @@ function LocationMenu(props: Props) {currentLocation && currentLocation.type === locationType.TYPE_CLOUD ? (<CloudLocationIcon />) : (- <LocationIcon />+ <LocalLocationIcon />);return (@@ -133,7 +132,7 @@ function LocationMenu(props: Props) {{location.type === locationType.TYPE_CLOUD ? (<CloudLocationIcon />) : (- <LocationIcon />+ <LocalLocationIcon />)}</ListItemIcon><ListItemText primary={location.name} />diff --git a/package.json b/package.jsonindex dd806330b..8817980a8 100644--- a/package.json+++ b/package.json@@ -47,7 +47,7 @@"cordova-list-emulators": "cd cordova && cordova run --list --emulator && cd ..","cordova-remove-android": "cd cordova && cordova platform remove android && cd ..","cordova-remove-ios": "cd cordova && cordova platform remove ios && cd ..",- "dev": "npm run prepare-node && npm run generate-jwt && npm run generate-extensions && cross-env START_HOT=0 node -r @babel/register ./internals/scripts/CheckPortInUse.js && cross-env START_HOT=0 npm run start-renderer-dev",+ "dev": "npm run prepare-node && npm run generate-jwt && npm run generate-extensions && node -r @babel/register ./internals/scripts/CheckPortInUse.js && cross-env START_HOT=0 npm run start-renderer-dev","generate-jwt": "node scripts/jwt_generate.js","generate-extensions": "node scripts/generateExtensionsConfig.js","install-ext-node-check": "npx cross-env PD_PLATFORM=node node scripts/checkWSinstalled.js",