Skip to content

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

feat: added entry id to the entry properties

Ilian Sapundshievdc891098b67d
diff --git a/src/renderer/components/CommonIcons.tsx b/src/renderer/components/CommonIcons.tsx
index 524773274..231212c5c 100644
--- a/src/renderer/components/CommonIcons.tsx
+++ b/src/renderer/components/CommonIcons.tsx
@@ -137,3 +137,5 @@ export { default as SaveIcon } from '@mui/icons-material/Save';
export { default as DownloadIcon } from '@mui/icons-material/DownloadForOffline';
export { default as TagIcon } from '@mui/icons-material/LocalOffer';
+
+export { default as IDIcon } from '@mui/icons-material/Abc';
diff --git a/src/renderer/components/EntryProperties.tsx b/src/renderer/components/EntryProperties.tsx
index 8876b5e0d..7ea484ccb 100644
--- a/src/renderer/components/EntryProperties.tsx
+++ b/src/renderer/components/EntryProperties.tsx
@@ -46,13 +46,14 @@ import {
LinkIcon,
LocalLocationIcon,
CloudLocationIcon,
+ IDIcon,
} from '-/components/CommonIcons';
+import InfoIcon from '-/components/InfoIcon';
import QRCodeIcon from '@mui/icons-material/QrCode';
import ColorPaletteIcon from '@mui/icons-material/ColorLens';
import SetBackgroundIcon from '@mui/icons-material/OpacityOutlined';
import ClearBackgroundIcon from '@mui/icons-material/FormatColorResetOutlined';
import RefreshIcon from '@mui/icons-material/Refresh';
-import InfoIcon from '-/components/InfoIcon';
import {
AttributionControl,
MapContainer,
@@ -1122,6 +1123,63 @@ function EntryProperties(props: Props) {
)}
</Grid>
</Grid>
+ <Grid
+ container
+ item
+ xs={12}
+ spacing={1}
+ alignItems="center"
+ justifyContent="center"
+ >
+ <Grid item xs={12}>
+ <TextField
+ data-tid="entryIDTID"
+ margin="dense"
+ name="path"
+ label={
+ <>
+ {t('core:entryId')}
+ <InfoIcon tooltip={t('core:entryIdTooltip')} />
+ </>
+ }
+ fullWidth={true}
+ value={openedEntry?.meta?.id}
+ InputProps={{
+ readOnly: true,
+ startAdornment: (
+ <InputAdornment position="start">
+ <IDIcon style={{ color: theme.palette.text.secondary }} />
+ </InputAdornment>
+ ),
+ endAdornment: (
+ <InputAdornment position="end">
+ <Tooltip title={t('core:copyIdToClipboard')}>
+ <Button
+ data-tid="copyIdToClipboardTID"
+ color="primary"
+ disabled={!openedEntry?.meta?.id}
+ onClick={() => {
+ const entryId = openedEntry?.meta?.id;
+ if (entryId) {
+ const clibboardItem = generateClipboardLink(
+ entryId,
+ entryId,
+ );
+ const promise =
+ navigator.clipboard.write(clibboardItem);
+ showNotification(t('core:entryIdCopied'));
+ }
+ }}
+ >
+ {t('core:copy')}
+ </Button>
+ </Tooltip>
+ </InputAdornment>
+ ),
+ }}
+ />
+ </Grid>
+ </Grid>
{isConfirmResetColorDialogOpened && (
<ConfirmDialog
open={isConfirmResetColorDialogOpened}
diff --git a/src/renderer/locales/en/core.json b/src/renderer/locales/en/core.json
index a158634a2..916d6ebf0 100644
--- a/src/renderer/locales/en/core.json
+++ b/src/renderer/locales/en/core.json
@@ -826,5 +826,9 @@
"filenameTagPlacedAtEnd": "Filename End",
"fileNameBeginTagPlaceExplanation": "Tags will be placed at the beginning of the filename, like this '[tag1 tag2] filename.ext'",
"fileNameEndTagPlaceExplanation": "Tags will be placed at end of the filename, like this 'filename [tag1 tag2].ext'",
+ "entryId": "Entry ID",
+ "copyIdToClipboard": "Copy entry ID to the clipboard",
+ "entryIdCopied": "Entry ID copied",
+ "entryIdTooltip": "Entry ID is used for sharing links",
"-": "-"
}