Skip to content

Commit

Permalink
fix(ui): ignore @every cron expression for FE pretty printing and u…
Browse files Browse the repository at this point in the history
…pdate `cronstrue` dependency. Fixes #13489 (#13586)

Signed-off-by: Darko Janjic <[email protected]>
  • Loading branch information
djanjic authored Oct 3, 2024
1 parent f1fbe09 commit ba75efb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"chartjs-plugin-annotation": "^0.5.7",
"classnames": "^2.5.1",
"cron-parser": "^4.9.0",
"cronstrue": "^2.47.0",
"cronstrue": "^2.50.0",
"dagre": "^0.8.5",
"history": "^4.10.1",
"js-yaml": "^4.1.0",
Expand Down
3 changes: 3 additions & 0 deletions ui/src/app/cron-workflows/pretty-schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export function PrettySchedule({schedule}: {schedule: string}) {
try {
if (schedule.split(' ').length >= 6) {
throw new Error('cron schedules must consist of 5 values only');
} else if (schedule.startsWith('@every')) {
return null;
}

const pretty = x.toString(schedule);
return <span title={pretty}>{pretty}</span>;
} catch (e) {
Expand Down
8 changes: 4 additions & 4 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3695,10 +3695,10 @@ cron-parser@^4.9.0:
dependencies:
luxon "^3.2.1"

cronstrue@^2.47.0:
version "2.47.0"
resolved "https://registry.yarnpkg.com/cronstrue/-/cronstrue-2.47.0.tgz#3cf447c2a3a070d5bad2cedd6383e7cc16f5a308"
integrity sha512-fnFwJy7zslTEz6h7O7BkwgHNBvuuPmkhAYKqPDxK5mBQLz2nG08T9afbnjm+yrvcc/wxrd+otaVSnoXT9ulUOw==
cronstrue@^2.50.0:
version "2.50.0"
resolved "https://registry.yarnpkg.com/cronstrue/-/cronstrue-2.50.0.tgz#eabba0f915f186765258b707b7a3950c663b5573"
integrity sha512-ULYhWIonJzlScCCQrPUG5uMXzXxSixty4djud9SS37DoNxDdkeRocxzHuAo4ImRBUK+mAuU5X9TSwEDccnnuPg==

cross-spawn@^6.0.0:
version "6.0.5"
Expand Down

0 comments on commit ba75efb

Please sign in to comment.