From 9fc605ac0633baf656d41aff0af36b6f6707eaeb Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 4 Mar 2022 10:05:46 +0000 Subject: [PATCH 01/22] backend for client export of rows --- .../src/api/controllers/row/external.js | 20 +++++++++++++++++ .../server/src/api/controllers/row/index.js | 10 +++++++++ .../src/api/controllers/row/internal.js | 17 ++++++++++++++ packages/server/src/api/routes/row.js | 22 +++++++++++++++++++ 4 files changed, 69 insertions(+) diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index 66a1e30ca6..5f06118acc 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -152,6 +152,26 @@ exports.validate = async () => { return { valid: true } } +exports.exportRows = async ctx => { + const { datasourceId, tableName } = breakExternalTableId(ctx.params.tableId) + const db = getAppDB() + const datasource = await db.get(datasourceId) + if (!datasource || !datasource.entities) { + ctx.throw(400, "Datasource has not been configured for plus API.") + } + const tables = datasource.entities + const table = tables[tableName] + ctx.request.body = { + query: { + oneOf: { + [table.primaryDisplay]: ctx.request.body.map(id => breakRowIdField(id)[0]) + }, + }, + } + return exports.search(ctx) +} + + exports.fetchEnrichedRow = async ctx => { const id = ctx.params.rowId const tableId = ctx.params.tableId diff --git a/packages/server/src/api/controllers/row/index.js b/packages/server/src/api/controllers/row/index.js index 1d003ebd18..839c549735 100644 --- a/packages/server/src/api/controllers/row/index.js +++ b/packages/server/src/api/controllers/row/index.js @@ -137,3 +137,13 @@ exports.fetchEnrichedRow = async function (ctx) { ctx.throw(400, err) } } + +exports.export = async function (ctx) { + const tableId = getTableId(ctx) + try { + ctx.body = await pickApi(tableId).exportRows(ctx) + } catch (err) { + ctx.throw(400, err) + } + +} diff --git a/packages/server/src/api/controllers/row/internal.js b/packages/server/src/api/controllers/row/internal.js index 7650ac275f..faf2d8117c 100644 --- a/packages/server/src/api/controllers/row/internal.js +++ b/packages/server/src/api/controllers/row/internal.js @@ -362,6 +362,23 @@ exports.validate = async ctx => { }) } +exports.exportRows = async ctx => { + const db = getAppDB() + const table = await db.get(ctx.params.tableId) + const rowIds = ctx.request.body + let response = ( + await db.allDocs({ + include_docs: true, + keys: rowIds, + }) + ).rows.map(row => row.doc) + + let rows = await outputProcessing(table, response) + + return rows +} + + exports.fetchEnrichedRow = async ctx => { const db = getAppDB() const tableId = ctx.params.tableId diff --git a/packages/server/src/api/routes/row.js b/packages/server/src/api/routes/row.js index 2ceddc779a..7978bac3c7 100644 --- a/packages/server/src/api/routes/row.js +++ b/packages/server/src/api/routes/row.js @@ -252,4 +252,26 @@ router rowController.destroy ) + /** + * @api {post} /api/:tableId/rows/export Export Rows + * @apiName Export rows + * @apiGroup rows + * @apiPermission table write access + * @apiDescription This API can export a number of provided rows + * + * @apiParam {string} tableId The ID of the table the row is to be deleted from. + * + * @apiParam (Body) {object[]} [rows] The row IDs which are to be exported + * + * @apiSuccess {object[]|object} + */ + .post( + "/api/:tableId/rows/export", + paramResource("tableId"), + authorized(PermissionTypes.TABLE, PermissionLevels.WRITE), + usage, + rowController.export + ) + + module.exports = router From 3d7e5c631321bec24c93a63c3972e253b7bf0c70 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 7 Mar 2022 09:57:03 +0000 Subject: [PATCH 02/22] Fix relative usage of S3 upload API calls --- packages/frontend-core/src/api/attachments.js | 105 +++++++++--------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/packages/frontend-core/src/api/attachments.js b/packages/frontend-core/src/api/attachments.js index 2077c4f7ef..e2eb348f9d 100644 --- a/packages/frontend-core/src/api/attachments.js +++ b/packages/frontend-core/src/api/attachments.js @@ -1,61 +1,66 @@ -export const buildAttachmentEndpoints = API => ({ - /** - * Uploads an attachment to the server. - * @param data the attachment to upload - * @param tableId the table ID to upload to - */ - uploadAttachment: async ({ data, tableId }) => { - return await API.post({ - url: `/api/attachments/${tableId}/upload`, - body: data, - json: false, - }) - }, - - /** - * Uploads an attachment to the server as a builder user from the builder. - * @param data the data to upload - */ - uploadBuilderAttachment: async data => { - return await API.post({ - url: "/api/attachments/process", - body: data, - json: false, - }) - }, - +export const buildAttachmentEndpoints = API => { /** * Generates a signed URL to upload a file to an external datasource. * @param datasourceId the ID of the datasource to upload to * @param bucket the name of the bucket to upload to * @param key the name of the file to upload to */ - getSignedDatasourceURL: async ({ datasourceId, bucket, key }) => { + const getSignedDatasourceURL = async ({ datasourceId, bucket, key }) => { return await API.post({ url: `/api/attachments/${datasourceId}/url`, body: { bucket, key }, }) - }, + } - /** - * Uploads a file to an external datasource. - * @param datasourceId the ID of the datasource to upload to - * @param bucket the name of the bucket to upload to - * @param key the name of the file to upload to - * @param data the file to upload - */ - externalUpload: async ({ datasourceId, bucket, key, data }) => { - const { signedUrl, publicUrl } = await API.getSignedDatasourceURL({ - datasourceId, - bucket, - key, - }) - await API.put({ - url: signedUrl, - body: data, - json: false, - external: true, - }) - return { publicUrl } - }, -}) + return { + getSignedDatasourceURL, + + /** + * Uploads an attachment to the server. + * @param data the attachment to upload + * @param tableId the table ID to upload to + */ + uploadAttachment: async ({ data, tableId }) => { + return await API.post({ + url: `/api/attachments/${tableId}/upload`, + body: data, + json: false, + }) + }, + + /** + * Uploads an attachment to the server as a builder user from the builder. + * @param data the data to upload + */ + uploadBuilderAttachment: async data => { + return await API.post({ + url: "/api/attachments/process", + body: data, + json: false, + }) + }, + + /** + * Uploads a file to an external datasource. + * @param datasourceId the ID of the datasource to upload to + * @param bucket the name of the bucket to upload to + * @param key the name of the file to upload to + * @param data the file to upload + */ + externalUpload: async ({ datasourceId, bucket, key, data }) => { + console.log(API) + const { signedUrl, publicUrl } = await getSignedDatasourceURL({ + datasourceId, + bucket, + key, + }) + await API.put({ + url: signedUrl, + body: data, + json: false, + external: true, + }) + return { publicUrl } + }, + } +} From bed09f5f6ccf409ff9d0ac552b2efbb620a9f9d7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 7 Mar 2022 09:57:15 +0000 Subject: [PATCH 03/22] Fix loading state in S3 upload component and show error if possible --- .../src/components/app/forms/S3Upload.svelte | 5 +- packages/client/stats.html | 2689 +++++++++++++++++ 2 files changed, 2693 insertions(+), 1 deletion(-) create mode 100644 packages/client/stats.html diff --git a/packages/client/src/components/app/forms/S3Upload.svelte b/packages/client/src/components/app/forms/S3Upload.svelte index ab66755b6e..031c49f4b4 100644 --- a/packages/client/src/components/app/forms/S3Upload.svelte +++ b/packages/client/src/components/app/forms/S3Upload.svelte @@ -81,7 +81,10 @@ loading = false return res } catch (error) { - notificationStore.actions.error(`Error uploading file: ${error}`) + notificationStore.actions.error( + `Error uploading file: ${error?.message || error}` + ) + loading = false } } diff --git a/packages/client/stats.html b/packages/client/stats.html new file mode 100644 index 0000000000..4cab61a146 --- /dev/null +++ b/packages/client/stats.html @@ -0,0 +1,2689 @@ + + + + + + + + RollUp Visualizer + + + +
+ + + + + From 91b698cfe10972d0cea04aef815c28f2f84f358f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 7 Mar 2022 10:17:05 +0000 Subject: [PATCH 04/22] Properly remove window event listener when unmounting component preview --- .../AppPreview/CurrentItemPreview.svelte | 3 +- packages/client/stats.html | 2689 +++++++++++++++++ 2 files changed, 2691 insertions(+), 1 deletion(-) create mode 100644 packages/client/stats.html diff --git a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte index 2a886fab0c..de50e0cfb2 100644 --- a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte @@ -134,8 +134,9 @@ // Remove all iframe event listeners on component destroy onDestroy(() => { + window.removeEventListener("message", receiveMessage) + if (iframe.contentWindow) { - window.removeEventListener("message", receiveMessage) if (!$store.clientFeatures.messagePassing) { // Legacy - remove in later versions of BB iframe.contentWindow.removeEventListener( diff --git a/packages/client/stats.html b/packages/client/stats.html new file mode 100644 index 0000000000..509a3b0175 --- /dev/null +++ b/packages/client/stats.html @@ -0,0 +1,2689 @@ + + + + + + + + RollUp Visualizer + + + +
+ + + + + From ed2c210db876e7af1ad363fa40836e8df092e3f8 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 7 Mar 2022 12:06:11 +0000 Subject: [PATCH 05/22] Add button action allowing for export of client row selection --- .../builder/src/builderStore/dataBinding.js | 8 ++- .../actions/ExportData.svelte | 71 +++++++++++++++++++ .../ButtonActionEditor/actions/index.js | 1 + .../ButtonActionEditor/manifest.json | 4 ++ packages/client/package.json | 1 + .../src/components/app/table/Table.svelte | 1 + packages/client/src/stores/rowSelection.js | 15 +++- packages/client/src/utils/buttonActions.js | 23 ++++++ packages/client/yarn.lock | 5 ++ packages/frontend-core/src/api/rows.js | 14 ++++ .../src/api/controllers/row/external.js | 5 +- .../server/src/api/controllers/row/index.js | 1 - .../src/api/controllers/row/internal.js | 3 +- packages/server/src/api/routes/row.js | 27 ++++--- 14 files changed, 155 insertions(+), 24 deletions(-) create mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 60cce2b1fd..5b9bebcbf5 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -331,7 +331,9 @@ const getSelectedRowsBindings = asset => { bindings = bindings.concat( tables.map(table => ({ type: "context", - runtimeBinding: `${safeState}.${makePropSafe(table._id)}`, + runtimeBinding: `${safeState}.${makePropSafe(table._id)}.${makePropSafe( + "selectedRows" + )}`, readableBinding: `${table._instanceName}.Selected rows`, })) ) @@ -343,7 +345,9 @@ const getSelectedRowsBindings = asset => { bindings = bindings.concat( tableBlocks.map(block => ({ type: "context", - runtimeBinding: `${safeState}.${makePropSafe(block._id + "-table")}`, + runtimeBinding: `${safeState}.${makePropSafe( + block._id + "-table" + )}.${makePropSafe("selectedRows")}`, readableBinding: `${block._instanceName}.Selected rows`, })) ) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte new file mode 100644 index 0000000000..93b9a556a6 --- /dev/null +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte @@ -0,0 +1,71 @@ + + +
+ + Choose the table that you would like to export your row selection from. +
+ Please ensure you have enabled row selection in the table settings + + +
+ + +
+
+ + diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js index 416ebffb1a..6593c9cbd4 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js @@ -12,3 +12,4 @@ export { default as UpdateState } from "./UpdateState.svelte" export { default as RefreshDataProvider } from "./RefreshDataProvider.svelte" export { default as DuplicateRow } from "./DuplicateRow.svelte" export { default as S3Upload } from "./S3Upload.svelte" +export { default as ExportData } from "./ExportData.svelte" diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json index ecbf0d8065..0f6d3344b2 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json @@ -80,6 +80,10 @@ "value": "publicUrl" } ] + }, + { + "name": "Export Data", + "component": "ExportData" } ] } \ No newline at end of file diff --git a/packages/client/package.json b/packages/client/package.json index 509020a5d1..4bf70e4d56 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -32,6 +32,7 @@ "@spectrum-css/vars": "^3.0.1", "apexcharts": "^3.22.1", "dayjs": "^1.10.5", + "downloadjs": "1.4.7", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/client/src/components/app/table/Table.svelte b/packages/client/src/components/app/table/Table.svelte index f5f591688f..e8dcd30929 100644 --- a/packages/client/src/components/app/table/Table.svelte +++ b/packages/client/src/components/app/table/Table.svelte @@ -42,6 +42,7 @@ $: { rowSelectionStore.actions.updateSelection( $component.id, + selectedRows.length ? selectedRows[0].tableId : "", selectedRows.map(row => row._id) ) } diff --git a/packages/client/src/stores/rowSelection.js b/packages/client/src/stores/rowSelection.js index 3d1f2038aa..4561557c6f 100644 --- a/packages/client/src/stores/rowSelection.js +++ b/packages/client/src/stores/rowSelection.js @@ -1,20 +1,29 @@ -import { writable } from "svelte/store" +import { get, writable } from "svelte/store" const createRowSelectionStore = () => { const store = writable({}) - function updateSelection(componentId, selectedRows) { + function updateSelection(componentId, tableId, selectedRows) { store.update(state => { - state[componentId] = [...selectedRows] + state[componentId] = { tableId: tableId, selectedRows: selectedRows } return state }) } + function getSelection(tableId) { + const selection = get(store) + const componentId = Object.keys(selection).find( + componentId => selection[componentId].tableId === tableId + ) + return componentId ? selection[componentId] : {} + } + return { subscribe: store.subscribe, set: store.set, actions: { updateSelection, + getSelection, }, } } diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index fec966725b..5d0f4ff71e 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -1,4 +1,5 @@ import { get } from "svelte/store" +import download from "downloadjs" import { routeStore, builderStore, @@ -8,6 +9,7 @@ import { notificationStore, dataSourceStore, uploadStore, + rowSelectionStore, } from "stores" import { API } from "api" import { ActionTypes } from "constants" @@ -239,6 +241,26 @@ const s3UploadHandler = async action => { } } +const exportDataHandler = async action => { + let selection = rowSelectionStore.actions.getSelection( + action.parameters.tableId + ) + if (selection.selectedRows && selection.selectedRows.length > 0) { + try { + const data = await API.exportRows({ + tableId: selection.tableId, + rows: selection.selectedRows, + }) + + download(JSON.stringify(data), `export.${action.parameters.type}`) + } catch (error) { + notificationStore.actions.error("There was an error exporting the data") + } + } else { + notificationStore.actions.error("Please select at least one row") + } +} + const handlerMap = { ["Save Row"]: saveRowHandler, ["Duplicate Row"]: duplicateRowHandler, @@ -254,6 +276,7 @@ const handlerMap = { ["Change Form Step"]: changeFormStepHandler, ["Update State"]: updateStateHandler, ["Upload File to S3"]: s3UploadHandler, + ["Export Data"]: exportDataHandler, } const confirmTextMap = { diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index 54d3ae755f..405591fd90 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -464,6 +464,11 @@ domutils@^2.6.0: domelementtype "^2.2.0" domhandler "^4.2.0" +downloadjs@1.4.7: + version "1.4.7" + resolved "https://registry.yarnpkg.com/downloadjs/-/downloadjs-1.4.7.tgz#f69f96f940e0d0553dac291139865a3cd0101e3c" + integrity sha1-9p+W+UDg0FU9rCkROYZaPNAQHjw= + electron-to-chromium@^1.3.896: version "1.3.900" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.900.tgz#5be2c5818a2a012c511b4b43e87b6ab7a296d4f5" diff --git a/packages/frontend-core/src/api/rows.js b/packages/frontend-core/src/api/rows.js index 553cf8e0de..1b6efe624f 100644 --- a/packages/frontend-core/src/api/rows.js +++ b/packages/frontend-core/src/api/rows.js @@ -60,4 +60,18 @@ export const buildRowEndpoints = API => ({ }, }) }, + + /** + * Exports rows. + * @param tableId the table ID to export the rows from + * @param rows the array of rows to export + */ + exportRows: async ({ tableId, rows }) => { + return await API.post({ + url: `/api/${tableId}/rows/exportRows`, + body: { + rows, + }, + }) + }, }) diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index 5f06118acc..b7c7a2bc6e 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -164,14 +164,15 @@ exports.exportRows = async ctx => { ctx.request.body = { query: { oneOf: { - [table.primaryDisplay]: ctx.request.body.map(id => breakRowIdField(id)[0]) + [table.primaryDisplay]: ctx.request.body.map( + id => breakRowIdField(id)[0] + ), }, }, } return exports.search(ctx) } - exports.fetchEnrichedRow = async ctx => { const id = ctx.params.rowId const tableId = ctx.params.tableId diff --git a/packages/server/src/api/controllers/row/index.js b/packages/server/src/api/controllers/row/index.js index 839c549735..c4a9ac8f06 100644 --- a/packages/server/src/api/controllers/row/index.js +++ b/packages/server/src/api/controllers/row/index.js @@ -145,5 +145,4 @@ exports.export = async function (ctx) { } catch (err) { ctx.throw(400, err) } - } diff --git a/packages/server/src/api/controllers/row/internal.js b/packages/server/src/api/controllers/row/internal.js index faf2d8117c..068a485a8a 100644 --- a/packages/server/src/api/controllers/row/internal.js +++ b/packages/server/src/api/controllers/row/internal.js @@ -365,7 +365,7 @@ exports.validate = async ctx => { exports.exportRows = async ctx => { const db = getAppDB() const table = await db.get(ctx.params.tableId) - const rowIds = ctx.request.body + const rowIds = ctx.request.body.rows let response = ( await db.allDocs({ include_docs: true, @@ -378,7 +378,6 @@ exports.exportRows = async ctx => { return rows } - exports.fetchEnrichedRow = async ctx => { const db = getAppDB() const tableId = ctx.params.tableId diff --git a/packages/server/src/api/routes/row.js b/packages/server/src/api/routes/row.js index 7978bac3c7..272b7d168d 100644 --- a/packages/server/src/api/routes/row.js +++ b/packages/server/src/api/routes/row.js @@ -253,25 +253,24 @@ router ) /** - * @api {post} /api/:tableId/rows/export Export Rows - * @apiName Export rows - * @apiGroup rows - * @apiPermission table write access - * @apiDescription This API can export a number of provided rows - * - * @apiParam {string} tableId The ID of the table the row is to be deleted from. - * - * @apiParam (Body) {object[]} [rows] The row IDs which are to be exported - * - * @apiSuccess {object[]|object} - */ + * @api {post} /api/:tableId/rows/exportRows Export Rows + * @apiName Export rows + * @apiGroup rows + * @apiPermission table write access + * @apiDescription This API can export a number of provided rows + * + * @apiParam {string} tableId The ID of the table the row is to be deleted from. + * + * @apiParam (Body) {object[]} [rows] The row IDs which are to be exported + * + * @apiSuccess {object[]|object} + */ .post( - "/api/:tableId/rows/export", + "/api/:tableId/rows/exportRows", paramResource("tableId"), authorized(PermissionTypes.TABLE, PermissionLevels.WRITE), usage, rowController.export ) - module.exports = router From 8185227ff16bea957cef7e1c40b7dd04abec13d3 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 7 Mar 2022 16:31:35 +0000 Subject: [PATCH 06/22] Fixing issue #4811 - when renaming SQL columns use an actual rename alteration rather than dropping the column. --- .../src/api/controllers/table/external.js | 18 +++++++++-- packages/server/src/definitions/datasource.ts | 6 ++++ .../server/src/integrations/base/sqlTable.ts | 30 +++++++++++++++---- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/packages/server/src/api/controllers/table/external.js b/packages/server/src/api/controllers/table/external.js index b27eebb0c4..86d855a28e 100644 --- a/packages/server/src/api/controllers/table/external.js +++ b/packages/server/src/api/controllers/table/external.js @@ -25,7 +25,8 @@ async function makeTableRequest( operation, table, tables, - oldTable = null + oldTable = null, + renamed = null ) { const json = { endpoint: { @@ -41,6 +42,9 @@ async function makeTableRequest( if (oldTable) { json.meta.table = oldTable } + if (renamed) { + json.meta.renamed = renamed + } return makeExternalQuery(datasource, json) } @@ -160,6 +164,7 @@ function isRelationshipSetup(column) { exports.save = async function (ctx) { const table = ctx.request.body + const { _rename: renamed } = table // can't do this right now delete table.dataImport const datasourceId = getDatasourceId(ctx.request.body) @@ -241,7 +246,14 @@ exports.save = async function (ctx) { const operation = oldTable ? DataSourceOperation.UPDATE_TABLE : DataSourceOperation.CREATE_TABLE - await makeTableRequest(datasource, operation, tableToSave, tables, oldTable) + await makeTableRequest( + datasource, + operation, + tableToSave, + tables, + oldTable, + renamed + ) // update any extra tables (like foreign keys in other tables) for (let extraTable of extraTablesToUpdate) { const oldExtraTable = oldTables[extraTable.name] @@ -258,6 +270,8 @@ exports.save = async function (ctx) { ) } + // remove the rename prop + delete tableToSave._rename // store it into couch now for budibase reference datasource.entities[tableToSave.name] = tableToSave await db.put(datasource) diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 6c8c8dc07d..2e2ad25f58 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -138,6 +138,11 @@ export interface PaginationJson { page?: string | number } +export interface RenameColumn { + old: string + updated: string +} + export interface RelationshipsJson { through?: string from?: string @@ -166,6 +171,7 @@ export interface QueryJson { meta?: { table?: Table tables?: Record + renamed: RenameColumn } extra?: { idFilter?: SearchFilters diff --git a/packages/server/src/integrations/base/sqlTable.ts b/packages/server/src/integrations/base/sqlTable.ts index b9ea7107fc..0c63b707ae 100644 --- a/packages/server/src/integrations/base/sqlTable.ts +++ b/packages/server/src/integrations/base/sqlTable.ts @@ -1,6 +1,10 @@ import { Knex, knex } from "knex" import { Table } from "../../definitions/common" -import { Operation, QueryJson } from "../../definitions/datasource" +import { + Operation, + QueryJson, + RenameColumn, +} from "../../definitions/datasource" import { breakExternalTableId } from "../utils" import SchemaBuilder = Knex.SchemaBuilder import CreateTableBuilder = Knex.CreateTableBuilder @@ -10,7 +14,8 @@ function generateSchema( schema: CreateTableBuilder, table: Table, tables: Record, - oldTable: null | Table = null + oldTable: null | Table = null, + renamed?: RenameColumn ) { let primaryKey = table && table.primary ? table.primary[0] : null const columns = Object.values(table.schema) @@ -29,7 +34,11 @@ function generateSchema( for (let [key, column] of Object.entries(table.schema)) { // skip things that are already correct const oldColumn = oldTable ? oldTable.schema[key] : null - if ((oldColumn && oldColumn.type) || (primaryKey === key && !isJunction)) { + if ( + (oldColumn && oldColumn.type) || + (primaryKey === key && !isJunction) || + renamed?.updated === key + ) { continue } switch (column.type) { @@ -81,6 +90,10 @@ function generateSchema( } } + if (renamed) { + schema.renameColumn(renamed.old, renamed.updated) + } + // need to check if any columns have been deleted if (oldTable) { const deletedColumns = Object.entries(oldTable.schema) @@ -90,6 +103,9 @@ function generateSchema( ) .map(([key]) => key) deletedColumns.forEach(key => { + if (renamed?.old === key) { + return + } if (oldTable.constrained && oldTable.constrained.indexOf(key) !== -1) { schema.dropForeign(key) } @@ -114,10 +130,11 @@ function buildUpdateTable( knex: SchemaBuilder, table: Table, tables: Record, - oldTable: Table + oldTable: Table, + renamed: RenameColumn ): SchemaBuilder { return knex.alterTable(table.name, schema => { - generateSchema(schema, table, tables, oldTable) + generateSchema(schema, table, tables, oldTable, renamed) }) } @@ -167,7 +184,8 @@ class SqlTableQueryBuilder { client, json.table, json.meta.tables, - json.meta.table + json.meta.table, + json.meta.renamed ) break case Operation.DELETE_TABLE: From 8d87968a74832e607a95c8984069b9cb49aa03d8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 8 Mar 2022 08:43:33 +0000 Subject: [PATCH 07/22] Remove stats file --- packages/client/stats.html | 2689 ------------------------------------ 1 file changed, 2689 deletions(-) delete mode 100644 packages/client/stats.html diff --git a/packages/client/stats.html b/packages/client/stats.html deleted file mode 100644 index 509a3b0175..0000000000 --- a/packages/client/stats.html +++ /dev/null @@ -1,2689 +0,0 @@ - - - - - - - - RollUp Visualizer - - - -
- - - - - From 6ae5ead5f122e35cd1225ef12569a2f487928ce6 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 8 Mar 2022 08:51:10 +0000 Subject: [PATCH 08/22] v1.0.80 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index af7c5930bd..2f375fcec0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.79", + "version": "1.0.80", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 9e19ea3517..56e184989c 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.79", + "version": "1.0.80", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 6dcb6a2b76..e776154557 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": "1.0.79", + "version": "1.0.80", "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 ce6fe862ad..a04149ce3f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.79", + "version": "1.0.80", "license": "GPL-3.0", "private": true, "scripts": { @@ -64,10 +64,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.79", - "@budibase/client": "^1.0.79", - "@budibase/frontend-core": "^1.0.79", - "@budibase/string-templates": "^1.0.79", + "@budibase/bbui": "^1.0.80", + "@budibase/client": "^1.0.80", + "@budibase/frontend-core": "^1.0.80", + "@budibase/string-templates": "^1.0.80", "@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 e0f0013909..c5433bd30c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.79", + "version": "1.0.80", "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 08ed7e8224..5e4fc4ce81 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.79", + "version": "1.0.80", "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": "^1.0.79", - "@budibase/frontend-core": "^1.0.79", - "@budibase/string-templates": "^1.0.79", + "@budibase/bbui": "^1.0.80", + "@budibase/frontend-core": "^1.0.80", + "@budibase/string-templates": "^1.0.80", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index ba86320542..3cfc0837e0 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.79", + "version": "1.0.80", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.79", + "@budibase/bbui": "^1.0.80", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 66d6e9bd6e..e17e29864f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.79", + "version": "1.0.80", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -73,9 +73,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.79", - "@budibase/client": "^1.0.79", - "@budibase/string-templates": "^1.0.79", + "@budibase/backend-core": "^1.0.80", + "@budibase/client": "^1.0.80", + "@budibase/string-templates": "^1.0.80", "@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 5134f7fb89..0a6c584bd2 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.79", + "version": "1.0.80", "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 76bfe29ccd..e39c9ed096 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.79", + "version": "1.0.80", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.79", - "@budibase/string-templates": "^1.0.79", + "@budibase/backend-core": "^1.0.80", + "@budibase/string-templates": "^1.0.80", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From f995dc1e578fb09b02f401904f07b059e74290ae Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 8 Mar 2022 10:03:32 +0000 Subject: [PATCH 09/22] v1.0.80-alpha.4 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 616fbec5e6..208c90c169 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 71f3c70fc1..705ba9cf3b 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 103c68f942..5cd1fd23c5 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": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.80-alpha.3", + "@budibase/string-templates": "^1.0.80-alpha.4", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 9fee122640..df2fe7aa34 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.80-alpha.3", - "@budibase/client": "^1.0.80-alpha.3", - "@budibase/frontend-core": "^1.0.80-alpha.3", - "@budibase/string-templates": "^1.0.80-alpha.3", + "@budibase/bbui": "^1.0.80-alpha.4", + "@budibase/client": "^1.0.80-alpha.4", + "@budibase/frontend-core": "^1.0.80-alpha.4", + "@budibase/string-templates": "^1.0.80-alpha.4", "@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 66f8811f55..1e5f58db1a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "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 8772b9135f..d1d29d3146 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "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": "^1.0.80-alpha.3", - "@budibase/frontend-core": "^1.0.80-alpha.3", - "@budibase/string-templates": "^1.0.80-alpha.3", + "@budibase/bbui": "^1.0.80-alpha.4", + "@budibase/frontend-core": "^1.0.80-alpha.4", + "@budibase/string-templates": "^1.0.80-alpha.4", "@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 2d19661369..267991d733 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.80-alpha.3", + "@budibase/bbui": "^1.0.80-alpha.4", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 30e21a7170..9853517b20 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -71,9 +71,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.80-alpha.3", - "@budibase/client": "^1.0.80-alpha.3", - "@budibase/string-templates": "^1.0.80-alpha.3", + "@budibase/backend-core": "^1.0.80-alpha.4", + "@budibase/client": "^1.0.80-alpha.4", + "@budibase/string-templates": "^1.0.80-alpha.4", "@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 9f228deda8..fc5be7e18e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "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 f7a0cf1a35..e57ce79569 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.80-alpha.3", + "version": "1.0.80-alpha.4", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.80-alpha.3", - "@budibase/string-templates": "^1.0.80-alpha.3", + "@budibase/backend-core": "^1.0.80-alpha.4", + "@budibase/string-templates": "^1.0.80-alpha.4", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 9a0c361ad0e99e337a9dae487d776344bc1b8f22 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Tue, 8 Mar 2022 11:15:02 +0100 Subject: [PATCH 10/22] show correct error and keep modal open --- .../DatasourceNavigator/modals/DatasourceConfigModal.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index 8f1218f087..0aaa2b201d 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -20,7 +20,9 @@ $goto(`./datasource/${resp._id}`) notifications.success(`Datasource updated successfully.`) } catch (err) { - notifications.error("Error saving datasource") + notifications.error(err?.message ?? "Error saving datasource") + // prevent the modal from closing + return false } } From 84f40bcac2bbb69254f3be69cf1c7cc3676f5fba Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 8 Mar 2022 11:06:36 +0000 Subject: [PATCH 11/22] v1.0.80-alpha.5 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 208c90c169..d67a32ef00 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 705ba9cf3b..25d98ec2a4 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 5cd1fd23c5..3cb109748a 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": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.80-alpha.4", + "@budibase/string-templates": "^1.0.80-alpha.5", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index df2fe7aa34..1558d05894 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.80-alpha.4", - "@budibase/client": "^1.0.80-alpha.4", - "@budibase/frontend-core": "^1.0.80-alpha.4", - "@budibase/string-templates": "^1.0.80-alpha.4", + "@budibase/bbui": "^1.0.80-alpha.5", + "@budibase/client": "^1.0.80-alpha.5", + "@budibase/frontend-core": "^1.0.80-alpha.5", + "@budibase/string-templates": "^1.0.80-alpha.5", "@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 1e5f58db1a..2264689e74 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "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 d1d29d3146..53838962f7 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "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": "^1.0.80-alpha.4", - "@budibase/frontend-core": "^1.0.80-alpha.4", - "@budibase/string-templates": "^1.0.80-alpha.4", + "@budibase/bbui": "^1.0.80-alpha.5", + "@budibase/frontend-core": "^1.0.80-alpha.5", + "@budibase/string-templates": "^1.0.80-alpha.5", "@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 267991d733..7b093f32fc 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.80-alpha.4", + "@budibase/bbui": "^1.0.80-alpha.5", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 9853517b20..1f829d26c3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -71,9 +71,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.80-alpha.4", - "@budibase/client": "^1.0.80-alpha.4", - "@budibase/string-templates": "^1.0.80-alpha.4", + "@budibase/backend-core": "^1.0.80-alpha.5", + "@budibase/client": "^1.0.80-alpha.5", + "@budibase/string-templates": "^1.0.80-alpha.5", "@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 fc5be7e18e..f4a6d28fec 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "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 e57ce79569..5130f310e7 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.80-alpha.4", + "version": "1.0.80-alpha.5", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.80-alpha.4", - "@budibase/string-templates": "^1.0.80-alpha.4", + "@budibase/backend-core": "^1.0.80-alpha.5", + "@budibase/string-templates": "^1.0.80-alpha.5", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 0b320ab29a78c9b1d2f07478ed14e031806a917f Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 8 Mar 2022 11:39:14 +0000 Subject: [PATCH 12/22] v1.0.80-alpha.6 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index d67a32ef00..fd46eb4e98 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 25d98ec2a4..6b0eb829cd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 3cb109748a..c2af613b8e 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": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.80-alpha.5", + "@budibase/string-templates": "^1.0.80-alpha.6", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 1558d05894..9aa047d0c5 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.80-alpha.5", - "@budibase/client": "^1.0.80-alpha.5", - "@budibase/frontend-core": "^1.0.80-alpha.5", - "@budibase/string-templates": "^1.0.80-alpha.5", + "@budibase/bbui": "^1.0.80-alpha.6", + "@budibase/client": "^1.0.80-alpha.6", + "@budibase/frontend-core": "^1.0.80-alpha.6", + "@budibase/string-templates": "^1.0.80-alpha.6", "@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 2264689e74..05d069fec1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "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 ccd67be70b..2ebafbf38f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "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": "^1.0.80-alpha.5", - "@budibase/frontend-core": "^1.0.80-alpha.5", - "@budibase/string-templates": "^1.0.80-alpha.5", + "@budibase/bbui": "^1.0.80-alpha.6", + "@budibase/frontend-core": "^1.0.80-alpha.6", + "@budibase/string-templates": "^1.0.80-alpha.6", "@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 7b093f32fc..5f8d79f831 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.80-alpha.5", + "@budibase/bbui": "^1.0.80-alpha.6", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 1f829d26c3..e6f186fff6 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -71,9 +71,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.80-alpha.5", - "@budibase/client": "^1.0.80-alpha.5", - "@budibase/string-templates": "^1.0.80-alpha.5", + "@budibase/backend-core": "^1.0.80-alpha.6", + "@budibase/client": "^1.0.80-alpha.6", + "@budibase/string-templates": "^1.0.80-alpha.6", "@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 f4a6d28fec..572fdfe74e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "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 5130f310e7..5569966011 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.80-alpha.5", + "version": "1.0.80-alpha.6", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.80-alpha.5", - "@budibase/string-templates": "^1.0.80-alpha.5", + "@budibase/backend-core": "^1.0.80-alpha.6", + "@budibase/string-templates": "^1.0.80-alpha.6", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 64658d98809c37f3bc194abc88b8ad9341ceaacd Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 8 Mar 2022 12:05:17 +0000 Subject: [PATCH 13/22] v1.0.81-alpha.0 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 ++++----- packages/cli/package.json | 2 +- packages/client/package.json | 31 ++++---------------------- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 +++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 ++--- 10 files changed, 24 insertions(+), 47 deletions(-) diff --git a/lerna.json b/lerna.json index 2f375fcec0..123a56be84 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.80", + "version": "1.0.81-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 56e184989c..5c073be156 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 6326fe6167..d492264098 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": "1.0.80", + "version": "1.0.81-alpha.0", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.80-alpha.6", + "@budibase/string-templates": "^1.0.81-alpha.0", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 67d9f5c107..e6ba5875f2 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.80", - "@budibase/client": "^1.0.80", - "@budibase/frontend-core": "^1.0.80", - "@budibase/string-templates": "^1.0.80", + "@budibase/bbui": "^1.0.81-alpha.0", + "@budibase/client": "^1.0.81-alpha.0", + "@budibase/frontend-core": "^1.0.81-alpha.0", + "@budibase/string-templates": "^1.0.81-alpha.0", "@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 c5433bd30c..3bdc60fb6f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "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 7c276693ee..33e3b2788c 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,37 +19,14 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.80", - "@budibase/frontend-core": "^1.0.80", - "@budibase/string-templates": "^1.0.80", + "@budibase/bbui": "^1.0.81-alpha.0", + "@budibase/frontend-core": "^1.0.81-alpha.0", + "@budibase/string-templates": "^1.0.81-alpha.0", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" }, - "devDependencies": { - "@rollup/plugin-alias": "^3.1.5", - "@rollup/plugin-commonjs": "^18.0.0", - "@rollup/plugin-node-resolve": "^11.2.1", - "@spectrum-css/button": "^3.0.3", - "@spectrum-css/card": "^3.0.3", - "@spectrum-css/divider": "^1.0.3", - "@spectrum-css/link": "^3.1.3", - "@spectrum-css/page": "^3.0.1", - "@spectrum-css/tag": "^3.1.4", - "@spectrum-css/typography": "^3.0.2", - "@spectrum-css/vars": "^3.0.1", - "apexcharts": "^3.22.1", - "dayjs": "^1.10.5", - "downloadjs": "1.4.7", - "regexparam": "^1.3.0", - "rollup-plugin-polyfill-node": "^0.8.0", - "shortid": "^2.2.15", - "svelte": "^3.38.2", - "svelte-apexcharts": "^1.0.2", - "svelte-flatpickr": "^3.1.0", - "svelte-spa-router": "^3.0.5" - }, "devDependencies": { "@rollup/plugin-alias": "^3.1.5", "@rollup/plugin-commonjs": "^18.0.0", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 3cfc0837e0..6d0a86ff14 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.80", + "@budibase/bbui": "^1.0.81-alpha.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 8317f3cdf8..1df52c67de 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -71,9 +71,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.80", - "@budibase/client": "^1.0.80", - "@budibase/string-templates": "^1.0.80", + "@budibase/backend-core": "^1.0.81-alpha.0", + "@budibase/client": "^1.0.81-alpha.0", + "@budibase/string-templates": "^1.0.81-alpha.0", "@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 73649597fb..e4cc2c49e6 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "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 e39c9ed096..23d5fa59b9 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.80", + "version": "1.0.81-alpha.0", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.80", - "@budibase/string-templates": "^1.0.80", + "@budibase/backend-core": "^1.0.81-alpha.0", + "@budibase/string-templates": "^1.0.81-alpha.0", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 064aee5e2e980b7eddef5b4f6b664c821ca554f9 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 8 Mar 2022 12:58:05 +0000 Subject: [PATCH 14/22] Update how button action for exporting works --- .../actions/ExportData.svelte | 27 ++++++++++--------- packages/client/src/stores/rowSelection.js | 6 ++--- packages/client/src/utils/buttonActions.js | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte index 93b9a556a6..5a10e1eca8 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExportData.svelte @@ -1,11 +1,13 @@