From 72547437fead0a071fceac27dae8628cdcae6a3e Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 27 Apr 2025 16:29:55 +0200 Subject: [PATCH] feat: add universal search to object viewer --- .../src/lib/components/SavedInputs.svelte | 11 +- .../clearableInput/ClearableInput.svelte | 6 +- .../flows/propPicker/PropPickerWrapper.svelte | 2 +- .../propertyPicker/ObjectViewer.svelte | 111 ++++++++++++++---- .../propertyPicker/PropPicker.svelte | 2 +- .../lib/components/propertyPicker/utils.ts | 25 +++- 6 files changed, 119 insertions(+), 38 deletions(-) diff --git a/frontend/src/lib/components/SavedInputs.svelte b/frontend/src/lib/components/SavedInputs.svelte index 1a2adf53ce..e16ba75c47 100644 --- a/frontend/src/lib/components/SavedInputs.svelte +++ b/frontend/src/lib/components/SavedInputs.svelte @@ -48,10 +48,10 @@ $: runnableType = scriptHash ? 'ScriptHash' : scriptPath - ? 'ScriptPath' - : flowPath - ? 'FlowPath' - : undefined + ? 'ScriptPath' + : flowPath + ? 'FlowPath' + : undefined let hasAlreadyFailed = false async function loadInputHistory() { @@ -379,7 +379,8 @@ class="w-full h-full items-center text-xs font-normal grid grid-cols-8 gap-4 min-w-0" >
-
+
{i.created_by} diff --git a/frontend/src/lib/components/common/clearableInput/ClearableInput.svelte b/frontend/src/lib/components/common/clearableInput/ClearableInput.svelte index d0f25cac69..d5a2a6b2fd 100644 --- a/frontend/src/lib/components/common/clearableInput/ClearableInput.svelte +++ b/frontend/src/lib/components/common/clearableInput/ClearableInput.svelte @@ -39,7 +39,7 @@ {value} {placeholder} rows="1" - class="resize-y duration-200 {inputClass}" + class="resize-y {inputClass}" {...$$restProps} on:input={handleInput} on:keydown|stopPropagation @@ -51,7 +51,7 @@ {type} {value} {placeholder} - class="duration-200 {(value ? '!pr-[26px] ' : '') + inputClass}" + class=" {(value ? '!pr-[26px] ' : '') + inputClass}" {...$$restProps} on:input={handleInput} on:keydown|stopPropagation @@ -63,7 +63,7 @@ +
+ {:else} + + {/if} + +{/if} {#if keys.length > 0} {#if !fullyCollapsed} @@ -132,10 +197,10 @@ : - {#if getTypeAsString(json[key]) === 'object'} + {#if getTypeAsString(jsonFiltered[key]) === 'object'} { - selectProp(key, json[key], true) + selectProp(key, jsonFiltered[key], true) }} - title={JSON.stringify(json[key])} + title={JSON.stringify(jsonFiltered[key])} > - {#if json[key] === NEVER_TESTED_THIS_FAR} + {#if jsonFiltered[key] === NEVER_TESTED_THIS_FAR} Test the flow to see a value - {:else if json[key] == undefined} + {:else if jsonFiltered[key] == undefined} undefined - {:else if json[key] == null} + {:else if jsonFiltered[key] == null} null - {:else if typeof json[key] == 'string'} - "{truncate(json[key], 200)}" - {:else if typeof json[key] == 'number' && Number.isInteger(json[key]) && !Number.isSafeInteger(json[key])} + {:else if typeof jsonFiltered[key] == 'string'} + "{truncate(jsonFiltered[key], 200)}" + {:else if typeof jsonFiltered[key] == 'number' && Number.isInteger(jsonFiltered[key]) && !Number.isSafeInteger(jsonFiltered[key])} - {truncate(JSON.stringify(json[key]), 200)} + {truncate(JSON.stringify(jsonFiltered[key]), 200)} @@ -181,7 +246,7 @@ {:else} - {truncate(JSON.stringify(json[key]), 200)} + {truncate(JSON.stringify(jsonFiltered[key]), 200)} {/if} @@ -198,20 +263,20 @@ {#if level == 0 && topBrackets}
{closeBracket} - {#if getTypeAsString(json) === 's3object'} + {#if getTypeAsString(jsonFiltered) === 's3object'} download @@ -240,7 +305,7 @@ {/if} {:else if topBrackets} {openBracket}{closeBracket} -{:else if json == undefined} +{:else if jsonFiltered == undefined} undefined {:else} No items diff --git a/frontend/src/lib/components/propertyPicker/PropPicker.svelte b/frontend/src/lib/components/propertyPicker/PropPicker.svelte index 8faf206f95..8c4da6dc22 100644 --- a/frontend/src/lib/components/propertyPicker/PropPicker.svelte +++ b/frontend/src/lib/components/propertyPicker/PropPicker.svelte @@ -197,7 +197,7 @@
-
+