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

Adds support for default values #34

Merged
merged 10 commits into from
Jan 14, 2020
Merged

Adds support for default values #34

merged 10 commits into from
Jan 14, 2020

Conversation

schottra
Copy link
Contributor

@schottra schottra commented Jan 13, 2020

Fixes flyteorg/flyte#18

This change adds support for default values when populating the Launch form. The default values are read from the selected launch plan and set as the initial value for the state hooks used to handle input interaction.

  • Added fromLiteral function to all InputHelper implementations. This function is intended to parse a Core.ILiteral (the type used for default values) into an InputValue which can be used to populate a control in the Launch form
  • Added defaultValue static property to InputHelper. For most types, this will be unset/undefined, because the default for an untouched control should be completely empty. For booleans, the default value will be set to false. This is because a toggle can't have an empty state and it causes issues when we send a noneType value for booleans.
  • Added logic to handle validation of required values
  • Added stories for default and required values
  • Added/updated helper functions to allow extraction of primitive values when parsing literals.
  • Unit tests for the literal parsing

@schottra schottra requested a review from mrmcduff January 13, 2020 19:09
@schottra schottra merged commit a9144a9 into master Jan 14, 2020
@schottra schottra deleted the fix-boolean-unchecked branch January 14, 2020 19:48
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.

Console sends undefined instead of false for unchecked toggle switches
2 participants