From 3b8564d4fa5a8f1fe4b5bd9d30598b81d8385cd5 Mon Sep 17 00:00:00 2001 From: Shams mosowi Date: Thu, 16 Jul 2020 22:31:16 +1000 Subject: [PATCH] show subtable doc count in cell --- www/src/components/Table/formatters/SubTable.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/src/components/Table/formatters/SubTable.tsx b/www/src/components/Table/formatters/SubTable.tsx index 1632d2ce..d989b541 100644 --- a/www/src/components/Table/formatters/SubTable.tsx +++ b/www/src/components/Table/formatters/SubTable.tsx @@ -29,6 +29,7 @@ export default function SubTable({ column, row }: CustomCellProps) { }, "") : ""; const fieldName = column.key as string; + const documentCount = row[fieldName]?.count ?? ""; const router = useRouter(); const parentLabels = queryString.parse(router.location.search).parentLabel; @@ -54,7 +55,7 @@ export default function SubTable({ column, row }: CustomCellProps) { className={clsx("cell-collapse-padding", classes.root)} > - {column.name}: {label} + {documentCount} {column.name}: {label}