1
0

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:
kolaente 2024-06-03 17:04:09 +02:00
parent c47d8c6dbe
commit 755e53af70
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -23,13 +23,20 @@ const projectStore = useProjectStore()
watch( watch(
() => modelValue, () => modelValue,
newValue => { newValue => {
const transform = filterString => transformFilterStringFromApi(
filterString,
labelId => labelStore.getLabelById(labelId)?.title,
projectId => projectStore.projects[projectId]?.title || null,
)
const transformed = { const transformed = {
...newValue, ...newValue,
filter: transformFilterStringFromApi( filter: transform(newValue.filter),
newValue.filter, bucketConfiguration: newValue.bucketConfiguration.map(bc => ({
labelId => labelStore.getLabelById(labelId)?.title, title: bc.title,
projectId => projectStore.projects[projectId]?.title || null, filter: transform(bc.filter),
), })),
} }
if (JSON.stringify(view.value) !== JSON.stringify(transformed)) { if (JSON.stringify(view.value) !== JSON.stringify(transformed)) {