[sql lab] fix table dropdown with large schema make UI unresponsive (#2547)

Indexing was done on render, moving to doing it only when the data
changes.
This commit is contained in:
Maxime Beauchemin
2017-04-04 12:19:44 -07:00
committed by GitHub
parent db6b2f3ae1
commit 6566377740
3 changed files with 11 additions and 7 deletions

View File

@@ -3,12 +3,15 @@ import Button from '../../components/Button';
const propTypes = {
allowAsync: PropTypes.bool.isRequired,
dbId: PropTypes.number.isRequired,
dbId: PropTypes.number,
queryState: PropTypes.string.isRequired,
runQuery: PropTypes.func.isRequired,
selectedText: PropTypes.string,
stopQuery: PropTypes.func.isRequired,
};
const defaultProps = {
allowAsync: false,
};
export default function RunQueryActionButton(props) {
const runBtnText = props.selectedText ? 'Run Selected Query' : 'Run Query';
@@ -69,3 +72,4 @@ export default function RunQueryActionButton(props) {
}
RunQueryActionButton.propTypes = propTypes;
RunQueryActionButton.defaultProps = defaultProps;