Skip to content

Commit b601660

Browse files
committed
Generate template tags in dashboard queries
1 parent 2ad2098 commit b601660

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apps/src/metabase/appController.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,13 @@ export class MetabaseController extends AppController<MetabaseAppState> {
280280
return actionContent;
281281
}
282282

283-
// Use provided template tags directly instead of auto-generating them
284-
const response = await runSQLQueryFromDashboard(sql, dbID, template_tags);
283+
const allSnippetsDict = await getSnippets() as MetabaseStateSnippetsDict;
284+
const allTemplateTags = getAllTemplateTagsInQuery(sql, allSnippetsDict)
285+
const mergedTemplateTags = {
286+
...allTemplateTags,
287+
...template_tags
288+
};
289+
const response = await runSQLQueryFromDashboard(sql, dbID, mergedTemplateTags);
285290
if (response.error) {
286291
actionContent.content = `<ERROR>${response.error}</ERROR>`;
287292
} else {

0 commit comments

Comments
 (0)