chore: Update embed tab to hide private embed settings (#40266)
Before:  After:  /ok-to-test tags="@tag.Settings" <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14488729430> > Commit: 9489312f0436f3f4f810927c4c606f4764c01d3d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14488729430&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Settings` > Spec: > <hr>Wed, 16 Apr 2025 09:21:15 UTC <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ankita Kinger <ankita@appsmith.com>
This commit is contained in:
parent
303a4d8bbb
commit
e07de53491
|
|
@ -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 (
|
||||
<div className="flex flex-col gap-6">
|
||||
|
|
@ -107,7 +107,7 @@ export function ShareModal() {
|
|||
</Switch>
|
||||
)}
|
||||
|
||||
{!isPublicApp && (
|
||||
{!isPublicApp && !isAiAgentFlowEnabled && (
|
||||
<PrivateEmbedSettings
|
||||
selectedMethod={selectedMethod}
|
||||
setSelectedMethod={setSelectedMethod}
|
||||
|
|
@ -142,9 +142,10 @@ export function AppSettings() {
|
|||
);
|
||||
const currentApplicationDetails = useSelector(getCurrentApplication);
|
||||
const isPublicApp = currentApplicationDetails?.isPublic || false;
|
||||
const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled);
|
||||
const snippetUrl = getSnippetUrl(
|
||||
embedSnippet.appViewEndPoint,
|
||||
isPublicApp,
|
||||
isPublicApp || isAiAgentFlowEnabled,
|
||||
selectedMethod,
|
||||
);
|
||||
const isCloudBillingEnabled = useIsCloudBillingEnabled();
|
||||
|
|
@ -182,20 +183,24 @@ export function AppSettings() {
|
|||
</div>
|
||||
)}
|
||||
|
||||
<Switch
|
||||
data-testid={"show-navigation-bar-toggle"}
|
||||
defaultSelected={embedSnippet.currentEmbedSetting?.showNavigationBar}
|
||||
onChange={() =>
|
||||
embedSnippet.onChange({
|
||||
showNavigationBar:
|
||||
!embedSnippet.currentEmbedSetting.showNavigationBar,
|
||||
})
|
||||
}
|
||||
>
|
||||
{createMessage(IN_APP_EMBED_SETTING.showNavigationBar)}
|
||||
</Switch>
|
||||
{Boolean(isAiAgentFlowEnabled) === false && (
|
||||
<Switch
|
||||
data-testid={"show-navigation-bar-toggle"}
|
||||
defaultSelected={
|
||||
embedSnippet.currentEmbedSetting?.showNavigationBar
|
||||
}
|
||||
onChange={() =>
|
||||
embedSnippet.onChange({
|
||||
showNavigationBar:
|
||||
!embedSnippet.currentEmbedSetting.showNavigationBar,
|
||||
})
|
||||
}
|
||||
>
|
||||
{createMessage(IN_APP_EMBED_SETTING.showNavigationBar)}
|
||||
</Switch>
|
||||
)}
|
||||
|
||||
{!isPublicApp && (
|
||||
{!isPublicApp && !isAiAgentFlowEnabled && (
|
||||
<PrivateEmbedSettings
|
||||
selectedMethod={selectedMethod}
|
||||
setSelectedMethod={setSelectedMethod}
|
||||
|
|
@ -216,10 +221,10 @@ export function EmbedSnippetTab({
|
|||
isAppSettings?: boolean;
|
||||
}) {
|
||||
const currentApplicationDetails = useSelector(getCurrentApplication);
|
||||
|
||||
const isPublicApp = currentApplicationDetails?.isPublic || false;
|
||||
const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled);
|
||||
|
||||
if (!isPublicApp) {
|
||||
if (!isPublicApp && !isAiAgentFlowEnabled) {
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<PrivateEmbeddingContent
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { getRampLink, showProductRamps } from "ee/selectors/rampSelectors";
|
|||
import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
|
||||
import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
|
||||
import EnterpriseTag from "components/EnterpriseTag";
|
||||
import { getIsAiAgentFlowEnabled } from "ee/selectors/aiAgentSelectors";
|
||||
|
||||
function PrivateEmbeddingContent(props: {
|
||||
// TODO: Fix this the next time the file is edited
|
||||
|
|
@ -55,9 +56,10 @@ export function PrivateEmbedRampModal() {
|
|||
false,
|
||||
isPrivateEmbedEnabled,
|
||||
);
|
||||
const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled);
|
||||
const canShowRamp = useSelector(showRampSelector);
|
||||
|
||||
if (canShowRamp) {
|
||||
if (canShowRamp && !isAiAgentFlowEnabled) {
|
||||
return (
|
||||
<div className="flex justify-between items-start">
|
||||
<div className="flex flex-col gap-1 w-4/5">
|
||||
|
|
@ -106,9 +108,10 @@ export function PrivateEmbedRampSidebar() {
|
|||
false,
|
||||
isPrivateEmbedEnabled,
|
||||
);
|
||||
const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled);
|
||||
const canShowRamp = useSelector(showRampSelector);
|
||||
|
||||
if (canShowRamp) {
|
||||
if (canShowRamp && !isAiAgentFlowEnabled) {
|
||||
return (
|
||||
<div className="mt-6" data-testid="t--private-embed-settings-ramp">
|
||||
<Text kind="body-m">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user