mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: [search query view] edit link is broken (#10128)
* fix: [search query view] edit link is broken * eslint + mypy * rever app.py changes * addressing comments * use api/v1/query * fix test
This commit is contained in:
committed by
GitHub
parent
0017b61f51
commit
1781ebbaa4
@@ -28,7 +28,6 @@ import ResultSet from './ResultSet';
|
||||
import ModalTrigger from '../../components/ModalTrigger';
|
||||
import HighlightedSql from './HighlightedSql';
|
||||
import { fDuration } from '../../modules/dates';
|
||||
import { storeQuery } from '../../utils/common';
|
||||
import QueryStateLabel from './QueryStateLabel';
|
||||
|
||||
const propTypes = {
|
||||
@@ -57,18 +56,10 @@ class QueryTable extends React.PureComponent {
|
||||
activeQuery: null,
|
||||
};
|
||||
}
|
||||
callback(url) {
|
||||
openQuery(id) {
|
||||
const url = `/superset/sqllab?queryId=${id}`;
|
||||
window.open(url);
|
||||
}
|
||||
openQuery(dbId, schema, sql) {
|
||||
const newQuery = {
|
||||
dbId,
|
||||
title: t('Untitled Query'),
|
||||
schema,
|
||||
sql,
|
||||
};
|
||||
storeQuery(newQuery).then(url => this.callback(url));
|
||||
}
|
||||
hideVisualizeModal() {
|
||||
this.setState({ showVisualizeModal: false });
|
||||
}
|
||||
@@ -127,10 +118,10 @@ class QueryTable extends React.PureComponent {
|
||||
<div style={{ width: '100px' }}>
|
||||
<button
|
||||
className="btn btn-link btn-xs"
|
||||
onClick={this.openQuery.bind(this, q.dbId, q.schema, q.sql)}
|
||||
onClick={this.openQuery.bind(this, q.queryId)}
|
||||
>
|
||||
<i className="fa fa-external-link" />
|
||||
{t('Open in SQL Editor')}
|
||||
<i className="fa fa-external-link m-r-3" />
|
||||
{t('Edit')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user