From cb93d9d557042df2b9fa0b7edba2c827a0e759d8 Mon Sep 17 00:00:00 2001 From: Daniel D'Abate Date: Thu, 6 Jun 2024 15:17:35 +0200 Subject: [PATCH] Bugfix - JS function "execute" from node crashing the frontend and response is hidden (#2589) * Bugfix - Fix crash when executing JS function from node and fix hidden response * add toString() to code executed result * Change height of CodeEditor to make it bigger, but still make the result visible below. --------- Co-authored-by: Henry Heng --- packages/ui/src/ui-component/dialog/ExpandTextDialog.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/ui-component/dialog/ExpandTextDialog.jsx b/packages/ui/src/ui-component/dialog/ExpandTextDialog.jsx index c93655fe..068f26c1 100644 --- a/packages/ui/src/ui-component/dialog/ExpandTextDialog.jsx +++ b/packages/ui/src/ui-component/dialog/ExpandTextDialog.jsx @@ -78,7 +78,7 @@ const ExpandTextDialog = ({ show, dialogProps, onCancel, onConfirm }) => { useEffect(() => { if (executeCustomFunctionNodeApi.error) { if (typeof executeCustomFunctionNodeApi.error === 'object' && executeCustomFunctionNodeApi.error?.response?.data) { - setCodeExecutedResult(executeCustomFunctionNodeApi.error?.response?.data) + setCodeExecutedResult(JSON.stringify(executeCustomFunctionNodeApi.error?.response?.data, null, 2)) } else if (typeof executeCustomFunctionNodeApi.error === 'string') { setCodeExecutedResult(executeCustomFunctionNodeApi.error) } @@ -100,7 +100,7 @@ const ExpandTextDialog = ({ show, dialogProps, onCancel, onConfirm }) => { borderColor: theme.palette.grey['500'], borderRadius: '12px', height: '100%', - maxHeight: languageType === 'js' ? 'calc(100vh - 250px)' : 'calc(100vh - 220px)', + maxHeight: languageType === 'js' ? 'calc(100vh - 330px)' : 'calc(100vh - 220px)', overflowX: 'hidden', backgroundColor: 'white' }} @@ -108,7 +108,7 @@ const ExpandTextDialog = ({ show, dialogProps, onCancel, onConfirm }) => { {