Rename workflow /debug URL path to /build (#SKY-7362) (#4656)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Navigate, Outlet, createBrowserRouter } from "react-router-dom";
|
import { Navigate, Outlet, createBrowserRouter } from "react-router-dom";
|
||||||
|
import { DebugToBuildRedirect } from "@/routes/workflows/DebugToBuildRedirect";
|
||||||
import { BrowserSession } from "@/routes/browserSessions/BrowserSession";
|
import { BrowserSession } from "@/routes/browserSessions/BrowserSession";
|
||||||
import { BrowserSessions } from "@/routes/browserSessions/BrowserSessions";
|
import { BrowserSessions } from "@/routes/browserSessions/BrowserSessions";
|
||||||
import { PageLayout } from "./components/PageLayout";
|
import { PageLayout } from "./components/PageLayout";
|
||||||
@@ -132,13 +133,21 @@ const router = createBrowserRouter([
|
|||||||
element: <Navigate to="runs" />,
|
element: <Navigate to="runs" />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "debug",
|
path: "build",
|
||||||
element: <Debugger />,
|
element: <Debugger />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":workflowRunId/:blockLabel/debug",
|
path: ":workflowRunId/:blockLabel/build",
|
||||||
element: <Debugger />,
|
element: <Debugger />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "debug",
|
||||||
|
element: <DebugToBuildRedirect />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ":workflowRunId/:blockLabel/debug",
|
||||||
|
element: <DebugToBuildRedirect />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "edit",
|
path: "edit",
|
||||||
element: <WorkflowEditor />,
|
element: <WorkflowEditor />,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ function WorkflowTemplates() {
|
|||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(
|
navigate(
|
||||||
`/workflows/${workflow.workflow_permanent_id}/debug`,
|
`/workflows/${workflow.workflow_permanent_id}/build`,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ function Header() {
|
|||||||
const embed = searchParams.get("embed");
|
const embed = searchParams.get("embed");
|
||||||
const match =
|
const match =
|
||||||
useMatch("/workflows/:workflowPermanentId/edit") ||
|
useMatch("/workflows/:workflowPermanentId/edit") ||
|
||||||
|
location.pathname.includes("build") ||
|
||||||
location.pathname.includes("debug") ||
|
location.pathname.includes("debug") ||
|
||||||
embed === "true";
|
embed === "true";
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ function PromptBox() {
|
|||||||
setAutoplay(workflow.workflow_permanent_id, firstBlock.label);
|
setAutoplay(workflow.workflow_permanent_id, firstBlock.label);
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(`/workflows/${workflow.workflow_permanent_id}/debug`);
|
navigate(`/workflows/${workflow.workflow_permanent_id}/build`);
|
||||||
},
|
},
|
||||||
onError: (error: AxiosError) => {
|
onError: (error: AxiosError) => {
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { Navigate, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
|
function DebugToBuildRedirect() {
|
||||||
|
const location = useLocation();
|
||||||
|
return (
|
||||||
|
<Navigate
|
||||||
|
to={
|
||||||
|
location.pathname.replace(/\/debug(\/|$)/, "/build$1") +
|
||||||
|
location.search +
|
||||||
|
location.hash
|
||||||
|
}
|
||||||
|
replace
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { DebugToBuildRedirect };
|
||||||
@@ -574,7 +574,7 @@ function RunWorkflowForm({
|
|||||||
</ul>
|
</ul>
|
||||||
<p className="mt-2">
|
<p className="mt-2">
|
||||||
<Link
|
<Link
|
||||||
to={`/workflows/${workflowPermanentId}/debug`}
|
to={`/workflows/${workflowPermanentId}/build`}
|
||||||
className="underline hover:no-underline"
|
className="underline hover:no-underline"
|
||||||
>
|
>
|
||||||
Go to the editor
|
Go to the editor
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ function WorkflowPage() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Button asChild variant="secondary">
|
<Button asChild variant="secondary">
|
||||||
<Link to={`/workflows/${workflowPermanentId}/debug`}>
|
<Link to={`/workflows/${workflowPermanentId}/build`}>
|
||||||
<Pencil2Icon className="mr-2 size-4" />
|
<Pencil2Icon className="mr-2 size-4" />
|
||||||
Edit
|
Edit
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ function WorkflowRun() {
|
|||||||
hideTrigger
|
hideTrigger
|
||||||
/>
|
/>
|
||||||
<Button asChild variant="secondary">
|
<Button asChild variant="secondary">
|
||||||
<Link to={`/workflows/${workflowPermanentId}/debug`}>
|
<Link to={`/workflows/${workflowPermanentId}/build`}>
|
||||||
<Pencil2Icon className="mr-2 h-4 w-4" />
|
<Pencil2Icon className="mr-2 h-4 w-4" />
|
||||||
Edit
|
Edit
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ function Workflows() {
|
|||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
handleIconClick(
|
handleIconClick(
|
||||||
event,
|
event,
|
||||||
`/workflows/${workflow.workflow_permanent_id}/debug`,
|
`/workflows/${workflow.workflow_permanent_id}/build`,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ function WorkflowsPageLayout() {
|
|||||||
const embed = searchParams.get("embed");
|
const embed = searchParams.get("embed");
|
||||||
const match =
|
const match =
|
||||||
useMatch("/workflows/:workflowPermanentId/edit") ||
|
useMatch("/workflows/:workflowPermanentId/edit") ||
|
||||||
|
location.pathname.includes("build") ||
|
||||||
location.pathname.includes("debug") ||
|
location.pathname.includes("debug") ||
|
||||||
embed === "true";
|
embed === "true";
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function DebuggerBlockRuns() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
navigate(
|
navigate(
|
||||||
`/workflows/${run.workflow_permanent_id}/${run.workflow_run_id}/${blockLabel}/debug`,
|
`/workflows/${run.workflow_permanent_id}/${run.workflow_run_id}/${blockLabel}/build`,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ function WorkflowHeader({
|
|||||||
if (debugStore.isDebugMode) {
|
if (debugStore.isDebugMode) {
|
||||||
navigate(`/workflows/${workflowPermanentId}/edit`);
|
navigate(`/workflows/${workflowPermanentId}/edit`);
|
||||||
} else {
|
} else {
|
||||||
navigate(`/workflows/${workflowPermanentId}/debug`);
|
navigate(`/workflows/${workflowPermanentId}/build`);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ function NodeHeader({
|
|||||||
workflowRunId === workflowRun?.workflow_run_id &&
|
workflowRunId === workflowRun?.workflow_run_id &&
|
||||||
statusIsFinalized(workflowRun)
|
statusIsFinalized(workflowRun)
|
||||||
) {
|
) {
|
||||||
// navigate(`/workflows/${workflowPermanentId}/debug`);
|
// navigate(`/workflows/${workflowPermanentId}/build`);
|
||||||
|
|
||||||
if (statusIsAFailureType(workflowRun)) {
|
if (statusIsAFailureType(workflowRun)) {
|
||||||
toast({
|
toast({
|
||||||
@@ -406,7 +406,7 @@ function NodeHeader({
|
|||||||
});
|
});
|
||||||
|
|
||||||
navigate(
|
navigate(
|
||||||
`/workflows/${workflowPermanentId}/${response.data.run_id}/${label}/debug`,
|
`/workflows/${workflowPermanentId}/${response.data.run_id}/${label}/build`,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
onError: (error: AxiosError) => {
|
onError: (error: AxiosError) => {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function useCreateWorkflowMutation() {
|
|||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: ["folders"],
|
queryKey: ["folders"],
|
||||||
});
|
});
|
||||||
navigate(`/workflows/${response.data.workflow_permanent_id}/debug`);
|
navigate(`/workflows/${response.data.workflow_permanent_id}/build`);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useLocation } from "react-router-dom";
|
|||||||
function useIsDebugMode() {
|
function useIsDebugMode() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
return useMemo(
|
return useMemo(
|
||||||
() => location.pathname.includes("debug"),
|
() => location.pathname.includes("build"),
|
||||||
[location.pathname],
|
[location.pathname],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user