fix(10): resolve WR-03/WR-04 code review warnings
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
efd6c78a15
commit
9a1c7df65d
@@ -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 = {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, watch, onMounted, onUnmounted } from 'vue'
|
||||
import { ref, reactive, computed, watch, onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useFoldersStore } from '../stores/folders.js'
|
||||
import { useDocumentsStore } from '../stores/documents.js'
|
||||
|
||||
@@ -200,6 +200,7 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import * as api from '../../api/client.js'
|
||||
import BreadcrumbBar from '../../components/ui/BreadcrumbBar.vue'
|
||||
import EmptyState from '../../components/ui/EmptyState.vue'
|
||||
import { formatTimestamp } from '../../utils/formatters.js'
|
||||
|
||||
const entries = ref([])
|
||||
const total = ref(0)
|
||||
@@ -332,14 +333,6 @@ async function downloadDailyExport() {
|
||||
}
|
||||
}
|
||||
|
||||
function formatTimestamp(iso) {
|
||||
if (!iso) return '—'
|
||||
try {
|
||||
return new Date(iso).toISOString().replace('T', ' ').slice(0, 19)
|
||||
} catch {
|
||||
return iso
|
||||
}
|
||||
}
|
||||
|
||||
function actionTypeClass(eventType) {
|
||||
if (!eventType) return 'bg-gray-100 text-gray-600'
|
||||
|
||||
Reference in New Issue
Block a user