Skip to content

Commit 8343a30

Browse files
author
Piotr
committed
context menu "Display correlated lines" option
1 parent fee4bd0 commit 8343a30

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/store.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ export const useMainStore = defineStore("main", () => {
218218
if (!row.correlation_id) {
219219
return
220220
}
221-
correlationFilter.value = row.correlation_id
221+
filterCorrelatedId(row.correlation_id)
222+
}
223+
224+
const filterCorrelatedId = (id: string) => {
225+
correlationFilter.value = id
222226
refeshFilterCorrelated()
223227
}
224228

@@ -511,6 +515,7 @@ export const useMainStore = defineStore("main", () => {
511515
clearAllRows,
512516
resetAllFiltersAndFacets,
513517
filterCorrelated,
518+
filterCorrelatedId,
514519
correlationFilter,
515520
resetCorrelationFilter,
516521
tracesRows,

src/stores/contextMenu.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ export const useContextMenuStore = defineStore("context_menu", () => {
2525
x.value = e.clientX + 1;
2626
y.value = e.clientY + 1;
2727

28+
let layout = useMainStore().layout
2829
switch (type.type) {
2930
case "cell":
30-
const column = useMainStore().layout.getColumn(type.columnId)
31+
const column = layout.getColumn(type.columnId)
3132
if (column?.faceted && !type.error) {
3233
let ff = useMainStore().facets[column.name].items.find(i => i.label == type.value)
3334
let label = "Filter by facet"
@@ -44,6 +45,15 @@ export const useContextMenuStore = defineStore("context_menu", () => {
4445
}
4546
})
4647
}
48+
if (layout.settings.correlationIdField === column.name && type.value) {
49+
actions.value?.push({
50+
label: "Display correlated lines",
51+
fn: () => {
52+
useMainStore().filterCorrelatedId(type.value!)
53+
hide()
54+
}
55+
})
56+
}
4757
/**
4858
* The feature of filtering by value is currently disabled due to the fact that
4959
* we're unable to effectively trace the source field only by using name.

0 commit comments

Comments
 (0)