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

lib: provide an optional error callback for validation #19600

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

jelly
Copy link
Member

@jelly jelly commented Nov 10, 2023

In podman we want to validate if the hostPath is correct, as this component returns an empty string on error and also as default state meaning we can't determine easily from an application.

This should not break our API.

In podman we want to validate if the hostPath is correct, as this
component returns an empty string on error and also as default state
meaning we can't determine easily from an application.
@@ -184,7 +184,7 @@ export class FileAutoComplete extends React.Component {
onSelect={(_, value) => {
this.setState({ value, isOpen: false });
this.debouncedChange(value);
this.props.onChange(value || '');
this.props.onChange(value || '', null);
Copy link
Contributor

Choose a reason for hiding this comment

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

This added line is not executed by any test. Details

Copy link
Member Author

Choose a reason for hiding this comment

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

We should maybe check if we get an error back. This PR would also be nice for reverse dependency testing with machines :)

Copy link
Member

Choose a reason for hiding this comment

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

Can do! Submit a machines PR which uses it, then you can run that PR against this PR with https://packit.dev/posts/testing-farm-triggering

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Anyway, this is safe API-wise, so feel free to land when green.

@jelly jelly marked this pull request as ready for review November 13, 2023 10:34
@jelly jelly merged commit 0e6ff0d into cockpit-project:main Nov 13, 2023
91 checks passed
@jelly jelly deleted the file-autocomplete-error-callback branch November 13, 2023 10:36
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.

3 participants