From eb1d2dc337b3ba6819d11a4f0e027fc89aa48897 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Tue, 28 Apr 2020 15:28:31 +0200 Subject: [PATCH] add setup to go to page-layout screen --- .../userInterface/ComponentsHierarchy.svelte | 34 ++++++----- .../userInterface/PageLayout.svelte | 56 +++++++++---------- .../frontend/[page]/[screen]/_fallback.svelte | 9 --- .../frontend/[page]/_layout.svelte | 7 --- 4 files changed, 47 insertions(+), 59 deletions(-) delete mode 100644 packages/builder/src/pages/[application]/frontend/[page]/_layout.svelte diff --git a/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte b/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte index 2df4f8feef..cdacd5b38f 100644 --- a/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte +++ b/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte @@ -1,4 +1,5 @@
@@ -57,7 +63,7 @@
store.setCurrentScreen(screen.title)}> + on:click|stopPropagation={() => changeScreen(screen)}> + import { goto } from "@sveltech/routify" // import { tick } from "svelte" import ComponentsHierarchyChildren from "./ComponentsHierarchyChildren.svelte" @@ -16,15 +17,12 @@ const joinPath = join("/") const normalizedName = name => - pipe( - name, - [ - trimCharsStart("./"), - trimCharsStart("~/"), - trimCharsStart("../"), - trimChars(" "), - ] - ) + pipe(name, [ + trimCharsStart("./"), + trimCharsStart("~/"), + trimCharsStart("../"), + trimChars(" "), + ]) const lastPartOfName = c => c && last(c.name ? c.name.split("/") : c._component.split("/")) @@ -33,10 +31,7 @@ const isFolderSelected = (current, folder) => isInSubfolder(current, folder) - $: _layout = pipe( - layout, - [c => ({ component: c, title: lastPartOfName(c) })] - ) + $: _layout = pipe(layout, [c => ({ component: c, title: lastPartOfName(c) })]) const isScreenSelected = component => component.component && @@ -48,6 +43,11 @@ // await tick() confirmDeleteDialog.show() } + + const setCurrentScreenToLayout = () => { + store.setScreenType("page") + $goto("./:page/page-layout") + }
@@ -55,7 +55,7 @@
store.setScreenType('page')}> + on:click|stopPropagation={setCurrentScreenToLayout}> @@ -89,23 +89,21 @@ onOk={() => store.deleteComponent(componentToDelete)} />