From 7c918302a90e92f71ba2711c4343dcab389cdfa8 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 4 Nov 2024 22:27:43 +0000 Subject: [PATCH] update all areas where ai flags come from license to come from feature flag --- .../src/components/automation/SetupPanel/CronBuilder.svelte | 6 ++++-- .../src/pages/builder/portal/settings/ai/index.svelte | 5 +++-- .../builder/src/pages/builder/portal/settings/index.svelte | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte index 51538944f4..fd235a70f2 100644 --- a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte +++ b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte @@ -9,7 +9,7 @@ } from "@budibase/bbui" import { onMount, createEventDispatcher } from "svelte" import { flags } from "stores/builder" - import { featureFlags } from "stores/portal" + import { featureFlags, licensing } from "stores/portal" import { API } from "api" import MagicWand from "../../../../assets/MagicWand.svelte" @@ -26,7 +26,9 @@ let aiCronPrompt = "" let loadingAICronExpression = false - $: aiEnabled = $featureFlags.AI_CUSTOM_CONFIGS || $featureFlags.BUDIBASE_AI + $: aiEnabled = + ($featureFlags.AI_CUSTOM_CONFIGS && $licensing.customAIConfigsEnabled) || + ($featureFlags.BUDIBASE_AI && $licensing.budibaseAIEnabled) $: { if (cronExpression) { try { diff --git a/packages/builder/src/pages/builder/portal/settings/ai/index.svelte b/packages/builder/src/pages/builder/portal/settings/ai/index.svelte index bbdf46a24e..ec0ff31e58 100644 --- a/packages/builder/src/pages/builder/portal/settings/ai/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/ai/index.svelte @@ -12,7 +12,7 @@ Tags, Tag, } from "@budibase/bbui" - import { admin, licensing } from "stores/portal" + import { admin, licensing, featureFlags } from "stores/portal" import { API } from "api" import AIConfigModal from "./ConfigModal.svelte" import AIConfigTile from "./AIConfigTile.svelte" @@ -27,7 +27,8 @@ let editingUuid $: isCloud = $admin.cloud - $: customAIConfigsEnabled = $licensing.customAIConfigsEnabled + $: customAIConfigsEnabled = + $featureFlags.AI_CUSTOM_CONFIGS && $licensing.customAIConfigsEnabled async function fetchAIConfig() { try { diff --git a/packages/builder/src/pages/builder/portal/settings/index.svelte b/packages/builder/src/pages/builder/portal/settings/index.svelte index 1448b43ec4..9ab8436f94 100644 --- a/packages/builder/src/pages/builder/portal/settings/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/index.svelte @@ -1,8 +1,8 @@