Skip to content

Commit 12a9469

Browse files
committed
fix(api, web): update cron trigger date handling and improve workflow import button UI
1 parent 2ebebcb commit 12a9469

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

apps/api/src/cron.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export async function handleCronTriggers(
145145
}
146146

147147
const interval = CronParser.parse(cronTrigger.cronExpression, {
148-
currentDate: now,
148+
currentDate: cronTrigger.lastRun || now,
149149
});
150150
const nextRun = interval.next().toDate();
151151

apps/web/src/pages/workflows/workflows-page.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
WorkflowWithMetadata,
55
} from "@dafthunk/types";
66
import { ColumnDef } from "@tanstack/react-table";
7-
import { MoreHorizontal, Plus } from "lucide-react";
7+
import { Import, MoreHorizontal, Plus } from "lucide-react";
88
import { useEffect, useState } from "react";
99
import { Link, useNavigate } from "react-router";
1010

@@ -441,15 +441,16 @@ export function WorkflowsPage() {
441441
automatic.
442442
</div>
443443
<div className="flex gap-2">
444+
445+
<Button onClick={() => setIsCreateDialogOpen(true)}>
446+
<Plus className="mr-2 h-4 w-4" />
447+
Create New Workflow
448+
</Button>
444449
<Button
445-
variant="outline"
446450
onClick={() => setIsImportDialogOpen(true)}
447451
>
448-
Import from Template
449-
</Button>
450-
<Button onClick={() => setIsCreateDialogOpen(true)}>
451-
<Plus className="mr-2 h-4 w-4" />
452-
Create Workflow
452+
<Import className="mr-2 h-4 w-4" />
453+
Import Workflow Template
453454
</Button>
454455
</div>
455456
</div>

0 commit comments

Comments
 (0)