Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): Display pretty cron schedule #5088

Merged
merged 4 commits into from
Feb 11, 2021
Merged

feat(ui): Display pretty cron schedule #5088

merged 4 commits into from
Feb 11, 2021

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Feb 11, 2021

image

image

image

image

Signed-off-by: Alex Collins <alex_collins@intuit.com>
@simster7
Copy link
Member

Ah, I though you had meant a cron scheduler builder. Not one to simply display a humanized version :)

@alexec
Copy link
Contributor Author

alexec commented Feb 11, 2021

Ah, I though you had meant a cron scheduler builder. Not one to simply display a humanized version :)

A builder could be a v2. We've both looked for libraries, and not found a good builder library.

@alexec alexec requested a review from simster7 February 11, 2021 18:23
@alexec alexec marked this pull request as ready for review February 11, 2021 18:23
@alexec
Copy link
Contributor Author

alexec commented Feb 11, 2021

@simster7 could I please request your review?

<div className='columns small-2'>{w.spec.schedule}</div>
<div className='columns small-2'>
<div className='columns small-3'>
<Schedule schedule={w.spec.schedule} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the "pretty" schedule should be displayed in the list view. It's not necessary when looking at all cron workflows (as opposed to just one in detail) and from your screenshot it looks like they're frequently cut off (bad UX)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like this to be visible in the list. My reasons:

  • Commonly I believe that people use simple schedules that are short.
  • It is easier for users to visually parse, vs raw schedule.
  • I expect truncation to happen about.

More complex example:

image

I'm going to ask the community.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see a bug in the library. 0 12 * */1 *. This should be "At 12:00 in every month.”

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh - 1st of the month?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "/1" === ""?

@@ -12,6 +13,7 @@ export const CronWorkflowSpecEditor = ({onChange, spec}: {spec: CronWorkflowSpec
<div className='columns small-3'>Schedule</div>
<div className='columns small-9'>
<TextInput value={spec.schedule} onChange={schedule => onChange({...spec, schedule})} />
<ScheduleValidator schedule={spec.schedule} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be inline with the input, not in a new line. The spec string will never be long enough to occupy even a tenth of the length of the input box, so no reason we can't use the remaining length more effectively with the validator

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to leave this, it is a small panel and I don't think it should be optimised.

alexec and others added 2 commits February 11, 2021 10:53
Co-authored-by: Simon Behar <simbeh7@gmail.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Copy link
Member

@simster7 simster7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre approval

Signed-off-by: Alex Collins <alex_collins@intuit.com>
@alexec
Copy link
Contributor Author

alexec commented Feb 11, 2021

I've pork-barrelled changes to formatting durations. We can rollback if disliked

@alexec alexec merged commit 3b7e373 into argoproj:master Feb 11, 2021
@alexec alexec deleted the cron branch February 11, 2021 22:41
@simster7 simster7 mentioned this pull request Feb 16, 2021
33 tasks
@alexec alexec added this to the v3.0 milestone Feb 16, 2021
@simster7 simster7 mentioned this pull request Mar 8, 2021
@alexec alexec mentioned this pull request Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants