mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
[explore-v2] Fix edit datasource link for druid datasources (#1982)
* only add imgSrc key if choices contain an imgSrc * handle table and druid edit links for datasource drop down * fix linting
This commit is contained in:
@@ -43,15 +43,13 @@ export default class SelectField extends React.Component {
|
||||
}
|
||||
getOptions() {
|
||||
const options = this.props.choices.map((c) => {
|
||||
let label = c[0];
|
||||
if (c.length > 1) {
|
||||
label = c[1];
|
||||
}
|
||||
return {
|
||||
const label = c.length > 1 ? c[1] : c[0];
|
||||
const newOptions = {
|
||||
value: c[0],
|
||||
label,
|
||||
imgSrc: c[2],
|
||||
};
|
||||
if (c[2]) newOptions.imgSrc = c[2];
|
||||
return newOptions;
|
||||
});
|
||||
if (this.props.freeForm) {
|
||||
// For FreeFormSelect, insert value into options if not exist
|
||||
|
||||
Reference in New Issue
Block a user