Feat: Update cron parser human readable string (#847)

* Update cron parser human readable string

* Create hot-cobras-flow.md

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
This commit is contained in:
Son Yen Nguyen
2024-01-17 00:22:35 +07:00
committed by GitHub
parent 0f342cd1be
commit a93b554f8b
3 changed files with 15 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
Make it clear that schedules are UTC by appending "UTC" to the end.
@@ -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>
) : (
@@ -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>
}
@@ -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}
@@ -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",