diff --git a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte index 92a20a4acc..51dd44026e 100644 --- a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte +++ b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte @@ -13,6 +13,8 @@ import NewLayoutModal from "components/design/NavigationPanel/NewLayoutModal.svelte" import { Icon, Modal, Select, Search, Tabs, Tab } from "@budibase/bbui" + export let showModal + const tabs = [ { title: "Screens", @@ -24,7 +26,7 @@ }, ] - export let modal + let modal $: selected = tabs.find(t => t.key === $params.assetType)?.title || "Screens" const navigate = ({ detail }) => { @@ -98,7 +100,7 @@
diff --git a/packages/builder/src/components/design/NavigationPanel/NavigationSelectionModal.svelte b/packages/builder/src/components/design/NavigationPanel/NavigationSelectionModal.svelte index d62363827b..ec3d11683e 100644 --- a/packages/builder/src/components/design/NavigationPanel/NavigationSelectionModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NavigationSelectionModal.svelte @@ -17,12 +17,12 @@ let selectedNav let createdScreens = [] $: { - selectedScreens.forEach(screen => { + selectedScreens?.forEach(screen => { createdScreens = [...createdScreens, screen.create()] }) } - $: blankSelected = selectedScreens.find(x => x.id === "createFromScratch") + $: blankSelected = selectedScreens.length === 1 const save = async screens => { for (let screen of screens) { diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index 979c0a1a6e..297f6c1d02 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -9,7 +9,7 @@ export let selectedScreens = [] const blankScreen = "createFromScratch" - $: blankSelected = selectedScreens.find(x => x.id === blankScreen) + $: blankSelected = selectedScreens.length === 1 $: autoSelected = selectedScreens.length > 0 && !blankSelected $: templates = getTemplates($store, $tables.list) @@ -19,7 +19,7 @@ screen => !screen.name.includes(table.name) ) } else { - const templates = getTemplates($store, $tables.list).filter(template => + const templates = templates.filter(template => template.name.includes(table.name) ) selectedScreens = [...templates, ...selectedScreens] @@ -41,7 +41,7 @@ Autogenerated screens come with CRUD functionality.