diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 9cdf2b2114..560b273668 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -119,6 +119,8 @@ services: watchtower-service: image: containrrr/watchtower + ports: + - "${WATCHTOWER_PORT}:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock command: --debug --http-api-update bbapps bbworker @@ -128,8 +130,6 @@ services: - WATCHTOWER_CLEANUP=true labels: - "com.centurylinklabs.watchtower.enable=false" - ports: - - 6161:8080 volumes: diff --git a/hosting/hosting.properties b/hosting/hosting.properties index d11972bc4b..c8e2f5c606 100644 --- a/hosting/hosting.properties +++ b/hosting/hosting.properties @@ -17,4 +17,5 @@ WORKER_PORT=4003 MINIO_PORT=4004 COUCH_DB_PORT=4005 REDIS_PORT=6379 +WATCHTOWER_PORT=6161 BUDIBASE_ENVIRONMENT=PRODUCTION diff --git a/lerna.json b/lerna.json index c22342eeb7..b00fa15ba4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.105-alpha.33", + "version": "0.9.115", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 03737c6a79..898a209171 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.105-alpha.33", + "version": "0.9.115", "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 14291fae30..47b3ece07d 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.105-alpha.33", + "version": "0.9.115", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index d9c8c86764..fc2a50e8d8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.105-alpha.33", + "version": "0.9.115", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.105-alpha.33", - "@budibase/client": "^0.9.105-alpha.33", + "@budibase/bbui": "^0.9.115", + "@budibase/client": "^0.9.115", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.105-alpha.33", + "@budibase/string-templates": "^0.9.115", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/analytics.js b/packages/builder/src/analytics.js index bcc59eb311..5b130a8e6b 100644 --- a/packages/builder/src/analytics.js +++ b/packages/builder/src/analytics.js @@ -23,6 +23,7 @@ async function activate() { if (posthogConfigured) { posthog.init(process.env.POSTHOG_TOKEN, { autocapture: false, + capture_pageview: false, api_host: process.env.POSTHOG_URL, }) posthog.set_config({ persistence: "cookie" }) @@ -79,6 +80,7 @@ const isFeedbackTimeElapsed = sinceDateStr => { const feedbackMilliseconds = feedbackHours * 60 * 60 * 1000 return Date.now() > sinceDate + feedbackMilliseconds } + function submitFeedback(values) { if (!analyticsEnabled || !process.env.POSTHOG_TOKEN) return localStorage.setItem(FEEDBACK_SUBMITTED_KEY, Date.now()) diff --git a/packages/cli/package.json b/packages/cli/package.json index 61dba51cfb..49473b8d8e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.105-alpha.33", + "version": "0.9.115", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/cli/src/constants.js b/packages/cli/src/constants.js index fe7c61f4fa..7a3b1463ca 100644 --- a/packages/cli/src/constants.js +++ b/packages/cli/src/constants.js @@ -15,5 +15,6 @@ exports.AnalyticsEvents = { SelfHostInit: "hosting_init", } -exports.BUDIBASE_POSTHOG_URL = "https://posthog.budi.live" -exports.BUDIBASE_POSTHOG_TOKEN = "Oeq9KzIpZYaNsXIvHw5QTZWNpfiG_EOjAOpjTyAiitY" +exports.BUDIBASE_POSTHOG_URL = "https://app.posthog.com" +exports.BUDIBASE_POSTHOG_TOKEN = + "phc_yGOn4i7jWKaCTapdGR6lfA4AvmuEQ2ijn5zAVSFYPlS" diff --git a/packages/cli/src/hosting/makeEnv.js b/packages/cli/src/hosting/makeEnv.js index 8806c2e1e6..d1d23999f8 100644 --- a/packages/cli/src/hosting/makeEnv.js +++ b/packages/cli/src/hosting/makeEnv.js @@ -26,6 +26,7 @@ WORKER_PORT=4003 MINIO_PORT=4004 COUCH_DB_PORT=4005 REDIS_PORT=6379 +WATCHTOWER_PORT=6161 BUDIBASE_ENVIRONMENT=PRODUCTION` } diff --git a/packages/client/package.json b/packages/client/package.json index 9a2037b8ca..37c562368d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.105-alpha.33", + "version": "0.9.115", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.105-alpha.33", - "@budibase/standard-components": "^0.9.105-alpha.33", - "@budibase/string-templates": "^0.9.105-alpha.33", + "@budibase/bbui": "^0.9.115", + "@budibase/standard-components": "^0.9.115", + "@budibase/string-templates": "^0.9.115", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 75d2df4360..92985b30ba 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.105-alpha.33", + "version": "0.9.115", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -62,9 +62,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.105-alpha.33", - "@budibase/client": "^0.9.105-alpha.33", - "@budibase/string-templates": "^0.9.105-alpha.33", + "@budibase/auth": "^0.9.115", + "@budibase/client": "^0.9.115", + "@budibase/string-templates": "^0.9.115", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -117,7 +117,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.105-alpha.33", + "@budibase/standard-components": "^0.9.115", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/server/src/api/controllers/table/utils.js b/packages/server/src/api/controllers/table/utils.js index 78dae60ab1..154a9ba8f5 100644 --- a/packages/server/src/api/controllers/table/utils.js +++ b/packages/server/src/api/controllers/table/utils.js @@ -1,4 +1,5 @@ const CouchDB = require("../../../db") +const linkRows = require("../../../db/linkedRows") const csvParser = require("../../../utilities/csvParser") const { getRowParams, @@ -74,6 +75,16 @@ exports.handleDataImport = async (appId, user, table, dataImport) => { const processed = inputProcessing(user, table, row) table = processed.table row = processed.row + + // make sure link rows are up to date + row = await linkRows.updateLinks({ + appId, + eventType: linkRows.EventType.ROW_SAVE, + row, + tableId: row.tableId, + table, + }) + for (let [fieldName, schema] of Object.entries(table.schema)) { // check whether the options need to be updated for inclusion as part of the data import if ( diff --git a/packages/server/src/api/routes/tests/datasource.spec.js b/packages/server/src/api/routes/tests/datasource.spec.js index 7387dd3c46..98a99717fd 100644 --- a/packages/server/src/api/routes/tests/datasource.spec.js +++ b/packages/server/src/api/routes/tests/datasource.spec.js @@ -94,7 +94,7 @@ describe("/datasources", () => { .expect(200) // this is mock data, can't test it expect(res.body).toBeDefined() - expect(pg.queryMock).toHaveBeenCalledWith(`select "users"."name" as "users.name", "users"."age" as "users.age" from "users" where "users"."name" like $1 limit $2`, ["John%", 5000]) + expect(pg.queryMock).toHaveBeenCalledWith(`select "users"."name" as "users.name", "users"."age" as "users.age" from "users" where "users"."name" ilike $1 limit $2`, ["John%", 5000]) }) }) diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index ca6dcb15fd..f03c0dbd37 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -52,7 +52,7 @@ function addFilters( if (filters.string) { iterate(filters.string, (key, value) => { const fnc = allOr ? "orWhere" : "where" - query = query[fnc](key, "like", `${value}%`) + query = query[fnc](key, "ilike", `${value}%`) }) } if (filters.range) { diff --git a/packages/server/src/integrations/tests/sql.spec.js b/packages/server/src/integrations/tests/sql.spec.js index a02a7e8198..fa8bcd1d86 100644 --- a/packages/server/src/integrations/tests/sql.spec.js +++ b/packages/server/src/integrations/tests/sql.spec.js @@ -82,7 +82,7 @@ describe("SQL query builder", () => { })) expect(query).toEqual({ bindings: ["John%", limit], - sql: `select * from "${TABLE_NAME}" where "${TABLE_NAME}"."name" like $1 limit $2` + sql: `select * from "${TABLE_NAME}" where "${TABLE_NAME}"."name" ilike $1 limit $2` }) }) diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 89fc86ef83..964ef1a007 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,12 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.105-alpha.33", + "version": "0.9.115", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.105-alpha.33", - "@spectrum-css/button": "^3.0.3", + "@budibase/bbui": "^0.9.115", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", "@spectrum-css/link": "^3.1.3", diff --git a/packages/standard-components/src/forms/Form.svelte b/packages/standard-components/src/forms/Form.svelte index a065432030..1fa8d7aa15 100644 --- a/packages/standard-components/src/forms/Form.svelte +++ b/packages/standard-components/src/forms/Form.svelte @@ -29,12 +29,9 @@ if (["user", "url"].includes(context.closestComponentId)) { return {} } - // Only inherit values if the table ID matches + // Always inherit the closest data source const closestContext = context[`${context.closestComponentId}`] || {} - if (dataSource.tableId !== closestContext?.tableId) { - return {} - } - return closestContext + return closestContext || {} } // Fetches the form schema from this form's dataSource, if one exists diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 52da0337c5..7685401b77 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.105-alpha.33", + "version": "0.9.115", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index f2f58aa2b3..709122ef72 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.105-alpha.33", + "version": "0.9.115", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -23,8 +23,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.105-alpha.33", - "@budibase/string-templates": "^0.9.105-alpha.33", + "@budibase/auth": "^0.9.115", + "@budibase/string-templates": "^0.9.115", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0",