diff --git a/cspell.config.json b/cspell.config.json index 8befa3e..676289e 100644 --- a/cspell.config.json +++ b/cspell.config.json @@ -46,6 +46,7 @@ "queryless", "unroute", "gdev", - "lokiexplore" + "lokiexplore", + "viewports" ] } diff --git a/src/components/Explore/filters/FilterRenderer.tsx b/src/components/Explore/filters/FilterRenderer.tsx index fb359d6..a895438 100644 --- a/src/components/Explore/filters/FilterRenderer.tsx +++ b/src/components/Explore/filters/FilterRenderer.tsx @@ -29,14 +29,13 @@ export function FilterRenderer({ filter, model, isWip }: Props) { const [keyQuery, setKeyQuery] = useState(''); const [valueQuery, setValueQuery] = useState(''); - const key = filter.key !== '' ? state?.keys?.find((key) => key.value === filter.key) ?? toOption(filter.key) : null; + const key = filter.key !== '' ? (state?.keys?.find((key) => key.value === filter.key) ?? toOption(filter.key)) : null; const value = filter.value !== '' ? toOption(filter.value) : null; const exploration = getTraceExplorationScene(model); const { value: metric } = exploration.getMetricVariable().useState(); const operators = useMemo(() => { - const operators = model._getOperators(); - return operators; + return model._getOperators(); }, [model]); useEffect(() => { @@ -114,6 +113,7 @@ export function FilterRenderer({ filter, model, isWip }: Props) { }} onCloseMenu={() => setValueQuery('')} virtualized + allowCustomValue /> ); @@ -145,15 +145,17 @@ export function FilterRenderer({ filter, model, isWip }: Props) { ); } -export const formatKeys = (keys: Array>, filters: AdHocVariableFilter[], metric: VariableValue) => { +export const formatKeys = ( + keys: Array>, + filters: AdHocVariableFilter[], + metric: VariableValue +) => { // Ensure we always have the same order of keys const resourceAttributes = keys.filter((k) => k.value?.includes(RESOURCE_ATTR)); const spanAttributes = keys.filter((k) => k.value?.includes(SPAN_ATTR)); const intrinsicAttributes = keys.filter((k) => { let checks = - !k.value?.includes(RESOURCE_ATTR) && - !k.value?.includes(SPAN_ATTR) && - ignoredAttributes.indexOf(k.value!) === -1; + !k.value?.includes(RESOURCE_ATTR) && !k.value?.includes(SPAN_ATTR) && ignoredAttributes.indexOf(k.value!) === -1; // if filters (primary signal) has kind key selected, then don't add kind to intrinsicAttributes // as you would overwrite it in the query if it's selected in the drop down