Skip to content
Snippets Groups Projects
Commit 2ca59050 authored by Leah Tacke genannt Unterberg's avatar Leah Tacke genannt Unterberg
Browse files

improved TablePreview.vue handling of weird input

parent 44c01019
Branches
No related tags found
No related merge requests found
Pipeline #572083 passed
......@@ -23,11 +23,11 @@ const page = ref(0)
const itemsPerPage = ref(5)
function sanitizeItemValue(v) {
if (v === null || v === undefined) return 'NA'
if (typeof v === 'string') return (v.length > 20 ? v.substring(0, 20) + '...' : v)
if (Array.isArray(v)) return v.join(', ')
if (typeof v === 'object') return JSON.stringify(v)
return v
let s = v
if (v === null || v === undefined) s = 'NA'
else if (Array.isArray(v)) s = v.join(', ')
else if (typeof v === 'object') s = JSON.stringify(v)
if (typeof s === 'string') return (s.length > 20 ? s.substring(0, 20) + '...' : s)
}
function loadItems({page, itemsPerPage}) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment