From b429f195c13bc0c39c1d12d9a5375c9db0838876 Mon Sep 17 00:00:00 2001 From: Darren Clarke Date: Fri, 31 Mar 2023 11:47:51 +0200 Subject: [PATCH] Leafcutter UI fixes --- apps/leafcutter/components/QueryBuilder.tsx | 6 +++--- apps/leafcutter/components/RawDataViewer.tsx | 5 +++-- apps/leafcutter/lib/opensearch.ts | 8 +++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/leafcutter/components/QueryBuilder.tsx b/apps/leafcutter/components/QueryBuilder.tsx index a72edd6..bbf8846 100644 --- a/apps/leafcutter/components/QueryBuilder.tsx +++ b/apps/leafcutter/components/QueryBuilder.tsx @@ -22,7 +22,7 @@ import { QueryDateRangeSelector } from "./QueryDateRangeSelector"; import { useAppContext } from "./AppProvider"; import { Tooltip } from "./Tooltip"; -interface QueryBuilderProps {} +interface QueryBuilderProps { } export const QueryBuilder: FC = () => { const t = useTranslate(); @@ -155,9 +155,9 @@ export const QueryBuilder: FC = () => { diff --git a/apps/leafcutter/components/RawDataViewer.tsx b/apps/leafcutter/components/RawDataViewer.tsx index 74350a6..32cc569 100644 --- a/apps/leafcutter/components/RawDataViewer.tsx +++ b/apps/leafcutter/components/RawDataViewer.tsx @@ -58,7 +58,7 @@ export const RawDataViewer: FC = ({ rows, height }) => { return ( - + e.stopPropagation()}> = ({ rows, height }) => { hideFooter disableColumnMenu scrollbarSize={10} + disableVirtualization /> - + ); }; diff --git a/apps/leafcutter/lib/opensearch.ts b/apps/leafcutter/lib/opensearch.ts index 299eca5..16f67dd 100644 --- a/apps/leafcutter/lib/opensearch.ts +++ b/apps/leafcutter/lib/opensearch.ts @@ -423,8 +423,6 @@ export const performQuery = async (searchQuery: any, limit: number) => { }); } - console.log(JSON.stringify(body, null, 2)); - const dataResponse = await client.search({ index: dataIndexName, size: limit, @@ -435,8 +433,12 @@ export const performQuery = async (searchQuery: any, limit: number) => { hits: { hits }, } = dataResponse.body; const results = hits.map((hit: any) => ({ - id: hit._id, ...hit._source, + id: hit._id, + incident: Array.isArray(hit._source.incident) ? hit._source.incident.join(", ") : hit._source.incident, + technology: Array.isArray(hit._source.technology) ? hit._source.technology.join(", ") : hit._source.technology, + targeted_group: Array.isArray(hit._source.targeted_group) ? hit._source.targeted_group.join(", ") : hit._source.targeted_group, + country: Array.isArray(hit._source.country) ? hit._source.country.join(", ") : hit._source.country, })); return results;