From e1d1be1e1a33cd46d52ddc993354d3b783048919 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 27 Mar 2020 12:38:27 +0000 Subject: [PATCH] showing correct front end elements for selected database --- .../src/accessLevels/AccessLevelsRoot.svelte | 30 ++++++++----------- .../userInterface/CurrentItemPreview.svelte | 4 +-- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/builder/src/accessLevels/AccessLevelsRoot.svelte b/packages/builder/src/accessLevels/AccessLevelsRoot.svelte index c71e712844..06349af851 100644 --- a/packages/builder/src/accessLevels/AccessLevelsRoot.svelte +++ b/packages/builder/src/accessLevels/AccessLevelsRoot.svelte @@ -2,7 +2,7 @@ import ButtonGroup from "../common/ButtonGroup.svelte" import Button from "../common/Button.svelte" import ActionButton from "../common/ActionButton.svelte" - import { store } from "../builderStore" + import { store, backendUiStore } from "../builderStore" import { generateFullPermissions, getNewAccessLevel } from "../common/core" import getIcon from "../common/icon" import AccessLevelView from "./AccessLevelView.svelte" @@ -10,7 +10,12 @@ let editingLevel = null let editingLevelIsNew = false - $: isEditing = editingLevel !== null + $: { + if (editingLevel !== null) { + backendUiStore.actions.modals.show("ACCESS_LEVELS") + } + } + $: modalOpen = $backendUiStore.visibleModal === 'ACCESS_LEVELS' let allPermissions = [] store.subscribe(db => { @@ -40,6 +45,7 @@ store.saveLevel(level, editingLevelIsNew, editingLevel) } editingLevel = null + backendUiStore.actions.modals.hide() } const getPermissionsString = perms => { @@ -83,10 +89,9 @@ {:else}(no actions added){/if} (isEditing = false)} - bind:isOpen={isEditing} - title={isEditing ? 'Edit Access Level' : 'Create Access Level'}> - {#if isEditing} + onClosed={backendUiStore.actions.modals.hide} + bind:isOpen={modalOpen} + title={modalOpen ? 'Edit Access Level' : 'Create Access Level'}> - {/if} + actions={$store.actions} + /> @@ -106,13 +111,4 @@ position: relative; padding: 1.5rem; } - - .actions-header { - flex: 0 1 auto; - } - - .node-view { - overflow-y: auto; - flex: 1 1 auto; - } diff --git a/packages/builder/src/userInterface/CurrentItemPreview.svelte b/packages/builder/src/userInterface/CurrentItemPreview.svelte index 429534ceb4..3ec48442ac 100644 --- a/packages/builder/src/userInterface/CurrentItemPreview.svelte +++ b/packages/builder/src/userInterface/CurrentItemPreview.svelte @@ -1,5 +1,5 @@