You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2020/12/17 23:16:49 UTC
[incubator-superset] 01/02: add new button
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a commit to branch hugh/ch229
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit d30524087ffd3bda666513d44bd5c3af54ea5114
Author: hughhhh <hu...@gmail.com>
AuthorDate: Thu Dec 17 18:00:24 2020 -0500
add new button
---
.../src/SqlLab/components/SqlEditor.jsx | 32 ++++++++++++++++------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/superset-frontend/src/SqlLab/components/SqlEditor.jsx b/superset-frontend/src/SqlLab/components/SqlEditor.jsx
index 509e0d9..bc28810 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditor.jsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditor.jsx
@@ -95,6 +95,13 @@ const defaultProps = {
scheduleQueryWarning: null,
};
+const runMenuBtn = (
+ <Menu onClick={() => console.log('clicked menu')}>
+ <Menu.Item key="1">Create As Table</Menu.Item>
+ <Menu.Item key="2">Create As View</Menu.Item>
+ </Menu>
+);
+
class SqlEditor extends React.PureComponent {
constructor(props) {
super(props);
@@ -559,6 +566,13 @@ class SqlEditor extends React.PureComponent {
<div className="leftItems">
<Form inline>
<span>
+ <Dropdown.Button
+ icon={<Icon color="#00000" name="caret-down" />}
+ type="primary"
+ overlay={runMenuBtn}
+ >
+ Run
+ </Dropdown.Button>
<RunQueryActionButton
allowAsync={
this.props.database
@@ -575,6 +589,15 @@ class SqlEditor extends React.PureComponent {
sql={this.state.sql}
/>
</span>
+ {limitWarning}
+ {this.props.latestQuery && (
+ <Timer
+ startTime={this.props.latestQuery.startDttm}
+ endTime={this.props.latestQuery.endDttm}
+ state={STATE_BSSTYLE_MAP[this.props.latestQuery.state]}
+ isRunning={this.props.latestQuery.state === 'running'}
+ />
+ )}
{isFeatureEnabled(FeatureFlag.ESTIMATE_QUERY_COST) &&
this.props.database &&
this.props.database.allows_cost_estimate && (
@@ -621,15 +644,6 @@ class SqlEditor extends React.PureComponent {
</Form>
</div>
<div className="rightItems">
- {limitWarning}
- {this.props.latestQuery && (
- <Timer
- startTime={this.props.latestQuery.startDttm}
- endTime={this.props.latestQuery.endDttm}
- state={STATE_BSSTYLE_MAP[this.props.latestQuery.state]}
- isRunning={this.props.latestQuery.state === 'running'}
- />
- )}
<Dropdown overlay={this.renderDropdown()} arrow>
<Icon name="more-horiz" />
</Dropdown>