Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class MetadataProfileSelectInputConnector extends Component {
value,
hasError,
hasWarning,
// Pulled out so it can't override this.onChange, which parses the id to a number
onChange,
...otherProps
} = this.props;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ class QualityProfileSelectInputConnector extends Component {
values,
hasError,
hasWarning,
// Pulled out so it can't override this.onChange, which parses the id to a number
onChange,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rather than pulling onChange out, spread the props first and put the props the connector owns after the spread, the way ProxySelectInputConnector does. That also stops a parent's isDisabled from hiding isFetching, and a parent's values/value from overriding the connector's. Same change in MetadataProfileSelectInputConnector (keep value={value ?? ''} there), and add isDisabled: PropTypes.bool to both propTypes:

<SelectInput
  {...this.props}
  values={this.getSelectValues()}
  onChange={this.onChange}
  isDisabled={this.props.isDisabled || isFetching}
/>

...otherProps
} = this.props;

Expand Down