From 115fc08aa4d08ca08c65c84e3805c6df0e1ea0b8 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 26 Nov 2021 15:02:03 +0000 Subject: [PATCH 01/11] Improve returning logic for oracle --- .../integrations/oracle/docker-compose.yml | 2 +- packages/server/src/integrations/base/sql.ts | 2 - packages/server/src/integrations/oracle.ts | 64 +++++++++---------- 3 files changed, 30 insertions(+), 38 deletions(-) diff --git a/packages/server/scripts/integrations/oracle/docker-compose.yml b/packages/server/scripts/integrations/oracle/docker-compose.yml index 5cd5e02f81..c54cd0a40b 100644 --- a/packages/server/scripts/integrations/oracle/docker-compose.yml +++ b/packages/server/scripts/integrations/oracle/docker-compose.yml @@ -4,7 +4,7 @@ version: "3.8" services: db: - container_name: oracle-xe + restart: always platform: linux/x86_64 image: container-registry.oracle.com/database/express:18.4.0-xe environment: diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index 471774db3d..9bf248d895 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -435,8 +435,6 @@ class SqlQueryBuilder extends SqlTableQueryBuilder { id = results?.[0].id } else if (sqlClient === SqlClients.MY_SQL) { id = results?.insertId - } else if (sqlClient === SqlClients.ORACLE) { - id = response.outBinds[0][0] } row = processFn( await this.getReturningRow(queryFn, this.checkLookupKeys(id, json)) diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index 13658399db..683dceed70 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -348,27 +348,7 @@ module OracleModule { this.schemaErrors = final.errors } - /** - * Knex default returning behaviour does not work with oracle - * Manually add the behaviour for the return column - */ - private addReturning( - query: SqlQuery, - bindings: BindParameters, - returnColumn: string - ) { - if (bindings instanceof Array) { - bindings.push({ dir: oracledb.BIND_OUT }) - query.sql = - query.sql + ` returning \"${returnColumn}\" into :${bindings.length}` - } - } - - private async internalQuery( - query: SqlQuery, - returnColum?: string, - operation?: string - ): Promise> { + private async internalQuery(query: SqlQuery): Promise> { let connection try { connection = await this.getConnection() @@ -376,13 +356,6 @@ module OracleModule { const options: ExecuteOptions = { autoCommit: true } const bindings: BindParameters = query.bindings || [] - if ( - returnColum && - (operation === Operation.CREATE || operation === Operation.UPDATE) - ) { - this.addReturning(query, bindings, returnColum) - } - const result: Result = await connection.execute( query.sql, bindings, @@ -441,13 +414,34 @@ module OracleModule { } async query(json: QueryJson) { - const primaryKeys = json.meta!.table!.primary - const primaryKey = primaryKeys ? primaryKeys[0] : undefined - const queryFn = (query: any, operation: string) => - this.internalQuery(query, primaryKey, operation) - const processFn = (response: any) => (response.rows ? response.rows : []) - const output = await this.queryWithReturning(json, queryFn, processFn) - return output + const operation = this._operation(json).toLowerCase() + const input = this._query(json, { disableReturning: true }) + if (Array.isArray(input)) { + const responses = [] + for (let query of input) { + responses.push(await this.internalQuery(query)) + } + return responses + } else { + const response = await this.internalQuery(input) + if (response.rows?.length) { + return response.rows + } else { + // get the last row that was updated + if ( + response.lastRowid && + json.endpoint?.entityId && + operation.toUpperCase() !== Operation.DELETE + ) { + const lastRow = await this.internalQuery({ + sql: `SELECT * FROM \"${json.endpoint.entityId}\" WHERE ROWID = '${response.lastRowid}'`, + }) + return lastRow.rows + } else { + return [{ [operation]: true }] + } + } + } } } From f75928a9c97c208f626be9f10b7b2434d7e21b0f Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 26 Nov 2021 16:50:15 +0000 Subject: [PATCH 02/11] Deletion support for returning rows --- packages/server/src/integrations/oracle.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index 683dceed70..bf8e83350e 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -414,7 +414,7 @@ module OracleModule { } async query(json: QueryJson) { - const operation = this._operation(json).toLowerCase() + const operation = this._operation(json) const input = this._query(json, { disableReturning: true }) if (Array.isArray(input)) { const responses = [] @@ -423,22 +423,34 @@ module OracleModule { } return responses } else { + // read the row to be deleted up front for the return + let deletedRows + if (operation === Operation.DELETE) { + const queryFn = (query: any) => this.internalQuery(query) + deletedRows = await this.getReturningRow(queryFn, json) + } + + // run the query const response = await this.internalQuery(input) - if (response.rows?.length) { + + // get the results or return the created / updated / deleted row + if (deletedRows?.rows?.length) { + return deletedRows.rows + } else if (response.rows?.length) { return response.rows } else { // get the last row that was updated if ( response.lastRowid && json.endpoint?.entityId && - operation.toUpperCase() !== Operation.DELETE + operation !== Operation.DELETE ) { const lastRow = await this.internalQuery({ sql: `SELECT * FROM \"${json.endpoint.entityId}\" WHERE ROWID = '${response.lastRowid}'`, }) return lastRow.rows } else { - return [{ [operation]: true }] + return [{ [ operation.toLowerCase() ]: true }] } } } From d06ab10c1dfd28872a5c8f6a7193c56511570543 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 26 Nov 2021 17:08:56 +0000 Subject: [PATCH 03/11] Fixing issue found with enriching rows in SQL - the system was assuming the array of entries contained a row ID that needed to be broken down. --- .../server/src/api/controllers/row/ExternalRequest.ts | 10 ++++++++-- packages/server/src/definitions/datasource.ts | 11 +++++++++++ packages/server/src/integrations/base/sql.ts | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index 2226dc99be..af199561dc 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -1,4 +1,5 @@ import { + FilterTypes, IncludeRelationships, Operation, PaginationJson, @@ -118,8 +119,13 @@ module External { } // check the row and filters to make sure they aren't a key of some sort if (config.filters) { - for (let filter of Object.values(config.filters)) { - if (typeof filter !== "object" || Object.keys(filter).length === 0) { + for (let [key, filter] of Object.entries(config.filters)) { + // oneOf is an array, don't iterate it + if ( + typeof filter !== "object" || + Object.keys(filter).length === 0 || + key === FilterTypes.ONE_OF + ) { continue } iterateObject(filter) diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 3760f54f2c..eb65ac994f 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -54,6 +54,17 @@ export enum IncludeRelationships { EXCLUDE = 0, } +export enum FilterTypes { + STRING = "string", + FUZZY = "fuzzy", + RANGE = "range", + EQUAL = "equal", + NOT_EQUAL = "notEqual", + EMPTY = "empty", + NOT_EMPTY = "notEmpty", + ONE_OF = "oneOf", +} + export interface QueryDefinition { type: QueryTypes displayName?: string diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index 471774db3d..1f733ac135 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -93,7 +93,7 @@ class InternalBuilder { if (filters.oneOf) { iterate(filters.oneOf, (key, array) => { const fnc = allOr ? "orWhereIn" : "whereIn" - query = query[fnc](key, array) + query = query[fnc](key, Array.isArray(array) ? array : [array]) }) } if (filters.string) { From 7ef5ae88232cc5197b2400f4db18351425ba28e5 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 26 Nov 2021 17:52:27 +0000 Subject: [PATCH 04/11] v0.9.190-alpha.9 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 8b7e036ddc..df45b3c53b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.190-alpha.8", + "version": "0.9.190-alpha.9", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 72ca7c90d7..4c0dcd1785 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.190-alpha.8", + "version": "0.9.190-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 6d0bc1a8fc..16ea645a0f 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.190-alpha.8", + "version": "0.9.190-alpha.9", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index ecda1be172..6357b73824 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.190-alpha.8", + "version": "0.9.190-alpha.9", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.190-alpha.8", - "@budibase/client": "^0.9.190-alpha.8", + "@budibase/bbui": "^0.9.190-alpha.9", + "@budibase/client": "^0.9.190-alpha.9", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.190-alpha.8", + "@budibase/string-templates": "^0.9.190-alpha.9", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index e37a6f6cad..4b73252dce 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.190-alpha.8", + "version": "0.9.190-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 0ab9d0fc65..dbe9c66a29 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.190-alpha.8", + "version": "0.9.190-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.190-alpha.8", + "@budibase/bbui": "^0.9.190-alpha.9", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.190-alpha.8", + "@budibase/string-templates": "^0.9.190-alpha.9", "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 a16ff8bc49..b22c1c9aa9 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.190-alpha.8", + "version": "0.9.190-alpha.9", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,9 +69,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.8", - "@budibase/client": "^0.9.190-alpha.8", - "@budibase/string-templates": "^0.9.190-alpha.8", + "@budibase/auth": "^0.9.190-alpha.9", + "@budibase/client": "^0.9.190-alpha.9", + "@budibase/string-templates": "^0.9.190-alpha.9", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b4203429f4..a9f9ada1c9 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.190-alpha.8", + "version": "0.9.190-alpha.9", "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 10389c2f1d..1659659da6 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.190-alpha.8", + "version": "0.9.190-alpha.9", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.8", - "@budibase/string-templates": "^0.9.190-alpha.8", + "@budibase/auth": "^0.9.190-alpha.9", + "@budibase/string-templates": "^0.9.190-alpha.9", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From d33eeec665623510d332717419cf2bceb4cc7535 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 26 Nov 2021 19:01:35 +0000 Subject: [PATCH 05/11] v0.9.190-alpha.10 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index df45b3c53b..7c04122790 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.190-alpha.9", + "version": "0.9.190-alpha.10", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 4c0dcd1785..cbdeb91afe 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.190-alpha.9", + "version": "0.9.190-alpha.10", "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 16ea645a0f..546d76495d 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.190-alpha.9", + "version": "0.9.190-alpha.10", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 6357b73824..00cdef4138 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.190-alpha.9", + "version": "0.9.190-alpha.10", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.190-alpha.9", - "@budibase/client": "^0.9.190-alpha.9", + "@budibase/bbui": "^0.9.190-alpha.10", + "@budibase/client": "^0.9.190-alpha.10", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.190-alpha.9", + "@budibase/string-templates": "^0.9.190-alpha.10", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 4b73252dce..81ad1ef20f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.190-alpha.9", + "version": "0.9.190-alpha.10", "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 dbe9c66a29..13e2ee725f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.190-alpha.9", + "version": "0.9.190-alpha.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": "^0.9.190-alpha.9", + "@budibase/bbui": "^0.9.190-alpha.10", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.190-alpha.9", + "@budibase/string-templates": "^0.9.190-alpha.10", "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 b22c1c9aa9..748e5abc8f 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.190-alpha.9", + "version": "0.9.190-alpha.10", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,9 +69,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.9", - "@budibase/client": "^0.9.190-alpha.9", - "@budibase/string-templates": "^0.9.190-alpha.9", + "@budibase/auth": "^0.9.190-alpha.10", + "@budibase/client": "^0.9.190-alpha.10", + "@budibase/string-templates": "^0.9.190-alpha.10", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a9f9ada1c9..b2b7f26276 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.190-alpha.9", + "version": "0.9.190-alpha.10", "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 1659659da6..0494bfef97 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.190-alpha.9", + "version": "0.9.190-alpha.10", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.9", - "@budibase/string-templates": "^0.9.190-alpha.9", + "@budibase/auth": "^0.9.190-alpha.10", + "@budibase/string-templates": "^0.9.190-alpha.10", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 8b4bd84ab5a9dd9d3d5a2ab6d21d375a4204e96a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 29 Nov 2021 08:30:52 +0000 Subject: [PATCH 06/11] Preserve bindings when duplicating components --- packages/builder/src/builderStore/store/frontend.js | 4 ++-- .../design/NavigationPanel/ComponentDropdownMenu.svelte | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 1f1fb035a4..c94c759792 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -524,7 +524,7 @@ export const getFrontendStore = () => { } } }, - paste: async (targetComponent, mode) => { + paste: async (targetComponent, mode, preserveBindings = false) => { let promises = [] store.update(state => { // Stop if we have nothing to paste @@ -536,7 +536,7 @@ export const getFrontendStore = () => { const cut = state.componentToPaste.isCut // immediately need to remove bindings, currently these aren't valid when pasted - if (!cut) { + if (!cut && !preserveBindings) { state.componentToPaste = removeBindings(state.componentToPaste) } diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentDropdownMenu.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentDropdownMenu.svelte index 06293e4168..56c5eef2ad 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentDropdownMenu.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentDropdownMenu.svelte @@ -53,7 +53,7 @@ const duplicateComponent = () => { storeComponentForCopy(false) - pasteComponent("below") + pasteComponent("below", true) } const deleteComponent = async () => { @@ -69,9 +69,9 @@ store.actions.components.copy(component, cut) } - const pasteComponent = mode => { + const pasteComponent = (mode, preserveBindings = false) => { // lives in store - also used by drag drop - store.actions.components.paste(component, mode) + store.actions.components.paste(component, mode, preserveBindings) } From 71e4764b174a4745454103dd26925b04310e79b0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 29 Nov 2021 08:58:49 +0000 Subject: [PATCH 07/11] Fix issue with navigation links editor mutating real component structure --- .../NavigationEditor/NavigationEditor.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte index b7a272e608..ea02b4184d 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte @@ -2,13 +2,15 @@ import { Button, ActionButton, Drawer } from "@budibase/bbui" import { createEventDispatcher } from "svelte" import NavigationDrawer from "./NavigationDrawer.svelte" + import { cloneDeep } from "lodash/fp" export let value = [] let drawer + let links = cloneDeep(value) const dispatch = createEventDispatcher() const save = () => { - dispatch("change", value) + dispatch("change", links) drawer.hide() } @@ -19,5 +21,5 @@ Configure the links in your navigation bar. - + From c81ca0502a316e61cf8482947d383483e5087392 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 29 Nov 2021 09:05:46 +0000 Subject: [PATCH 08/11] Fix layout navigation not scrolling when required --- packages/client/src/components/app/Layout.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte index 87e5ac3b5b..59765f9305 100644 --- a/packages/client/src/components/app/Layout.svelte +++ b/packages/client/src/components/app/Layout.svelte @@ -313,6 +313,9 @@ height: 100%; overflow: auto; } + .desktop.layout--left .links { + overflow-y: auto; + } .desktop .nav--left { width: 250px; @@ -379,6 +382,7 @@ justify-content: flex-start; align-items: stretch; padding: var(--spacing-xl); + overflow-y: auto; } .mobile .link { width: calc(100% - 30px); From d716f387593aed5b3c88ea253722a551d2e2e3ad Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 29 Nov 2021 11:53:46 +0000 Subject: [PATCH 09/11] autoscreen fixes --- .../FrontendNavigatePane.svelte | 11 ++- .../NavigationPanel/NewScreenModal.svelte | 73 +++++++++++++------ .../NavigationPanel/ScreenDetailsModal.svelte | 6 ++ .../NavigationPanel/ScreenWizard.svelte | 16 ++-- 4 files changed, 70 insertions(+), 36 deletions(-) diff --git a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte index 51dd44026e..ea9ebbf2c5 100644 --- a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte +++ b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte @@ -25,8 +25,7 @@ key: "layout", }, ] - - let modal + let newLayoutModal $: selected = tabs.find(t => t.key === $params.assetType)?.title || "Screens" const navigate = ({ detail }) => { @@ -93,14 +92,18 @@ {#each $store.layouts as layout, idx (layout._id)} 0} /> {/each} - +
- +
diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index fbd1fc9256..67dbf581f2 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -10,16 +10,39 @@ ProgressCircle, } from "@budibase/bbui" import getTemplates from "builderStore/store/screenTemplates" + import { onDestroy } from "svelte" + + import { createEventDispatcher } from "svelte" - export let selectedScreens = [] export let chooseModal export let save export let showProgressCircle = false + + let selectedScreens = [] + const blankScreen = "createFromScratch" + const dispatch = createEventDispatcher() + + function setScreens() { + dispatch("save", { + screens: selectedScreens, + }) + } $: blankSelected = selectedScreens?.length === 1 $: autoSelected = selectedScreens?.length > 0 && !blankSelected + let templates = getTemplates($store, $tables.list) + + const confirm = async () => { + if (autoSelected) { + setScreens() + await save() + } else { + setScreens() + chooseModal(1) + } + } const toggleScreenSelection = table => { if (selectedScreens.find(s => s.table === table.name)) { selectedScreens = selectedScreens.filter( @@ -32,14 +55,18 @@ selectedScreens = [...partialTemplates, ...selectedScreens] } } + + onDestroy(() => { + selectedScreens = [] + }) -
+
(autoSelected ? save() : chooseModal(1))} + onConfirm={() => confirm()} disabled={!selectedScreens.length} size="L" > @@ -70,29 +97,31 @@ {/if}
- Autogenerated Screens + {#if $tables.list.filter(table => table._id !== "ta_users").length > 0} + Autogenerated Screens - {#each $tables.list.filter(table => table._id !== "ta_users") as table} -
x.table === table.name)} - on:click={() => toggleScreenSelection(table)} - class="item" - > -
-
{table.name}
-
+ {#each $tables.list.filter(table => table._id !== "ta_users") as table}
x.table === table.name)} + on:click={() => toggleScreenSelection(table)} + class="item" > - {#if selectedScreens.find(x => x.table === table.name)} -
- -
- {/if} +
+
{table.name}
+
+
+ {#if selectedScreens.find(x => x.table === table.name)} +
+ +
+ {/if} +
-
- {/each} + {/each} + {/if}
{#if showProgressCircle} diff --git a/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte b/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte index e5cc839045..6d906da742 100644 --- a/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte @@ -2,6 +2,7 @@ import { ModalContent, Input, ProgressCircle } from "@budibase/bbui" import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl" import { selectedAccessRole, allScreens } from "builderStore" + import { onDestroy } from "svelte" export let screenName export let url @@ -32,6 +33,11 @@ screen.routing.roleId === roleId ) } + + onDestroy(() => { + screenName = "" + url = "" + }) { let existingScreenCount = $store.screens.filter( s => s.props._instanceName == draftScreen.props._instanceName @@ -90,17 +89,14 @@ ) } - onDestroy(() => { - selectedScreens = [] - screenName = "" - url = "" - createdScreens = [] - }) - export const showModal = () => { newScreenModal.show() } + const setScreens = evt => { + selectedScreens = evt.detail.screens + } + const chooseModal = index => { /* 0 = newScreenModal @@ -119,7 +115,7 @@ Date: Mon, 29 Nov 2021 13:58:47 +0000 Subject: [PATCH 10/11] v0.9.190-alpha.11 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 7c04122790..f2b3975169 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.190-alpha.10", + "version": "0.9.190-alpha.11", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index cbdeb91afe..6987c8c88b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.190-alpha.10", + "version": "0.9.190-alpha.11", "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 546d76495d..814a4971bf 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.190-alpha.10", + "version": "0.9.190-alpha.11", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 00cdef4138..1f7996d1b2 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.190-alpha.10", + "version": "0.9.190-alpha.11", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.190-alpha.10", - "@budibase/client": "^0.9.190-alpha.10", + "@budibase/bbui": "^0.9.190-alpha.11", + "@budibase/client": "^0.9.190-alpha.11", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.190-alpha.10", + "@budibase/string-templates": "^0.9.190-alpha.11", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 81ad1ef20f..e37ef7f849 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.190-alpha.10", + "version": "0.9.190-alpha.11", "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 13e2ee725f..96e6ea76cb 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.190-alpha.10", + "version": "0.9.190-alpha.11", "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.190-alpha.10", + "@budibase/bbui": "^0.9.190-alpha.11", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.190-alpha.10", + "@budibase/string-templates": "^0.9.190-alpha.11", "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 748e5abc8f..eea2b18124 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.190-alpha.10", + "version": "0.9.190-alpha.11", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,9 +69,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.10", - "@budibase/client": "^0.9.190-alpha.10", - "@budibase/string-templates": "^0.9.190-alpha.10", + "@budibase/auth": "^0.9.190-alpha.11", + "@budibase/client": "^0.9.190-alpha.11", + "@budibase/string-templates": "^0.9.190-alpha.11", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b2b7f26276..7378b79b60 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.190-alpha.10", + "version": "0.9.190-alpha.11", "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 0494bfef97..63c392d275 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.190-alpha.10", + "version": "0.9.190-alpha.11", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.10", - "@budibase/string-templates": "^0.9.190-alpha.10", + "@budibase/auth": "^0.9.190-alpha.11", + "@budibase/string-templates": "^0.9.190-alpha.11", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 40aa9656e122dc96ac05235fd52b7e9f448df63c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 30 Nov 2021 10:14:02 +0000 Subject: [PATCH 11/11] v0.9.190-alpha.12 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index f2b3975169..c1939719a8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.190-alpha.11", + "version": "0.9.190-alpha.12", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 6987c8c88b..2aec96c6f8 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.190-alpha.11", + "version": "0.9.190-alpha.12", "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 814a4971bf..b50a3ded2c 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.190-alpha.11", + "version": "0.9.190-alpha.12", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 1f7996d1b2..7774dfbffc 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.190-alpha.11", + "version": "0.9.190-alpha.12", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.190-alpha.11", - "@budibase/client": "^0.9.190-alpha.11", + "@budibase/bbui": "^0.9.190-alpha.12", + "@budibase/client": "^0.9.190-alpha.12", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.190-alpha.11", + "@budibase/string-templates": "^0.9.190-alpha.12", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index e37ef7f849..b43b28a9fc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.190-alpha.11", + "version": "0.9.190-alpha.12", "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 96e6ea76cb..32781cfedc 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.190-alpha.11", + "version": "0.9.190-alpha.12", "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.190-alpha.11", + "@budibase/bbui": "^0.9.190-alpha.12", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.190-alpha.11", + "@budibase/string-templates": "^0.9.190-alpha.12", "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 eea2b18124..5966cc81fc 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.190-alpha.11", + "version": "0.9.190-alpha.12", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,9 +69,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.11", - "@budibase/client": "^0.9.190-alpha.11", - "@budibase/string-templates": "^0.9.190-alpha.11", + "@budibase/auth": "^0.9.190-alpha.12", + "@budibase/client": "^0.9.190-alpha.12", + "@budibase/string-templates": "^0.9.190-alpha.12", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 7378b79b60..2fafa1f7ab 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.190-alpha.11", + "version": "0.9.190-alpha.12", "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 63c392d275..6ac6b2ab61 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.190-alpha.11", + "version": "0.9.190-alpha.12", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^0.9.190-alpha.11", - "@budibase/string-templates": "^0.9.190-alpha.11", + "@budibase/auth": "^0.9.190-alpha.12", + "@budibase/string-templates": "^0.9.190-alpha.12", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0",