fix(views): transform bucket configurations
This fixes a bug where filter buckets would not be editable because the bucket configuration was a read-only entry from the watcher.
This commit is contained in:
parent
c47d8c6dbe
commit
755e53af70
@ -23,13 +23,20 @@ const projectStore = useProjectStore()
|
|||||||
watch(
|
watch(
|
||||||
() => modelValue,
|
() => modelValue,
|
||||||
newValue => {
|
newValue => {
|
||||||
const transformed = {
|
|
||||||
...newValue,
|
const transform = filterString => transformFilterStringFromApi(
|
||||||
filter: transformFilterStringFromApi(
|
filterString,
|
||||||
newValue.filter,
|
|
||||||
labelId => labelStore.getLabelById(labelId)?.title,
|
labelId => labelStore.getLabelById(labelId)?.title,
|
||||||
projectId => projectStore.projects[projectId]?.title || null,
|
projectId => projectStore.projects[projectId]?.title || null,
|
||||||
),
|
)
|
||||||
|
|
||||||
|
const transformed = {
|
||||||
|
...newValue,
|
||||||
|
filter: transform(newValue.filter),
|
||||||
|
bucketConfiguration: newValue.bucketConfiguration.map(bc => ({
|
||||||
|
title: bc.title,
|
||||||
|
filter: transform(bc.filter),
|
||||||
|
})),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JSON.stringify(view.value) !== JSON.stringify(transformed)) {
|
if (JSON.stringify(view.value) !== JSON.stringify(transformed)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user