Document single-editable-entity-type shortcut when adding entities to a Project - #915
Conversation
When a user can edit only one entity type, the Add-entity action on a Project detail page now opens that entity type's picker directly and is labeled 'Add new to project <type>', skipping the type-selection step. Reflects mautic/mautic PR #16927 (UXUI-302).
|
Just a reminder: I review PR comments by default. If you want me to ignore a specific comment, start it with |
|
Thanks @adiati98 — good catch. The two steps aren't duplicates: the first picks the entity type (e.g. Email vs. Form) and the second picks the specific entity of that type. I'll reword them so that distinction is clear and push the update to this PR shortly. |
Address @adiati98's review on PR mautic#915: reword the two consecutive steps so choosing the entity type (Email, Form, Campaign) is distinct from selecting the specific entity of that type.
|
|
||
| #. Choose the type of entity you want to add. | ||
| #. Select the entity you want to add to the Project. | ||
| #. If you can edit more than one entity type, choose the entity type you want to add, such as Email, Form, or Campaign. |
There was a problem hiding this comment.
Confirms the type-selection step only applies when editableTypes|length != 1 (i.e., more than one editable entity type); addEntityType is set only when exactly one type is editable.
|
|
||
| .. note:: | ||
|
|
||
| When you can edit only one entity type, Mautic skips the type-selection step and opens the picker for that entity type directly. In this case, the button names the entity type. For example, it reads **Add new to project Email** instead of **Add Entities to Project**. This happens automatically based on the entity types you can edit and requires no configuration. |
There was a problem hiding this comment.
Confirms button/header text and link target: when exactly one editable entity type exists, button links directly to addEntity (skips selectEntityType/type-selection modal) and label becomes 'mautic.project.add' trans ~ ' ' ~ entity type label (e.g. "Add new to project Email"); otherwise falls back to 'mautic.project.add_entity' trans ("Add Entities to Project") and links to selectEntityType.
|
|
||
| .. note:: | ||
|
|
||
| When you can edit only one entity type, Mautic skips the type-selection step and opens the picker for that entity type directly. In this case, the button names the entity type. For example, it reads **Add new to project Email** instead of **Add Entities to Project**. This happens automatically based on the entity types you can edit and requires no configuration. |
There was a problem hiding this comment.
Confirms translation string mautic.project.add_entity = "Add Entities to Project", the label used when more than one (or zero) entity types are editable.
|
|
||
| .. note:: | ||
|
|
||
| When you can edit only one entity type, Mautic skips the type-selection step and opens the picker for that entity type directly. In this case, the button names the entity type. For example, it reads **Add new to project Email** instead of **Add Entities to Project**. This happens automatically based on the entity types you can edit and requires no configuration. |
There was a problem hiding this comment.
Confirms translation string mautic.project.add = "Add new to project", concatenated with the entity type label (e.g. "Email") to produce "Add new to project Email".
|
|
||
| .. note:: | ||
|
|
||
| When you can edit only one entity type, Mautic skips the type-selection step and opens the picker for that entity type directly. In this case, the button names the entity type. For example, it reads **Add new to project Email** instead of **Add Entities to Project**. This happens automatically based on the entity types you can edit and requires no configuration. |
There was a problem hiding this comment.
Confirms viewAction passes editableTypes derived from ProjectEntityLoaderService::getEntityTypesWithEditPermissions(), i.e. the shortcut is automatic and based purely on the current user's edit permissions with no separate configuration/setting.
|
@adiati98 good question — the two steps aren't duplicates, so I reworded them for clarity rather than merging them. The first step picks the entity type (the kind of thing you're adding — Email, Form, Campaign, and so on), which only appears when you can edit more than one type. The second step then picks the specific entity of that type to add to the Project. The steps now read:
Pushed to this PR in place. Vale passes clean. |
Open in Promptless
Mautic PR #16927 (UXUI-302) adds a shortcut to the "Add Entities to Project" action on a Project's detail page: when a User can edit only one entity type, selecting the action now opens that entity type's picker directly and labels the button 'Add new to project ' (for example, 'Add new to project Email'), skipping the intermediate type-selection step. When a User can edit more than one entity type, the existing type-selection flow is unchanged.
This updates the "Assigning entities to a Project → From the Project" procedure in docs/projects/projects-overview.rst to mark the type-selection step as conditional and adds a note describing the single-editable-type shortcut, so readers whose instance skips the step aren't confused.
Trigger Events
Review response (@adiati98): The two steps aren't duplicates — they describe two distinct choices. Reworded for clarity:
Applied verbatim to the intent of the review comment; no deviation. Verified against the source flow in mautic/mautic#16927 and Vale passes clean on the changed page.