enhancement
major
minor
defect
critical
major
minor
major
#30063
Administration of the React UI: people (contacts with optional login) in one form
Split off #30047. Follow-up to #29767; related: #29108.
Context
The React UI administration is handled by admin/admin.view.xml in tl-layout-view; feature modules contribute sections via same-path overlays (see the developer article on view-layer/overlays). The administration of com.top_logic.contact is available only in the classic UI.
In the React account administration (admin/access-control/accounts.view.xml), a user’s contact data cannot be edited: the first and last name from tl.accounts:Person are passed through to the contact as derived (read-only) attributes, and email, title, and phone numbers are not available at all.
Feature
In an application using `com.top_logic.contact`, the React administration has a single page for users: a user contact form with an optional login field. All user attributes—contact data and login data—are edited in a single form using a single edit mode.
Solution
- New general form element <object-fields attribute="..."> (com.top_logic.layout.view): within a <form>, it contains fields for the object to which a unidirectional reference of the form object points (forward or backward). It is a FormParticipant with its own overlay of the referenced object in the form’s edit mode: dirty status, validation, prompts for unsaved changes, and saving are handled by the form, within a single transaction.
- "People" page (configured in com.top_logic.layout.view.contact; in an application with contacts, this replaces the "Accounts" page via an overlay): table of people’s contacts; a form based on Contacts:PersonContact (Title, First Name, Last Name, Email, Phone Numbers, Fax, Comments) with <object-fields attribute="account"> for the login credentials. The company is not displayed. Company contacts and organizational units are not transferred.
- Add/Remove Login Outside of Edit Mode: “Add Login” creates the account via the account creation dialog and passes the contact as initialData; “Remove Login” deletes the account, but the contact remains. A contact with a login can only be deleted after the login has been removed. The remaining account commands (reset password, MFA, etc.) on the base page are retained.
- Account creation with initial data (com.top_logic): Person.create(..., TLObject initialData) and PersonManager.initUser(Person, TLObject initialData); ContactPersonManager directly links a passed contact without an account to the new account (otherwise, the search is performed via the login name as before). This ensures that a duplicate contact is never created, even if multiple contacts share the same previous login name.
- Named Commands in View Overlays: The command lists of panels (and all elements based on CommandCarrierElement) and forms are mapped via the name attribute when views are merged; an overlay can remove, replace, or add a named command.
Migration
Java code in an application that reads or sets the command list of a CommandCarrierElement or FormElement configuration (getCommands()) now receives a List<ViewCommand.Config> instead of a List< PolymorphicConfiguration<? extends ViewCommand>>. .view.xml files do not need to be modified.
Verification
tl-demo-react (/view/, root / root1234), Administration → Access control → People: edit name, email, groups, and language in a single edit mode; add a login to a contact, log in with it, remove the login (contact remains), add it again (same contact).