Delay rendering blocks until the schema has been attempted to be loaded
This commit is contained in:
parent
58e0daeb8c
commit
3a8e217bb7
|
@ -45,6 +45,7 @@
|
|||
let dataProviderId
|
||||
let repeaterId
|
||||
let schema
|
||||
let schemaLoaded = false
|
||||
|
||||
$: fetchSchema(dataSource)
|
||||
$: enrichedSearchColumns = enrichSearchColumns(searchColumns, schema)
|
||||
|
@ -113,9 +114,11 @@
|
|||
if (dataSource) {
|
||||
schema = await fetchDatasourceSchema(dataSource)
|
||||
}
|
||||
schemaLoaded = true
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if schemaLoaded}
|
||||
<Block>
|
||||
<div class="card-list" use:styleable={$component.styles}>
|
||||
<BlockComponent type="form" bind:id={formId} props={{ dataSource }}>
|
||||
|
@ -208,6 +211,7 @@
|
|||
</BlockComponent>
|
||||
</div>
|
||||
</Block>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.header {
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
{#if schemaLoaded}
|
||||
<Block>
|
||||
<div class={size} use:styleable={$component.styles}>
|
||||
<BlockComponent type="form" bind:id={formId} props={{ dataSource }}>
|
||||
|
@ -136,7 +137,6 @@
|
|||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if schema}
|
||||
<BlockComponent
|
||||
type="dataprovider"
|
||||
bind:id={dataProviderId}
|
||||
|
@ -165,10 +165,10 @@
|
|||
}}
|
||||
/>
|
||||
</BlockComponent>
|
||||
{/if}
|
||||
</BlockComponent>
|
||||
</div>
|
||||
</Block>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.header {
|
||||
|
|
Loading…
Reference in New Issue