Show feedback attachment once
Deploy EG-BIM QA Gateway / deploy (push) Successful in 46s

This commit is contained in:
root committed 2026-10-23 17:06:06 +09:00
1 parent 61fd4edf97
commit aa2a52bf14
2 files changed
+5 -9

No files matched your search

-2
View File
@@ -276,8 +276,6 @@ button { cursor: pointer; }
.attachments h3 { margin: 0 0 8px; font-size: 14px; }
.attachment-item { padding: 7px 0; color: #555; font-size: 13px; }
.attachments a { color: var(--navy); text-decoration: underline; }
.detail-attachment-preview-link { display: block; width: fit-content; margin-bottom: 8px; }
.detail-attachment-preview { display: block; max-width: min(100%, 420px); max-height: 320px; border: 1px solid var(--line); border-radius: 4px; object-fit: contain; }
.completion-notice[hidden], .completion-done-notice[hidden] { display: none; }
.completion-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 22px 0; padding: 15px 17px; border: 1px solid #f0c45c; background: #fff9e8; color: #5b4500; }
.completion-notice strong { display: block; margin-bottom: 4px; }
+5 -7
View File
@@ -35,13 +35,13 @@
let name = item.original_file_name || item.originalFileName || item.file_name || item.fileName || item.name || '';
if (!name && safeUrl) {
try {
name = decodeURIComponent(new URL(safeUrl, window.location.origin).pathname.split('/').pop() || '');
const objectName = decodeURIComponent(new URL(safeUrl, window.location.origin).pathname.split('/').pop() || '');
const parts = objectName.split('_');
name = parts.length > 2 ? parts.slice(2).join('_') : objectName;
} catch (error) {}
}
name = name || '첨부파일';
const mimeType = item.content_type || item.contentType || item.mime_type || item.mimeType || '';
const isImage = /^image\//i.test(String(mimeType)) || /\.(avif|gif|jpe?g|png|webp|bmp|svg)(?:$|[?#])/i.test(name) || /\.(avif|gif|jpe?g|png|webp|bmp|svg)(?:$|[?#])/i.test(safeUrl);
return { name: name, url: safeUrl, isImage: isImage };
return { name: name, url: safeUrl };
}
function readJson(key, fallback) {
@@ -596,9 +596,7 @@
if (attachmentBox) attachmentBox.innerHTML = attachments.length ? attachments.map(function (attachment) {
const file = normalizeFeedbackAttachment(attachment);
if (!file.url) return '<div class="attachment-item">📎 ' + escapeHtml(file.name) + '</div>';
const link = '<a href="' + escapeHtml(file.url) + '" target="_blank" rel="noopener noreferrer">📎 ' + escapeHtml(file.name) + '</a>';
const preview = file.isImage ? '<a class="detail-attachment-preview-link" href="' + escapeHtml(file.url) + '" target="_blank" rel="noopener noreferrer"><img class="detail-attachment-preview" src="' + escapeHtml(file.url) + '" alt="' + escapeHtml(file.name) + '" loading="lazy"></a>' : '';
return '<div class="attachment-item">' + preview + link + '</div>';
return '<div class="attachment-item"><a href="' + escapeHtml(file.url) + '" target="_blank" rel="noopener noreferrer">📎 ' + escapeHtml(file.name) + '</a></div>';
}).join('') : '<span class="help-text">첨부된 파일이 없습니다.</span>';
const editButton = qs('#editButton');
const deleteButton = qs('#deleteButton');