From e4f765fcfddaa88ba11527b1905be8b34727cfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20P=C3=B6ttker?= Date: Sat, 9 May 2026 12:15:54 +0200 Subject: [PATCH] refactor: redesign summary view in MailImportWizard to improve readability and document information layout --- .../src/components/MailImportWizard.tsx | 102 +++++++++--------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/paperless-frontend/src/components/MailImportWizard.tsx b/paperless-frontend/src/components/MailImportWizard.tsx index 6ed2f98..55921d1 100644 --- a/paperless-frontend/src/components/MailImportWizard.tsx +++ b/paperless-frontend/src/components/MailImportWizard.tsx @@ -1,20 +1,19 @@ import { useState, useEffect } from 'react'; -import { +import { Modal, Steps, Button, Table, Radio, Select, Input, DatePicker, - Space, Row, Col, Typography, message, Spin, Result, Alert, Card, Tag + Space, Row, Col, Typography, message, Spin, Result, Alert, Tag } from 'antd'; import type { ColumnsType } from 'antd/es/table'; import { emailImportApi, type AttachmentImportData } from '../api/email-import'; import { paperlessApi, type PaperlessCorrespondent } from '../api/paperless'; import dayjs from 'dayjs'; -import { - PrinterOutlined, FileTextOutlined, PaperClipOutlined, ArrowRightOutlined, - WarningOutlined +import { + PrinterOutlined, PaperClipOutlined, ArrowRightOutlined, WarningOutlined } from '@ant-design/icons'; import PdfSplitViewer from './PdfSplitViewer'; import BarcodePositioner from './BarcodePositioner'; -const { Text, Title } = Typography; +const { Text } = Typography; interface MailImportWizardProps { visible: boolean; @@ -664,66 +663,61 @@ export default function MailImportWizard({ visible, onClose, email, attachments const attachmentsToImport = importData.filter(i => i.type === 'ATTACHMENT'); return ( -
- Zusammenfassung des Imports - - Bitte überprüfe die folgende Struktur. Mit Klick auf "Import Ausführen" werden die Belegnummern reserviert und die Dokumente hochgeladen. - - - {mainDocs.length === 0 && } +
+ {mainDocs.length === 0 && ( + + )} {mainDocs.map(main => { const mainAttachments = attachmentsToImport.filter(a => a.parentVirtualId === main.virtualId); - const mode = belegnummerMode[main.virtualId] || 'neu'; const num = belegnummern[main.virtualId] || '000000'; const yr = barcodes[main.virtualId]?.jahr || dayjs(email.Date).format('YYYY'); - - return ( -
- - - - - -
- {main.fileName} -
- Hauptdokument -
-
- - - - {mode === 'neu' ? `Belegnr.: ${yr}-${num}` : `Belegnr.: ${yr}-${num}`} - - -
+ const datum = eingangsdaten[main.virtualId]; + const belegnr = `${yr}-${String(num).padStart(6, '0')}`; - {mainAttachments.length > 0 && ( -
- {mainAttachments.map(att => ( -
- - - {att.fileName} - Anlage -
- ))} -
- )} -
+ return ( +
+ {main.fileName} + + + + + Eingangsdatum: {datum?.format('DD.MM.YYYY') ?? '—'} + + + Belegnummer: {belegnr} + + + {mainAttachments.length > 0 && ( +
+ {mainAttachments.map(att => ( +
+ + + {att.fileName} + Anlage +
+ ))} +
+ )} + + + + +
); })} - {/* Orphans (Attachments without parent or parents ignored) */} {attachmentsToImport.filter(a => !mainDocs.find(m => m.virtualId === a.parentVirtualId)).map(orphan => (
- +
))}