Fix client errors

This commit is contained in:
Andrew Kingston 2020-11-12 09:31:04 +00:00
parent aa70eab935
commit 0f12f19619
5 changed files with 6 additions and 16 deletions

View File

@ -2,7 +2,7 @@ import { attachChildren } from "./render/attachChildren"
import { createTreeNode } from "./render/prepareRenderComponent"
import { screenRouter } from "./render/screenRouter"
import { createStateManager } from "./state/stateManager"
import { getAppId } from "./render/getAppId"
import { getAppId } from "../../component-sdk/src/utils"
export const createApp = ({
componentLibraries,

View File

@ -1,6 +1,6 @@
import { createApp } from "./createApp"
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.

View File

@ -1,20 +1,12 @@
import setBindableComponentProp from "./setBindableComponentProp"
import { attachChildren } from "../render/attachChildren"
import store from "../state/store"
import { baseApiCall } from "../api/index"
export const bbFactory = ({
componentLibraries,
onScreenSlotRendered,
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) => {
const attachParams = {
componentLibraries,
@ -33,7 +25,6 @@ export const bbFactory = ({
store.getState(treeNode.contextStoreKey)
)),
setBinding: setBindableComponentProp(treeNode),
api,
parent,
store: store.getStore(treeNode.contextStoreKey),
// these parameters are populated by screenRouter

View File

@ -1,15 +1,14 @@
import api from "../api"
import renderTemplateString from "./renderTemplateString"
import { updateRow, saveRow, deleteRow } from "../../../component-sdk"
export const EVENT_TYPE_MEMBER_NAME = "##eventHandlerType"
export const eventHandlers = routeTo => {
const handlers = {
"Navigate To": param => routeTo(param && param.url),
"Update Row": api.updateRow,
"Save Row": api.saveRow,
"Delete Row": api.deleteRow,
"Trigger Workflow": api.triggerWorkflow,
"Update Row": updateRow,
"Save Row": saveRow,
"Delete Row": deleteRow,
}
// when an event is called, this is what gets run