Skip to content

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

chore: adding tooltips in for the locaiton view

Ilian Sapundshievcb7fe47457c8
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index 2c036771a..08991babc 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -602,14 +602,13 @@ const FolderContainer = (props: Props) => {
>
<MainSearchField
fullWidth
- id="textQuery"
- name="textQuery"
+ data-tid="toggleSearch"
defaultValue=""
variant="outlined"
size="small"
style={{
marginTop: 10,
- width: 'calc(200px)'
+ width: 200
}}
onKeyDown={() => setSearchVisible(!isSearchVisible)}
onClick={() => setSearchVisible(!isSearchVisible)}
diff --git a/app/components/LocationView.tsx b/app/components/LocationView.tsx
index af4439363..b861759eb 100644
--- a/app/components/LocationView.tsx
+++ b/app/components/LocationView.tsx
@@ -209,6 +209,41 @@ const LocationView = (props: Props) => {
}
};
+ let locationNameTitle = getLocationPath(location);
+ if (isCloudLocation && location.bucketName) {
+ if (location.endpointURL) {
+ locationNameTitle = location.endpointURL + ' - ' + location.bucketName;
+ } else if (location.region) {
+ locationNameTitle = location.region + ' - ' + location.bucketName;
+ }
+ }
+
+ const LocationTitle = (
+ <Tooltip title={locationNameTitle}>
+ <div
+ style={{
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ maxWidth: 240
+ }}
+ >
+ <Typography
+ variant="inherit"
+ style={{
+ paddingLeft: 5,
+ paddingRight: 5
+ }}
+ className={props.classes.header}
+ data-tid="locationTitleElement"
+ noWrap
+ >
+ {location.name}
+ </Typography>
+ </div>
+ </Tooltip>
+ );
+
return (
/* <div key={location.uuid}> */
<>
@@ -233,7 +268,6 @@ const LocationView = (props: Props) => {
? props.classes.listItemSelected
: props.classes.listItem
}
- title={getLocationPath(location)}
button
onClick={handleLocationClick}
onContextMenu={event => handleLocationContextMenuClick(event)}
@@ -249,42 +283,26 @@ const LocationView = (props: Props) => {
}}
onClick={handleLocationIconClick}
>
- {isCloudLocation ? (
- <CloudLocationIcon
- style={{
- cursor: 'pointer'
- }}
- className={props.classes.icon}
- />
- ) : (
- <LocationIcon
- style={{
- cursor: 'pointer'
- }}
- className={props.classes.icon}
- />
- )}
+ <Tooltip title={i18n.t('clickToExpand')} arrow placement="top">
+ {isCloudLocation ? (
+ <CloudLocationIcon
+ style={{
+ cursor: 'pointer'
+ }}
+ className={props.classes.icon}
+ />
+ ) : (
+ <LocationIcon
+ style={{
+ cursor: 'pointer'
+ }}
+ className={props.classes.icon}
+ />
+ )}
+ </Tooltip>
</ListItemIcon>
-
{isCloudLocation && !AppConfig.isElectron ? (
- <div
- style={{
- maxWidth: 250
- }}
- >
- <Typography
- variant="inherit"
- style={{
- paddingLeft: 5,
- paddingRight: 5
- }}
- className={props.classes.header}
- data-tid="locationTitleElement"
- noWrap
- >
- {location.name}
- </Typography>
- </div>
+ { LocationTitle }
) : (
<TargetMoveFileBox
accepts={[DragItemTypes.FILE]}
@@ -292,24 +310,7 @@ const LocationView = (props: Props) => {
path={getLocationPath(location)}
location={location}
>
- <div
- style={{
- maxWidth: 250
- }}
- >
- <Typography
- variant="inherit"
- style={{
- paddingLeft: 5,
- paddingRight: 5
- }}
- className={props.classes.header}
- data-tid="locationTitleElement"
- noWrap
- >
- {location.name}
- </Typography>
- </div>
+ {LocationTitle}
</TargetMoveFileBox>
)}
<ListItemSecondaryAction>
diff --git a/app/locales/en/core.json b/app/locales/en/core.json
index 9abec6b07..c1293b913 100644
--- a/app/locales/en/core.json
+++ b/app/locales/en/core.json
@@ -639,5 +639,6 @@
"currentLocation": "Current Location",
"navigateTo": "Navigate to",
"searchScope": "Search Scope",
+ "clickToExpand": "Click to load sub folders",
"-": "-"
}