Skip to content
Snippets Groups Projects
Commit c72d47c2 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Don't use getHumanReadableValue for equivalentArgument filter

parent b7d82d88
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import { mbqlEq } from "./util";
import type { Field as FieldReference } from "metabase/meta/types/Query";
import type { Field, FieldId, FieldValues } from "metabase/meta/types/Field";
import type { Value } from "metabase/meta/types/Dataset";
// gets the target field ID (recursively) from any type of field, including raw field ID, fk->, and datetime-field cast.
export function getFieldTargetId(field: FieldReference): ?FieldId {
......
import _ from "underscore";
import { isa, isFK as isTypeFK, isPK as isTypePK, TYPE } from "metabase/lib/types";
import { getFieldValues, getHumanReadableValue } from "metabase/lib/query/field";
import { getFieldValues } from "metabase/lib/query/field";
// primary field types used for picking operators, etc
export const NUMBER = "NUMBER";
......@@ -182,7 +182,8 @@ function equivalentArgument(field, table) {
.filter(([value, displayValue]) => value != null)
.map(([value, displayValue]) => ({
key: value,
name: getHumanReadableValue(value, values)
// NOTE Atte Keinänen 8/7/17: Similar logic as in getHumanReadableValue of lib/query/field
name: displayValue ? displayValue : String(value)
}))
.sort((a, b) => a.key === b.key ? 0 : (a.key < b.key ? -1 : 1))
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment