From c6465e444c394337e3aa2ea58d1af3065b83d8a2 Mon Sep 17 00:00:00 2001 From: hhssb Date: Wed, 4 Dec 2024 14:01:48 +0100 Subject: [PATCH 1/2] ui: Display name instead of code for stat definitions and external idents --- app/src/app/reports/ReportsPageClient.tsx | 2 +- .../app/search/components/statistical-unit-table-header.tsx | 4 ++-- .../components/statistical-unit-hierarchy/topology-item.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/app/reports/ReportsPageClient.tsx b/app/src/app/reports/ReportsPageClient.tsx index 245c43ed5..e10d80681 100644 --- a/app/src/app/reports/ReportsPageClient.tsx +++ b/app/src/app/reports/ReportsPageClient.tsx @@ -34,7 +34,7 @@ export default function ReportsPageClient({ { value: "count", label: "Count", title: "Number of enterprises" }, ...(statDefinitions.map(({ code, name }) => ({ value: code!, - label: code!, + label: name!, title: name!, })) ?? []), ]; diff --git a/app/src/app/search/components/statistical-unit-table-header.tsx b/app/src/app/search/components/statistical-unit-table-header.tsx index eedd5f54e..a3cecf8dd 100644 --- a/app/src/app/search/components/statistical-unit-table-header.tsx +++ b/app/src/app/search/components/statistical-unit-table-header.tsx @@ -29,7 +29,7 @@ export function StatisticalUnitTableHeader({ return ( - {externalIdentTypes.map(({ code }) => code).join(" | ")} + {externalIdentTypes.map(({ name }) => name).join(" | ")} ); @@ -92,7 +92,7 @@ export function StatisticalUnitTableHeader({ key={`h-cell-${headerCellSuffix(column)}`} className="text-right hidden lg:table-cell [&>*]:capitalize" name={statDefinition.code!} - label={statDefinition.code!} + label={statDefinition.name!} /> ); } diff --git a/app/src/components/statistical-unit-hierarchy/topology-item.tsx b/app/src/components/statistical-unit-hierarchy/topology-item.tsx index 170f79c7a..de7f2baf3 100644 --- a/app/src/components/statistical-unit-hierarchy/topology-item.tsx +++ b/app/src/components/statistical-unit-hierarchy/topology-item.tsx @@ -82,7 +82,7 @@ export function TopologyItem({ ); From 4baad5251d078c807340a3951b1fa6afc66f30c7 Mon Sep 17 00:00:00 2001 From: hhssb Date: Wed, 4 Dec 2024 14:06:49 +0100 Subject: [PATCH 2/2] ui: Display number of active statistical variables on dashboard --- app/src/app/dashboard/statistical-variable-count-card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/app/dashboard/statistical-variable-count-card.tsx b/app/src/app/dashboard/statistical-variable-count-card.tsx index 11370b6a7..412773a71 100644 --- a/app/src/app/dashboard/statistical-variable-count-card.tsx +++ b/app/src/app/dashboard/statistical-variable-count-card.tsx @@ -6,7 +6,7 @@ export const StatisticalVariableCountCard = async () => { const client = await createSupabaseSSRClient(); const { count, error } = await client - .from("stat_definition") + .from("stat_definition_active") .select("", { count: "exact" }) .limit(0);