remove backendUiStore

This commit is contained in:
Keviin Åberg Kultalahti 2021-03-23 13:42:03 +01:00
parent 9445b1efdc
commit 5deceb7928
5 changed files with 6 additions and 27 deletions

View File

@ -1,5 +1,4 @@
import { getFrontendStore } from "./store/frontend"
import { getBackendUiStore } from "./store/backend"
import { getAutomationStore } from "./store/automation"
import { getHostingStore } from "./store/hosting"
import { getThemeStore } from "./store/theme"
@ -9,7 +8,6 @@ import { FrontendTypes, LAYOUT_NAMES } from "../constants"
import { findComponent } from "./storeUtils"
export const store = getFrontendStore()
export const backendUiStore = getBackendUiStore()
export const automationStore = getAutomationStore()
export const themeStore = getThemeStore()
export const hostingStore = getHostingStore()

View File

@ -1,13 +0,0 @@
import { writable } from "svelte/store"
const INITIAL_BACKEND_UI_STATE = {}
export const getBackendUiStore = () => {
const store = writable({ ...INITIAL_BACKEND_UI_STATE })
store.actions = {
reset: () => store.set({ ...INITIAL_BACKEND_UI_STATE }),
}
return store
}

View File

@ -1,5 +1,5 @@
<script>
import { backendUiStore, store, allScreens } from "builderStore"
import { store, allScreens } from "builderStore"
import { tables } from 'builderStore/store/backend/'
import { notifier } from "builderStore/store/notifications"
import { DropdownMenu, Button, Input } from "@budibase/bbui"
@ -52,14 +52,9 @@
function checkValid(evt) {
const tableName = evt.target.value
if (
originalName !== tableName &&
$backendUiStore.models?.some(model => model.name === tableName)
) {
error = `Table with name ${tableName} already exists. Please choose another name.`
return
}
error = ""
error = originalName !== tableName
? `Table with name ${tableName} already exists. Please choose another name.`
: ""
}
</script>

View File

@ -4,7 +4,6 @@
import {
store,
automationStore,
backendUiStore,
hostingStore,
} from "builderStore"
import { string, object } from "yup"
@ -152,7 +151,7 @@
)
const pkg = await applicationPkg.json()
if (applicationPkg.ok) {
backendUiStore.actions.reset()
// backendUiStore.actions.reset()
await store.actions.initialise(pkg)
await automationStore.actions.fetch()
} else {

View File

@ -18,7 +18,7 @@
const pkg = await res.json()
if (res.ok) {
backendUiStore.actions.reset()
// backendUiStore.actions.reset()
await store.actions.initialise(pkg)
await automationStore.actions.fetch()
await roles.fetch()