fix optional chaining error and adds guard for no model selected.
This commit is contained in:
parent
d9c8e6cd96
commit
38e42c0e9e
|
@ -113,7 +113,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
class="menu"
|
|
||||||
bind:this={dropdown}
|
bind:this={dropdown}
|
||||||
on:click={hideDropdown}
|
on:click={hideDropdown}
|
||||||
width="170px"
|
width="170px"
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
"@budibase/client": "^0.1.25",
|
"@budibase/client": "^0.1.25",
|
||||||
"@rollup/plugin-commonjs": "^11.1.0",
|
"@rollup/plugin-commonjs": "^11.1.0",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"rollup": "^1.11.0",
|
"rollup": "^2.11.2",
|
||||||
"rollup-plugin-commonjs": "^10.0.2",
|
"rollup-plugin-commonjs": "^10.0.2",
|
||||||
"rollup-plugin-json": "^4.0.0",
|
"rollup-plugin-json": "^4.0.0",
|
||||||
"rollup-plugin-livereload": "^1.0.1",
|
"rollup-plugin-livereload": "^1.0.1",
|
||||||
"rollup-plugin-node-resolve": "^5.0.0",
|
"rollup-plugin-node-resolve": "^5.0.0",
|
||||||
"rollup-plugin-postcss": "^3.1.5",
|
"rollup-plugin-postcss": "^3.1.5",
|
||||||
"rollup-plugin-svelte": "^5.0.0",
|
"rollup-plugin-svelte": "^5.0.3",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"shortid": "^2.2.15",
|
"shortid": "^2.2.15",
|
||||||
"sirv-cli": "^0.4.4",
|
"sirv-cli": "^0.4.4",
|
||||||
|
|
|
@ -2,6 +2,7 @@ import svelte from "rollup-plugin-svelte"
|
||||||
import resolve from "rollup-plugin-node-resolve"
|
import resolve from "rollup-plugin-node-resolve"
|
||||||
import commonjs from "@rollup/plugin-commonjs"
|
import commonjs from "@rollup/plugin-commonjs"
|
||||||
import postcss from "rollup-plugin-postcss"
|
import postcss from "rollup-plugin-postcss"
|
||||||
|
import { terser } from "rollup-plugin-terser";
|
||||||
|
|
||||||
const lodash_fp_exports = ["isEmpty"]
|
const lodash_fp_exports = ["isEmpty"]
|
||||||
|
|
||||||
|
@ -16,6 +17,7 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
terser(),
|
||||||
postcss({
|
postcss({
|
||||||
plugins: [],
|
plugins: [],
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
let model
|
let model
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
if (datasource.modelId) {
|
||||||
const jsonModel = await _bb.api.get(`/api/models/${datasource.modelId}`)
|
const jsonModel = await _bb.api.get(`/api/models/${datasource.modelId}`)
|
||||||
model = await jsonModel.json()
|
model = await jsonModel.json()
|
||||||
const { schema } = model
|
const { schema } = model
|
||||||
|
@ -40,13 +41,15 @@
|
||||||
hide: shouldHideField(key),
|
hide: shouldHideField(key),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
editable:
|
editable:
|
||||||
schema[key].type !== "boolean" && schema[key].type !== "attachment",
|
schema[key].type !== "boolean" &&
|
||||||
|
schema[key].type !== "attachment",
|
||||||
cellRenderer: renderers.get(schema[key].type),
|
cellRenderer: renderers.get(schema[key].type),
|
||||||
autoHeight: schema[key].type === "attachment",
|
autoHeight: schema[key].type === "attachment",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
dataLoaded = true
|
dataLoaded = true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const shouldHideField = name => {
|
const shouldHideField = name => {
|
||||||
|
|
Loading…
Reference in New Issue