From 1bffa76194aa4d8e9c8298f3dc5a409bdbb5f35f Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Thu, 15 Oct 2020 16:15:28 +0200 Subject: [PATCH 1/9] removes add row button on grid component --- .../src/DataGrid/Component.svelte | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/standard-components/src/DataGrid/Component.svelte b/packages/standard-components/src/DataGrid/Component.svelte index 0d86808961..e4acdbd2ea 100644 --- a/packages/standard-components/src/DataGrid/Component.svelte +++ b/packages/standard-components/src/DataGrid/Component.svelte @@ -11,7 +11,6 @@ import { onMount } from "svelte" import AgGrid from "@budibase/svelte-ag-grid" - import CreateRowButton from "./CreateRow/Button.svelte" import { TextButton as DeleteButton, Icon, Modal, ModalContent } from "@budibase/bbui" export let _bb @@ -79,13 +78,6 @@ } }) - const isEditable = type => - type !== "boolean" && - type !== "options" && - // type !== "datetime" && - type !== "link" && - type !== "attachment" - const shouldHideField = name => { if (name.startsWith("_")) return true // always 'row' @@ -96,10 +88,6 @@ return false } - const handleNewRow = async () => { - data = await fetchData(datasource) - } - const handleUpdate = ({ detail }) => { data[detail.row] = detail.data updateRow(detail.data) @@ -133,7 +121,6 @@ {#if dataLoaded} {#if canAddDelete}
- {#if selectedRows.length > 0} From ee4e1718d5c4eadfdfbc3ececed77f7ad4020766 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Thu, 15 Oct 2020 16:24:03 +0200 Subject: [PATCH 2/9] fixes jumpy behaviour when selecting rows --- packages/standard-components/src/DataGrid/Component.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/standard-components/src/DataGrid/Component.svelte b/packages/standard-components/src/DataGrid/Component.svelte index e4acdbd2ea..d2743cecea 100644 --- a/packages/standard-components/src/DataGrid/Component.svelte +++ b/packages/standard-components/src/DataGrid/Component.svelte @@ -148,6 +148,7 @@ \ No newline at end of file + a { + color: var(--grey-6); + } + From 312c5fc4376f99248d94fda431b5936b229581d0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 16 Oct 2020 11:59:59 +0100 Subject: [PATCH 7/9] Fixing an issue whereby in some enrichment calls the count of links would be doubled (counting both sides). --- packages/server/src/db/linkedRows/index.js | 9 +++++++-- packages/server/src/db/linkedRows/linkUtils.js | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/server/src/db/linkedRows/index.js b/packages/server/src/db/linkedRows/index.js index 0932fc665f..dedb0f84a5 100644 --- a/packages/server/src/db/linkedRows/index.js +++ b/packages/server/src/db/linkedRows/index.js @@ -1,5 +1,5 @@ const LinkController = require("./LinkController") -const { IncludeDocs, getLinkDocuments, createLinkView } = require("./linkUtils") +const { IncludeDocs, getLinkDocuments, createLinkView, getUniqueByProp } = require("./linkUtils") const _ = require("lodash") /** @@ -110,7 +110,12 @@ exports.attachLinkInfo = async (instanceId, rows) => { // now iterate through the rows and all field information for (let row of rows) { // get all links for row, ignore fieldName for now - const linkVals = responses.filter(el => el.thisId === row._id) + // have to get unique as the previous table query can + // return duplicates, could be querying for both tables in a relation + const linkVals = getUniqueByProp( + responses.filter(el => el.thisId === row._id), + "id" + ) for (let linkVal of linkVals) { // work out which link pertains to this row if (!(row[linkVal.fieldName] instanceof Array)) { diff --git a/packages/server/src/db/linkedRows/linkUtils.js b/packages/server/src/db/linkedRows/linkUtils.js index 8f548eed3d..5f600cc3cb 100644 --- a/packages/server/src/db/linkedRows/linkUtils.js +++ b/packages/server/src/db/linkedRows/linkUtils.js @@ -92,3 +92,9 @@ exports.getLinkDocuments = async function({ } } } + +exports.getUniqueByProp = (array, prop) => { + return array.filter((obj, pos, arr) => { + return arr.map(mapObj => mapObj[prop]).indexOf(obj[prop]) === pos + }) +} From 8e3e12f234ad42cd282b826074d270b08f665ce6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 16 Oct 2020 12:13:27 +0100 Subject: [PATCH 8/9] Linting. --- packages/server/src/db/linkedRows/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/server/src/db/linkedRows/index.js b/packages/server/src/db/linkedRows/index.js index dedb0f84a5..6f745b6e7c 100644 --- a/packages/server/src/db/linkedRows/index.js +++ b/packages/server/src/db/linkedRows/index.js @@ -1,5 +1,10 @@ const LinkController = require("./LinkController") -const { IncludeDocs, getLinkDocuments, createLinkView, getUniqueByProp } = require("./linkUtils") +const { + IncludeDocs, + getLinkDocuments, + createLinkView, + getUniqueByProp, +} = require("./linkUtils") const _ = require("lodash") /** From ddc979dc59cae20f98322dd27b10f11580a0cf5d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 16 Oct 2020 12:41:05 +0100 Subject: [PATCH 9/9] v0.2.2 --- lerna.json | 2 +- packages/builder/package.json | 4 ++-- packages/cli/package.json | 4 ++-- packages/client/package.json | 2 +- packages/server/package.json | 4 ++-- packages/standard-components/package.json | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lerna.json b/lerna.json index bd38e87505..b3e7fe4677 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.2.1", + "version": "0.2.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/builder/package.json b/packages/builder/package.json index 4ddf917bee..52df8902c5 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.2.1", + "version": "0.2.2", "license": "AGPL-3.0", "private": true, "scripts": { @@ -64,7 +64,7 @@ }, "dependencies": { "@budibase/bbui": "^1.41.0", - "@budibase/client": "^0.2.1", + "@budibase/client": "^0.2.2", "@budibase/colorpicker": "^1.0.1", "@fortawesome/fontawesome-free": "^5.14.0", "@sentry/browser": "5.19.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index e3a1fc1f3a..0d6ab00d63 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "budibase", - "version": "0.2.1", + "version": "0.2.2", "description": "Budibase CLI", "repository": "https://github.com/Budibase/Budibase", "homepage": "https://www.budibase.com", @@ -17,7 +17,7 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/server": "^0.2.1", + "@budibase/server": "^0.2.2", "@inquirer/password": "^0.0.6-alpha.0", "chalk": "^2.4.2", "dotenv": "^8.2.0", diff --git a/packages/client/package.json b/packages/client/package.json index b4313a9954..e9a4e52c8f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.2.1", + "version": "0.2.2", "license": "MPL-2.0", "main": "dist/budibase-client.js", "module": "dist/budibase-client.esm.mjs", diff --git a/packages/server/package.json b/packages/server/package.json index de1ccd5845..93194a1080 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/server", - "version": "0.2.1", + "version": "0.2.2", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -42,7 +42,7 @@ "author": "Michael Shanks", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/client": "^0.2.1", + "@budibase/client": "^0.2.2", "@koa/router": "^8.0.0", "@sendgrid/mail": "^7.1.1", "@sentry/node": "^5.19.2", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 77e1cee746..cd18e8d769 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -13,7 +13,7 @@ "dev:builder": "rollup -cw" }, "devDependencies": { - "@budibase/client": "^0.2.1", + "@budibase/client": "^0.2.2", "@rollup/plugin-commonjs": "^11.1.0", "lodash": "^4.17.15", "rollup": "^2.11.2", @@ -31,7 +31,7 @@ "keywords": [ "svelte" ], - "version": "0.2.1", + "version": "0.2.2", "license": "MIT", "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", "dependencies": {