app user name shown in ui

This commit is contained in:
suryacp23 2026-07-27 11:29:04 +05:30
parent b1003de515
commit 5ed1022a7b

View File

@ -791,12 +791,20 @@ export function DynamicForm({ client, activityId: initialActivityId, instanceId:
const isValEmpty = val === undefined || val === null || String(val).trim() === '';
const currentFieldError = showErrors && f.mandatory && isValEmpty ? 'Required' : undefined;
let displayVal = (val as string) ?? '';
if (schema.field_defaults?.[f.id]?.prefill?.value === 'current_user_id') {
const user = client.currentUser();
if (user && String(val) === String(user.id)) {
displayVal = user.name;
}
}
return (
<TextField
label={f.name}
required={f.mandatory}
type={type}
value={(val as string) ?? ''}
value={displayVal}
onChange={(newVal) => handleFieldChange(f.id, newVal)}
error={currentFieldError}
/>