From 9a1c7df65d5f47513a08a8bab81c53f8b03efdfd Mon Sep 17 00:00:00 2001 From: curo1305 Date: Tue, 16 Jun 2026 10:18:00 +0200 Subject: [PATCH] fix(10): resolve WR-03/WR-04 code review warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WR-04: AdminAuditView.vue had a local formatTimestamp() duplicating shared util logic — moved to utils/formatters.js and imported from there per CLAUDE.md shared-module rule. WR-03: Remove unused onUnmounted import from FileManagerView.vue. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/utils/formatters.js | 10 ++++++++++ frontend/src/views/FileManagerView.vue | 2 +- frontend/src/views/admin/AdminAuditView.vue | 9 +-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/src/utils/formatters.js b/frontend/src/utils/formatters.js index 8ff46e0..cc0135c 100644 --- a/frontend/src/utils/formatters.js +++ b/frontend/src/utils/formatters.js @@ -18,6 +18,16 @@ export function formatSize(bytes) { return (bytes / 1048576).toFixed(1) + ' MB' } +/** Formats an ISO timestamp for audit log display: YYYY-MM-DD HH:MM:SS */ +export function formatTimestamp(iso) { + if (!iso) return '—' + try { + return new Date(iso).toISOString().replace('T', ' ').slice(0, 19) + } catch { + return iso + } +} + /** Maps a cloud provider slug to a Tailwind text-color class. */ export function providerColor(provider) { const map = { diff --git a/frontend/src/views/FileManagerView.vue b/frontend/src/views/FileManagerView.vue index 217baf0..14176c7 100644 --- a/frontend/src/views/FileManagerView.vue +++ b/frontend/src/views/FileManagerView.vue @@ -44,7 +44,7 @@