From 167f75ddc3582af9b934aadb254fa7e56b7a7bd8 Mon Sep 17 00:00:00 2001 From: "Bryson G." Date: Fri, 20 Dec 2024 01:25:42 -0800 Subject: [PATCH] refactor(dashboard): show log output --- .../components/NodeTypes/Task/TaskDetails.tsx | 16 +++++++++------- .../app/[tenantId]/components/OverflowText.tsx | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/TaskDetails.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/TaskDetails.tsx index 8445f69cd..58f1f6cfc 100644 --- a/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/TaskDetails.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/TaskDetails.tsx @@ -9,6 +9,7 @@ import { FC } from 'react' import { NodeRunsList } from '../../NodeRunsList' import { NodeDetails } from '../NodeDetails' import { getTaskRun } from './getTaskRun' +import { OverflowText } from '@/app/[tenantId]/components/OverflowText' export const TaskDetails: FC<{ taskNode?: TaskNode @@ -93,14 +94,15 @@ export const TaskDetails: FC<{ {nodeRun && nodeRun.errorMessage && (

Error

-
- {data?.attempts[0]?.logOutput?.str ?? nodeRun.errorMessage} -
+
- ) -} - - + )} + + ) } diff --git a/dashboard/src/app/[tenantId]/components/OverflowText.tsx b/dashboard/src/app/[tenantId]/components/OverflowText.tsx index 8d6bef453..66760e08d 100644 --- a/dashboard/src/app/[tenantId]/components/OverflowText.tsx +++ b/dashboard/src/app/[tenantId]/components/OverflowText.tsx @@ -10,9 +10,10 @@ import { tryFormatAsJson } from '@/app/utils/tryFormatAsJson' type OverflowTextProps = { text: string className?: string + variant?: 'error' } -export const OverflowText: FC = ({ text, className }) => { +export const OverflowText: FC = ({ text, className, variant }) => { const textRef = useRef(null) const [isOverflowing, setIsOverflowing] = useState(false) @@ -45,7 +46,7 @@ export const OverflowText: FC = ({ text, className }) => { -
+
{formattedText}