feat(csv export): improved username in csv
This commit is contained in:
parent
2d59172323
commit
ade678da1f
|
@ -13,6 +13,7 @@ import {CSV_CHARSETS, downloadCsv} from "@/lib/csv.ts";
|
||||||
import {showSuccessNotification} from "@/components/util.tsx";
|
import {showSuccessNotification} from "@/components/util.tsx";
|
||||||
import {PocketBaseErrorAlert} from "@/lib/pocketbase.tsx";
|
import {PocketBaseErrorAlert} from "@/lib/pocketbase.tsx";
|
||||||
import {formatDateForExcel} from "@/lib/datetime.ts";
|
import {formatDateForExcel} from "@/lib/datetime.ts";
|
||||||
|
import {getUserName} from "@/components/users/modals/util.tsx";
|
||||||
|
|
||||||
type FormValues = {
|
type FormValues = {
|
||||||
questionSchemaFields: string[]
|
questionSchemaFields: string[]
|
||||||
|
@ -122,7 +123,7 @@ export default function DownloadDataModal({opened, onClose, lists, event, query}
|
||||||
const statusData = e.entryStatusData || {}
|
const statusData = e.entryStatusData || {}
|
||||||
return [
|
return [
|
||||||
...(showDebug ? [e.user, e.id] : []),
|
...(showDebug ? [e.user, e.id] : []),
|
||||||
e.expand?.user.username ?? "N/A", formatDateForExcel(e.created), e.listName, formatDateForExcel(e.slotStartDate), formatDateForExcel(e.slotEndDate),
|
getUserName(e.expand?.user) ?? "N/A", formatDateForExcel(e.created), e.listName, formatDateForExcel(e.slotStartDate), formatDateForExcel(e.slotEndDate),
|
||||||
...questionSchema.fields.map(f => questionData[f.id]?.value?.toString() ?? "N/A").map(escapeSeparator),
|
...questionSchema.fields.map(f => questionData[f.id]?.value?.toString() ?? "N/A").map(escapeSeparator),
|
||||||
...statusSchema.fields.map(f => statusData[f.id]?.value?.toString() ?? "N/A").map(escapeSeparator)
|
...statusSchema.fields.map(f => statusData[f.id]?.value?.toString() ?? "N/A").map(escapeSeparator)
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue