Merge branches 'budi-8957-date-filter-equals-does-not-work' and 'master' of github.com:budibase/budibase into budi-8957-date-filter-equals-does-not-work

This commit is contained in:
Sam Rose 2025-01-09 17:16:55 +00:00
commit f477d1b158
No known key found for this signature in database
6 changed files with 13 additions and 47 deletions

View File

@ -1,9 +1,7 @@
import { derived, Readable } from "svelte/store" import { derived, Readable } from "svelte/store"
import { admin } from "./admin" import { admin } from "./admin"
import { auth } from "./auth" import { auth } from "./auth"
import { isEnabled } from "@/helpers/featureFlags"
import { sdk } from "@budibase/shared-core" import { sdk } from "@budibase/shared-core"
import { FeatureFlag } from "@budibase/types"
interface MenuItem { interface MenuItem {
title: string title: string
@ -73,13 +71,11 @@ export const menu: Readable<MenuItem[]> = derived(
title: "Environment", title: "Environment",
href: "/builder/portal/settings/environment", href: "/builder/portal/settings/environment",
}, },
] {
if (isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS)) {
settingsSubPages.push({
title: "AI", title: "AI",
href: "/builder/portal/settings/ai", href: "/builder/portal/settings/ai",
}) },
} ]
if (!cloud) { if (!cloud) {
settingsSubPages.push({ settingsSubPages.push({

@ -1 +1 @@
Subproject commit 15b7f0907e66e4144338404bb071bc1ccfc98137 Subproject commit 193476cdfade6d3c613e6972f16ee0c527e01ff6

View File

@ -4,15 +4,8 @@ import {
processAIColumns, processAIColumns,
processFormulas, processFormulas,
} from "../../../utilities/rowProcessor" } from "../../../utilities/rowProcessor"
import { context, features } from "@budibase/backend-core" import { context } from "@budibase/backend-core"
import { import { Table, Row, FormulaType, FieldType, ViewV2 } from "@budibase/types"
Table,
Row,
FeatureFlag,
FormulaType,
FieldType,
ViewV2,
} from "@budibase/types"
import * as linkRows from "../../../db/linkedRows" import * as linkRows from "../../../db/linkedRows"
import isEqual from "lodash/isEqual" import isEqual from "lodash/isEqual"
import { cloneDeep, merge } from "lodash/fp" import { cloneDeep, merge } from "lodash/fp"
@ -164,10 +157,8 @@ export async function finaliseRow(
}) })
const aiEnabled = const aiEnabled =
((await features.isEnabled(FeatureFlag.BUDIBASE_AI)) && (await pro.features.isBudibaseAIEnabled()) ||
(await pro.features.isBudibaseAIEnabled())) || (await pro.features.isAICustomConfigsEnabled())
((await features.isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS)) &&
(await pro.features.isAICustomConfigsEnabled()))
if (aiEnabled) { if (aiEnabled) {
row = await processAIColumns(table, row, { row = await processAIColumns(table, row, {
contextRows: [enrichedRow], contextRows: [enrichedRow],

View File

@ -27,11 +27,9 @@ import {
Hosting, Hosting,
ActionImplementation, ActionImplementation,
AutomationStepDefinition, AutomationStepDefinition,
FeatureFlag,
} from "@budibase/types" } from "@budibase/types"
import sdk from "../sdk" import sdk from "../sdk"
import { getAutomationPlugin } from "../utilities/fileSystem" import { getAutomationPlugin } from "../utilities/fileSystem"
import { features } from "@budibase/backend-core"
type ActionImplType = ActionImplementations< type ActionImplType = ActionImplementations<
typeof env.SELF_HOSTED extends "true" ? Hosting.SELF : Hosting.CLOUD typeof env.SELF_HOSTED extends "true" ? Hosting.SELF : Hosting.CLOUD
@ -78,6 +76,7 @@ export const BUILTIN_ACTION_DEFINITIONS: Record<
LOOP: loop.definition, LOOP: loop.definition,
COLLECT: collect.definition, COLLECT: collect.definition,
TRIGGER_AUTOMATION_RUN: triggerAutomationRun.definition, TRIGGER_AUTOMATION_RUN: triggerAutomationRun.definition,
BRANCH: branch.definition,
// these used to be lowercase step IDs, maintain for backwards compat // these used to be lowercase step IDs, maintain for backwards compat
discord: discord.definition, discord: discord.definition,
slack: slack.definition, slack: slack.definition,
@ -105,14 +104,7 @@ if (env.SELF_HOSTED) {
export async function getActionDefinitions(): Promise< export async function getActionDefinitions(): Promise<
Record<keyof typeof AutomationActionStepId, AutomationStepDefinition> Record<keyof typeof AutomationActionStepId, AutomationStepDefinition>
> { > {
if (await features.isEnabled(FeatureFlag.AUTOMATION_BRANCHING)) { if (env.SELF_HOSTED) {
BUILTIN_ACTION_DEFINITIONS["BRANCH"] = branch.definition
}
if (
env.SELF_HOSTED ||
(await features.isEnabled(FeatureFlag.BUDIBASE_AI)) ||
(await features.isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS))
) {
BUILTIN_ACTION_DEFINITIONS["OPENAI"] = openai.definition BUILTIN_ACTION_DEFINITIONS["OPENAI"] = openai.definition
} }

View File

@ -7,9 +7,8 @@ import {
AutomationIOType, AutomationIOType,
OpenAIStepInputs, OpenAIStepInputs,
OpenAIStepOutputs, OpenAIStepOutputs,
FeatureFlag,
} from "@budibase/types" } from "@budibase/types"
import { env, features } from "@budibase/backend-core" import { env } from "@budibase/backend-core"
import * as automationUtils from "../automationUtils" import * as automationUtils from "../automationUtils"
import * as pro from "@budibase/pro" import * as pro from "@budibase/pro"
@ -99,12 +98,8 @@ export async function run({
try { try {
let response let response
const customConfigsEnabled = const customConfigsEnabled = await pro.features.isAICustomConfigsEnabled()
(await features.isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS)) && const budibaseAIEnabled = await pro.features.isBudibaseAIEnabled()
(await pro.features.isAICustomConfigsEnabled())
const budibaseAIEnabled =
(await features.isEnabled(FeatureFlag.BUDIBASE_AI)) &&
(await pro.features.isBudibaseAIEnabled())
let llmWrapper let llmWrapper
if (budibaseAIEnabled || customConfigsEnabled) { if (budibaseAIEnabled || customConfigsEnabled) {

View File

@ -1,16 +1,8 @@
export enum FeatureFlag { export enum FeatureFlag {
AUTOMATION_BRANCHING = "AUTOMATION_BRANCHING",
AI_CUSTOM_CONFIGS = "AI_CUSTOM_CONFIGS",
DEFAULT_VALUES = "DEFAULT_VALUES",
BUDIBASE_AI = "BUDIBASE_AI",
USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR", USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR",
} }
export const FeatureFlagDefaults = { export const FeatureFlagDefaults = {
[FeatureFlag.DEFAULT_VALUES]: true,
[FeatureFlag.AUTOMATION_BRANCHING]: true,
[FeatureFlag.AI_CUSTOM_CONFIGS]: true,
[FeatureFlag.BUDIBASE_AI]: true,
[FeatureFlag.USE_ZOD_VALIDATOR]: false, [FeatureFlag.USE_ZOD_VALIDATOR]: false,
} }