@@ -39,6 +63,7 @@
on:focus={() => (focused = true)}
on:blur={() => (focused = false)}
class:placeholder
+ bind:this={ref}
/>
{#if suffix && !placeholder}
{suffix}
@@ -74,4 +99,11 @@
line-height: 17px;
font-family: var(--font-sans);
}
+ input:-webkit-autofill {
+ border-radius: 2px;
+ -webkit-box-shadow: 0 0 0 100px var(--spectrum-global-color-gray-300) inset;
+ -webkit-text-fill-color: var(--spectrum-global-color-gray-900);
+ transition: -webkit-box-shadow 130ms 200ms, background-color 0s 86400s;
+ padding: 3px 8px 4px 8px;
+ }
diff --git a/packages/bbui/src/Form/Core/TextField.svelte b/packages/bbui/src/Form/Core/TextField.svelte
index fe05ef2c64..acc2169a06 100644
--- a/packages/bbui/src/Form/Core/TextField.svelte
+++ b/packages/bbui/src/Form/Core/TextField.svelte
@@ -13,6 +13,7 @@
export let quiet = false
export let align
export let autofocus = false
+ export let autocomplete = null
const dispatch = createEventDispatcher()
@@ -103,6 +104,7 @@
class="spectrum-Textfield-input"
style={align ? `text-align: ${align};` : ""}
inputmode={type === "number" ? "decimal" : "text"}
+ {autocomplete}
/>
diff --git a/packages/bbui/src/Form/Input.svelte b/packages/bbui/src/Form/Input.svelte
index f37cf55b63..d3cb13e731 100644
--- a/packages/bbui/src/Form/Input.svelte
+++ b/packages/bbui/src/Form/Input.svelte
@@ -14,6 +14,7 @@
export let updateOnChange = true
export let quiet = false
export let autofocus
+ export let autocomplete
const dispatch = createEventDispatcher()
const onChange = e => {
@@ -33,6 +34,7 @@
{type}
{quiet}
{autofocus}
+ {autocomplete}
on:change={onChange}
on:click
on:input
diff --git a/packages/builder/package.json b/packages/builder/package.json
index 153da728e0..3255a98ae2 100644
--- a/packages/builder/package.json
+++ b/packages/builder/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"license": "GPL-3.0",
"private": true,
"scripts": {
@@ -58,10 +58,10 @@
}
},
"dependencies": {
- "@budibase/bbui": "2.3.2-alpha.3",
- "@budibase/client": "2.3.2-alpha.3",
- "@budibase/frontend-core": "2.3.2-alpha.3",
- "@budibase/string-templates": "2.3.2-alpha.3",
+ "@budibase/bbui": "^2.3.10",
+ "@budibase/client": "^2.3.10",
+ "@budibase/frontend-core": "^2.3.10",
+ "@budibase/string-templates": "^2.3.10",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",
diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
index 3e5549fcf5..95e53b4192 100644
--- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
+++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
@@ -75,16 +75,20 @@
editableColumn.constraints.presence = { allowEmpty: false }
}
- $: if (field && !savingColumn) {
- editableColumn = cloneDeep(field)
- originalName = editableColumn.name ? editableColumn.name + "" : null
- linkEditDisabled = originalName != null
- isCreating = originalName == null
- primaryDisplay =
- $tables.selected.primaryDisplay == null ||
- $tables.selected.primaryDisplay === editableColumn.name
+ const initialiseField = (field, savingColumn) => {
+ if (field && !savingColumn) {
+ editableColumn = cloneDeep(field)
+ originalName = editableColumn.name ? editableColumn.name + "" : null
+ linkEditDisabled = originalName != null
+ isCreating = originalName == null
+ primaryDisplay =
+ $tables.selected.primaryDisplay == null ||
+ $tables.selected.primaryDisplay === editableColumn.name
+ }
}
+ $: initialiseField(field, savingColumn)
+
$: checkConstraints(editableColumn)
$: required = !!editableColumn?.constraints?.presence || primaryDisplay
$: uneditable =
@@ -583,7 +587,12 @@
title="Formula"
label="Formula"
value={editableColumn.formula}
- on:change={e => (editableColumn.formula = e.detail)}
+ on:change={e => {
+ editableColumn = {
+ ...editableColumn,
+ formula: e.detail,
+ }
+ }}
bindings={getBindings({ table })}
allowJS
/>
diff --git a/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte b/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte
index 602a054eaf..e41ec8f745 100644
--- a/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte
+++ b/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte
@@ -71,6 +71,7 @@
}
}}
value={productionValue}
+ autocomplete="new-password"
/>
@@ -83,6 +84,7 @@
disabled={useProductionValue}
label="Value"
value={useProductionValue ? productionValue : developmentValue}
+ autocomplete="new-password"
/>
diff --git a/packages/builder/src/components/portal/onboarding/tours.js b/packages/builder/src/components/portal/onboarding/tours.js
index 8acd5bb8ce..d1485c4872 100644
--- a/packages/builder/src/components/portal/onboarding/tours.js
+++ b/packages/builder/src/components/portal/onboarding/tours.js
@@ -62,6 +62,7 @@ const getTours = () => {
id: TOUR_STEP_KEYS.BUILDER_APP_PUBLISH,
title: "Publish",
layout: OnboardingPublish,
+ route: "/builder/app/:application/design",
query: ".toprightnav #builder-app-publish-button",
onLoad: () => {
tourEvent(TOUR_STEP_KEYS.BUILDER_APP_PUBLISH)
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsSection.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsSection.svelte
index bf8bff1292..21bed847f5 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsSection.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsSection.svelte
@@ -147,8 +147,8 @@
options: setting.options || [],
// Number fields
- min: setting.min || null,
- max: setting.max || null,
+ min: setting.min ?? null,
+ max: setting.max ?? null,
}}
{bindings}
{componentBindings}
diff --git a/packages/cli/package.json b/packages/cli/package.json
index ae44bd0a83..02029a6162 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {
@@ -26,9 +26,9 @@
"outputPath": "build"
},
"dependencies": {
- "@budibase/backend-core": "2.3.2-alpha.3",
- "@budibase/string-templates": "2.3.2-alpha.3",
- "@budibase/types": "2.3.2-alpha.3",
+ "@budibase/backend-core": "^2.3.10",
+ "@budibase/string-templates": "^2.3.10",
+ "@budibase/types": "^2.3.10",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",
diff --git a/packages/client/package.json b/packages/client/package.json
index 6206e2923e..a3ca8fd41b 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/client",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@@ -19,9 +19,9 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
- "@budibase/bbui": "2.3.2-alpha.3",
- "@budibase/frontend-core": "2.3.2-alpha.3",
- "@budibase/string-templates": "2.3.2-alpha.3",
+ "@budibase/bbui": "^2.3.10",
+ "@budibase/frontend-core": "^2.3.10",
+ "@budibase/string-templates": "^2.3.10",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",
diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json
index cc0c51339f..80f0951d1d 100644
--- a/packages/frontend-core/package.json
+++ b/packages/frontend-core/package.json
@@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
- "@budibase/bbui": "2.3.2-alpha.3",
+ "@budibase/bbui": "^2.3.10",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index 246a6842e7..e7cd87e039 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/sdk",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"description": "Budibase Public API SDK",
"author": "Budibase",
"license": "MPL-2.0",
diff --git a/packages/server/package.json b/packages/server/package.json
index 391a5f326f..17dce32e07 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@@ -43,11 +43,11 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
- "@budibase/backend-core": "2.3.2-alpha.3",
- "@budibase/client": "2.3.2-alpha.3",
- "@budibase/pro": "2.3.2-alpha.3",
- "@budibase/string-templates": "2.3.2-alpha.3",
- "@budibase/types": "2.3.2-alpha.3",
+ "@budibase/backend-core": "^2.3.10",
+ "@budibase/client": "^2.3.10",
+ "@budibase/pro": "2.3.10",
+ "@budibase/string-templates": "^2.3.10",
+ "@budibase/types": "^2.3.10",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",
diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts
index 2a43c3665c..6120c3cdcb 100644
--- a/packages/server/src/api/controllers/row/external.ts
+++ b/packages/server/src/api/controllers/row/external.ts
@@ -191,7 +191,7 @@ export async function validate(ctx: BBContext) {
}
export async function exportRows(ctx: BBContext) {
- const { datasourceId } = breakExternalTableId(ctx.params.tableId)
+ const { datasourceId, tableName } = breakExternalTableId(ctx.params.tableId)
const format = ctx.query.format
const { columns } = ctx.request.body
const datasource = await sdk.datasources.get(datasourceId!)
@@ -227,7 +227,9 @@ export async function exportRows(ctx: BBContext) {
rows = result.rows
}
- // @ts-ignore
+ if (!tableName) {
+ ctx.throw(400, "Could not find table name.")
+ }
let schema = datasource.entities[tableName].schema
let exportRows = cleanExportRows(rows, schema, format, columns)
diff --git a/packages/server/src/api/controllers/table/utils.ts b/packages/server/src/api/controllers/table/utils.ts
index 162df3754c..bbccde467b 100644
--- a/packages/server/src/api/controllers/table/utils.ts
+++ b/packages/server/src/api/controllers/table/utils.ts
@@ -104,7 +104,6 @@ export function importToRows(data: any, table: any, user: any = {}) {
const processed: any = inputProcessing(user, table, row, {
noAutoRelationships: true,
})
- table = processed.table
row = processed.row
let fieldName: any
@@ -113,6 +112,7 @@ export function importToRows(data: any, table: any, user: any = {}) {
// check whether the options need to be updated for inclusion as part of the data import
if (
schema.type === FieldTypes.OPTIONS &&
+ row[fieldName] &&
(!schema.constraints.inclusion ||
schema.constraints.inclusion.indexOf(row[fieldName]) === -1)
) {
@@ -120,6 +120,7 @@ export function importToRows(data: any, table: any, user: any = {}) {
...schema.constraints.inclusion,
row[fieldName],
]
+ schema.constraints.inclusion.sort()
}
}
diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts
index e2dd69da24..edbce6db0a 100644
--- a/packages/server/src/integrations/index.ts
+++ b/packages/server/src/integrations/index.ts
@@ -67,6 +67,15 @@ if (
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
}
+export async function getDefinition(source: SourceName): Promise {
+ // check if its integrated, faster
+ if (DEFINITIONS[source]) {
+ return DEFINITIONS[source]
+ }
+ const allDefinitions = await getDefinitions()
+ return allDefinitions[source]
+}
+
export async function getDefinitions() {
const pluginSchemas: { [key: string]: Integration } = {}
if (env.SELF_HOSTED) {
diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts
index 437a9812a6..2da190df5e 100644
--- a/packages/server/src/integrations/microsoftSqlServer.ts
+++ b/packages/server/src/integrations/microsoftSqlServer.ts
@@ -26,7 +26,7 @@ interface MSSQLConfig {
user: string
password: string
server: string
- port: number
+ port: number | string
database: string
schema: string
encrypt?: boolean
diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts
index 21a289858e..b3fe5bcdf1 100644
--- a/packages/server/src/sdk/app/datasources/datasources.ts
+++ b/packages/server/src/sdk/app/datasources/datasources.ts
@@ -3,6 +3,7 @@ import { findHBSBlocks, processObjectSync } from "@budibase/string-templates"
import {
Datasource,
DatasourceFieldType,
+ Integration,
PASSWORD_REPLACEMENT,
RestAuthConfig,
RestAuthType,
@@ -11,16 +12,38 @@ import {
} from "@budibase/types"
import { cloneDeep } from "lodash/fp"
import { getEnvironmentVariables } from "../../utils"
-import { getDefinitions } from "../../../integrations"
+import { getDefinitions, getDefinition } from "../../../integrations"
const ENV_VAR_PREFIX = "env."
+export function checkDatasourceTypes(schema: Integration, config: any) {
+ for (let key of Object.keys(config)) {
+ if (!schema.datasource[key]) {
+ continue
+ }
+ const type = schema.datasource[key].type
+ if (
+ type === DatasourceFieldType.NUMBER &&
+ typeof config[key] === "string"
+ ) {
+ config[key] = parseFloat(config[key])
+ }
+ }
+ return config
+}
+
async function enrichDatasourceWithValues(datasource: Datasource) {
const cloned = cloneDeep(datasource)
const env = await getEnvironmentVariables()
- const processed = processObjectSync(cloned, { env }, { onlyFound: true })
+ const processed = processObjectSync(
+ cloned,
+ { env },
+ { onlyFound: true }
+ ) as Datasource
+ const definition = await getDefinition(processed.source)
+ processed.config = checkDatasourceTypes(definition, processed.config)
return {
- datasource: processed as Datasource,
+ datasource: processed,
envVars: env as Record,
}
}
diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts
index 91105a2194..74c202c33d 100644
--- a/packages/server/src/threads/automation.ts
+++ b/packages/server/src/threads/automation.ts
@@ -464,13 +464,17 @@ export function execute(job: Job, callback: WorkerCallback) {
throw new Error("Unable to execute, event doesn't contain app ID.")
}
return context.doInAppContext(appId, async () => {
- const automationOrchestrator = new Orchestrator(job)
- try {
- const response = await automationOrchestrator.execute()
- callback(null, response)
- } catch (err) {
- callback(err)
- }
+ const envVars = await sdkUtils.getEnvironmentVariables()
+ // put into automation thread for whole context
+ await context.doInEnvironmentContext(envVars, async () => {
+ const automationOrchestrator = new Orchestrator(job)
+ try {
+ const response = await automationOrchestrator.execute()
+ callback(null, response)
+ } catch (err) {
+ callback(err)
+ }
+ })
})
}
@@ -480,11 +484,7 @@ export const removeStalled = async (job: Job) => {
throw new Error("Unable to execute, event doesn't contain app ID.")
}
await context.doInAppContext(appId, async () => {
- const envVars = await sdkUtils.getEnvironmentVariables()
- // put into automation thread for whole context
- await context.doInEnvironmentContext(envVars, async () => {
- const automationOrchestrator = new Orchestrator(job)
- await automationOrchestrator.stopCron("stalled")
- })
+ const automationOrchestrator = new Orchestrator(job)
+ await automationOrchestrator.stopCron("stalled")
})
}
diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json
index db734a754f..1d9d2b28cd 100644
--- a/packages/string-templates/package.json
+++ b/packages/string-templates/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",
diff --git a/packages/types/package.json b/packages/types/package.json
index 00500edecc..d0aebd9d8a 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/types",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"description": "Budibase types",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/packages/worker/package.json b/packages/worker/package.json
index 9a55f527df..628cbb1b14 100644
--- a/packages/worker/package.json
+++ b/packages/worker/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
- "version": "2.3.2-alpha.3",
+ "version": "2.3.10",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
- "@budibase/backend-core": "2.3.2-alpha.3",
- "@budibase/pro": "2.3.2-alpha.3",
- "@budibase/string-templates": "2.3.2-alpha.3",
- "@budibase/types": "2.3.2-alpha.3",
+ "@budibase/backend-core": "^2.3.10",
+ "@budibase/pro": "2.3.10",
+ "@budibase/string-templates": "^2.3.10",
+ "@budibase/types": "^2.3.10",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",