Skip to content

Commit 118ea7a

Browse files
committed
fix(filtering): do not display data labels outside of debug mode
Fix a bug where data labels where being displayed outside of debug mode when another label of the same task was highlighted Signed-off-by: Zacharias Fragkiadakis <[email protected]>
1 parent 9c39792 commit 118ea7a

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

components/ColumnIssueCard.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,32 @@ const status = computed<ColumnCardStatus>(() => ({
2424
const radicleInterfaceBaseUrl = useRadicleInterfaceBaseUrl()
2525
const isDebugging = useIsDebugging()
2626
27+
// TODO: zac reduce duplication between ColumnIssueCard and ColumnPatchCard
2728
const labels = computed(() =>
2829
isDebugging.value
2930
? props.issue.labels
3031
: props.issue.labels.filter((label) => !label.startsWith(dataLabelNamespace)),
3132
)
3233
34+
const highlights = computed(() => {
35+
if (!props.highlights) {
36+
return undefined
37+
}
38+
39+
if (isDebugging.value) {
40+
return props.highlights
41+
}
42+
43+
const filteredHighlightLabels = props.highlights.labels.filter(
44+
(label) => !(label[0] ?? '').startsWith(dataLabelNamespace),
45+
)
46+
47+
return {
48+
...props.highlights,
49+
labels: filteredHighlightLabels,
50+
}
51+
})
52+
3353
const href = computed(() =>
3454
new URL(
3555
`/nodes/${route.params.node}/${route.params.rid}/issues/${props.issue.id}`,

components/ColumnPatchCard.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,32 @@ const status = computed<ColumnCardStatus>(() => ({
2929
const radicleInterfaceBaseUrl = useRadicleInterfaceBaseUrl()
3030
const isDebugging = useIsDebugging()
3131
32+
// TODO: zac reduce duplication between ColumnIssueCard and ColumnPatchCard
3233
const labels = computed(() =>
3334
isDebugging.value
3435
? props.patch.labels
3536
: props.patch.labels.filter((label) => !label.startsWith(dataLabelNamespace)),
3637
)
3738
39+
const highlights = computed(() => {
40+
if (!props.highlights) {
41+
return undefined
42+
}
43+
44+
if (isDebugging.value) {
45+
return props.highlights
46+
}
47+
48+
const filteredHighlightLabels = props.highlights.labels.filter(
49+
(label) => !(label[0] ?? '').startsWith(dataLabelNamespace),
50+
)
51+
52+
return {
53+
...props.highlights,
54+
labels: filteredHighlightLabels,
55+
}
56+
})
57+
3858
const href = computed(() =>
3959
new URL(
4060
`/nodes/${route.params.node}/${route.params.rid}/patches/${props.patch.id}`,

0 commit comments

Comments
 (0)