Преглед изворни кода

make separator configurable

Sven Klemm пре 7 година
родитељ
комит
039e38d510

+ 3 - 0
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;

+ 1 - 1
public/app/core/components/sql_part/sql_part_editor.ts

@@ -153,7 +153,7 @@ export function sqlPartEditorDirective($compile, templateSrv) {
           }
 
           if (index > 0) {
-            $('<span>, </span>').appendTo($paramsContainer);
+            $('<span>' + partDef.separator + '</span>').appendTo($paramsContainer);
           }
 
           var paramValue = templateSrv.highlightVariablesAsHtml(part.params[index]);