Skip to content

Commit

Permalink
Feat: Update cron parser human readable string (#847)
Browse files Browse the repository at this point in the history
* Update cron parser human readable string

* Create hot-cobras-flow.md

---------

Co-authored-by: Matt Aitken <[email protected]>
  • Loading branch information
nosyn and matt-aitken authored Jan 16, 2024
1 parent 0f342cd commit a93b554
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-cobras-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---

Make it clear that schedules are UTC by appending "UTC" to the end.
10 changes: 5 additions & 5 deletions apps/webapp/app/components/jobs/JobsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export function JobsTable({ jobs, noResultsText }: { jobs: ProjectJob[]; noResul
<TableRow key={job.id} className="group">
<TableCell to={path}>
<span className="flex items-center gap-2">
<NamedIcon name={job.event.icon} className="h-8 w-8" />
<NamedIcon name={job.event.icon} className="w-8 h-8" />
<LabelValueStack
label={job.title}
value={
job.dynamic ? (
<span className="flex items-center gap-0.5">
<NamedIcon name="dynamic" className="h-4 w-4" />{" "}
<NamedIcon name="dynamic" className="w-4 h-4" />{" "}
<span className="uppercase">Dynamic:</span> {job.event.title}
</span>
) : (
Expand All @@ -75,9 +75,9 @@ export function JobsTable({ jobs, noResultsText }: { jobs: ProjectJob[]; noResul
key={integration.key}
button={
<div className="relative">
<NamedIcon name={integration.icon} className="h-6 w-6" />
<NamedIcon name={integration.icon} className="w-6 h-6" />
{integration.setupStatus === "MISSING_FIELDS" && (
<NamedIcon name="error" className="absolute -left-1 -top-1 h-4 w-4" />
<NamedIcon name="error" className="absolute w-4 h-4 -left-1 -top-1" />
)}
</div>
}
Expand All @@ -99,7 +99,7 @@ export function JobsTable({ jobs, noResultsText }: { jobs: ProjectJob[]; noResul
{job.properties && (
<SimpleTooltip
button={
<div className="flex max-w-[200px] items-start justify-start gap-5 truncate">
<div className="flex max-w-[300px] items-start justify-start gap-5 truncate">
{job.properties.map((property, index) => (
<LabelValueStack
key={index}
Expand Down
6 changes: 5 additions & 1 deletion packages/trigger-sdk/src/triggers/scheduled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ export class CronTrigger implements Trigger<ScheduledEventSpecification> {
constructor(private options: CronOptions) {}

get event() {
/**
* We need to concat `(UTC)` string at the end of the human readable string to avoid confusion
* with execution time/last run of a job in the UI dashboard which is displayed in local time.
*/
const humanReadable = cronstrue.toString(this.options.cron, {
throwExceptionOnParseError: false,
});
}).concat(" (UTC)");

return {
name: "trigger.scheduled",
Expand Down

0 comments on commit a93b554

Please sign in to comment.