From 4485d1673d41f8f66090e87ad17df12e9e81e89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20P=C3=B6ttker?= Date: Sun, 10 May 2026 06:52:26 +0200 Subject: [PATCH] refactor: simplify MailImportWizard success view and adjust InboxDetailPage dropdown styling --- .../src/components/MailImportWizard.tsx | 68 +++++++++---------- .../src/pages/InboxDetailPage.tsx | 2 +- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/paperless-frontend/src/components/MailImportWizard.tsx b/paperless-frontend/src/components/MailImportWizard.tsx index 55921d1..d44dac8 100644 --- a/paperless-frontend/src/components/MailImportWizard.tsx +++ b/paperless-frontend/src/components/MailImportWizard.tsx @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react'; import { Modal, Steps, Button, Table, Radio, Select, Input, DatePicker, - Space, Row, Col, Typography, message, Spin, Result, Alert, Tag + Space, Row, Col, Typography, message, Spin, Alert, Tag } from 'antd'; import type { ColumnsType } from 'antd/es/table'; import { emailImportApi, type AttachmentImportData } from '../api/email-import'; @@ -637,49 +637,25 @@ export default function MailImportWizard({ visible, onClose, email, attachments }; // --- Step 3: Abschluss Render --- - const renderStep3 = () => { - if (importSuccess) { - return ( - - Schließen - , - ...importData.filter(i => i.type !== 'IGNORE').map(item => ( - - )) - ]} - /> - ); - } - - // Summary view before import + const renderDocumentList = (showPrint: boolean) => { const mainDocs = importData.filter(i => i.type === 'MAIN'); const attachmentsToImport = importData.filter(i => i.type === 'ATTACHMENT'); - return ( -
+ <> {mainDocs.length === 0 && ( )} - {mainDocs.map(main => { const mainAttachments = attachmentsToImport.filter(a => a.parentVirtualId === main.virtualId); const num = belegnummern[main.virtualId] || '000000'; const yr = barcodes[main.virtualId]?.jahr || dayjs(email.Date).format('YYYY'); const datum = eingangsdaten[main.virtualId]; const belegnr = `${yr}-${String(num).padStart(6, '0')}`; - return (
{main.fileName} - + Eingangsdatum: {datum?.format('DD.MM.YYYY') ?? '—'} @@ -701,16 +677,17 @@ export default function MailImportWizard({ visible, onClose, email, attachments
)} - - - + {showPrint && ( + + + + )}
); })} - {attachmentsToImport.filter(a => !mainDocs.find(m => m.virtualId === a.parentVirtualId)).map(orphan => (
))} - + ); }; + const renderStep3 = () => { + if (importSuccess) { + return ( +
+ + {renderDocumentList(true)} +
+ ); + } + return renderDocumentList(false); + }; + return ( Schließen + ) : ( {currentStep > 0 && } {currentStep < 2 && } diff --git a/paperless-frontend/src/pages/InboxDetailPage.tsx b/paperless-frontend/src/pages/InboxDetailPage.tsx index e6be406..48ef39c 100644 --- a/paperless-frontend/src/pages/InboxDetailPage.tsx +++ b/paperless-frontend/src/pages/InboxDetailPage.tsx @@ -1119,7 +1119,7 @@ export default function InboxDetailPage() { } onClick={() => { if (canProcess) setWizardOpen(true); }}