remove backendUiStore
This commit is contained in:
parent
9445b1efdc
commit
5deceb7928
|
@ -1,5 +1,4 @@
|
||||||
import { getFrontendStore } from "./store/frontend"
|
import { getFrontendStore } from "./store/frontend"
|
||||||
import { getBackendUiStore } from "./store/backend"
|
|
||||||
import { getAutomationStore } from "./store/automation"
|
import { getAutomationStore } from "./store/automation"
|
||||||
import { getHostingStore } from "./store/hosting"
|
import { getHostingStore } from "./store/hosting"
|
||||||
import { getThemeStore } from "./store/theme"
|
import { getThemeStore } from "./store/theme"
|
||||||
|
@ -9,7 +8,6 @@ import { FrontendTypes, LAYOUT_NAMES } from "../constants"
|
||||||
import { findComponent } from "./storeUtils"
|
import { findComponent } from "./storeUtils"
|
||||||
|
|
||||||
export const store = getFrontendStore()
|
export const store = getFrontendStore()
|
||||||
export const backendUiStore = getBackendUiStore()
|
|
||||||
export const automationStore = getAutomationStore()
|
export const automationStore = getAutomationStore()
|
||||||
export const themeStore = getThemeStore()
|
export const themeStore = getThemeStore()
|
||||||
export const hostingStore = getHostingStore()
|
export const hostingStore = getHostingStore()
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { backendUiStore, store, allScreens } from "builderStore"
|
import { store, allScreens } from "builderStore"
|
||||||
import { tables } from 'builderStore/store/backend/'
|
import { tables } from 'builderStore/store/backend/'
|
||||||
import { notifier } from "builderStore/store/notifications"
|
import { notifier } from "builderStore/store/notifications"
|
||||||
import { DropdownMenu, Button, Input } from "@budibase/bbui"
|
import { DropdownMenu, Button, Input } from "@budibase/bbui"
|
||||||
|
@ -52,14 +52,9 @@
|
||||||
|
|
||||||
function checkValid(evt) {
|
function checkValid(evt) {
|
||||||
const tableName = evt.target.value
|
const tableName = evt.target.value
|
||||||
if (
|
error = originalName !== tableName
|
||||||
originalName !== tableName &&
|
? `Table with name ${tableName} already exists. Please choose another name.`
|
||||||
$backendUiStore.models?.some(model => model.name === tableName)
|
: ""
|
||||||
) {
|
|
||||||
error = `Table with name ${tableName} already exists. Please choose another name.`
|
|
||||||
return
|
|
||||||
}
|
|
||||||
error = ""
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
import {
|
import {
|
||||||
store,
|
store,
|
||||||
automationStore,
|
automationStore,
|
||||||
backendUiStore,
|
|
||||||
hostingStore,
|
hostingStore,
|
||||||
} from "builderStore"
|
} from "builderStore"
|
||||||
import { string, object } from "yup"
|
import { string, object } from "yup"
|
||||||
|
@ -152,7 +151,7 @@
|
||||||
)
|
)
|
||||||
const pkg = await applicationPkg.json()
|
const pkg = await applicationPkg.json()
|
||||||
if (applicationPkg.ok) {
|
if (applicationPkg.ok) {
|
||||||
backendUiStore.actions.reset()
|
// backendUiStore.actions.reset()
|
||||||
await store.actions.initialise(pkg)
|
await store.actions.initialise(pkg)
|
||||||
await automationStore.actions.fetch()
|
await automationStore.actions.fetch()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
const pkg = await res.json()
|
const pkg = await res.json()
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
backendUiStore.actions.reset()
|
// backendUiStore.actions.reset()
|
||||||
await store.actions.initialise(pkg)
|
await store.actions.initialise(pkg)
|
||||||
await automationStore.actions.fetch()
|
await automationStore.actions.fetch()
|
||||||
await roles.fetch()
|
await roles.fetch()
|
||||||
|
|
Loading…
Reference in New Issue