From 6e0b72b34bb66a12d56372a4c6f5ace54e902265 Mon Sep 17 00:00:00 2001 From: seb Date: Thu, 15 Oct 2026 00:42:46 +0200 Subject: [PATCH] u --- src/api/shipment.js | 6 ++ src/components/manifest/Attachment.jsx | 6 ++ src/components/manifest/QuoteList.jsx | 76 ++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) diff --git a/src/api/shipment.js b/src/api/shipment.js index 3ff56cf..c038eda 100644 --- a/src/api/shipment.js +++ b/src/api/shipment.js @@ -28,4 +28,10 @@ export const shipment = { return http(`/api/shipment/${id}`, { method: 'DELETE' }); }, // #endregion + + // #region DELETE /api/shipment/:id/file/:fileId — deleteFile + deleteFile(id, fileId) { + return http(`/api/shipment/${id}/file/${fileId}`, { method: 'DELETE' }); + }, + // #endregion }; diff --git a/src/components/manifest/Attachment.jsx b/src/components/manifest/Attachment.jsx index 38ea0f8..b40879c 100644 --- a/src/components/manifest/Attachment.jsx +++ b/src/components/manifest/Attachment.jsx @@ -8,6 +8,7 @@ import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdf'; import SyncIcon from '@mui/icons-material/Sync'; import DeleteOutlineOutlinedIcon from '@mui/icons-material/DeleteOutlineOutlined'; import { tileBaseSx, TILE_SIZE } from 'dashgui/tiles'; +import SkeleHashImage from '../settings/SkeleHashImage'; import { generateTextThumbnail } from '../../utils/textThumbnail'; import { notifyErrorMessage } from '../../utils/notify'; import { @@ -164,6 +165,11 @@ export class Attachment extends PureComponent { display: 'block', }} /> + ) : attachment?.skeledash ? ( + ) : isText ? ( + + + @@ -112,9 +117,79 @@ class QuoteRow extends PureComponent { const gross = quote.grossTotal != null ? Number(quote.grossTotal) : quoteGrossTotal(quote.lines); const customer = quote.customerName || this.partyName(quote.entityId); const quantityInfo = quote.totalQuantity != null ? ` · ${quote.totalQuantity} Stück` : ''; + const files = Array.isArray(quote.files) ? quote.files : []; return ( onOpen?.(quote)}> + {/* Document SkeleHash / PDF Previews (one small icon per file) */} + + {files.map((file, index) => { + const fileId = file.fileId ?? file.id; + const title = file.name ? `${file.name} (Öffnen)` : 'Datei öffnen'; + return ( + + { + e.stopPropagation(); + if (quote.id != null && fileId != null) { + window.open(`/api/quote/${encodeURIComponent(quote.id)}/file/${encodeURIComponent(fileId)}`, '_blank'); + } else { + onOpen?.(quote); + } + }} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.stopPropagation(); + e.preventDefault(); + if (quote.id != null && fileId != null) { + window.open(`/api/quote/${encodeURIComponent(quote.id)}/file/${encodeURIComponent(fileId)}`, '_blank'); + } + } + }} + sx={{ + width: 18, + height: 24, + flexShrink: 0, + borderRadius: 0.5, + overflow: 'hidden', + bgcolor: 'background.paper', + border: '1px solid', + borderColor: 'divider', + boxShadow: '0 1px 2px rgba(0,0,0,0.08)', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + cursor: 'pointer', + transition: 'transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease', + '&:hover': { + boxShadow: '0 2px 6px rgba(0,0,0,0.22)', + borderColor: 'primary.main', + transform: 'scale(1.2)', + zIndex: 2, + }, + }} + > + {file.skeledash ? ( + + ) : ( + + )} + + + ); + })} + + {quote.number} @@ -515,6 +590,7 @@ export class QuoteList extends PureComponent { userSelect: 'none', }} > + Nr. / Ref. Datum Kunde