Skip to content

Commit

Permalink
revert if block change
Browse files Browse the repository at this point in the history
  • Loading branch information
briangregoryholmes committed Dec 19, 2023
1 parent 7653da8 commit 0a81ce9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/queries/metricsview.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ func convertDimensionFilterToExpression(cond *runtimev1.MetricsViewFilter_Cond,
} else {
inExpr = expressionpb.In(expressionpb.Identifier(cond.Name), inExprs)
}

}

var likeExpr *runtimev1.Expression
if len(cond.Like) == 1 {
Expand Down Expand Up @@ -631,7 +631,7 @@ func convertDimensionFilterToExpression(cond *runtimev1.MetricsViewFilter_Cond,
} else if likeExpr != nil {
return likeExpr
}
}

Check failure on line 634 in runtime/queries/metricsview.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot --custom-order (gci)

return nil
}
Expand Down
32 changes: 32 additions & 0 deletions web-common/src/features/dashboards/filters/Filters.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<!-- @component
The main feature-set component for dashboard filters
-->
<script context="module" lang="ts">
import { writable } from "svelte/store";
import type { Writable } from "svelte/store";
export const temporaryFilters: Writable<
{
name: string;
label: string;
selectedValues: any[];
filterType: string;
}[]
> = writable([]);
</script>

<script lang="ts">
import {
Chip,
Expand Down Expand Up @@ -119,14 +133,32 @@ The main feature-set component for dashboard filters
};
}) ?? [];
const currentTemporaryFilters =
$temporaryFilters
.filter((dimensionValues) => dimensionValues.name !== undefined)
.map((dimensionValues) => {
const name = dimensionValues.name as string;
return {
name,
label: getDisplayName(
dimensionIdMap.get(name) as MetricsViewSpecDimensionV2
),
selectedValues: [],
filterType: "exclude",
};
}) ?? [];
currentDimensionFilters = [
...currentDimensionIncludeFilters,
...currentDimensionExcludeFilters,
...currentTemporaryFilters,
];
// sort based on name to make sure toggling include/exclude is not jarring
currentDimensionFilters.sort((a, b) => (a.name > b.name ? 1 : -1));
}
$: console.log($temporaryFilters);
function setActiveDimension(name, value = "") {
activeDimensionName = name;
searchText = value;
Expand Down

0 comments on commit 0a81ce9

Please sign in to comment.