diff --git a/public/app/features/explore/Explore.tsx b/public/app/features/explore/Explore.tsx index a9aacd41489..5132e9d1cd9 100644 --- a/public/app/features/explore/Explore.tsx +++ b/public/app/features/explore/Explore.tsx @@ -205,13 +205,13 @@ export class Explore extends React.PureComponent { * TODO: In the future, we would like to return active filters based the query that produced the log line. * @alpha */ - isFilterLabelActive = async (key: string, value: string, refId?: string) => { + isFilterLabelActive = async (key: string, value: string | number, refId?: string) => { const query = this.props.queries.find((q) => q.refId === refId); if (!query) { return false; } const ds = await getDataSourceSrv().get(query.datasource); - if (hasToggleableQueryFiltersSupport(ds) && ds.queryHasFilter(query, { key, value })) { + if (hasToggleableQueryFiltersSupport(ds) && ds.queryHasFilter(query, { key, value: value.toString() })) { return true; } return false; @@ -220,11 +220,11 @@ export class Explore extends React.PureComponent { /** * Used by Logs details. */ - onClickFilterLabel = (key: string, value: string, frame?: DataFrame) => { + onClickFilterLabel = (key: string, value: string | number, frame?: DataFrame) => { this.onModifyQueries( { type: 'ADD_FILTER', - options: { key, value }, + options: { key, value: value.toString() }, frame, }, frame?.refId @@ -234,11 +234,11 @@ export class Explore extends React.PureComponent { /** * Used by Logs details. */ - onClickFilterOutLabel = (key: string, value: string, frame?: DataFrame) => { + onClickFilterOutLabel = (key: string, value: string | number, frame?: DataFrame) => { this.onModifyQueries( { type: 'ADD_FILTER_OUT', - options: { key, value }, + options: { key, value: value.toString() }, frame, }, frame?.refId @@ -248,15 +248,15 @@ export class Explore extends React.PureComponent { /** * Used by Logs Popover Menu. */ - onClickFilterValue = (value: string, refId?: string) => { - this.onModifyQueries({ type: 'ADD_STRING_FILTER', options: { value } }, refId); + onClickFilterValue = (value: string | number, refId?: string) => { + this.onModifyQueries({ type: 'ADD_STRING_FILTER', options: { value: value.toString() } }, refId); }; /** * Used by Logs Popover Menu. */ - onClickFilterOutValue = (value: string, refId?: string) => { - this.onModifyQueries({ type: 'ADD_STRING_FILTER_OUT', options: { value } }, refId); + onClickFilterOutValue = (value: string | number, refId?: string) => { + this.onModifyQueries({ type: 'ADD_STRING_FILTER_OUT', options: { value: value.toString() } }, refId); }; onClickAddQueryRowButton = () => {