From e07de5349125e61bea07b04d32d5d302efab3aa5 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Wed, 16 Apr 2025 16:00:46 +0530 Subject: [PATCH] chore: Update embed tab to hide private embed settings (#40266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: ![CleanShot 2025-04-16 at 12 41 16](https://github.com/user-attachments/assets/1bdeda82-ca9d-4d21-89d4-eb347557a981) After: ![CleanShot 2025-04-16 at 12 37 57](https://github.com/user-attachments/assets/0de714d8-42e0-477f-96b3-cc54ae36cfcc) /ok-to-test tags="@tag.Settings" > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 9489312f0436f3f4f810927c4c606f4764c01d3d > Cypress dashboard. > Tags: `@tag.Settings` > Spec: >
Wed, 16 Apr 2025 09:21:15 UTC ## Summary by CodeRabbit - **New Features** - Added support for an AI agent flow, affecting embed snippet behavior and visibility of related settings. - **Refactor** - Updated logic to control the display of embed options and settings based on the new AI agent flow feature flag. --------- Co-authored-by: Ankita Kinger --- .../ce/pages/Applications/EmbedSnippetTab.tsx | 49 ++++++++++--------- .../EmbedSnippet/PrivateEmbeddingContent.tsx | 7 ++- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/app/client/src/ce/pages/Applications/EmbedSnippetTab.tsx b/app/client/src/ce/pages/Applications/EmbedSnippetTab.tsx index 31dab0062a..37642b65f9 100644 --- a/app/client/src/ce/pages/Applications/EmbedSnippetTab.tsx +++ b/app/client/src/ce/pages/Applications/EmbedSnippetTab.tsx @@ -52,13 +52,13 @@ export function ShareModal() { ); const currentApplicationDetails = useSelector(getCurrentApplication); const isPublicApp = currentApplicationDetails?.isPublic || false; - const snippetUrl = getSnippetUrl( - embedSnippet.appViewEndPoint, - isPublicApp, - selectedMethod, - ); const isCloudBillingEnabled = useIsCloudBillingEnabled(); const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled); + const snippetUrl = getSnippetUrl( + embedSnippet.appViewEndPoint, + isPublicApp || isAiAgentFlowEnabled, + selectedMethod, + ); return (
@@ -107,7 +107,7 @@ export function ShareModal() { )} - {!isPublicApp && ( + {!isPublicApp && !isAiAgentFlowEnabled && ( )} - - embedSnippet.onChange({ - showNavigationBar: - !embedSnippet.currentEmbedSetting.showNavigationBar, - }) - } - > - {createMessage(IN_APP_EMBED_SETTING.showNavigationBar)} - + {Boolean(isAiAgentFlowEnabled) === false && ( + + embedSnippet.onChange({ + showNavigationBar: + !embedSnippet.currentEmbedSetting.showNavigationBar, + }) + } + > + {createMessage(IN_APP_EMBED_SETTING.showNavigationBar)} + + )} - {!isPublicApp && ( + {!isPublicApp && !isAiAgentFlowEnabled && (
@@ -106,9 +108,10 @@ export function PrivateEmbedRampSidebar() { false, isPrivateEmbedEnabled, ); + const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled); const canShowRamp = useSelector(showRampSelector); - if (canShowRamp) { + if (canShowRamp && !isAiAgentFlowEnabled) { return (