diff --git a/packages/bbui/src/Form/FieldLabel.svelte b/packages/bbui/src/Form/FieldLabel.svelte
index b070df8cae..3606d77c7b 100644
--- a/packages/bbui/src/Form/FieldLabel.svelte
+++ b/packages/bbui/src/Form/FieldLabel.svelte
@@ -1,19 +1,24 @@
-
+
+
+
diff --git a/packages/bbui/src/Tooltip/TooltipWrapper.svelte b/packages/bbui/src/Tooltip/TooltipWrapper.svelte
new file mode 100644
index 0000000000..c587dec1dc
--- /dev/null
+++ b/packages/bbui/src/Tooltip/TooltipWrapper.svelte
@@ -0,0 +1,60 @@
+
+
+
+
+ {#if tooltip}
+
+
(showTooltip = true)}
+ on:mouseleave={() => (showTooltip = false)}
+ >
+
+
+ {#if showTooltip}
+
+
+
+ {/if}
+
+ {/if}
+
+
+
diff --git a/packages/builder/package.json b/packages/builder/package.json
index 960a320c53..4bacc69112 100644
--- a/packages/builder/package.json
+++ b/packages/builder/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
- "version": "1.0.44-alpha.9",
+ "version": "1.0.49-alpha.4",
"license": "GPL-3.0",
"private": true,
"scripts": {
@@ -65,10 +65,10 @@
}
},
"dependencies": {
- "@budibase/bbui": "^1.0.44-alpha.9",
- "@budibase/client": "^1.0.44-alpha.9",
+ "@budibase/bbui": "^1.0.49-alpha.4",
+ "@budibase/client": "^1.0.49-alpha.4",
"@budibase/colorpicker": "1.1.2",
- "@budibase/string-templates": "^1.0.44-alpha.9",
+ "@budibase/string-templates": "^1.0.49-alpha.4",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",
diff --git a/packages/builder/src/builderStore/api.js b/packages/builder/src/builderStore/api.js
index 897d3a74db..a932799701 100644
--- a/packages/builder/src/builderStore/api.js
+++ b/packages/builder/src/builderStore/api.js
@@ -1,11 +1,20 @@
import { store } from "./index"
import { get as svelteGet } from "svelte/store"
import { removeCookie, Cookies } from "./cookies"
+import { auth } from "stores/portal"
const apiCall =
method =>
async (url, body, headers = { "Content-Type": "application/json" }) => {
headers["x-budibase-app-id"] = svelteGet(store).appId
+ headers["x-budibase-api-version"] = "1"
+
+ // add csrf token if authenticated
+ const user = svelteGet(auth).user
+ if (user && user.csrfToken) {
+ headers["x-csrf-token"] = user.csrfToken
+ }
+
const json = headers["Content-Type"] === "application/json"
const resp = await fetch(url, {
method: method,
diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js
index 23704556ad..5181e756c6 100644
--- a/packages/builder/src/builderStore/index.js
+++ b/packages/builder/src/builderStore/index.js
@@ -1,6 +1,5 @@
import { getFrontendStore } from "./store/frontend"
import { getAutomationStore } from "./store/automation"
-import { getHostingStore } from "./store/hosting"
import { getThemeStore } from "./store/theme"
import { derived, writable } from "svelte/store"
import { FrontendTypes, LAYOUT_NAMES } from "../constants"
@@ -9,7 +8,6 @@ import { findComponent } from "./componentUtils"
export const store = getFrontendStore()
export const automationStore = getAutomationStore()
export const themeStore = getThemeStore()
-export const hostingStore = getHostingStore()
export const currentAsset = derived(store, $store => {
const type = $store.currentFrontEndType
diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js
index fdfe450edf..0d740e08e0 100644
--- a/packages/builder/src/builderStore/store/frontend.js
+++ b/packages/builder/src/builderStore/store/frontend.js
@@ -2,7 +2,6 @@ import { get, writable } from "svelte/store"
import { cloneDeep } from "lodash/fp"
import {
allScreens,
- hostingStore,
currentAsset,
mainLayout,
selectedComponent,
@@ -100,7 +99,6 @@ export const getFrontendStore = () => {
version: application.version,
revertableVersion: application.revertableVersion,
}))
- await hostingStore.actions.fetch()
// Initialise backend stores
const [_integrations] = await Promise.all([
diff --git a/packages/builder/src/builderStore/store/hosting.js b/packages/builder/src/builderStore/store/hosting.js
deleted file mode 100644
index fb174c2663..0000000000
--- a/packages/builder/src/builderStore/store/hosting.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import { writable } from "svelte/store"
-import api, { get } from "../api"
-
-const INITIAL_HOSTING_UI_STATE = {
- appUrl: "",
- deployedApps: {},
- deployedAppNames: [],
- deployedAppUrls: [],
-}
-
-export const getHostingStore = () => {
- const store = writable({ ...INITIAL_HOSTING_UI_STATE })
- store.actions = {
- fetch: async () => {
- const response = await api.get("/api/hosting/urls")
- const urls = await response.json()
- store.update(state => {
- state.appUrl = urls.app
- return state
- })
- },
- fetchDeployedApps: async () => {
- let deployments = await (await get("/api/hosting/apps")).json()
- store.update(state => {
- state.deployedApps = deployments
- state.deployedAppNames = Object.values(deployments).map(app => app.name)
- state.deployedAppUrls = Object.values(deployments).map(app => app.url)
- return state
- })
- return deployments
- },
- }
- return store
-}
diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
index 1fa5c6e073..0d73f3d36d 100644
--- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
+++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
@@ -22,8 +22,10 @@
RelationshipTypes,
ALLOWABLE_STRING_OPTIONS,
ALLOWABLE_NUMBER_OPTIONS,
+ ALLOWABLE_JSON_OPTIONS,
ALLOWABLE_STRING_TYPES,
ALLOWABLE_NUMBER_TYPES,
+ ALLOWABLE_JSON_TYPES,
SWITCHABLE_TYPES,
} from "constants/backend"
import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils"
@@ -150,6 +152,7 @@
delete field.subtype
delete field.tableId
delete field.relationshipType
+ delete field.formulaType
// Add in defaults and initial definition
const definition = fieldDefinitions[event.detail?.toUpperCase()]
@@ -161,6 +164,9 @@
if (field.type === LINK_TYPE) {
field.relationshipType = RelationshipTypes.MANY_TO_MANY
}
+ if (field.type === FORMULA_TYPE) {
+ field.formulaType = "dynamic"
+ }
}
function onChangeRequired(e) {
@@ -241,6 +247,11 @@
ALLOWABLE_NUMBER_TYPES.indexOf(field.type) !== -1
) {
return ALLOWABLE_NUMBER_OPTIONS
+ } else if (
+ originalName &&
+ ALLOWABLE_JSON_TYPES.indexOf(field.type) !== -1
+ ) {
+ return ALLOWABLE_JSON_OPTIONS
} else if (!external) {
return [
...Object.values(fieldDefinitions),
@@ -431,8 +442,22 @@
error={errors.relatedName}
/>
{:else if field.type === FORMULA_TYPE}
+ {#if !table.sql}
+