+
{defaultRunType === "automatic-trigger" && }
{/* Preset/Trigger fields */}
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ScheduleView/ScheduleView.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ScheduleView/ScheduleView.tsx
index 7de4c7ea46..2d6b97eb08 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ScheduleView/ScheduleView.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunAgentModal/components/ScheduleView/ScheduleView.tsx
@@ -1,11 +1,9 @@
import { Input } from "@/components/atoms/Input/Input";
-import { MultiToggle } from "@/components/molecules/MultiToggle/MultiToggle";
import { Text } from "@/components/atoms/Text/Text";
-import { Select } from "@/components/atoms/Select/Select";
-import { useScheduleView } from "./useScheduleView";
import { useCallback, useState } from "react";
import { validateSchedule } from "./helpers";
import { TimezoneNotice } from "../TimezoneNotice/TimezoneNotice";
+import { CronScheduler } from "../CronScheduler/CronScheduler";
interface Props {
scheduleName: string;
@@ -24,41 +22,22 @@ export function ScheduleView({
onCronExpressionChange,
onValidityChange,
}: Props) {
- const {
- repeat,
- selectedDays,
- time,
- repeatOptions,
- dayItems,
- setSelectedDays,
- handleRepeatChange,
- handleTimeChange,
- handleSelectAll,
- handleWeekdays,
- handleWeekends,
- } = useScheduleView({ onCronExpressionChange });
-
function handleScheduleNameChange(e: React.ChangeEvent) {
onScheduleNameChange(e.target.value);
}
const [errors, setErrors] = useState<{
scheduleName?: string;
- time?: string;
}>({});
const validateNow = useCallback(
- (partial: { scheduleName?: string; time?: string }) => {
- const fieldErrors = validateSchedule({
- scheduleName,
- time,
- ...partial,
- });
+ (partial: { scheduleName?: string }) => {
+ const fieldErrors = validateSchedule({ scheduleName, ...partial });
setErrors(fieldErrors);
if (onValidityChange)
onValidityChange(Object.keys(fieldErrors).length === 0);
},
- [scheduleName, time, onValidityChange],
+ [scheduleName, onValidityChange],
);
return (
@@ -67,12 +46,14 @@ export function ScheduleView({
id="schedule-name"
label="Schedule Name"
value={scheduleName}
+ size="small"
onChange={(e) => {
handleScheduleNameChange(e);
validateNow({ scheduleName: e.target.value });
}}
placeholder="Enter a name for this schedule"
error={errors.scheduleName}
+ className="max-w-80"
/>
{recommendedScheduleCron && (
@@ -84,65 +65,15 @@ export function ScheduleView({
)}
-
-
- {repeat === "weekly" && (
-
-
- Repeats on
-
-
-
-
-
-
-
-
-
- )}
-
-
{
- const value = e.target.value.trim();
- handleTimeChange({ ...e, target: { ...e.target, value } } as any);
- validateNow({ time: value });
- }}
- placeholder="00:00"
- error={errors.time}
- />
-
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
index 7bebac4020..ccfd51d497 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
@@ -2,23 +2,16 @@ import { RunStatusBadge } from "../RunDetails/components/RunStatusBadge";
import { Text } from "@/components/atoms/Text/Text";
import { Button } from "@/components/atoms/Button/Button";
import {
- PencilSimpleIcon,
TrashIcon,
StopIcon,
PlayIcon,
- ArrowSquareOut,
+ ArrowSquareOutIcon,
} from "@phosphor-icons/react";
import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";
import moment from "moment";
import { GraphExecution } from "@/app/api/__generated__/models/graphExecution";
import { useRunDetailHeader } from "./useRunDetailHeader";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
-} from "@/components/molecules/DropdownMenu/DropdownMenu";
-import Link from "next/link";
+import { AgentActions } from "./components/AgentActions";
type Props = {
agent: LibraryAgent;
@@ -77,40 +70,28 @@ export function RunDetailHeader({
>
Delete run
-
-
-
-
-
- {canStop ? (
-
- Stop run
-
- ) : null}
- {openInBuilderHref ? (
-
-
- Open in builder
-
-
- ) : null}
-
-
- Edit agent
-
-
-
-
+ {openInBuilderHref ? (
+
+ ) : null}
+ {canStop ? (
+
+ ) : null}
+
) : null}