From af6f043d3e5714d9841fb1b2e7edca9571a87619 Mon Sep 17 00:00:00 2001 From: "Maxim.Kolmakov" Date: Fri, 13 Sep 2024 16:11:00 +0200 Subject: [PATCH] Add settings to disable filtering of metrics --- .../src/components/settings/PlotSettings.vue | 2 ++ .../settings/ShowAllMetricsSwitch.vue | 17 +++++++++++++++++ .../src/components/settings/settingsStore.ts | 10 +++++++++- .../src/configurators/MeasureConfigurator.ts | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 dashboard/new-dashboard/src/components/settings/ShowAllMetricsSwitch.vue diff --git a/dashboard/new-dashboard/src/components/settings/PlotSettings.vue b/dashboard/new-dashboard/src/components/settings/PlotSettings.vue index 2697faae..d8d56e8b 100644 --- a/dashboard/new-dashboard/src/components/settings/PlotSettings.vue +++ b/dashboard/new-dashboard/src/components/settings/PlotSettings.vue @@ -13,6 +13,7 @@ + @@ -32,6 +33,7 @@ import RemoveOutliersSwitch from "./RemoveOutliersSwitch.vue" import { RemoveOutliersConfigurator } from "./configurators/RemoveOutliersConfigurator" import { useSettingsStore } from "./settingsStore" import { storeToRefs } from "pinia" +import ShowAllMetricsSwitch from "./ShowAllMetricsSwitch.vue" const settingsPanel = useTemplateRef("settingsPanel") const settingsIcon = useTemplateRef("settingsIcon") diff --git a/dashboard/new-dashboard/src/components/settings/ShowAllMetricsSwitch.vue b/dashboard/new-dashboard/src/components/settings/ShowAllMetricsSwitch.vue new file mode 100644 index 00000000..ae4e1ac6 --- /dev/null +++ b/dashboard/new-dashboard/src/components/settings/ShowAllMetricsSwitch.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/dashboard/new-dashboard/src/components/settings/settingsStore.ts b/dashboard/new-dashboard/src/components/settings/settingsStore.ts index af3d26fd..eb876a70 100644 --- a/dashboard/new-dashboard/src/components/settings/settingsStore.ts +++ b/dashboard/new-dashboard/src/components/settings/settingsStore.ts @@ -8,6 +8,7 @@ export const useSettingsStore = defineStore("settingsStore", () => { const storedDetectChanges = useStorage("detectChangesEnabled", false) const storedFlexibleYZero = useStorage("floatingNull", false) const storedRemoveOutliers = useStorage("removeOutliers", false) + const storedShowAllMetrics = useStorage("showAllMetrics", false) const scaling = computed({ get: () => storedScaling.value, @@ -46,5 +47,12 @@ export const useSettingsStore = defineStore("settingsStore", () => { }, }) - return { scaling, smoothing, detectChanges, flexibleYZero, removeOutliers } + const showAllMetrics = computed({ + get: () => storedShowAllMetrics.value, + set(value) { + storedShowAllMetrics.value = value + }, + }) + + return { scaling, smoothing, detectChanges, flexibleYZero, removeOutliers, showAllMetrics } }) diff --git a/dashboard/new-dashboard/src/configurators/MeasureConfigurator.ts b/dashboard/new-dashboard/src/configurators/MeasureConfigurator.ts index f00f2082..747fee1e 100644 --- a/dashboard/new-dashboard/src/configurators/MeasureConfigurator.ts +++ b/dashboard/new-dashboard/src/configurators/MeasureConfigurator.ts @@ -128,7 +128,7 @@ export class MeasureConfigurator implements DataQueryConfigurator, ChartConfigur //filter for editor menu !/.*#(update|getchildren|getselection)@.*/i.test(it) && //filter out _23 metrics, we need them in DB but not in UI - !/.*_\d+(#.*)?$/.test(it) + (!/.*_\d+(#.*)?$/.test(it) || useSettingsStore().showAllMetrics) ) data = customSort(data, MAIN_METRICS)