From e1679790f7d81d39b25e3ffd8f2f4a8c1244b4ef Mon Sep 17 00:00:00 2001 From: Vikrant Gupta Date: Wed, 27 Mar 2024 01:01:24 +0530 Subject: [PATCH] fix: log chips not forming making filtering not work (#4749) * fix: log chips not forming making filtering not work * fix: remove console log --- frontend/src/components/Logs/ListLogView/index.tsx | 1 - frontend/src/hooks/queryBuilder/useTag.ts | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/Logs/ListLogView/index.tsx b/frontend/src/components/Logs/ListLogView/index.tsx index 5577579b64..2b828d663c 100644 --- a/frontend/src/components/Logs/ListLogView/index.tsx +++ b/frontend/src/components/Logs/ListLogView/index.tsx @@ -48,7 +48,6 @@ function LogGeneralField({ fieldValue, linesPerRow = 1, }: LogFieldProps): JSX.Element { - console.log('fieldKey:', fieldKey, linesPerRow); const html = useMemo( () => ({ __html: convert.toHtml(dompurify.sanitize(fieldValue)), diff --git a/frontend/src/hooks/queryBuilder/useTag.ts b/frontend/src/hooks/queryBuilder/useTag.ts index a3bbd4af05..419aaaedc9 100644 --- a/frontend/src/hooks/queryBuilder/useTag.ts +++ b/frontend/src/hooks/queryBuilder/useTag.ts @@ -75,10 +75,13 @@ export const useTag = ( (value: string): void => { const { tagKey } = getTagToken(value); const parts = tagKey.split('-'); - // this is done to ensure that `hello-world` also gets converted to `body CONTAINS hello-world` - const id = parts[parts.length - 1]; - const key = parts.slice(0, -1).join('-'); + let id = parts[parts.length - 1]; + let key = parts.slice(0, -1).join('-'); + if (parts.length === 1) { + id = ''; + [key] = parts; + } if (id === 'custom') { const customValue = whereClauseConfig