khtruong commented on a change in pull request #7770: Autocomplete in the table
browser in SQL lab is broken - Fix part 2
URL:
https://github.com/apache/incubator-superset/pull/7770#discussion_r299122142
##########
File path: superset/assets/src/components/TableSelector.jsx
##########
@@ -99,15 +99,22 @@ export default class TableSelector extends
React.PureComponent {
});
}
getTableNamesBySubStr(input) {
- const { tableName } = this.state;
if (!this.props.dbId || !input) {
- const options = this.addOptionIfMissing([], tableName);
+ const options = [];
return Promise.resolve({ options });
}
return SupersetClient.get({
endpoint: encodeURI(`/superset/tables/${this.props.dbId}/` +
`${encodeURIComponent(this.props.schema)}/${encodeURIComponent(input)}`),
- }).then(({ json }) => ({ options: this.addOptionIfMissing(json.options,
tableName) }));
+ }).then(({ json }) => {
+ const options = json.options.map(o => ({
+ value: o.value.table,
+ schema: o.value.schema,
+ label: o.label,
+ title: o.label,
Review comment:
Sounds good! I'll update the code. As for the title, I am not sure what the
history is on that attribute and why we need it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]