From 831f3b543f7d6a960a714b9345a60f5a1b17623e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 9 Nov 2021 15:24:13 +0000 Subject: [PATCH 1/3] Disable links when in builder preview --- packages/client/src/utils/linkable.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/utils/linkable.js b/packages/client/src/utils/linkable.js index 4258f6b562..d82a53474b 100644 --- a/packages/client/src/utils/linkable.js +++ b/packages/client/src/utils/linkable.js @@ -4,6 +4,9 @@ import { builderStore } from "stores" export const linkable = (node, href) => { if (get(builderStore).inBuilder) { + node.onclick = e => { + e.preventDefault() + } return } link(node, href) From 4690ae827c4b313689b4b1c64af5e39c1f069db7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 9 Nov 2021 15:45:32 +0000 Subject: [PATCH 2/3] Use full bindings for releationships and attachments --- .../builder/src/builderStore/dataBinding.js | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 165ed37fbb..93e495b616 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -217,18 +217,8 @@ const getProviderContextBindings = (asset, dataProviders) => { keys.forEach(key => { const fieldSchema = schema[key] - // Make safe runtime binding and replace certain bindings with a - // new property to help display components - let runtimeBoundKey = key - if (fieldSchema.type === "link") { - runtimeBoundKey = `${key}_text` - } else if (fieldSchema.type === "attachment") { - runtimeBoundKey = `${key}_first` - } - - const runtimeBinding = `${safeComponentId}.${makePropSafe( - runtimeBoundKey - )}` + // Make safe runtime binding + const runtimeBinding = `${safeComponentId}.${makePropSafe(key)}` // Optionally use a prefix with readable bindings let readableBinding = component._instanceName @@ -267,17 +257,9 @@ const getUserBindings = () => { const safeUser = makePropSafe("user") keys.forEach(key => { const fieldSchema = schema[key] - // Replace certain bindings with a new property to help display components - let runtimeBoundKey = key - if (fieldSchema.type === "link") { - runtimeBoundKey = `${key}_text` - } else if (fieldSchema.type === "attachment") { - runtimeBoundKey = `${key}_first` - } - bindings.push({ type: "context", - runtimeBinding: `${safeUser}.${makePropSafe(runtimeBoundKey)}`, + runtimeBinding: `${safeUser}.${makePropSafe(key)}`, readableBinding: `Current User.${key}`, // Field schema and provider are required to construct relationship // datasource options, based on bindable properties From 0456f1ef2c3d4b2a394d11a8ac244a311bafe0e8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 9 Nov 2021 15:48:04 +0000 Subject: [PATCH 3/3] Add comment to client rows API --- packages/client/src/api/rows.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/client/src/api/rows.js b/packages/client/src/api/rows.js index acd083454d..aca817dc8e 100644 --- a/packages/client/src/api/rows.js +++ b/packages/client/src/api/rows.js @@ -107,6 +107,8 @@ export const deleteRows = async ({ tableId, rows }) => { /** * Enriches rows which contain certain field types so that they can * be properly displayed. + * The ability to create these bindings has been removed, but they will still + * exist in client apps to support backwards compatibility. */ export const enrichRows = async (rows, tableId) => { if (!Array.isArray(rows)) {