From 387946f536c603e4e8726abb5bfeb6dcb4528243 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 29 Mar 2024 17:08:13 +0100 Subject: [PATCH] display result nits --- .../src/lib/components/DisplayResult.svelte | 29 +++++++++------ .../apps/editor/RunnableJobPanel.svelte | 35 +++---------------- 2 files changed, 24 insertions(+), 40 deletions(-) diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte index d5d50e704b..7a0e7e665f 100644 --- a/frontend/src/lib/components/DisplayResult.svelte +++ b/frontend/src/lib/components/DisplayResult.svelte @@ -99,6 +99,9 @@ if (result !== undefined) { if (typeof result === 'string') { + length = 0 + largeObject = false + is_render_all = false return 'plain' } try { @@ -270,7 +273,7 @@ {#if result != undefined && length != undefined && largeObject != undefined}
- {#if (resultKind && !['json', 's3object', 's3object-list', 'table-col', 'table-row'].includes(resultKind) && !hideAsJson) || isTableDisplay} + {#if (resultKind && typeof result == 'object' && !['json', 's3object', 's3object-list', 'table-col', 'table-row'].includes(resultKind) && !hideAsJson) || isTableDisplay} {/if}
-
- - {#if !forceJson && resultKind == 'table-col'} + {#if !forceJson && resultKind == 'table-col'} {@const data = 'table-col' in result ? result['table-col'] : result} {:else if !forceJson && resultKind == 'table-row'} @@ -392,9 +393,19 @@ src="data:image/gif;base64,{contentOrRootString(result.gif)}" /> - {:else if !forceJson && resultKind == 'plain'} -
-
{result?.['result']}
+ {:else if !forceJson && resultKind == 'plain'}
{typeof result == 'string' ? result : result?.['result']}
{#if !noControls} +
+ +
+ {/if}
{:else if !forceJson && resultKind == 'file'}
@@ -552,9 +563,7 @@ {/if} {:else if typeof result == 'string' && result.length > 0} -
{result}
- {#if !noControls} -
+
{result}
{#if !noControls}
diff --git a/frontend/src/lib/components/apps/editor/RunnableJobPanel.svelte b/frontend/src/lib/components/apps/editor/RunnableJobPanel.svelte index 3466c35cf2..a340f87969 100644 --- a/frontend/src/lib/components/apps/editor/RunnableJobPanel.svelte +++ b/frontend/src/lib/components/apps/editor/RunnableJobPanel.svelte @@ -74,41 +74,16 @@ {#if frontendJob}

-                    
-                                                        
-                                                    
-                                                
+ > {:else if testJob != undefined && 'result' in testJob && testJob.result != undefined}

-                            
-																
-															
-														
+ result={testJob.result} + /> {:else}
{#if testIsLoading}