remove conflicting variable layer in metric histo select

This commit is contained in:
Christoph Kluge
2025-02-28 14:00:27 +01:00
parent d5394c9e92
commit 0fe0461340
3 changed files with 16 additions and 20 deletions

View File

@@ -3,7 +3,7 @@
Properties:
- `cluster String`: Currently selected cluster
- `metricsInHistograms [String]`: The currently selected metrics to display as histogram
- `selectedHistograms [String]`: The currently selected metrics to display as histogram
- ìsOpen Bool`: Is selection opened
-->
@@ -21,13 +21,12 @@
import { gql, getContextClient, mutationStore } from "@urql/svelte";
export let cluster;
export let metricsInHistograms;
export let selectedHistograms;
export let isOpen;
const client = getContextClient();
const initialized = getContext("initialized");
function loadHistoMetrics(isInitialized, thisCluster) {
if (!isInitialized) return [];
@@ -43,8 +42,6 @@
}
}
$: pendingMetrics = [...metricsInHistograms]; // Copy on change from above
const updateConfigurationMutation = ({ name, value }) => {
return mutationStore({
client: client,
@@ -69,13 +66,12 @@
}
function closeAndApply() {
metricsInHistograms = [...pendingMetrics]; // Set for parent
isOpen = !isOpen;
updateConfiguration({
name: cluster
? `user_view_histogramMetrics:${cluster}`
: "user_view_histogramMetrics",
value: metricsInHistograms,
value: selectedHistograms,
});
}
@@ -89,7 +85,7 @@
<ListGroup>
{#each availableMetrics as metric (metric)}
<ListGroupItem>
<input type="checkbox" bind:group={pendingMetrics} value={metric} />
<input type="checkbox" bind:group={selectedHistograms} value={metric} />
{metric}
</ListGroupItem>
{/each}