diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 6f657f57d6..06c47f94af 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -44,6 +44,7 @@ import { RowUtils } from "@budibase/frontend-core" import ServerBindingPanel from "components/common/bindings/ServerBindingPanel.svelte" import OptionsEditor from "./OptionsEditor.svelte" + import { isEnabled, TENANT_FEATURE_FLAGS } from "helpers/featureFlags" const AUTO_TYPE = FieldType.AUTO const FORMULA_TYPE = FieldType.FORMULA @@ -168,11 +169,12 @@ editableColumn?.type !== JSON_TYPE && !editableColumn.autocolumn $: canHaveDefault = - editableColumn?.type === FieldType.NUMBER || - editableColumn?.type === FieldType.JSON || - editableColumn?.type === FieldType.DATETIME || - editableColumn?.type === FieldType.LONGFORM || - editableColumn?.type === FieldType.STRING + isEnabled(TENANT_FEATURE_FLAGS.DEFAULT_VALUES) && + (editableColumn?.type === FieldType.NUMBER || + editableColumn?.type === FieldType.JSON || + editableColumn?.type === FieldType.DATETIME || + editableColumn?.type === FieldType.LONGFORM || + editableColumn?.type === FieldType.STRING) $: canBeRequired = editableColumn?.type !== LINK_TYPE && !uneditable && diff --git a/packages/builder/src/helpers/featureFlags.js b/packages/builder/src/helpers/featureFlags.js index fe30fb9980..824e3c3f3e 100644 --- a/packages/builder/src/helpers/featureFlags.js +++ b/packages/builder/src/helpers/featureFlags.js @@ -6,6 +6,7 @@ export const TENANT_FEATURE_FLAGS = { USER_GROUPS: "USER_GROUPS", ONBOARDING_TOUR: "ONBOARDING_TOUR", GOOGLE_SHEETS: "GOOGLE_SHEETS", + DEFAULT_VALUES: "DEFAULT_VALUES", } export const isEnabled = featureFlag => { diff --git a/packages/worker/src/index.ts b/packages/worker/src/index.ts index d59d8d96ef..79e6f4493d 100644 --- a/packages/worker/src/index.ts +++ b/packages/worker/src/index.ts @@ -96,11 +96,11 @@ export default server.listen(parseInt(env.PORT || "4002"), async () => { console.log(startupLog) await initPro() await redis.clients.init() + features.init() cache.docWritethrough.init() // configure events to use the pro audit log write // can't integrate directly into backend-core due to cyclic issues await events.processors.init(proSdk.auditLogs.write) - features.init() }) process.on("uncaughtException", err => {