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(db-connection-ui): Bug rendering db creation modal if no superset_text.yml available #15095

Merged
merged 1 commit into from
Jun 10, 2021
Merged
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 @@ -370,7 +370,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
className="preferred-item"
onClick={() => setDatabaseModel(database.engine)}
buttonText={database.name}
icon={dbImages[database.engine]}
icon={dbImages && dbImages[database.engine]}
Copy link
Member

Choose a reason for hiding this comment

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

I think this might be better as a const in the component that you then call.

You might also want to check this with no image because I am pretty sure icon is a required class on this.

Copy link
Member Author

@hughhhh hughhhh Jun 10, 2021

Choose a reason for hiding this comment

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

I want to keep the component functional, and i add a condition for the icon inside the compenent. Basically this will default to the default icon if icon isnt set.

https://github.com/apache/superset/blob/pexdax/db-connection-ui/superset-frontend/src/components/IconButton/index.tsx#L98

/>
))}
</div>
Expand Down