minor app fixes

This commit is contained in:
Ruben Fiszel
2023-03-19 15:35:40 +01:00
parent fbe2f0ca93
commit b497c3463f
4 changed files with 14 additions and 7 deletions
@@ -68,7 +68,7 @@
}
}
$: resolvedConfig.triggerOnAppLoad && runnableComponent?.runComponent()
$: resolvedConfig?.triggerOnAppLoad && runnableComponent?.runComponent()
$: if (outputs?.loading != undefined) {
outputs.loading.set(false, true)
@@ -101,9 +101,17 @@
let testJob: CompletedJob | undefined = undefined
let testJobLoader: TestJobLoader | undefined = undefined
$: schemaStripped = stripSchema(fields, $stateId)
let schemaStripped: Schema | undefined =
autoRefresh || forceSchemaDisplay ? emptySchema() : undefined
$: (autoRefresh || forceSchemaDisplay) &&
Object.keys(fields ?? {}).length > 0 &&
(schemaStripped = stripSchema(fields, $stateId))
function stripSchema(inputs: AppInputs, s: any): Schema {
if (inputs === undefined) {
return emptySchema()
}
let schema =
runnable?.type == 'runnableByName' ? runnable.inlineScript?.schema : runnable?.schema
try {
@@ -308,7 +316,7 @@
{#if render}
<div class="h-full flex relative flex-row flex-wrap {wrapperClass}" style={wrapperStyle}>
{#if schemaStripped && Object.keys(schemaStripped?.properties ?? {}).length > 0 && (autoRefresh || forceSchemaDisplay)}
{#if (autoRefresh || forceSchemaDisplay) && schemaStripped && Object.keys(schemaStripped?.properties ?? {}).length > 0}
<div class="px-2 h-fit min-h-0">
<LightweightSchemaForm schema={schemaStripped} bind:args />
</div>
@@ -87,9 +87,7 @@
{#if component}
<div class="flex min-h-full flex-col min-w-[150px] w-full divide-y">
{#if component.componentInput}
<PanelSection
title={component.componentInput.fieldType === 'any' ? 'By Runnable' : 'Data Source'}
>
<PanelSection title="Data Source">
<svelte:fragment slot="action">
<span
class={classNames(
@@ -23,7 +23,8 @@
$: onLoad =
!onClick ||
(appComponent.configuration.triggerOnAppLoad.ctype === undefined &&
(appComponent?.configuration?.triggerOnAppLoad != undefined &&
appComponent?.configuration?.triggerOnAppLoad?.ctype === undefined &&
appComponent.configuration.triggerOnAppLoad.type == 'static' &&
appComponent.configuration.triggerOnAppLoad.value)
</script>