mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
[sql lab] deeper support for templating (#3996)
* [sql lab] deeper support for templating * Fixing py tests * Fix typo
This commit is contained in:
committed by
GitHub
parent
e4903e6dc6
commit
44e753d94d
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user