fix(views): transform bucket configurations
All checks were successful
continuous-integration/drone/push Build is passing

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
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

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