diff --git a/src/commands/custom_command.ts b/src/commands/custom_command.ts index 8fb29e7d..e0b6b146 100644 --- a/src/commands/custom_command.ts +++ b/src/commands/custom_command.ts @@ -21,9 +21,14 @@ export class CustomCommand extends Command { const filters: {[key: string]: string} = {} const dashboardFilters = dashboard.dashboard_filters || dashboard.filters - for (const filter of dashboardFilters) { - filters[filter.name] = query - } + const params = query.split(";") + const usedFilters = dashboardFilters.slice(0, params.length) + var iterator = params.values() + + usedFilters.forEach(function (value: any) { + filters[value.name] = iterator.next().value + }) + const runner = new DashboardQueryRunner(context, matchedCommand.dashboard, filters) runner.start() diff --git a/src/looker.ts b/src/looker.ts index 7dea1daa..25ca4a11 100644 --- a/src/looker.ts +++ b/src/looker.ts @@ -104,7 +104,12 @@ export class Looker { const dashboardFilters = dashboard.dashboard_filters || dashboard.filters if (dashboardFilters && dashboardFilters.length > 0) { - command.helptext = `<${dashboardFilters[0].title.toLowerCase()}>` + let descText = "" + dashboardFilters.forEach(function (value: any) { + descText += `<${value.title.toLowerCase()}>` + descText += ";" + }) + command.helptext = descText.substring(0, descText.length - 1) } Looker.customCommands[command.name] = command