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" } from "@budibase/bbui"
import { onMount, createEventDispatcher } from "svelte" import { onMount, createEventDispatcher } from "svelte"
import { flags } from "stores/builder" import { flags } from "stores/builder"
import { featureFlags } from "stores/portal" import { featureFlags, licensing } from "stores/portal"
import { API } from "api" import { API } from "api"
import MagicWand from "../../../../assets/MagicWand.svelte" import MagicWand from "../../../../assets/MagicWand.svelte"
@ -26,7 +26,9 @@
let aiCronPrompt = "" let aiCronPrompt = ""
let loadingAICronExpression = false 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) { if (cronExpression) {
try { try {

View File

@ -12,7 +12,7 @@
Tags, Tags,
Tag, Tag,
} from "@budibase/bbui" } from "@budibase/bbui"
import { admin, licensing } from "stores/portal" import { admin, licensing, featureFlags } from "stores/portal"
import { API } from "api" import { API } from "api"
import AIConfigModal from "./ConfigModal.svelte" import AIConfigModal from "./ConfigModal.svelte"
import AIConfigTile from "./AIConfigTile.svelte" import AIConfigTile from "./AIConfigTile.svelte"
@ -27,7 +27,8 @@
let editingUuid let editingUuid
$: isCloud = $admin.cloud $: isCloud = $admin.cloud
$: customAIConfigsEnabled = $licensing.customAIConfigsEnabled $: customAIConfigsEnabled =
$featureFlags.AI_CUSTOM_CONFIGS && $licensing.customAIConfigsEnabled
async function fetchAIConfig() { async function fetchAIConfig() {
try { try {

View File

@ -1,8 +1,8 @@
<script> <script>
import { redirect } from "@roxi/routify" 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") $redirect("./ai")
} else { } else {
$redirect("./auth") $redirect("./auth")