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',
|
||||
width: 130,
|
||||
render: (ids: Record<string, number> | null) => {
|
||||
if (!ids) return null;
|
||||
const entries = Object.entries(ids);
|
||||
if (!ids || typeof ids !== 'object') return null;
|
||||
const entries = Object.entries(ids).filter(([, v]) => v != null);
|
||||
if (entries.length === 0) return null;
|
||||
|
||||
const paperlessUrl = getEnv('PAPERLESS_URL');
|
||||
return (
|
||||
<Space size={[0, 4]} wrap>
|
||||
{entries.map(([, id]) => {
|
||||
const paperlessUrl = getEnv('PAPERLESS_URL');
|
||||
return (
|
||||
{entries.map(([rangeKey, id]) =>
|
||||
paperlessUrl ? (
|
||||
<a
|
||||
key={id}
|
||||
href={paperlessUrl ? `${paperlessUrl}/documents/${id}` : undefined}
|
||||
key={rangeKey}
|
||||
href={`${paperlessUrl}/documents/${id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
@@ -123,8 +123,10 @@ export default function MailDetailPage() {
|
||||
{id}
|
||||
</Tag>
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
) : (
|
||||
<Tag color="blue" key={rangeKey}>{id}</Tag>
|
||||
)
|
||||
)}
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
@@ -151,13 +153,14 @@ export default function MailDetailPage() {
|
||||
cancelText="Nein"
|
||||
placement="bottomRight"
|
||||
>
|
||||
<Button danger icon={<CloseCircleOutlined />}>
|
||||
<Button danger icon={<CloseCircleOutlined />} disabled={email.Status === 1}>
|
||||
Als ignoriert markieren
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<FileTextOutlined />}
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<FileTextOutlined />}
|
||||
disabled={email.Status === 1}
|
||||
onClick={async () => {
|
||||
if (!email) return;
|
||||
const hide = message.loading('Prüfe Vorschaubilder...', 0);
|
||||
|
||||
Reference in New Issue
Block a user