mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-04-28 03:30:10 +00:00
read WORKFLOW_SCHEDULES flag from backend instead of PostHog JS SDK (#5406)
This commit is contained in:
parent
2e72c2380c
commit
2bddb8dae6
4 changed files with 21 additions and 39 deletions
|
|
@ -10,11 +10,9 @@ import {
|
|||
LightningBoltIcon,
|
||||
} from "@radix-ui/react-icons";
|
||||
import { KeyIcon } from "@/components/icons/KeyIcon.tsx";
|
||||
import { useFeatureFlag } from "@/hooks/useFeatureFlag";
|
||||
|
||||
function SideNav() {
|
||||
const { collapsed } = useSidebarStore();
|
||||
const schedulesEnabled = useFeatureFlag("WORKFLOW_SCHEDULES");
|
||||
|
||||
return (
|
||||
<nav
|
||||
|
|
@ -40,15 +38,11 @@ function SideNav() {
|
|||
to: "/runs",
|
||||
icon: <CounterClockwiseClockIcon className="size-6" />,
|
||||
},
|
||||
...(schedulesEnabled
|
||||
? [
|
||||
{
|
||||
label: "Schedules",
|
||||
to: "/schedules",
|
||||
icon: <CalendarIcon className="size-6" />,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
label: "Schedules",
|
||||
to: "/schedules",
|
||||
icon: <CalendarIcon className="size-6" />,
|
||||
},
|
||||
{
|
||||
label: "Browsers",
|
||||
to: "/browser-sessions",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
import { Navigate } from "react-router-dom";
|
||||
import { useFeatureFlag } from "@/hooks/useFeatureFlag";
|
||||
import { ScheduleDetailPage } from "@/routes/schedules/ScheduleDetailPage";
|
||||
|
||||
export function ScheduleDetailRoute() {
|
||||
const enabled = useFeatureFlag("WORKFLOW_SCHEDULES");
|
||||
if (enabled) return <ScheduleDetailPage />;
|
||||
return <Navigate to="/workflows" replace />;
|
||||
return <ScheduleDetailPage />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
import { Navigate } from "react-router-dom";
|
||||
import { useFeatureFlag } from "@/hooks/useFeatureFlag";
|
||||
import { SchedulesPage } from "@/routes/schedules/SchedulesPage";
|
||||
|
||||
export function SchedulesRoute() {
|
||||
const enabled = useFeatureFlag("WORKFLOW_SCHEDULES");
|
||||
if (enabled) return <SchedulesPage />;
|
||||
return <Navigate to="/workflows" replace />;
|
||||
return <SchedulesPage />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ import { useDebugStore } from "@/store/useDebugStore";
|
|||
import { useRecordingStore } from "@/store/useRecordingStore";
|
||||
import { useWorkflowTitleStore } from "@/store/WorkflowTitleStore";
|
||||
import { useWorkflowHasChangesStore } from "@/store/WorkflowHasChangesStore";
|
||||
import { useFeatureFlag } from "@/hooks/useFeatureFlag";
|
||||
import { cn } from "@/util/utils";
|
||||
import { CacheKeyValuesResponse } from "@/routes/workflows/types/scriptTypes";
|
||||
|
||||
|
|
@ -99,7 +98,6 @@ function WorkflowHeader({
|
|||
const { data: workflowRun } = useWorkflowRunQuery();
|
||||
const debugStore = useDebugStore();
|
||||
const recordingStore = useRecordingStore();
|
||||
const schedulesEnabled = useFeatureFlag("WORKFLOW_SCHEDULES");
|
||||
const workflowRunIsRunningOrQueued =
|
||||
workflowRun && statusIsRunningOrQueued(workflowRun);
|
||||
const [chosenCacheKeyValue, setChosenCacheKeyValue] = useState<string | null>(
|
||||
|
|
@ -400,22 +398,20 @@ function WorkflowHeader({
|
|||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
)}
|
||||
{schedulesEnabled && (
|
||||
<Button
|
||||
disabled={isRecording}
|
||||
variant="tertiary"
|
||||
size="lg"
|
||||
onClick={onScheduleClick}
|
||||
>
|
||||
<ClockIcon className="mr-2 h-5 w-5" />
|
||||
<span className="mr-2">Schedule</span>
|
||||
{schedulesPanelOpen ? (
|
||||
<ChevronUpIcon className="h-6 w-6" />
|
||||
) : (
|
||||
<ChevronDownIcon className="h-6 w-6" />
|
||||
)}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
disabled={isRecording}
|
||||
variant="tertiary"
|
||||
size="lg"
|
||||
onClick={onScheduleClick}
|
||||
>
|
||||
<ClockIcon className="mr-2 h-5 w-5" />
|
||||
<span className="mr-2">Schedule</span>
|
||||
{schedulesPanelOpen ? (
|
||||
<ChevronUpIcon className="h-6 w-6" />
|
||||
) : (
|
||||
<ChevronDownIcon className="h-6 w-6" />
|
||||
)}
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isRecording}
|
||||
variant="tertiary"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue