Skip to content

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

minor changes (#1973)

Stanimir8e573f0d3203
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index c16fb6c22..43c5bd05b 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -126,7 +126,13 @@ const classes = {
fileBadge: `${PREFIX}-fileBadge`
};
-const Root = styled('div')(({ theme }) => ({
+const Root = styled(Box)(({ theme }) => ({
+ width: '100%',
+ flexDirection: 'column',
+ flex: '1 1 100%',
+ display: 'flex',
+ backgroundColor: theme.palette.background.default,
+ height: '100%', // filePropsHeight ||
[`& .${classes.toolbar2}`]: {
width: '100%',
paddingLeft: 0,
@@ -1324,211 +1330,200 @@ function EntryContainer(props: Props) {
const toolbarButtons = () => {
if (openedFile.path !== undefined) {
return (
- <Root>
+ <>
<Box
style={{
- width: '100%',
- flexDirection: 'column',
- flex: '1 1 100%',
+ paddingLeft: 0,
+ paddingRight: 50,
+ paddingTop: 0,
+ minHeight: 50,
display: 'flex',
- backgroundColor: theme.palette.background.default,
- height: '100%' // filePropsHeight ||
+ flexDirection: 'row',
+ justifyContent: 'flex-start'
}}
>
<Box
+ className={classes.flexLeft}
style={{
- paddingLeft: 0,
- paddingRight: 50,
- paddingTop: 0,
- minHeight: 50,
+ paddingLeft: 10,
display: 'flex',
- flexDirection: 'row',
- justifyContent: 'flex-start'
+ alignItems: 'center',
+ paddingRight: editingSupported ? 85 : 5
}}
>
- <Box
- className={classes.flexLeft}
- style={{
- paddingLeft: 10,
- display: 'flex',
- alignItems: 'center',
- paddingRight: editingSupported ? 85 : 5
- }}
- >
- <Tooltip title={fileName}>
- <Box
- data-tid={'OpenedTID' + dataTidFormat(fileName)}
- style={{
- color: theme.palette.text.primary,
- display: 'inline',
- fontSize: 17,
- maxHeight: 40,
- overflowY: 'auto'
- }}
- >
- {fileTitle}
- </Box>
- </Tooltip>
- {openedFile.isFile ? (
- <>
- {fileChanged.current ? (
- <Tooltip title={i18n.t('core:fileChanged')}>
- <span
- style={{
- color: theme.palette.text.primary,
- margin: 3
- }}
- >
- {String.fromCharCode(0x25cf)}
- </span>
- </Tooltip>
- ) : (
- ''
- )}
- <span
- className={classes.fileBadge}
- style={{
- backgroundColor: openedFile.color,
- textTransform: 'uppercase'
- }}
- >
- {'.' +
- extractFileExtension(
- openedFile.path,
- PlatformIO.getDirSeparator()
- )}
- </span>
- </>
- ) : (
+ <Tooltip title={fileName}>
+ <Box
+ data-tid={'OpenedTID' + dataTidFormat(fileName)}
+ style={{
+ color: theme.palette.text.primary,
+ display: 'inline',
+ fontSize: 17,
+ maxHeight: 40,
+ overflowY: 'auto'
+ }}
+ >
+ {fileTitle}
+ </Box>
+ </Tooltip>
+ {openedFile.isFile ? (
+ <>
+ {fileChanged.current ? (
+ <Tooltip title={i18n.t('core:fileChanged')}>
+ <span
+ style={{
+ color: theme.palette.text.primary,
+ margin: 3
+ }}
+ >
+ {String.fromCharCode(0x25cf)}
+ </span>
+ </Tooltip>
+ ) : (
+ ''
+ )}
<span
className={classes.fileBadge}
- title={i18n.t('core:toggleEntryProperties')}
style={{
- backgroundColor: AppConfig.defaultFolderColor
+ backgroundColor: openedFile.color,
+ textTransform: 'uppercase'
}}
>
- {i18n.t('core:folder')}
+ {'.' +
+ extractFileExtension(
+ openedFile.path,
+ PlatformIO.getDirSeparator()
+ )}
</span>
- )}
- <ProTooltip tooltip={i18n.t('core:toggleBookmark')}>
- <IconButton
- data-tid="toggleBookmarkTID"
- aria-label="bookmark"
- size="small"
- onClick={bookmarkClick}
- >
- {haveBookmark ? (
- <BookmarkIcon
- style={{
- color: theme.palette.primary.main
- }}
- />
- ) : (
- <BookmarkAddIcon
- style={{
- color: theme.palette.text.secondary
- }}
- />
- )}
- </IconButton>
- </ProTooltip>
- <TagsPreview tags={openedFile.tags} />
- </Box>
- <div
- style={{
- zIndex: 1,
- position: 'absolute',
- right: 0,
- backgroundColor: theme.palette.background.default,
- display: 'flex',
- alignItems: 'center'
- }}
- >
- {isEditable && props.revisionsEnabled && (
+ </>
+ ) : (
+ <span
+ className={classes.fileBadge}
+ title={i18n.t('core:toggleEntryProperties')}
+ style={{
+ backgroundColor: AppConfig.defaultFolderColor
+ }}
+ >
+ {i18n.t('core:folder')}
+ </span>
+ )}
+ <ProTooltip tooltip={i18n.t('core:toggleBookmark')}>
+ <IconButton
+ data-tid="toggleBookmarkTID"
+ aria-label="bookmark"
+ size="small"
+ onClick={bookmarkClick}
+ >
+ {haveBookmark ? (
+ <BookmarkIcon
+ style={{
+ color: theme.palette.primary.main
+ }}
+ />
+ ) : (
+ <BookmarkAddIcon
+ style={{
+ color: theme.palette.text.secondary
+ }}
+ />
+ )}
+ </IconButton>
+ </ProTooltip>
+ <TagsPreview tags={openedFile.tags} />
+ </Box>
+ <div
+ style={{
+ zIndex: 1,
+ position: 'absolute',
+ right: 0,
+ backgroundColor: theme.palette.background.default,
+ display: 'flex',
+ alignItems: 'center'
+ }}
+ >
+ {isEditable && props.revisionsEnabled && (
+ <Tooltip
+ title={
+ i18n.t('core:autosave') +
+ (!Pro
+ ? ' - ' +
+ i18n.t('core:thisFunctionalityIsAvailableInPro')
+ : '')
+ }
+ >
+ <Switch
+ data-tid="autoSaveTID"
+ checked={
+ openedFile.isAutoSaveEnabled !== undefined &&
+ openedFile.isAutoSaveEnabled
+ }
+ onChange={toggleAutoSave}
+ name="autoSave"
+ color="primary"
+ />
+ </Tooltip>
+ )}
+
+ {editingSupported && openedFile.editMode && (
+ <ButtonGroup>
+ <Tooltip title={i18n.t('core:cancelEditing')}>
+ <Button
+ onClick={reloadDocument}
+ aria-label={i18n.t('core:cancelEditing')}
+ size="small"
+ variant="outlined"
+ color="primary"
+ startIcon={isDesktopMode && <CancelIcon />}
+ >
+ {fileChanged.current
+ ? i18n.t('core:cancel')
+ : i18n.t('core:closeButton')}
+ </Button>
+ </Tooltip>
<Tooltip
title={
- i18n.t('core:autosave') +
- (!Pro
- ? ' - ' +
- i18n.t('core:thisFunctionalityIsAvailableInPro')
- : '')
+ i18n.t('core:saveFile') +
+ ' (' +
+ (AppConfig.isMaclike ? '⌘' : 'CTRL') +
+ ' + S)'
}
>
- <Switch
- data-tid="autoSaveTID"
- checked={
- openedFile.isAutoSaveEnabled !== undefined &&
- openedFile.isAutoSaveEnabled
- }
- onChange={toggleAutoSave}
- name="autoSave"
- color="primary"
- />
- </Tooltip>
- )}
-
- {editingSupported && openedFile.editMode && (
- <ButtonGroup>
- <Tooltip title={i18n.t('core:cancelEditing')}>
- <Button
- onClick={reloadDocument}
- aria-label={i18n.t('core:cancelEditing')}
- size="small"
- variant="outlined"
- color="primary"
- startIcon={isDesktopMode && <CancelIcon />}
- >
- {fileChanged.current
- ? i18n.t('core:cancel')
- : i18n.t('core:closeButton')}
- </Button>
- </Tooltip>
- <Tooltip
- title={
- i18n.t('core:saveFile') +
- ' (' +
- (AppConfig.isMaclike ? '⌘' : 'CTRL') +
- ' + S)'
- }
- >
- <LoadingButton
- disabled={false}
- onClick={startSavingFile}
- aria-label={i18n.t('core:saveFile')}
- data-tid="fileContainerSaveFile"
- size="small"
- variant="outlined"
- color="primary"
- startIcon={isDesktopMode && <SaveIcon />}
- loading={isSavingInProgress}
- >
- {i18n.t('core:save')}
- </LoadingButton>
- </Tooltip>
- </ButtonGroup>
- )}
- {editingSupported && !openedFile.editMode && (
- <Tooltip title={i18n.t('core:editFile')}>
- <Button
+ <LoadingButton
disabled={false}
+ onClick={startSavingFile}
+ aria-label={i18n.t('core:saveFile')}
+ data-tid="fileContainerSaveFile"
size="small"
variant="outlined"
color="primary"
- onClick={editFile}
- aria-label={i18n.t('core:editFile')}
- data-tid="fileContainerEditFile"
- startIcon={<EditIcon />}
+ startIcon={isDesktopMode && <SaveIcon />}
+ loading={isSavingInProgress}
>
- {i18n.t('core:edit')}
- </Button>
+ {i18n.t('core:save')}
+ </LoadingButton>
</Tooltip>
- )}
- {closeButton}
- </div>
- </Box>
- {entryProperties}
+ </ButtonGroup>
+ )}
+ {editingSupported && !openedFile.editMode && (
+ <Tooltip title={i18n.t('core:editFile')}>
+ <Button
+ disabled={false}
+ size="small"
+ variant="outlined"
+ color="primary"
+ onClick={editFile}
+ aria-label={i18n.t('core:editFile')}
+ data-tid="fileContainerEditFile"
+ startIcon={<EditIcon />}
+ >
+ {i18n.t('core:edit')}
+ </Button>
+ </Tooltip>
+ )}
+ {closeButton}
+ </div>
</Box>
- </Root>
+ {entryProperties}
+ </>
);
}
return <div>{i18n.t('core:noEntrySelected')}</div>;
@@ -1588,7 +1583,7 @@ function EntryContainer(props: Props) {
percent={percent.current}
setPercent={setPercent}
>
- {toolbarButtons()}
+ <Root>{toolbarButtons()}</Root>
<FileView
key="FileViewID"
openedFile={openedFiles[0]}
@@ -1720,9 +1715,11 @@ function EntryContainer(props: Props) {
saveAs={saveAs}
override={override}
/>
- {/* eslint-disable-next-line jsx-a11y/anchor-has-content,jsx-a11y/anchor-is-valid */}
- <a href="#" id="downloadFile" />
- {renderPanels()}
+ <div style={{ height: 'calc(100% - 47px)' }}>
+ {/* eslint-disable-next-line jsx-a11y/anchor-has-content,jsx-a11y/anchor-is-valid */}
+ <a href="#" id="downloadFile" />
+ {renderPanels()}
+ </div>
</GlobalHotKeys>
);
}
diff --git a/app/components/EntryProperties.tsx b/app/components/EntryProperties.tsx
index 4c4ceabc2..bbdff3815 100644
--- a/app/components/EntryProperties.tsx
+++ b/app/components/EntryProperties.tsx
@@ -1395,7 +1395,7 @@ function EntryProperties(props: Props) {
</Grid>
)}
</Grid>
- <Grid container item xs={12} style={{ height: 150 }}></Grid>
+ <Grid container item xs={12} style={{ height: 150 }}/>
</Grid>
{isConfirmResetColorDialogOpened && (
<ConfirmDialog
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index 76cd4566e..518e6c7ac 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -81,6 +81,7 @@ const classes = {
};
const Root = styled('div')(({ theme }) => ({
+ position: 'relative',
[`& .${classes.button}`]: {
position: 'relative',
padding: '8px 12px 6px 8px',
@@ -506,7 +507,7 @@ function FolderContainer(props: Props) {
: '';
// keyBindings['openSearch'].toUpperCase()
return (
- <Root data-tid="folderContainerTID" style={{ position: 'relative' }}>
+ <Root data-tid="folderContainerTID">
<div
style={{
flex: '1 1 100%',
diff --git a/app/components/PathBreadcrumbs.tsx b/app/components/PathBreadcrumbs.tsx
index 37bac74fc..ad88c252a 100644
--- a/app/components/PathBreadcrumbs.tsx
+++ b/app/components/PathBreadcrumbs.tsx
@@ -41,7 +41,7 @@ const StyledBreadcrumb = styled(Chip)(({ theme }) => {
: theme.palette.grey[800];
return {
backgroundColor,
- height: theme.spacing(3),
+ height: theme.spacing(4),
color: theme.palette.text.primary,
fontWeight: theme.typography.fontWeightRegular,
'&:hover, &:focus': {
diff --git a/app/containers/MainPage.tsx b/app/containers/MainPage.tsx
index e6b57a655..81377bde1 100644
--- a/app/containers/MainPage.tsx
+++ b/app/containers/MainPage.tsx
@@ -113,6 +113,7 @@ const classes = {
};
const Root = styled('div')(({ theme }) => ({
+ height: '100%',
[`& .${classes.content}`]: {
height: '100%',
flexGrow: 1,
@@ -683,11 +684,7 @@ function MainPage(props: Props) {
return (
<Root>
- <HotKeys
- handlers={keyBindingHandlers}
- keyMap={keyMap}
- style={{ height: '100%' }}
- >
+ <HotKeys handlers={keyBindingHandlers} keyMap={keyMap}>
<MoveOrCopyFilesDialog
open={moveCopyDialogOpened !== undefined}
onClose={() => {
@@ -800,8 +797,8 @@ function MainPage(props: Props) {
/>
)}
<NewEntryDialog
- open={props.isNewEntryDialogOpened}
- onClose={toggleNewEntryDialog}
+ open={props.isNewEntryDialogOpened}
+ onClose={toggleNewEntryDialog}
/>
{props.isNewFileDialogOpened && (
<NewFileDialog