major
minor
defect
major
minor
minor
#26420
Refactoring: Remove ResPrefix from AbstractFormDialog
Currently, dialogs opened programmatically are required to have a ResPrefix, from which ResKeys are derived in a more or less undefined manner . However, many of these dialogs require only a very small number of ResKeys, which would be better defined explicitly in an I18NConstants file.
In particular, if you want to open such a programmatically generated dialog from an in-app configurable component or command, you have no way to enter the required resources in the Layout Editor, since only individual `ResKeys`—but not `ResPrefixes`—can be created there . Therefore, you should create such dialogs using a `ResKey` for the dialog title rather than a ` ResPrefix`, from which the key for the dialog title is derived using the suffix `.title`.
Code Migration
- In all subclasses of `tl:AbstractFormDialogBase`, the constructor parameter `resourcePrefix ` has been removed. In some cases, it has been replaced by a parameter named ` dialogTitle`.
- By default, the `getResourcePrefix()` method in `tl:AbstractFormDialogBase` now only returns `ResPrefix.NONE ` and is used solely for creating the ` FormContext `. When creating custom fields, you must either assign a custom label to them (preferred) or override the method.
- The form ID for subclasses of `tl:AbstractFormDialogBase` changes. Therefore, user settings for such dialogs will be lost unless the getFormId() method is overridden and the value CodeUtil.toCamelCase(resourcePrefix.key("Form").getKey()) is returned.
Test
Refactoring, no test.