From 15818d9d628669758fe9065e71ee1ac958630bd5 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 20 Sep 2022 10:07:07 +0100 Subject: [PATCH] Minor change to ensure correct labelling for OAuthToken binding --- packages/builder/src/builderStore/dataBinding.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index fc16ceec18..41476fd9ec 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -9,14 +9,14 @@ import { import { store } from "builderStore" import { queries as queriesStores, - roles as rolesStore, tables as tablesStore, + roles as rolesStore, } from "stores/backend" import { + makePropSafe, + isJSBinding, decodeJSBinding, encodeJSBinding, - isJSBinding, - makePropSafe, } from "@budibase/string-templates" import { TableNames } from "../constants" import { JSONUtils } from "@budibase/frontend-core" @@ -71,11 +71,11 @@ export const getAuthBindings = () => { runtime: `${safeUser}.${safeOAuth2}.${safeAccessToken}`, readable: `Current User.OAuthToken`, key: "accessToken", + display: { name: "OAuthToken" }, }, ] - bindings = Object.keys(authBindings).map(key => { - const fieldBinding = authBindings[key] + bindings = authBindings.map(fieldBinding => { return { type: "context", runtimeBinding: fieldBinding.runtime, @@ -83,6 +83,7 @@ export const getAuthBindings = () => { fieldSchema: { type: "string", name: fieldBinding.key }, providerId: "user", category: "Current User", + display: fieldBinding.display, } }) return bindings @@ -404,7 +405,7 @@ export const getUserBindings = () => { providerId: "user", category: "Current User", icon: "User", - display: fieldSchema, + display: fieldSchema.fieldName, }) }) return bindings