Commit 98fe0595 authored by Tobias Siegler's avatar Tobias Siegler Committed by waldhacker
Browse files

[TASK] Improve form element header in form inspector

If a field contains a label that is too long, this creates an ugly line
break in the form element header. And also the label of the field is
displayed redundantly below the header. So we output the field type
instead of the label.

Resolves: #97488
Releases: main
Change-Id: Ia33b0b41697ecf4cb43bad51069596322fa4a704
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74489

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: default avatarAndreas Steiger <typo3@andreassteiger.de>
Tested-by: Björn Jacob's avatarBjörn Jacob <bjoern.jacob@tritum.de>
Tested-by: waldhacker's avatarwaldhacker <hello@waldhacker.dev>
Reviewed-by: default avatarAndreas Steiger <typo3@andreassteiger.de>
Reviewed-by: Björn Jacob's avatarBjörn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: waldhacker's avatarwaldhacker <hello@waldhacker.dev>
parent 5107f249
......@@ -2666,9 +2666,15 @@ function factory($, Helper, Icons, Notification, Modal, MessageUtility) {
}
assert('object' === $.type(formElement), 'Invalid parameter "formElement"', 1478967319);
return $('<span></span>').text((formElement.get('label')
? formElement.get('label')
: formElement.get('identifier')));
if (formElement.get('type') === 'Form') {
label = formElement.get('type');
} else {
label = getFormElementDefinition(formElement, 'label')
? getFormElementDefinition(formElement, 'label')
: formElement.get('identifier');
}
return $('<span></span>').text(label);
};
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment