- Build, automate and self-host internal tools in minutes
+ The low code platform you'll enjoy using
- Budibase is an open-source low-code platform, helping developers and IT professionals build, automate, and ship internal tools on their own infrastructure in minutes.
+ Budibase is an open source low-code platform, and the easiest way to build internal tools that improve productivity.
🤖 🎨 🚀
+
-
+
@@ -65,68 +66,25 @@
- **Admin paradise.** Budibase is made to scale. With Budibase, you can self-host on your own infrastructure and globally manage users, onboarding, SMTP, apps, groups, theming and more. You can also provide users/groups with an app portal and disseminate user-management to the group manager.
-
-
----
-
-
+
## 🏁 Get started
-Currently there are two ways to get started with Budibase; Digital Ocean, and Docker.
+
+
+
+Deploy Budibase self-Hosted in your existing infrastructure, using Docker, Kubernetes, and Digital Ocean.
+Or use Budibase Cloud if you don't need to self-host, and would like to get started quickly.
+
+### [Get started with Budibase](https://budibase.com)
+
+
-### Get started with Digital Ocean
-The easiest and quickest way to get started, is to use Digital Ocean:
-1-click Digital Ocean deploy
-
-
-
-
-
-
-### Get started with Docker
-To get started, you must have docker and docker compose installed on your machine.
-Once you have Docker installed, the process takes 5 minutes, with these four steps:
-
-1. Install the Budibase CLI.
-
-```
-$ npm i -g @budibase/cli
-```
-
-
-2. Setup Budibase (select where to store Budibase, and the port to run it on)
-
-```
-budi hosting --init
-```
-
-
-3. Run Budibase
-
-```
-budi hosting --start
-```
-
-
-4. Create your admin user
-
-Enter the email and password for the new admin user.
-
-Done! You are now ready to build powerful internal tools in minutes. For additional information on how to get started and learn Budibase, visit our [docs](https://docs.budibase.com/getting-started).
-
-
-
----
-
-
-
## 🎓 Learning Budibase
The Budibase documentation [lives here](https://docs.budibase.com).
----
@@ -134,22 +92,17 @@ The Budibase documentation [lives here](https://docs.budibase.com).
If you have a question or would like to talk with other Budibase users and join our community, please hop over to [Github discussions](https://github.com/Budibase/budibase/discussions)
-
+
-
-
----
-
-
## ❗ Code of conduct
Budibase is dedicated to providing a welcoming, diverse, and harrassment-free experience for everyone. We expect everyone in the Budibase community to abide by our [**Code of Conduct**](https://github.com/Budibase/budibase/blob/HEAD/.github/CODE_OF_CONDUCT.md). Please read it.
----
-
+
+
## 🙌 Contributing to Budibase
@@ -168,32 +121,22 @@ Budibase is a monorepo managed by lerna. Lerna manages the building and publishi
- [packages/server](https://github.com/Budibase/budibase/tree/HEAD/packages/server) - The budibase server. This Koa app is responsible for serving the JS for the builder and budibase apps, as well as providing the API for interaction with the database and file system.
For more information, see [CONTRIBUTING.md](https://github.com/Budibase/budibase/blob/HEAD/.github/CONTRIBUTING.md)
-
-
----
+
## 📝 License
Budibase is open-source, licensed as [GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html). The client and component libraries are licensed as [MPL](https://directory.fsf.org/wiki/License:MPL-2.0) - so the apps that you build can be licensed however you like.
+
----
-
-
-
-
## ⭐ Stargazers over time
[![Stargazers over time](https://starchart.cc/Budibase/budibase.svg)](https://starchart.cc/Budibase/budibase)
If you are having issues between updates of the builder, please use the guide [here](https://github.com/Budibase/budibase/blob/HEAD/.github/CONTRIBUTING.md#troubleshooting) to clear down your environment.
-
-
----
-
## Contributors ✨
diff --git a/lerna.json b/lerna.json
index af3bb8afb4..d8f7b40b3c 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "0.9.169-alpha.4",
+ "version": "0.9.169-alpha.9",
"npmClient": "yarn",
"packages": [
"packages/*"
diff --git a/packages/auth/package.json b/packages/auth/package.json
index a956233797..51cce29dc0 100644
--- a/packages/auth/package.json
+++ b/packages/auth/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/auth",
- "version": "0.9.169-alpha.4",
+ "version": "0.9.169-alpha.9",
"description": "Authentication middlewares for budibase builder and apps",
"main": "src/index.js",
"author": "Budibase",
diff --git a/packages/bbui/package.json b/packages/bbui/package.json
index 07dbbf2d97..bfe635124b 100644
--- a/packages/bbui/package.json
+++ b/packages/bbui/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
- "version": "0.9.169-alpha.4",
+ "version": "0.9.169-alpha.9",
"license": "AGPL-3.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
diff --git a/packages/bbui/src/Form/Core/DatePicker.svelte b/packages/bbui/src/Form/Core/DatePicker.svelte
index 176db9f497..71126a5b13 100644
--- a/packages/bbui/src/Form/Core/DatePicker.svelte
+++ b/packages/bbui/src/Form/Core/DatePicker.svelte
@@ -31,7 +31,11 @@
const handleChange = event => {
const [dates] = event.detail
- dispatch("change", dates[0])
+ let newValue = dates[0]
+ if (newValue) {
+ newValue = newValue.toISOString()
+ }
+ dispatch("change", newValue)
}
const clearDateOnBackspace = event => {
@@ -57,11 +61,38 @@
const els = document.querySelectorAll(`#${flatpickrId} input`)
els.forEach(el => el.blur())
}
+
+ const parseDate = val => {
+ if (!val) {
+ return null
+ }
+ let date
+ if (val instanceof Date) {
+ // Use real date obj if already parsed
+ date = val
+ } else if (isNaN(val)) {
+ // Treat as date string of some sort
+ date = new Date(val)
+ } else {
+ // Treat as numerical timestamp
+ date = new Date(parseInt(val))
+ }
+ const time = date.getTime()
+ if (isNaN(time)) {
+ return null
+ }
+ // By rounding to the nearest second we avoid locking up in an endless
+ // loop in the builder, caused by potentially enriching {{ now }} to every
+ // millisecond.
+ return new Date(Math.floor(time / 1000) * 1000)
+ }
+
+ $: console.log(value)
{
- const isoString = e.detail.toISOString()
- value = isoString
- dispatch("change", isoString)
+ value = e.detail
+ dispatch("change", e.detail)
}
diff --git a/packages/builder/package.json b/packages/builder/package.json
index ef7b5102cf..12f617fcbf 100644
--- a/packages/builder/package.json
+++ b/packages/builder/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
- "version": "0.9.169-alpha.4",
+ "version": "0.9.169-alpha.9",
"license": "AGPL-3.0",
"private": true,
"scripts": {
@@ -65,10 +65,10 @@
}
},
"dependencies": {
- "@budibase/bbui": "^0.9.169-alpha.4",
- "@budibase/client": "^0.9.169-alpha.4",
+ "@budibase/bbui": "^0.9.169-alpha.9",
+ "@budibase/client": "^0.9.169-alpha.9",
"@budibase/colorpicker": "1.1.2",
- "@budibase/string-templates": "^0.9.169-alpha.4",
+ "@budibase/string-templates": "^0.9.169-alpha.9",
"@sentry/browser": "6.0.0",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",
diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js
index 3389e20d40..a19646e6fd 100644
--- a/packages/builder/src/builderStore/dataBinding.js
+++ b/packages/builder/src/builderStore/dataBinding.js
@@ -472,7 +472,7 @@ function bindingReplacement(bindableProperties, textWithBindings, convertTo) {
idx = searchString.indexOf(from)
if (idx !== -1) {
let end = idx + from.length,
- searchReplace = Array(binding[convertTo].length).join("*")
+ searchReplace = Array(binding[convertTo].length + 1).join("*")
// blank out parts of the search string
searchString = replaceBetween(searchString, idx, end, searchReplace)
newBoundValue = replaceBetween(
diff --git a/packages/builder/src/components/backend/DataTable/modals/FilterModal.svelte b/packages/builder/src/components/backend/DataTable/modals/FilterModal.svelte
index 1b2e92ced2..2b76fd2209 100644
--- a/packages/builder/src/components/backend/DataTable/modals/FilterModal.svelte
+++ b/packages/builder/src/components/backend/DataTable/modals/FilterModal.svelte
@@ -90,34 +90,30 @@
function isMultipleChoice(field) {
return (
- (viewTable.schema[field].constraints &&
- viewTable.schema[field].constraints.inclusion &&
- viewTable.schema[field].constraints.inclusion.length) ||
- viewTable.schema[field].type === "boolean"
+ viewTable.schema[field]?.constraints?.inclusion?.length ||
+ viewTable.schema[field]?.type === "boolean"
)
}
function fieldOptions(field) {
- return viewTable.schema[field].type === "options"
- ? viewTable.schema[field].constraints.inclusion
+ return viewTable.schema[field]?.type === "options"
+ ? viewTable.schema[field]?.constraints.inclusion
: [true, false]
}
function isDate(field) {
- return viewTable.schema[field].type === "datetime"
+ return viewTable.schema[field]?.type === "datetime"
}
function isNumber(field) {
- return viewTable.schema[field].type === "number"
+ return viewTable.schema[field]?.type === "number"
}
const fieldChanged = filter => ev => {
- // reset if type changed
- if (
- filter.key &&
- ev.detail &&
- viewTable.schema[filter.key].type !== viewTable.schema[ev.detail].type
- ) {
+ // Reset if type changed
+ const oldType = viewTable.schema[filter.key]?.type
+ const newType = viewTable.schema[ev.detail]?.type
+ if (filter.key && ev.detail && oldType !== newType) {
filter.value = ""
}
}
diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte
index 29c3ad2022..2c8ae25abe 100644
--- a/packages/builder/src/components/start/CreateAppModal.svelte
+++ b/packages/builder/src/components/start/CreateAppModal.svelte
@@ -66,6 +66,11 @@
const checkValidity = async (values, validator) => {
const obj = object().shape(validator)
Object.keys(validator).forEach(key => ($errors[key] = null))
+ if (template?.fromFile && values.file == null) {
+ valid = false
+ return
+ }
+
try {
await obj.validate(values, { abortEarly: false })
} catch (validationErrors) {
@@ -73,6 +78,7 @@
$errors[error.path] = capitalise(error.message)
})
}
+
valid = await obj.isValid(values)
}
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 9bf7539c73..ca560d09b5 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
- "version": "0.9.169-alpha.4",
+ "version": "0.9.169-alpha.9",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {
diff --git a/packages/client/package.json b/packages/client/package.json
index ab32642fa7..1615cd29bf 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/client",
- "version": "0.9.169-alpha.4",
+ "version": "0.9.169-alpha.9",
"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": "^0.9.169-alpha.4",
+ "@budibase/bbui": "^0.9.169-alpha.9",
"@budibase/standard-components": "^0.9.139",
- "@budibase/string-templates": "^0.9.169-alpha.4",
+ "@budibase/string-templates": "^0.9.169-alpha.9",
"regexparam": "^1.3.0",
"shortid": "^2.2.15",
"svelte-spa-router": "^3.0.5"
diff --git a/packages/client/src/components/app/forms/DateTimeField.svelte b/packages/client/src/components/app/forms/DateTimeField.svelte
index 466f7eafd5..515b6adc77 100644
--- a/packages/client/src/components/app/forms/DateTimeField.svelte
+++ b/packages/client/src/components/app/forms/DateTimeField.svelte
@@ -12,31 +12,6 @@
let fieldState
let fieldApi
-
- const parseDate = val => {
- if (!val) {
- return null
- }
- let date
- if (val instanceof Date) {
- // Use real date obj if already parsed
- date = val
- } else if (isNaN(val)) {
- // Treat as date string of some sort
- date = new Date(val)
- } else {
- // Treat as numerical timestamp
- date = new Date(parseInt(val))
- }
- const time = date.getTime()
- if (isNaN(time)) {
- return null
- }
- // By rounding to the nearest second we avoid locking up in an endless
- // loop in the builder, caused by potentially enriching {{ now }} to every
- // millisecond.
- return new Date(Math.floor(time / 1000) * 1000)
- }
{
let updatedRows = []
@@ -21,6 +27,7 @@ exports.checkForColumnUpdates = async (db, oldTable, updatedTable) => {
}
// check for renaming of columns or deleted columns
if (rename || deletedColumns.length !== 0) {
+ // Update all rows
const rows = await db.allDocs(
getRowParams(updatedTable._id, null, {
include_docs: true,
@@ -35,6 +42,9 @@ exports.checkForColumnUpdates = async (db, oldTable, updatedTable) => {
}
return doc
})
+
+ // Update views
+ await exports.checkForViewUpdates(db, updatedTable, rename, deletedColumns)
delete updatedTable._rename
}
return { rows: updatedRows, table: updatedTable }
@@ -223,4 +233,86 @@ exports.getExternalTable = async (appId, datasourceId, tableName) => {
return entities[tableName]
}
+exports.getTable = async (appId, tableId) => {
+ const db = new CouchDB(appId)
+ if (isExternalTable(tableId)) {
+ let { datasourceId, tableName } = breakExternalTableId(tableId)
+ return exports.getExternalTable(appId, datasourceId, tableName)
+ } else {
+ return db.get(tableId)
+ }
+}
+
+exports.checkForViewUpdates = async (db, table, rename, deletedColumns) => {
+ const views = await getViews(db)
+ const tableViews = views.filter(view => view.meta.tableId === table._id)
+
+ // Check each table view to see if impacted by this table action
+ for (let view of tableViews) {
+ let needsUpdated = false
+
+ // First check for renames, otherwise check for deletions
+ if (rename) {
+ // Update calculation field if required
+ if (view.meta.field === rename.old) {
+ view.meta.field = rename.updated
+ needsUpdated = true
+ }
+
+ // Update group by field if required
+ if (view.meta.groupBy === rename.old) {
+ view.meta.groupBy = rename.updated
+ needsUpdated = true
+ }
+
+ // Update filters if required
+ if (view.meta.filters) {
+ view.meta.filters.forEach(filter => {
+ if (filter.key === rename.old) {
+ filter.key = rename.updated
+ needsUpdated = true
+ }
+ })
+ }
+ } else if (deletedColumns) {
+ deletedColumns.forEach(column => {
+ // Remove calculation statement if required
+ if (view.meta.field === column) {
+ delete view.meta.field
+ delete view.meta.calculation
+ delete view.meta.groupBy
+ needsUpdated = true
+ }
+
+ // Remove group by field if required
+ if (view.meta.groupBy === column) {
+ delete view.meta.groupBy
+ needsUpdated = true
+ }
+
+ // Remove filters referencing deleted field if required
+ if (view.meta.filters && view.meta.filters.length) {
+ const initialLength = view.meta.filters.length
+ view.meta.filters = view.meta.filters.filter(filter => {
+ return filter.key !== column
+ })
+ if (initialLength !== view.meta.filters.length) {
+ needsUpdated = true
+ }
+ }
+ })
+ }
+
+ // Update view if required
+ if (needsUpdated) {
+ const newViewTemplate = viewTemplate(view.meta)
+ await saveView(db, null, view.name, newViewTemplate)
+ if (!newViewTemplate.meta.schema) {
+ newViewTemplate.meta.schema = table.schema
+ }
+ table.views[view.name] = newViewTemplate.meta
+ }
+ }
+}
+
exports.TableSaveFunctions = TableSaveFunctions
diff --git a/packages/server/src/automations/automationUtils.js b/packages/server/src/automations/automationUtils.js
index 5cb84c63b1..2cf4b35a18 100644
--- a/packages/server/src/automations/automationUtils.js
+++ b/packages/server/src/automations/automationUtils.js
@@ -1,9 +1,4 @@
-const CouchDB = require("../db")
-const {
- isExternalTable,
- breakExternalTableId,
-} = require("../integrations/utils")
-const { getExternalTable } = require("../api/controllers/table/utils")
+const { getTable } = require("../api/controllers/table/utils")
/**
* When values are input to the system generally they will be of type string as this is required for template strings.
@@ -21,7 +16,7 @@ const { getExternalTable } = require("../api/controllers/table/utils")
* @returns {object} The inputs object which has had all the various types supported by this function converted to their
* primitive types.
*/
-module.exports.cleanInputValues = (inputs, schema) => {
+exports.cleanInputValues = (inputs, schema) => {
if (schema == null) {
return inputs
}
@@ -63,30 +58,11 @@ module.exports.cleanInputValues = (inputs, schema) => {
* @param {object} row The input row structure which requires clean-up after having been through template statements.
* @returns {Promise