diff --git a/packages/backend-core/src/features/index.ts b/packages/backend-core/src/features/index.ts index e0bd29b1bc..1ae194ea0b 100644 --- a/packages/backend-core/src/features/index.ts +++ b/packages/backend-core/src/features/index.ts @@ -267,4 +267,5 @@ export class FlagSet, 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), }) diff --git a/packages/server/src/db/linkedRows/index.ts b/packages/server/src/db/linkedRows/index.ts index 2394d00d0e..fa5808a28c 100644 --- a/packages/server/src/db/linkedRows/index.ts +++ b/packages/server/src/db/linkedRows/index.ts @@ -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)