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(Form): Add EnumField #1967

Merged

Conversation

tplevko
Copy link
Contributor

@tplevko tplevko commented Jan 30, 2025

Context

Add support for EnumField

part of: #1939

Copy link
Member

@lordrip lordrip left a comment

Choose a reason for hiding this comment

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

Thanks @tplevko, looks good, just a few touches and we're good 👌

@@ -57,6 +58,7 @@ export const Typeahead: FunctionComponent<TypeaheadProps> = ({
const onTextInputClear = () => {
setInputValue('');
setIsOpen(true);
onCleanInput();
Copy link
Member

Choose a reason for hiding this comment

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

This object could be undefined when using the TypeaheadField outside of the EnumField scope.

Suggested change
onCleanInput();
onCleanInput?.();

Comment on lines 33 to 37
if (!isDefined(item)) {
onChange(undefined);
return;
}
onChange(item.name);
Copy link
Member

Choose a reason for hiding this comment

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

We could simplify it to:

Suggested change
if (!isDefined(item)) {
onChange(undefined);
return;
}
onChange(item.name);
onChange(item?.name);

name: String(item),
description: '',
value: String(item),
})) || [],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
})) || [],
})) ?? [],

@tplevko tplevko marked this pull request as ready for review January 30, 2025 10:03
@lordrip lordrip merged commit 92da3c1 into KaotoIO:feat/form-with-anyof-support Jan 30, 2025
3 of 5 checks passed
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.

2 participants