diff --git a/ui/src/dashboards/actions/index.js b/ui/src/dashboards/actions/index.js index ca9a6e9d3..79ab6bade 100644 --- a/ui/src/dashboards/actions/index.js +++ b/ui/src/dashboards/actions/index.js @@ -9,7 +9,7 @@ import { updateDashboardCell as updateDashboardCellAJAX, addDashboardCell as addDashboardCellAJAX, deleteDashboardCell as deleteDashboardCellAJAX, - runTemplateVariableQuery, + getTempVarValuesBySourceQuery, } from 'src/dashboards/apis' import {notify} from 'shared/actions/notifications' @@ -337,7 +337,9 @@ export const hydrateTempVarValues = (source, dashboard) => async dispatch => { ) const asyncQueries = tempsWithQueries.map(({query}) => - runTemplateVariableQuery(source, {query: makeQueryForTemplate(query)}) + getTempVarValuesBySourceQuery(source, { + query: makeQueryForTemplate(query), + }) ) const results = await Promise.all(asyncQueries) diff --git a/ui/src/dashboards/apis/index.js b/ui/src/dashboards/apis/index.js index 90db53818..a6461f368 100644 --- a/ui/src/dashboards/apis/index.js +++ b/ui/src/dashboards/apis/index.js @@ -87,7 +87,7 @@ export const editTemplateVariables = async templateVariable => { } } -export const runTemplateVariableQuery = async ( +export const getTempVarValuesBySourceQuery = async ( source, { query, diff --git a/ui/src/dashboards/components/template_variables/Row.js b/ui/src/dashboards/components/template_variables/Row.js index 35c8cce0e..c589309c5 100644 --- a/ui/src/dashboards/components/template_variables/Row.js +++ b/ui/src/dashboards/components/template_variables/Row.js @@ -14,7 +14,7 @@ import TableInput from 'src/dashboards/components/template_variables/TableInput' import RowValues from 'src/dashboards/components/template_variables/RowValues' import ConfirmButton from 'src/shared/components/ConfirmButton' -import {runTemplateVariableQuery as runTemplateVariableQueryAJAX} from 'src/dashboards/apis' +import {getTempVarValuesBySourceQuery as getTempVarValuesBySourceQueryAJAX} from 'src/dashboards/apis' import parsers from 'shared/parsing' @@ -203,7 +203,10 @@ class RowWrapper extends Component { if (type === 'csv') { parsedData = e.target.values.value.split(',').map(value => value.trim()) } else { - parsedData = await this.runTemplateVariableQuery(source, queryConfig) + parsedData = await this.getTempVarValuesBySourceQuery( + source, + queryConfig + ) } onRunQuerySuccess(template, queryConfig, compact(parsedData), tempVar) @@ -264,12 +267,12 @@ class RowWrapper extends Component { this.setState({selectedTagKey: item.text}) } - runTemplateVariableQuery = async ( + getTempVarValuesBySourceQuery = async ( source, {query, database, rp, tempVars, type, measurement, tagKey} ) => { try { - const {data} = await runTemplateVariableQueryAJAX(source, { + const {data} = await getTempVarValuesBySourceQueryAJAX(source, { query, db: database, rp,