From 7ddfadfb183c9908f9b48d2254f48c8560968cdf Mon Sep 17 00:00:00 2001 From: ahmadshaheer1 Date: Thu, 27 Jun 2024 09:18:39 +0430 Subject: [PATCH] fix: remove duplicate severityText in raw logs --- .../src/components/Logs/RawLogView/index.tsx | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/Logs/RawLogView/index.tsx b/frontend/src/components/Logs/RawLogView/index.tsx index fcb8beeeec..d1ae19fe99 100644 --- a/frontend/src/components/Logs/RawLogView/index.tsx +++ b/frontend/src/components/Logs/RawLogView/index.tsx @@ -62,8 +62,6 @@ function RawLogView({ const isDarkMode = useIsDarkMode(); const isReadOnlyLog = !isLogsExplorerPage || isReadOnly; - const severityText = data.severity_text ? `${data.severity_text} |` : ''; - const logType = getLogIndicatorType(data); const updatedSelecedFields = useMemo( @@ -88,17 +86,16 @@ function RawLogView({ attributesText += ' | '; } - const text = useMemo( - () => + const text = useMemo(() => { + const date = typeof data.timestamp === 'string' - ? `${dayjs(data.timestamp).format( - 'YYYY-MM-DD HH:mm:ss.SSS', - )} | ${attributesText} ${severityText} ${data.body}` - : `${dayjs(data.timestamp / 1e6).format( - 'YYYY-MM-DD HH:mm:ss.SSS', - )} | ${attributesText} ${severityText} ${data.body}`, - [data.timestamp, data.body, severityText, attributesText], - ); + ? dayjs(data.timestamp) + : dayjs(data.timestamp / 1e6); + + return `${date.format('YYYY-MM-DD HH:mm:ss.SSS')} | ${attributesText} ${ + data.body + }`; + }, [data.timestamp, data.body, attributesText]); const handleClickExpand = useCallback(() => { if (activeContextLog || isReadOnly) return;