update all areas where ai flags come from license to come from feature flag

This commit is contained in:
Martin McKeaveney 2024-11-04 22:27:43 +00:00
parent 7b867abd19
commit 7c918302a9
3 changed files with 9 additions and 6 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -1,8 +1,8 @@
<script>
import { redirect } from "@roxi/routify"
import { licensing } from "stores/portal"
import { licensing, featureFlags } from "stores/portal"
if ($licensing.customAIConfigsEnabled) {
if ($featureFlags.AI_CUSTOM_CONFIGS && $licensing.customAIConfigsEnabled) {
$redirect("./ai")
} else {
$redirect("./auth")