From ab6a4391d93d4d57fc8be1b520fe986bdcd67572 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 17 Jun 2021 17:08:12 +0100 Subject: [PATCH 1/3] quick fix for paging and making deletion work correctly. --- packages/server/src/api/controllers/row/external.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index 5f04e84d37..31636953d2 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -35,6 +35,7 @@ function outputProcessing(rows, table) { } row._id = generateRowIdField(idParts) row.tableId = table._id + row._rev = "rev" } return rows } @@ -176,7 +177,6 @@ exports.bulkDestroy = async ctx => { const appId = ctx.appId const { rows } = ctx.request.body const tableId = ctx.params.tableId - // TODO: this can probably be optimised to a single SQL statement in the future let promises = [] for (let row of rows) { promises.push( @@ -232,7 +232,7 @@ exports.search = async ctx => { sort, paginate: { limit: 1, - page: bookmark + 1, + page: (bookmark * limit) + 1, } }) hasNextPage = nextRows.length > 0 From c80ad016f2658d1c883ced4cc1c7a215ccc4843e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 17 Jun 2021 17:50:40 +0100 Subject: [PATCH 2/3] Making internal database view a bit nicer. --- .../data/datasource/bb_internal/index.svelte | 73 +++++++++++++++++-- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte index 311bd94837..686847982a 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte @@ -1,6 +1,9 @@ @@ -9,10 +12,66 @@ - - Budibase Internal DB +
+ +
+ + Budibase Internal +
+ Budibase internal tables are part of your app, the data will be stored in your apps context. + + Tables +
+ {#each $tables.list.filter(table => table.type !== "external") as table} +
+ {table.name} + display column: {table.primaryDisplay} +
+ {/each} +
+
+ +
+
+
-
- -
-
+ \ No newline at end of file From 552c608b49f26d3079e4d6606fb7cc770b80a6c6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 17 Jun 2021 18:19:34 +0100 Subject: [PATCH 3/3] Fixing some issues with cypress tests and screens getting multipled. --- packages/builder/cypress/support/commands.js | 6 +++--- .../backend/TableNavigator/modals/CreateTableModal.svelte | 2 +- .../[application]/data/datasource/bb_internal/index.svelte | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 670f3fb988..d7452284a4 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -37,7 +37,7 @@ Cypress.Commands.add("createApp", name => { cy.contains("Create app").click() }) .then(() => { - cy.contains("Budibase DB", { + cy.get(".selected > .content", { timeout: 20000, }).should("be.visible") }) @@ -51,7 +51,7 @@ Cypress.Commands.add("deleteApp", () => { .then(val => { console.log(val) if (val.length > 0) { - cy.get(".hoverable > use").click() + cy.get(".title > :nth-child(3) > .spectrum-Icon").click() cy.contains("Delete").click() cy.get(".spectrum-Button--warning").click() } @@ -72,7 +72,7 @@ Cypress.Commands.add("createTestTableWithData", () => { Cypress.Commands.add("createTable", tableName => { // Enter table name - cy.get("Budibase DB") + cy.contains("Budibase DB").click() cy.contains("Create new table").click() cy.get(".spectrum-Modal").within(() => { cy.get("input").first().type(tableName).blur() diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index 33d15282fc..13b8eb1296 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -91,7 +91,7 @@ } // Navigate to new table - $goto(`./table/${table._id}`) + $goto(`../../table/${table._id}`) } diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte index 686847982a..17f8f494e9 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/index.svelte @@ -2,7 +2,7 @@ import { Button, Heading, Body, Layout, Modal, Divider } from "@budibase/bbui" import CreateTableModal from "components/backend/TableNavigator/modals/CreateTableModal.svelte" import ICONS from "components/backend/DatasourceNavigator/icons" - import { tables, datasources } from "stores/backend" + import { tables } from "stores/backend" import { goto } from "@roxi/routify" let modal @@ -29,7 +29,9 @@ {#each $tables.list.filter(table => table.type !== "external") as table}
{table.name} - display column: {table.primaryDisplay} + {#if table.primaryDisplay} + display column: {table.primaryDisplay} + {/if}
{/each}