Quick fix for datasource deletion, due to the datasource defaulting to an empty object it appeared like a datasource had been set and the UI would attempt to render with this empty state. When not selected move off of the selected datasource page instead and handle the datasource not being selected.
This commit is contained in:
parent
bbda776c49
commit
1299917e94
|
@ -12,16 +12,25 @@
|
|||
import PromptQueryModal from "./_components/PromptQueryModal.svelte"
|
||||
import SettingsPanel from "./_components/panels/Settings.svelte"
|
||||
import { helpers } from "@budibase/shared-core"
|
||||
import { goto } from "@roxi/routify"
|
||||
|
||||
let selectedPanel = null
|
||||
let panelOptions = []
|
||||
|
||||
// datasources.selected can return null temporarily on datasource deletion
|
||||
$: datasource = $datasources.selected || {}
|
||||
$: datasource = $datasources.selected
|
||||
$: {
|
||||
if (!datasource) {
|
||||
$goto("./datasource")
|
||||
}
|
||||
}
|
||||
|
||||
$: getOptions(datasource)
|
||||
|
||||
const getOptions = datasource => {
|
||||
if (!datasource) {
|
||||
return
|
||||
}
|
||||
if (datasource.plus) {
|
||||
// Google Sheets' integration definition specifies `relationships: false` as it doesn't support relationships like other plus datasources
|
||||
panelOptions =
|
||||
|
@ -49,6 +58,7 @@
|
|||
|
||||
<PromptQueryModal />
|
||||
|
||||
{#if datasource}
|
||||
<section>
|
||||
<Layout noPadding>
|
||||
<Layout gap="XS" noPadding>
|
||||
|
@ -94,6 +104,7 @@
|
|||
{/if}
|
||||
</Layout>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
section {
|
||||
|
|
Loading…
Reference in New Issue