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

Fix QuerySourceDropdown value type #5284

Merged
merged 2 commits into from
Nov 24, 2020
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion client/app/pages/queries/QuerySource.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function QuerySource(props) {
<DynamicComponent
name={"QuerySourceDropdown"}
dataSources={dataSources}
value={dataSource ? dataSource.id : undefined}
value={dataSource ? String(dataSource.id) : undefined}
Copy link
Member

Choose a reason for hiding this comment

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

This seems to cause bugs to percy:

Screen Shot 2020-11-24 at 09 43 39

Copy link
Member

Choose a reason for hiding this comment

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

How about just update

to be PropTypes.oneOfType([PropTypes.string, PropTypes.number])? Considering it is supposed to be the id and we need to support both types, that should do it 🙂

disabled={!queryFlags.canEdit || !dataSourcesLoaded || dataSources.length === 0}
loading={!dataSourcesLoaded}
onChange={handleDataSourceChange}
Expand Down