Minor change to ensure correct labelling for OAuthToken binding

This commit is contained in:
Dean 2022-09-20 10:07:07 +01:00
parent 674263fe9f
commit 15818d9d62
1 changed files with 7 additions and 6 deletions

View File

@ -9,14 +9,14 @@ import {
import { store } from "builderStore" import { store } from "builderStore"
import { import {
queries as queriesStores, queries as queriesStores,
roles as rolesStore,
tables as tablesStore, tables as tablesStore,
roles as rolesStore,
} from "stores/backend" } from "stores/backend"
import { import {
makePropSafe,
isJSBinding,
decodeJSBinding, decodeJSBinding,
encodeJSBinding, encodeJSBinding,
isJSBinding,
makePropSafe,
} from "@budibase/string-templates" } from "@budibase/string-templates"
import { TableNames } from "../constants" import { TableNames } from "../constants"
import { JSONUtils } from "@budibase/frontend-core" import { JSONUtils } from "@budibase/frontend-core"
@ -71,11 +71,11 @@ export const getAuthBindings = () => {
runtime: `${safeUser}.${safeOAuth2}.${safeAccessToken}`, runtime: `${safeUser}.${safeOAuth2}.${safeAccessToken}`,
readable: `Current User.OAuthToken`, readable: `Current User.OAuthToken`,
key: "accessToken", key: "accessToken",
display: { name: "OAuthToken" },
}, },
] ]
bindings = Object.keys(authBindings).map(key => { bindings = authBindings.map(fieldBinding => {
const fieldBinding = authBindings[key]
return { return {
type: "context", type: "context",
runtimeBinding: fieldBinding.runtime, runtimeBinding: fieldBinding.runtime,
@ -83,6 +83,7 @@ export const getAuthBindings = () => {
fieldSchema: { type: "string", name: fieldBinding.key }, fieldSchema: { type: "string", name: fieldBinding.key },
providerId: "user", providerId: "user",
category: "Current User", category: "Current User",
display: fieldBinding.display,
} }
}) })
return bindings return bindings
@ -404,7 +405,7 @@ export const getUserBindings = () => {
providerId: "user", providerId: "user",
category: "Current User", category: "Current User",
icon: "User", icon: "User",
display: fieldSchema, display: fieldSchema.fieldName,
}) })
}) })
return bindings return bindings