Fix client errors
This commit is contained in:
parent
299dcbab3d
commit
bf5aa49e4d
|
@ -2,7 +2,7 @@ import { attachChildren } from "./render/attachChildren"
|
||||||
import { createTreeNode } from "./render/prepareRenderComponent"
|
import { createTreeNode } from "./render/prepareRenderComponent"
|
||||||
import { screenRouter } from "./render/screenRouter"
|
import { screenRouter } from "./render/screenRouter"
|
||||||
import { createStateManager } from "./state/stateManager"
|
import { createStateManager } from "./state/stateManager"
|
||||||
import { getAppId } from "./render/getAppId"
|
import { getAppId } from "../../component-sdk/src/utils"
|
||||||
|
|
||||||
export const createApp = ({
|
export const createApp = ({
|
||||||
componentLibraries,
|
componentLibraries,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { createApp } from "./createApp"
|
import { createApp } from "./createApp"
|
||||||
import { builtins, builtinLibName } from "./render/builtinComponents"
|
import { builtins, builtinLibName } from "./render/builtinComponents"
|
||||||
import { getAppId } from "./render/getAppId"
|
import { getAppId } from "../../component-sdk/src/utils"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a web application from static budibase definition files.
|
* create a web application from static budibase definition files.
|
||||||
|
|
|
@ -1,20 +1,12 @@
|
||||||
import setBindableComponentProp from "./setBindableComponentProp"
|
import setBindableComponentProp from "./setBindableComponentProp"
|
||||||
import { attachChildren } from "../render/attachChildren"
|
import { attachChildren } from "../render/attachChildren"
|
||||||
import store from "../state/store"
|
import store from "../state/store"
|
||||||
import { baseApiCall } from "../api/index"
|
|
||||||
|
|
||||||
export const bbFactory = ({
|
export const bbFactory = ({
|
||||||
componentLibraries,
|
componentLibraries,
|
||||||
onScreenSlotRendered,
|
onScreenSlotRendered,
|
||||||
runEventActions,
|
runEventActions,
|
||||||
}) => {
|
}) => {
|
||||||
const api = {
|
|
||||||
post: (url, body) => baseApiCall("POST", url, body),
|
|
||||||
get: (url, body) => baseApiCall("GET", url, body),
|
|
||||||
patch: (url, body) => baseApiCall("PATCH", url, body),
|
|
||||||
delete: (url, body) => baseApiCall("DELETE", url, body),
|
|
||||||
}
|
|
||||||
|
|
||||||
return (treeNode, setupState) => {
|
return (treeNode, setupState) => {
|
||||||
const attachParams = {
|
const attachParams = {
|
||||||
componentLibraries,
|
componentLibraries,
|
||||||
|
@ -33,7 +25,6 @@ export const bbFactory = ({
|
||||||
store.getState(treeNode.contextStoreKey)
|
store.getState(treeNode.contextStoreKey)
|
||||||
)),
|
)),
|
||||||
setBinding: setBindableComponentProp(treeNode),
|
setBinding: setBindableComponentProp(treeNode),
|
||||||
api,
|
|
||||||
parent,
|
parent,
|
||||||
store: store.getStore(treeNode.contextStoreKey),
|
store: store.getStore(treeNode.contextStoreKey),
|
||||||
// these parameters are populated by screenRouter
|
// these parameters are populated by screenRouter
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
import api from "../api"
|
|
||||||
import renderTemplateString from "./renderTemplateString"
|
import renderTemplateString from "./renderTemplateString"
|
||||||
|
import { updateRow, saveRow, deleteRow } from "../../../component-sdk"
|
||||||
|
|
||||||
export const EVENT_TYPE_MEMBER_NAME = "##eventHandlerType"
|
export const EVENT_TYPE_MEMBER_NAME = "##eventHandlerType"
|
||||||
|
|
||||||
export const eventHandlers = routeTo => {
|
export const eventHandlers = routeTo => {
|
||||||
const handlers = {
|
const handlers = {
|
||||||
"Navigate To": param => routeTo(param && param.url),
|
"Navigate To": param => routeTo(param && param.url),
|
||||||
"Update Row": api.updateRow,
|
"Update Row": updateRow,
|
||||||
"Save Row": api.saveRow,
|
"Save Row": saveRow,
|
||||||
"Delete Row": api.deleteRow,
|
"Delete Row": deleteRow,
|
||||||
"Trigger Workflow": api.triggerWorkflow,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// when an event is called, this is what gets run
|
// when an event is called, this is what gets run
|
||||||
|
|
Loading…
Reference in New Issue