Skip to content

Commit

Permalink
Add settings to disable filtering of metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
MaXal committed Sep 13, 2024
1 parent 4329d47 commit af6f043
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ScalingSwitch class="mb-2" />
<DetectChangesSwitch class="mb-2" />
<FlexibleZeroOnYAxis class="mb-2" />
<ShowAllMetricsSwitch class="mb-2" />
<RemoveOutliersSwitch />
</OverlayPanel>
</template>
Expand All @@ -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<OverlayPanel>("settingsPanel")
const settingsIcon = useTemplateRef<HTMLElement>("settingsIcon")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<div class="flex items-center justify-between w-full">
<span v-tooltip.left="'Disable filtering of detailed metrics like completion_32. Require page reloading.'">Show all metrics:</span>
<InputSwitch
v-model="settingsStore.showAllMetrics"
class="ml-4"
/>
</div>
</template>

<script setup lang="ts">
import { useSettingsStore } from "./settingsStore"
const settingsStore = useSettingsStore()
</script>

<style scoped></style>
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 }
})
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit af6f043

Please sign in to comment.