From e5df14875b561087c87472b76f20598d560f5093 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:09:02 -0300 Subject: [PATCH] feat: put Shareable Playground under ENABLE_PUBLISH feature flag and removed old publish (#7482) * Removed old toolbar * Add enable_publish check before showing Shareable Playground * Removed enable_publish condition on play button * Removed enable_publish condition on playground title * Removed unused import --- .../components/deploy-dropdown.tsx | 107 +++++++++--------- .../components/playground-button.tsx | 3 +- .../core/flowToolbarComponent/index.tsx | 67 +---------- .../chatView/chatMessage/chat-message.tsx | 5 +- src/frontend/src/modals/IOModal/new-modal.tsx | 3 +- 5 files changed, 60 insertions(+), 125 deletions(-) diff --git a/src/frontend/src/components/core/flowToolbarComponent/components/deploy-dropdown.tsx b/src/frontend/src/components/core/flowToolbarComponent/components/deploy-dropdown.tsx index 21608d396..cdbaa5180 100644 --- a/src/frontend/src/components/core/flowToolbarComponent/components/deploy-dropdown.tsx +++ b/src/frontend/src/components/core/flowToolbarComponent/components/deploy-dropdown.tsx @@ -10,7 +10,7 @@ import { import { Switch } from "@/components/ui/switch"; import { usePatchUpdateFlow } from "@/controllers/API/queries/flows/use-patch-update-flow"; import { CustomLink } from "@/customization/components/custom-link"; -import { ENABLE_WIDGET } from "@/customization/feature-flags"; +import { ENABLE_PUBLISH, ENABLE_WIDGET } from "@/customization/feature-flags"; import ApiModal from "@/modals/apiModal/new-api-modal"; import EmbedModal from "@/modals/EmbedModal/embed-modal"; import useAlertStore from "@/stores/alertStore"; @@ -130,63 +130,66 @@ export default function PublishDropdown() { )} - -
- - {}} + -
- - Shareable Playground -
-
-
-
- { - e.preventDefault(); - e.stopPropagation(); - handlePublishedSwitch(isPublished); - }} - /> + {}} + > +
+ + Shareable Playground +
+
+ +
+ { + e.preventDefault(); + e.stopPropagation(); + handlePublishedSwitch(isPublished); + }} + /> +
-
-
+ + )} diff --git a/src/frontend/src/components/core/flowToolbarComponent/components/playground-button.tsx b/src/frontend/src/components/core/flowToolbarComponent/components/playground-button.tsx index 13b63f784..16424b5c3 100644 --- a/src/frontend/src/components/core/flowToolbarComponent/components/playground-button.tsx +++ b/src/frontend/src/components/core/flowToolbarComponent/components/playground-button.tsx @@ -1,7 +1,6 @@ import ForwardedIconComponent from "@/components/common/genericIconComponent"; import ShadTooltip from "@/components/common/shadTooltipComponent"; import { PLAYGROUND_BUTTON_NAME } from "@/constants/constants"; -import { ENABLE_PUBLISH } from "@/customization/feature-flags"; import IOModal from "@/modals/IOModal/new-modal"; const PlaygroundButton = ({ hasIO, open, setOpen, canvasOpen }) => { @@ -9,7 +8,7 @@ const PlaygroundButton = ({ hasIO, open, setOpen, canvasOpen }) => { ); diff --git a/src/frontend/src/components/core/flowToolbarComponent/index.tsx b/src/frontend/src/components/core/flowToolbarComponent/index.tsx index 5d47f5f54..4a74f5e6e 100644 --- a/src/frontend/src/components/core/flowToolbarComponent/index.tsx +++ b/src/frontend/src/components/core/flowToolbarComponent/index.tsx @@ -1,15 +1,8 @@ import ShadTooltip from "@/components/common/shadTooltipComponent"; -import PlaygroundButton from "@/components/core/flowToolbarComponent/components/playground-button"; -import { - ENABLE_API, - ENABLE_LANGFLOW_STORE, - ENABLE_PUBLISH, -} from "@/customization/feature-flags"; import { track } from "@/customization/utils/analytics"; import { Panel } from "@xyflow/react"; import { useEffect, useMemo, useState } from "react"; import { useHotkeys } from "react-hotkeys-hook"; -import ApiModal from "../../../modals/apiModal"; import ShareModal from "../../../modals/shareModal"; import useFlowStore from "../../../stores/flowStore"; import { useShortcutsStore } from "../../../stores/shortcuts"; @@ -122,66 +115,10 @@ export default function FlowToolbar(): JSX.Element {
- {ENABLE_PUBLISH ? ( - - ) : ( -
-
- -
- {ENABLE_API && ( - <> -
- {currentFlow && currentFlow.data && ( - -
- - API -
-
- )} -
- - )} - {ENABLE_LANGFLOW_STORE && ( -
-
- {ModalMemo} -
-
- )} -
- )} +
diff --git a/src/frontend/src/modals/IOModal/components/chatView/chatMessage/chat-message.tsx b/src/frontend/src/modals/IOModal/components/chatView/chatMessage/chat-message.tsx index 1021f43e0..30a00dad6 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/chatMessage/chat-message.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/chatMessage/chat-message.tsx @@ -2,10 +2,7 @@ import { ProfileIcon } from "@/components/core/appHeaderComponent/components/Pro import { ContentBlockDisplay } from "@/components/core/chatComponents/ContentBlockDisplay"; import { useUpdateMessage } from "@/controllers/API/queries/messages"; import { CustomProfileIcon } from "@/customization/components/custom-profile-icon"; -import { - ENABLE_DATASTAX_LANGFLOW, - ENABLE_PUBLISH, -} from "@/customization/feature-flags"; +import { ENABLE_DATASTAX_LANGFLOW } from "@/customization/feature-flags"; import useFlowsManagerStore from "@/stores/flowsManagerStore"; import useFlowStore from "@/stores/flowStore"; import { useUtilityStore } from "@/stores/utilityStore"; diff --git a/src/frontend/src/modals/IOModal/new-modal.tsx b/src/frontend/src/modals/IOModal/new-modal.tsx index 08e72223c..462a2c470 100644 --- a/src/frontend/src/modals/IOModal/new-modal.tsx +++ b/src/frontend/src/modals/IOModal/new-modal.tsx @@ -75,8 +75,7 @@ export default function IOModal({ currentFlowId, ); const flowName = useFlowStore((state) => state.currentFlow?.name); - const PlaygroundTitle = - playgroundPage && ENABLE_PUBLISH && flowName ? flowName : "Playground"; + const PlaygroundTitle = playgroundPage && flowName ? flowName : "Playground"; useEffect(() => { setIOModalOpen(open);