-
Notifications
You must be signed in to change notification settings - Fork 59
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 Launch Plan selector #3
Conversation
@@ -107,26 +108,42 @@ export const LaunchWorkflowForm: React.FC<LaunchWorkflowFormProps> = props => { | |||
{...state.workflowOptionsLoadingState} | |||
> | |||
<div className={styles.formControl}> | |||
<WorkflowSelector | |||
<SearchableSelector | |||
label="Workflow Version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A const somewhere? ¯\_(ツ)_/¯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only used in this file, in this single place. So I'm inclined not to make it a constant. If/when we get around to i18n support, my position on that will definitely change :-)
launchPlan && workflow.hasLoaded | ||
? getInputs(workflow.value, launchPlan) | ||
selectedLaunchPlan && workflow.hasLoaded | ||
? getInputs(workflow.value, selectedLaunchPlan.data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can selectedLaunchPlan.data
also change, and should you trigger the useEffect
on that too? Just checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. So technically, according to the Rules of Hooks, using that value means I should include it in the dependency array.
Practically, the data in the selector options is a const value that does not change unless you regenerate all of the items. In that case, the outer object would also change.
But I plan on enabling the extra lint rule in the future to ensure all captured values used in the effect are listed in the dependencies array. So I'll update it here.
Good catch!
I'm going to merge this and make the above-mentioned change in my follow-up branch. |
Signed-off-by: Nastya Rusina <[email protected]>
WorkflowSelector
a generic component, and made the fetchResults function optional. The default implementation will just search the values of the provided options without issuing any network requests