Fix array label properties display

This commit is contained in:
Maurus Decimus
2026-04-21 15:44:00 +02:00
parent cfb3a308cd
commit 35e0ef74b9
6 changed files with 43 additions and 10 deletions
+4 -3
View File
@@ -47,6 +47,7 @@ import {
import { jmapGet, jmapSet, jmapRequest, getAccountId } from '@/services/jmap/client';
import { calculateJmapPatch } from '@/lib/jmapPatch';
import { friendlySetError } from '@/lib/jmapErrors';
import { coerceLabel } from '@/lib/objectOptions';
import { toast } from '@/hooks/use-toast';
import { logFormChange } from '@/lib/debug';
import { FieldWidget } from '@/components/forms/FieldWidget';
@@ -695,9 +696,9 @@ export function DynamicForm({ viewName, objectId }: DynamicFormProps) {
const labelProp = list?.labelProperty;
if (labelProp) {
const raw = formData[labelProp];
if (typeof raw === 'string' && raw.length > 0) {
return t('form.editTitleWithValue', 'Edit {{name}}: {{value}}', { name, value: raw });
const value = coerceLabel(formData[labelProp], '');
if (value.length > 0) {
return t('form.editTitleWithValue', 'Edit {{name}}: {{value}}', { name, value });
}
}
return t('form.editTitle', 'Edit {{name}}', { name });