[sql lab] deeper support for templating (#3996)

* [sql lab] deeper support for templating

* Fixing py tests

* Fix typo
This commit is contained in:
Maxime Beauchemin
2017-12-19 15:55:58 -08:00
committed by GitHub
parent e4903e6dc6
commit 44e753d94d
8 changed files with 174 additions and 8 deletions

View File

@@ -15,6 +15,7 @@ import {
import SplitPane from 'react-split-pane';
import Button from '../../components/Button';
import TemplateParamsEditor from './TemplateParamsEditor';
import SouthPane from './SouthPane';
import SaveQuery from './SaveQuery';
import Timer from '../../components/Timer';
@@ -24,6 +25,7 @@ import { STATE_BSSTYLE_MAP } from '../constants';
import RunQueryActionButton from './RunQueryActionButton';
import { t } from '../../locales';
const propTypes = {
actions: PropTypes.object.isRequired,
height: PropTypes.string.isRequired,
@@ -95,6 +97,7 @@ class SqlEditor extends React.PureComponent {
tab: qe.title,
schema: qe.schema,
tempTableName: ctas ? this.state.ctas : '',
templateParams: qe.templateParams,
runAsync,
ctas,
};
@@ -189,6 +192,13 @@ class SqlEditor extends React.PureComponent {
</Form>
</div>
<div className="pull-right">
<TemplateParamsEditor
language="json"
onChange={(params) => {
this.props.actions.queryEditorSetTemplateParams(qe, params);
}}
code={qe.templateParams}
/>
{limitWarning}
{this.props.latestQuery &&
<Timer