diff --git a/src/client/components/selectable-string-filter-menu/string-values-list.tsx b/src/client/components/selectable-string-filter-menu/string-values-list.tsx index dd99fb96a..dc59cc13f 100644 --- a/src/client/components/selectable-string-filter-menu/string-values-list.tsx +++ b/src/client/components/selectable-string-filter-menu/string-values-list.tsx @@ -23,13 +23,13 @@ import { Binary } from "../../../common/utils/functional/functional"; import { StringValue } from "./string-value"; import "./string-values-list.scss"; -function filterRows(rows: string[], searchText: string): string[] { +function filterRows(rows: Array, searchText: string): Array { if (!searchText) return rows; const searchTextLower = searchText.toLowerCase(); - return rows.filter(d => d.toLowerCase().indexOf(searchTextLower) !== -1); + return rows.filter(d => String(d).toLowerCase().indexOf(searchTextLower) !== -1); } -function prependPromotedValues(rows: string[], promoted: Set): string[] { +function prependPromotedValues(rows: Array, promoted: Set): Array { return [ ...promoted, ...rows.filter(value => !promoted.contains(value)) @@ -40,15 +40,15 @@ interface RowsListProps { dimension: Dimension; dataset: Dataset; searchText: string; - selectedValues: Set; - promotedValues: Set; + selectedValues: Set; + promotedValues: Set; filterMode: FilterMode; onRowSelect: Binary; } export const StringValuesList: React.SFC = props => { const { onRowSelect, filterMode, dataset, dimension, searchText, promotedValues, selectedValues } = props; - const rowValues = dataset.data.map(d => String(d[dimension.name])); + const rowValues: Array = dataset.data.map(d => d[dimension.name]); const values = prependPromotedValues(rowValues, promotedValues); const matchingValues = filterRows(values, searchText); if (searchText && matchingValues.length === 0) { diff --git a/src/common/utils/formatter/formatter.ts b/src/common/utils/formatter/formatter.ts index f221d50ed..543160330 100644 --- a/src/common/utils/formatter/formatter.ts +++ b/src/common/utils/formatter/formatter.ts @@ -68,7 +68,7 @@ function getFormattedStringClauseValues({ values, action }: StringFilterClause): case StringFilterAction.CONTAINS: return `"${values.first()}"`; case StringFilterAction.IN: - return values.count() > 1 ? `(${values.count()})` : values.first(); + return values.count() > 1 ? `(${values.count()})` : String(values.first()); } }