Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: form for editing ws schedule #1634

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

Merged
merged 4 commits into from
May 20, 2022
Merged

Conversation

greyscaled
Copy link
Contributor

Summary:

This presents a form component and storybook. The UI will be a routed
page and added into the dashboard in a separate PR. It is likely a
XService will be used at the page level to supply errors and actions to
this form.

Impact of Change:

Further progress on #1455

Squashed Commits:

  • refactor: add className prop to Stack

combine classes with internal classes and an optional external className
to better control the Stack.

Summary:

This presents a form component and storybook. The UI will be a routed
page and added into the dashboard in a separate PR. It is likely a
XService will be used at the page level to supply errors and actions to
this form.

Impact of Change:

Further progress on #1455

Squashed Commits:

* refactor: add className prop to Stack

combine classes with internal classes and an optional external className
to better control the Stack.
@greyscaled greyscaled self-assigned this May 20, 2022
@greyscaled greyscaled requested a review from a team as a code owner May 20, 2022 18:48
@greyscaled greyscaled changed the title feat: ui for editing ws schedule feat: form for editing ws schedule May 20, 2022
@greyscaled greyscaled requested a review from johnstcn May 20, 2022 18:50
Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

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

nice!

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

LGTM!

control={<Checkbox checked={form.values.saturday} onChange={form.handleChange} name="saturday" />}
label={Language.daySaturdayLabel}
/>
</FormGroup>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Review: I can create a map for these as a refactor...will do in follow-up/later.

Comment on lines +51 to +58
initialValues: {
sunday: false,
monday: true,
tuesday: true,
wednesday: true,
thursday: true,
friday: true,
saturday: false,
Copy link
Member

@johnstcn johnstcn May 20, 2022

Choose a reason for hiding this comment

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

(non-blocking): I'm not sure how this is going to be translated into a CRON string, but the below are all valid representations:

MON-FRI
MON,TUE,THU,SUN
1-3
2,3,4,5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The parent controlling the form will map the startTime and each of these into an acceptable cron string.

It will likely do , format for simplicity. We will test each of these cases both with code and in crontab.guru.

However, this is all to say - that's a follow-up to the form, that doesn't need to know anything about cron. The code that maps between the form and API is dependency injected via onSubmit, which allows us to test and maintain it in isolation, should something about our cron format change (which is nice).

@greyscaled greyscaled enabled auto-merge (squash) May 20, 2022 19:44
@greyscaled greyscaled merged commit 4f75291 into main May 20, 2022
@greyscaled greyscaled deleted the vapurrmaid/gh-1455/part-2/form branch May 20, 2022 20:26
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
* feat: ui for editing ws schedule

Summary:

This presents a form component and storybook. The UI will be a routed
page and added into the dashboard in a separate PR. It is likely a
XService will be used at the page level to supply errors and actions to
this form.

Impact of Change:

Further progress on #1455

Squashed Commits:

* refactor: add className prop to Stack

combine classes with internal classes and an optional external className
to better control the Stack.

* fix: getFormHelpers helperText

the helperText logic was incorrect, the helperText would only show if not touched.
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.

4 participants