From 6e38033a95b40245501dd6cbf00981247ddda936 Mon Sep 17 00:00:00 2001
From: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Date: Fri, 4 Apr 2025 18:17:23 -0300
Subject: [PATCH] fix: publish button not redirecting to right path (#7439)
* Added custom link to shareable playground
* Added correct tooltip to Shareable Playground button
* Fix typo
---
.../components/deploy-dropdown.tsx | 48 +++++++++++--------
1 file changed, 28 insertions(+), 20 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 7169cd435..21608d396 100644
--- a/src/frontend/src/components/core/flowToolbarComponent/components/deploy-dropdown.tsx
+++ b/src/frontend/src/components/core/flowToolbarComponent/components/deploy-dropdown.tsx
@@ -9,6 +9,7 @@ import {
} from "@/components/ui/dropdown-menu";
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 ApiModal from "@/modals/apiModal/new-api-modal";
import EmbedModal from "@/modals/EmbedModal/embed-modal";
@@ -18,9 +19,11 @@ import useFlowsManagerStore from "@/stores/flowsManagerStore";
import useFlowStore from "@/stores/flowStore";
import { cn } from "@/utils/utils";
import { useState } from "react";
+import { useHref } from "react-router-dom";
export default function PublishDropdown() {
- const domain = window.location.origin;
+ const location = useHref("/");
+ const domain = window.location.origin + location;
const [openEmbedModal, setOpenEmbedModal] = useState(false);
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const flowId = currentFlow?.id;
@@ -134,7 +137,7 @@ export default function PublishDropdown() {
hasIO
? isPublished
? encodeURI(`${domain}/playground/${flowId}`)
- : "Active to share a public version of this Playground"
+ : "Activate to share a public version of this Playground"
: "Add a Chat Input or Chat Output to access your flow"
}
>
@@ -145,25 +148,30 @@ export default function PublishDropdown() {
)}
data-testid="shareable-playground"
>
-