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

Use enums

This commit is contained in:
Adria Navarro 2024-08-27 16:15:25 +02:00
parent d4b0ef7d47
commit 5f40737e9c
3 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import env from "../environment"
import * as context from "../context"
import { PostHog, PostHogOptions } from "posthog-node"
import { IdentityType, UserCtx } from "@budibase/types"
import { FeatureFlag, IdentityType, UserCtx } from "@budibase/types"
import tracer from "dd-trace"
let posthog: PostHog | undefined
@ -267,5 +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),
[FeatureFlag.ENRICHED_RELATIONSHIPS]: Flag.boolean(false),
})

View file

@ -14,6 +14,7 @@ import { processFormulas } from "../../utilities/rowProcessor"
import { context, features } from "@budibase/backend-core"
import {
ContextUser,
FeatureFlag,
FieldType,
LinkDocumentValue,
Row,
@ -273,7 +274,7 @@ export async function squashLinksToPrimaryDisplay(
obj.primaryDisplay = getPrimaryDisplayValue(link, linkedTable)
const allowRelationshipSchemas = await features.flags.isEnabled(
"ENRICHED_RELATIONSHIPS"
FeatureFlag.ENRICHED_RELATIONSHIPS
)
if (schema.schema && allowRelationshipSchemas) {
for (const relField of Object.entries(schema.schema)

View file

@ -1,6 +1,7 @@
export enum FeatureFlag {
PER_CREATOR_PER_USER_PRICE = "PER_CREATOR_PER_USER_PRICE",
PER_CREATOR_PER_USER_PRICE_ALERT = "PER_CREATOR_PER_USER_PRICE_ALERT",
ENRICHED_RELATIONSHIPS = "ENRICHED_RELATIONSHIPS",
}
export interface TenantFeatureFlags {