diff --git a/packages/builder/rollup.config.js b/packages/builder/rollup.config.js index 2ec676b0e8..2ebde91183 100644 --- a/packages/builder/rollup.config.js +++ b/packages/builder/rollup.config.js @@ -105,7 +105,9 @@ const lodash_fp_exports = [ "toPairs", "remove", "findIndex", - "compose" + "compose", + "get", + "tap" ] const lodash_exports = [ diff --git a/packages/builder/src/PackageRoot.svelte b/packages/builder/src/PackageRoot.svelte index fcdc2d5c71..ab07f2bac1 100644 --- a/packages/builder/src/PackageRoot.svelte +++ b/packages/builder/src/PackageRoot.svelte @@ -4,7 +4,7 @@ import UserInterfaceRoot from "./userInterface/UserInterfaceRoot.svelte" import BackendRoot from "./BackendRoot.svelte" import { fade } from "svelte/transition" - import { SettingsIcon, PreviewIcon, HelpIcon } from "./common/Icons/" + import { SettingsIcon, PreviewIcon } from "./common/Icons/" const TABS = { BACKEND: "backend", diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index 1fff326d46..5fa14b5c5f 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -23,7 +23,6 @@ export const getBackendUiStore = () => { name: "" }, breadcrumbs: [], - selectedRecord: {}, selectedDatabase: {}, selectedModel: {}, } @@ -49,6 +48,12 @@ export const getBackendUiStore = () => { return state }), }, + views: { + select: view => store.update(state => { + state.selectedView = { ...state.selectedView, ...view } + return state + }) + }, modals: { show: modal => store.update(state => ({ ...state, visibleModal: modal })), hide: () => store.update(state => ({ ...state, visibleModal: null })) diff --git a/packages/builder/src/database/ModelDataTable/ModelDataTable.svelte b/packages/builder/src/database/ModelDataTable/ModelDataTable.svelte index 126b4f6cce..4a59d11298 100644 --- a/packages/builder/src/database/ModelDataTable/ModelDataTable.svelte +++ b/packages/builder/src/database/ModelDataTable/ModelDataTable.svelte @@ -1,7 +1,7 @@ - - {last($backendUiStore.breadcrumbs)} - + {last($backendUiStore.breadcrumbs)} fetchRecordsForView(e.target.value)}> + on:change={e => { + const view = e.target.value + backendUiStore.actions.views.select(view) + }}> {#each views as view} {view.name} {/each} diff --git a/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte b/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte index 35ac8c2c1f..d6f027125d 100644 --- a/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte +++ b/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte @@ -2,15 +2,15 @@ import Modal from "../../../common/Modal.svelte" import { store } from "../../../builderStore" import ActionButton from "../../../common/ActionButton.svelte" - import * as api from "../api" + // import * as api from "../api" export let onClosed let userName async function createUser() { - const response = await api.createUser($store.appname, userName) - store.createUserForInstance(response) + // const response = await api.createUser($store.appname, userName) + // store.createUserForInstance(response) onClosed() }