fix: improve mail document ID rendering and disable actions for ignored emails
Build and Push Multi-Platform Images / build-and-push (push) Successful in 18s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 18s
This commit is contained in:
@@ -102,18 +102,18 @@ export default function MailDetailPage() {
|
|||||||
key: 'PaperlessDocumentIds',
|
key: 'PaperlessDocumentIds',
|
||||||
width: 130,
|
width: 130,
|
||||||
render: (ids: Record<string, number> | null) => {
|
render: (ids: Record<string, number> | null) => {
|
||||||
if (!ids) return null;
|
if (!ids || typeof ids !== 'object') return null;
|
||||||
const entries = Object.entries(ids);
|
const entries = Object.entries(ids).filter(([, v]) => v != null);
|
||||||
if (entries.length === 0) return null;
|
if (entries.length === 0) return null;
|
||||||
|
|
||||||
|
const paperlessUrl = getEnv('PAPERLESS_URL');
|
||||||
return (
|
return (
|
||||||
<Space size={[0, 4]} wrap>
|
<Space size={[0, 4]} wrap>
|
||||||
{entries.map(([, id]) => {
|
{entries.map(([rangeKey, id]) =>
|
||||||
const paperlessUrl = getEnv('PAPERLESS_URL');
|
paperlessUrl ? (
|
||||||
return (
|
|
||||||
<a
|
<a
|
||||||
key={id}
|
key={rangeKey}
|
||||||
href={paperlessUrl ? `${paperlessUrl}/documents/${id}` : undefined}
|
href={`${paperlessUrl}/documents/${id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
@@ -123,8 +123,10 @@ export default function MailDetailPage() {
|
|||||||
{id}
|
{id}
|
||||||
</Tag>
|
</Tag>
|
||||||
</a>
|
</a>
|
||||||
);
|
) : (
|
||||||
})}
|
<Tag color="blue" key={rangeKey}>{id}</Tag>
|
||||||
|
)
|
||||||
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -151,13 +153,14 @@ export default function MailDetailPage() {
|
|||||||
cancelText="Nein"
|
cancelText="Nein"
|
||||||
placement="bottomRight"
|
placement="bottomRight"
|
||||||
>
|
>
|
||||||
<Button danger icon={<CloseCircleOutlined />}>
|
<Button danger icon={<CloseCircleOutlined />} disabled={email.Status === 1}>
|
||||||
Als ignoriert markieren
|
Als ignoriert markieren
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon={<FileTextOutlined />}
|
icon={<FileTextOutlined />}
|
||||||
|
disabled={email.Status === 1}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (!email) return;
|
if (!email) return;
|
||||||
const hide = message.loading('Prüfe Vorschaubilder...', 0);
|
const hide = message.loading('Prüfe Vorschaubilder...', 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user