diff --git a/public/app/core/components/sql_part/sql_part.ts b/public/app/core/components/sql_part/sql_part.ts index e3e729b7da2..e74d4d860c6 100644 --- a/public/app/core/components/sql_part/sql_part.ts +++ b/public/app/core/components/sql_part/sql_part.ts @@ -8,6 +8,7 @@ export class SqlPartDef { defaultParams: any[]; wrapOpen: string; wrapClose: string; + separator: string; renderer: any; category: any; addStrategy: any; @@ -23,9 +24,11 @@ export class SqlPartDef { if (this.style === "function") { this.wrapOpen = "("; this.wrapClose = ")"; + this.separator = ", "; } else { this.wrapOpen = " "; this.wrapClose = " "; + this.separator = " "; } this.params = options.params; this.defaultParams = options.defaultParams; diff --git a/public/app/core/components/sql_part/sql_part_editor.ts b/public/app/core/components/sql_part/sql_part_editor.ts index 43404b41423..5f92b0f0e09 100644 --- a/public/app/core/components/sql_part/sql_part_editor.ts +++ b/public/app/core/components/sql_part/sql_part_editor.ts @@ -153,7 +153,7 @@ export function sqlPartEditorDirective($compile, templateSrv) { } if (index > 0) { - $(', ').appendTo($paramsContainer); + $('' + partDef.separator + '').appendTo($paramsContainer); } var paramValue = templateSrv.highlightVariablesAsHtml(part.params[index]);