From b7a2f5c2611523d52ae2c5142fcaefc7f819b41d Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Tue, 6 May 2025 16:02:38 +0530 Subject: [PATCH] chore: Add placeholder AI Integrations form (#40583) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Adds a new AI integrations form and a feature flag to control it ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 047893cddfa36128ca4b07263ef2e49afba40fe1 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Tue, 06 May 2025 06:16:52 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Introduced a new AI Chat Integrations form control component. - Added a feature flag to enable or disable AI Chat Integrations. - **Chores** - Registered the new form control type and component in the form control registry. - Updated feature flag override capabilities to include the new AI Chat Integrations flag. --- .../formControls/AIChatIntegrationsControl.tsx | 18 ++++++++++++++++++ .../src/ce/components/formControls/index.ts | 1 + app/client/src/ce/entities/FeatureFlag.ts | 2 ++ .../AIChatIntegrationsControl/index.ts | 1 + .../utils/formControl/FormControlRegistry.tsx | 9 +++++++++ .../src/utils/formControl/formControlTypes.ts | 1 + .../src/utils/hooks/useFeatureFlagOverride.ts | 1 + 7 files changed, 33 insertions(+) create mode 100644 app/client/src/ce/components/formControls/AIChatIntegrationsControl.tsx create mode 100644 app/client/src/ce/components/formControls/index.ts create mode 100644 app/client/src/ee/components/formControls/AIChatIntegrationsControl/index.ts diff --git a/app/client/src/ce/components/formControls/AIChatIntegrationsControl.tsx b/app/client/src/ce/components/formControls/AIChatIntegrationsControl.tsx new file mode 100644 index 0000000000..39a0550f3f --- /dev/null +++ b/app/client/src/ce/components/formControls/AIChatIntegrationsControl.tsx @@ -0,0 +1,18 @@ +import React from "react"; +import BaseControl, { + type ControlProps, +} from "components/formControls/BaseControl"; +import type { ControlType } from "constants/PropertyControlConstants"; + +interface AIChatIntegrationsControlProps extends ControlProps {} + +class AIChatIntegrationsControl extends BaseControl { + getControlType(): ControlType { + return "AI_CHAT_INTEGRATIONS_FORM"; + } + public render() { + return
AIChatIntegrationsControl
; + } +} + +export default AIChatIntegrationsControl; diff --git a/app/client/src/ce/components/formControls/index.ts b/app/client/src/ce/components/formControls/index.ts new file mode 100644 index 0000000000..977f194275 --- /dev/null +++ b/app/client/src/ce/components/formControls/index.ts @@ -0,0 +1 @@ +export { default } from "./AIChatIntegrationsControl"; diff --git a/app/client/src/ce/entities/FeatureFlag.ts b/app/client/src/ce/entities/FeatureFlag.ts index b16c34ca15..63f151e0e7 100644 --- a/app/client/src/ce/entities/FeatureFlag.ts +++ b/app/client/src/ce/entities/FeatureFlag.ts @@ -59,6 +59,7 @@ export const FEATURE_FLAG = { license_external_saas_plugins_enabled: "license_external_saas_plugins_enabled", release_computation_cache_enabled: "release_computation_cache_enabled", + release_ai_chat_integrations_enabled: "release_ai_chat_integrations_enabled", } as const; export type FeatureFlag = keyof typeof FEATURE_FLAG; @@ -108,6 +109,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = { release_git_package_enabled: false, license_external_saas_plugins_enabled: false, release_computation_cache_enabled: false, + release_ai_chat_integrations_enabled: false, }; export const AB_TESTING_EVENT_KEYS = { diff --git a/app/client/src/ee/components/formControls/AIChatIntegrationsControl/index.ts b/app/client/src/ee/components/formControls/AIChatIntegrationsControl/index.ts new file mode 100644 index 0000000000..eb7d8e90e0 --- /dev/null +++ b/app/client/src/ee/components/formControls/AIChatIntegrationsControl/index.ts @@ -0,0 +1 @@ +export { default } from "ce/components/formControls/AIChatIntegrationsControl"; diff --git a/app/client/src/utils/formControl/FormControlRegistry.tsx b/app/client/src/utils/formControl/FormControlRegistry.tsx index 06ae0c609c..0dc64d91a7 100644 --- a/app/client/src/utils/formControl/FormControlRegistry.tsx +++ b/app/client/src/utils/formControl/FormControlRegistry.tsx @@ -56,6 +56,7 @@ import { AiChatSystemInstructionsControl, type AiChatSystemInstructionsControlProps, } from "components/formControls/AIChatSystemInstructionsControl"; +import AIChatIntegrationsControl from "ee/components/formControls/AIChatIntegrationsControl"; /** * NOTE: If you are adding a component that uses FormControl @@ -253,6 +254,14 @@ class FormControlRegistry { }, }, ); + FormControlFactory.registerControlBuilder( + formControlTypes.AI_CHAT_INTEGRATIONS_FORM, + { + buildPropertyControl(controlProps): JSX.Element { + return ; + }, + }, + ); FormControlFactory.registerControlBuilder( formControlTypes.DATASOURCE_LINK, { diff --git a/app/client/src/utils/formControl/formControlTypes.ts b/app/client/src/utils/formControl/formControlTypes.ts index 7564fd922d..c5f9468aff 100644 --- a/app/client/src/utils/formControl/formControlTypes.ts +++ b/app/client/src/utils/formControl/formControlTypes.ts @@ -27,4 +27,5 @@ export default { DATASOURCE_LINK: "DATASOURCE_LINK", CUSTOM_ACTIONS_CONFIG_FORM: "CUSTOM_ACTIONS_CONFIG_FORM", AI_CHAT_SYSTEM_INSTRUCTIONS: "AI_CHAT_SYSTEM_INSTRUCTIONS", + AI_CHAT_INTEGRATIONS_FORM: "AI_CHAT_INTEGRATIONS_FORM", }; diff --git a/app/client/src/utils/hooks/useFeatureFlagOverride.ts b/app/client/src/utils/hooks/useFeatureFlagOverride.ts index ab30f18f42..03dbe071a0 100644 --- a/app/client/src/utils/hooks/useFeatureFlagOverride.ts +++ b/app/client/src/utils/hooks/useFeatureFlagOverride.ts @@ -16,6 +16,7 @@ export const AvailableFeaturesToOverride: FeatureFlag[] = [ "release_anvil_enabled", "release_layout_conversion_enabled", "license_ai_agent_enabled", + "release_ai_chat_integrations_enabled", ]; export type OverriddenFeatureFlags = Partial>;