mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-05 16:19:55 -06:00
feat: Show SingleUse ID data in survey responses table (#6742)
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
This commit is contained in:
@@ -96,6 +96,7 @@ const mapResponsesToTableData = (
|
||||
? t("environments.surveys.responses.completed")
|
||||
: t("environments.surveys.responses.not_completed"),
|
||||
responseId: response.id,
|
||||
singleUseId: response.singleUseId,
|
||||
tags: response.tags,
|
||||
variables: survey.variables.reduce(
|
||||
(acc, curr) => {
|
||||
|
||||
@@ -312,6 +312,14 @@ export const generateResponseTableColumns = (
|
||||
},
|
||||
};
|
||||
|
||||
const singleUseIdColumn: ColumnDef<TResponseTableData> = {
|
||||
accessorKey: "singleUseId",
|
||||
header: () => <div className="gap-x-1.5">{t("environments.surveys.responses.single_use_id")}</div>,
|
||||
cell: ({ row }) => {
|
||||
return <p className="truncate text-slate-900">{row.original.singleUseId}</p>;
|
||||
},
|
||||
};
|
||||
|
||||
const quotasColumn: ColumnDef<TResponseTableData> = {
|
||||
accessorKey: "quota",
|
||||
header: t("common.quota"),
|
||||
@@ -409,6 +417,7 @@ export const generateResponseTableColumns = (
|
||||
// Combine the selection column with the dynamic question columns
|
||||
const baseColumns = [
|
||||
personColumn,
|
||||
singleUseIdColumn,
|
||||
dateColumn,
|
||||
...(showQuotasColumn ? [quotasColumn] : []),
|
||||
statusColumn,
|
||||
|
||||
@@ -409,6 +409,7 @@ export type TResponseUpdate = z.infer<typeof ZResponseUpdate>;
|
||||
|
||||
export const ZResponseTableData = z.object({
|
||||
responseId: z.string(),
|
||||
singleUseId: z.string().nullable(),
|
||||
createdAt: z.date(),
|
||||
status: z.string(),
|
||||
verifiedEmail: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user