1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Feature flagging backend

This commit is contained in:
Adria Navarro 2024-08-27 15:42:01 +02:00
parent ed19c9db7e
commit d4b0ef7d47
2 changed files with 5 additions and 2 deletions

View file

@ -267,4 +267,5 @@ export class FlagSet<V extends Flag<any>, T extends { [key: string]: V }> {
// default values set correctly and their types flow through the system.
export const flags = new FlagSet({
DEFAULT_VALUES: Flag.boolean(false),
ENRICHED_RELATIONSHIPS: Flag.boolean(false),
})

View file

@ -11,7 +11,7 @@ import { USER_METDATA_PREFIX } from "../utils"
import partition from "lodash/partition"
import { getGlobalUsersFromMetadata } from "../../utilities/global"
import { processFormulas } from "../../utilities/rowProcessor"
import { context } from "@budibase/backend-core"
import { context, features } from "@budibase/backend-core"
import {
ContextUser,
FieldType,
@ -272,7 +272,9 @@ export async function squashLinksToPrimaryDisplay(
const obj: any = { _id: link._id }
obj.primaryDisplay = getPrimaryDisplayValue(link, linkedTable)
const allowRelationshipSchemas = true // TODO
const allowRelationshipSchemas = await features.flags.isEnabled(
"ENRICHED_RELATIONSHIPS"
)
if (schema.schema && allowRelationshipSchemas) {
for (const relField of Object.entries(schema.schema)
.filter(([_, field]) => field.visible !== false)