feat: Show SingleUse ID data in survey responses table (#6742)

Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
This commit is contained in:
Hemachandar
2025-10-28 13:08:44 +05:30
committed by GitHub
parent 4e3438683e
commit fe5ff9a71c
3 changed files with 11 additions and 0 deletions

View File

@@ -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) => {

View File

@@ -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,

View File

@@ -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(),