diff --git a/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte b/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte index 693fbe7431..2907919ce7 100644 --- a/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte +++ b/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte @@ -24,7 +24,11 @@
- +
{config.provider} diff --git a/packages/builder/src/stores/portal/menu.js b/packages/builder/src/stores/portal/menu.js index 1e6282894e..a572539863 100644 --- a/packages/builder/src/stores/portal/menu.js +++ b/packages/builder/src/stores/portal/menu.js @@ -3,7 +3,7 @@ import { admin } from "./admin" import { auth } from "./auth" import { isEnabled } from "helpers/featureFlags" import { sdk } from "@budibase/shared-core" -import { FeatureFlag } from "@budibase/types"; +import { FeatureFlag } from "@budibase/types" export const menu = derived([admin, auth], ([$admin, $auth]) => { const user = $auth?.user @@ -65,12 +65,10 @@ export const menu = derived([admin, auth], ([$admin, $auth]) => { }, ] if (isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS)) { - settingsSubPages.push( - { - title: "AI", - href: "/builder/portal/settings/ai", - } - ) + settingsSubPages.push({ + title: "AI", + href: "/builder/portal/settings/ai", + }) } if (!cloud) { diff --git a/packages/worker/src/api/controllers/global/configs.ts b/packages/worker/src/api/controllers/global/configs.ts index a8dfbe6360..d51ae65c51 100644 --- a/packages/worker/src/api/controllers/global/configs.ts +++ b/packages/worker/src/api/controllers/global/configs.ts @@ -343,7 +343,9 @@ async function enrichAIConfig(aiConfig: AIConfig) { // Return the Budibase AI data source as part of the response if licensing allows const budibaseAIEnabled = await pro.features.isBudibaseAIEnabled() - const defaultConfigExists = Object.keys(aiConfig.config).some(key => aiConfig.config[key].isDefault) + const defaultConfigExists = Object.keys(aiConfig.config).some( + key => aiConfig.config[key].isDefault + ) if (budibaseAIEnabled) { aiConfig.config["budibase_ai"] = { provider: "OpenAI", diff --git a/packages/worker/src/api/controllers/global/tests/configs.spec.ts b/packages/worker/src/api/controllers/global/tests/configs.spec.ts index 8b859dcb89..419c12ccb0 100644 --- a/packages/worker/src/api/controllers/global/tests/configs.spec.ts +++ b/packages/worker/src/api/controllers/global/tests/configs.spec.ts @@ -45,7 +45,9 @@ describe("Global configs controller", () => { }) it("Should return the default BB AI config when the feature is turned on", async () => { - jest.spyOn(pro.features, "isBudibaseAIEnabled").mockImplementation(() => true) + jest + .spyOn(pro.features, "isBudibaseAIEnabled") + .mockImplementation(() => true) configs.getConfig.mockResolvedValue({ config: { ai: { @@ -81,7 +83,9 @@ describe("Global configs controller", () => { }) it("Should not not return the default Budibase AI config when on self host", async () => { - jest.spyOn(pro.features, "isBudibaseAIEnabled").mockImplementation(() => false) + jest + .spyOn(pro.features, "isBudibaseAIEnabled") + .mockImplementation(() => false) configs.getConfig.mockResolvedValue({ config: { ai: { @@ -140,7 +144,6 @@ describe("Global configs controller", () => { await verifyAIConfig(newConfig, existingConfig) // should be unchanged - expect(newConfig.config.aiconfig.apiKey === "myapikey") + expect(newConfig.config.aiconfig.apiKey).toEqual("myapikey") }) - })