mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
fix(sqllab): Add templateParams on kv store (#22013)
This commit is contained in:
parent
86d52fcbc4
commit
c3f1873c43
@ -1365,6 +1365,7 @@ export function popStoredQuery(urlId) {
|
|||||||
schema: json.schema ? json.schema : null,
|
schema: json.schema ? json.schema : null,
|
||||||
autorun: json.autorun ? json.autorun : false,
|
autorun: json.autorun ? json.autorun : false,
|
||||||
sql: json.sql ? json.sql : 'SELECT ...',
|
sql: json.sql ? json.sql : 'SELECT ...',
|
||||||
|
templateParams: json.templateParams,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -72,6 +72,7 @@ const unsavedQueryEditor = {
|
|||||||
schema: 'query_schema_updated',
|
schema: 'query_schema_updated',
|
||||||
sql: 'SELECT * FROM Updated Limit 100',
|
sql: 'SELECT * FROM Updated Limit 100',
|
||||||
autorun: true,
|
autorun: true,
|
||||||
|
templateParams: '{ "my_value": "foo" }',
|
||||||
};
|
};
|
||||||
|
|
||||||
const standardProviderWithUnsaved: React.FC = ({ children }) => (
|
const standardProviderWithUnsaved: React.FC = ({ children }) => (
|
||||||
|
@ -48,13 +48,19 @@ function ShareSqlLabQuery({
|
|||||||
}: ShareSqlLabQueryPropTypes) {
|
}: ShareSqlLabQueryPropTypes) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
const { dbId, name, schema, autorun, sql, remoteId } = useQueryEditor(
|
const { dbId, name, schema, autorun, sql, remoteId, templateParams } =
|
||||||
queryEditorId,
|
useQueryEditor(queryEditorId, [
|
||||||
['dbId', 'name', 'schema', 'autorun', 'sql', 'remoteId'],
|
'dbId',
|
||||||
);
|
'name',
|
||||||
|
'schema',
|
||||||
|
'autorun',
|
||||||
|
'sql',
|
||||||
|
'remoteId',
|
||||||
|
'templateParams',
|
||||||
|
]);
|
||||||
|
|
||||||
const getCopyUrlForKvStore = (callback: Function) => {
|
const getCopyUrlForKvStore = (callback: Function) => {
|
||||||
const sharedQuery = { dbId, name, schema, autorun, sql };
|
const sharedQuery = { dbId, name, schema, autorun, sql, templateParams };
|
||||||
|
|
||||||
return storeQuery(sharedQuery)
|
return storeQuery(sharedQuery)
|
||||||
.then(shortUrl => {
|
.then(shortUrl => {
|
||||||
|
Loading…
Reference in New Issue
Block a user