diff --git a/lerna.json b/lerna.json index 3f92ee6697..80d7963f04 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.91-alpha.9", + "version": "1.0.91-alpha.10", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index a2d6a2bc7a..6766ae6987 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.91-alpha.9", + "version": "1.0.91-alpha.10", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index ef0a53c688..06afdff505 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.91-alpha.9", + "version": "1.0.91-alpha.10", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.91-alpha.9", + "@budibase/string-templates": "^1.0.91-alpha.10", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 51b9574ab3..5813335526 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.91-alpha.9", + "version": "1.0.91-alpha.10", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.91-alpha.9", - "@budibase/client": "^1.0.91-alpha.9", - "@budibase/frontend-core": "^1.0.91-alpha.9", - "@budibase/string-templates": "^1.0.91-alpha.9", + "@budibase/bbui": "^1.0.91-alpha.10", + "@budibase/client": "^1.0.91-alpha.10", + "@budibase/frontend-core": "^1.0.91-alpha.10", + "@budibase/string-templates": "^1.0.91-alpha.10", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index 82556c74cf..619bdd94a1 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -3,7 +3,7 @@ import { getAutomationStore } from "./store/automation" import { getThemeStore } from "./store/theme" import { derived, writable } from "svelte/store" import { FrontendTypes, LAYOUT_NAMES } from "../constants" -import { findComponent } from "./componentUtils" +import { findComponent, findComponentPath } from "./componentUtils" export const store = getFrontendStore() export const automationStore = getAutomationStore() @@ -29,6 +29,16 @@ export const selectedComponent = derived( } ) +export const selectedComponentPath = derived( + [store, currentAsset], + ([$store, $currentAsset]) => { + return findComponentPath( + $currentAsset?.props, + $store.selectedComponentId + ).map(component => component._id) + } +) + export const currentAssetId = derived(store, $store => { return $store.currentFrontEndType === FrontendTypes.SCREEN ? $store.selectedScreenId diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte index 0c975eab18..2c67a3966c 100644 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte @@ -10,12 +10,10 @@
-
- - - - -
+ + + +
@@ -24,9 +22,6 @@
diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ComponentTree.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ComponentTree.svelte index d0095b2c0d..6b78bc40c1 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ComponentTree.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ComponentTree.svelte @@ -5,6 +5,7 @@ import NavItem from "components/common/NavItem.svelte" import { capitalise } from "helpers" import { notifications } from "@budibase/bbui" + import { selectedComponentPath } from "builderStore" export let components = [] export let currentComponent @@ -71,10 +72,20 @@ notifications.error("Error saving component") } } + + const isOpen = (component, selectedComponentPath, closedNodes) => { + if (!component?._children?.length) { + return false + } + if (selectedComponentPath.includes(component._id)) { + return true + } + return !closedNodes[component._id] + }