Skip to content

Document single-editable-entity-type shortcut when adding entities to a Project - #915

Open
promptless-for-oss wants to merge 5 commits into
mautic:7.2from
Promptless:promptless/pr-16927-projects-single-entity-shortcut
Open

Document single-editable-entity-type shortcut when adding entities to a Project#915
promptless-for-oss wants to merge 5 commits into
mautic:7.2from
Promptless:promptless/pr-16927-projects-single-entity-shortcut

Conversation

@promptless-for-oss

@promptless-for-oss promptless-for-oss commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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:

  • Step 1 picks the entity type (the kind: Email, Form, Campaign, …), shown only when you can edit more than one type.
  • Step 2 picks the specific entity of that type to add to the Project.

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.

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).
RCheesley
RCheesley previously approved these changes Aug 14, 2026
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Just a reminder: I review PR comments by default. If you want me to ignore a specific comment, start it with aside or /aside.

@adiati98 adiati98 added this to the Mautic 7.2 milestone Sep 1, 2026
Comment thread docs/projects/projects-overview.rst Outdated
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Source: https://github.com/mautic/mautic/blob/f4b169ed391572ceaa93d749a5419a5d16203f04/app/bundles/ProjectBundle/Resources/views/Project/details.html.twig#L23-L24


.. 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Source: https://github.com/mautic/mautic/blob/f4b169ed391572ceaa93d749a5419a5d16203f04/app/bundles/ProjectBundle/Resources/views/Project/details.html.twig#L32-L36


.. 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirms translation string mautic.project.add_entity = "Add Entities to Project", the label used when more than one (or zero) entity types are editable.

Source: https://github.com/mautic/mautic/blob/f4b169ed391572ceaa93d749a5419a5d16203f04/app/bundles/ProjectBundle/Translations/en_US/messages.ini#L28


.. 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Source: https://github.com/mautic/mautic/blob/f4b169ed391572ceaa93d749a5419a5d16203f04/app/bundles/ProjectBundle/Translations/en_US/messages.ini#L36


.. 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Source: https://github.com/mautic/mautic/blob/f4b169ed391572ceaa93d749a5419a5d16203f04/app/bundles/ProjectBundle/Controller/ProjectController.php#L354

@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

@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:

If you can edit more than one entity type, choose the entity type you want to add, such as Email, Form, or Campaign.
Select the specific entity of that type to add to the Project.

Pushed to this PR in place. Vale passes clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants