[Feature Request] Scoped CRUD / Global Scope for CRUD Controllers
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 12/100
Research direction
The issue names no files, classes or tests, so there is no concrete entry point yet. Before any code, a newcomer would need to find how CRUD controllers build their query and where the dashboard main menu is defined, then agree the design with maintainers, since the URL parameter, the 'All' option and per-controller filtering are all open questions. Done means that agreed design is written down or a first prototype is reviewed.
Written by the indexing model from the issue text.
Description
Short description of what this feature will allow to do:
I would like to suggest a feature to define a global scope shared across multiple CRUD controllers, instead of having to implement the same filters in each controller.
I have already encountered this requirement in three different projects.
For example:
- Annual event management: An application used to manage a festival that takes place every year. Organizers manage participants, workshops, schedules, etc. There is no reason to mix records from different editions on the same CRUD pages.
- Multi-project management: An application managing multiple projects, where products, services, and other entities belong to a specific project. Users should be able to select a project and only see records related to it across all relevant CRUD controllers.
In my current implementations, I use a global dropdown in the main menu to select the active scope, which is stored in the session. However, this approach has a major limitation: if a user opens multiple browser tabs and changes the scope in one tab, it also affects the others.
A better approach would be to manage the scope through a URL parameter, automatically preserved across EasyAdmin navigation. This would allow users to work with different scopes in separate tabs without conflicts.
Example of how to use this feature
The expected behavior would be:
- A global dropdown would allow users to select the active scope.
- The dropdown could also include an optional "All" option to disable scoping and display records from all scopes together.
- Each CRUD controller could configure whether it uses the global scope and, if so, define how its queries should be filtered based on the selected scope.
- The selected scope would be preserved in the URL when navigating between CRUD pages.
- New records could automatically be associated with the selected scope.
- CRUD controllers not using the scope would remain unaffected.
- Different browser tabs could use different scopes independently.
Ideally, the scope selector would be configured at the dashboard level, while each CRUD controller would define its own filtering logic.
I think this could be useful for many applications, especially those managing multiple projects, organizations, events, or tenants.
Here is an exemple of how I render scope in my "events management" project main menu (only the CRUDs in red square are filtered by scope):
|
|
|
Another exemple of design (using menu header style for the dropdown) from another project (red block are scoped CRUDs):
|
|
|
- Dominant language
- PHP
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 52
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EasyCorp/EasyAdminBundle
-
bug design
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
EasyCorp/EasyAdminBundle#7958 ·
Maintainers usually reply within 2 days
-
design feature
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
EasyCorp/EasyAdminBundle#7930 ·
Maintainers usually reply within 2 days
-
design
Difficulty 2/5 Under an hour Newbie friendliness 88/100
EasyCorp/EasyAdminBundle#7879 ·
Maintainers usually reply within 2 days
-
design
Difficulty 1/5 Under an hour Newbie friendliness 90/100
EasyCorp/EasyAdminBundle#7875 ·
Maintainers usually reply within 2 days
-
#[AdminRoute]: the requirements of an action silently replace the ones of the classPossibly taken @anthonyhacart claimed this 1 day ago. Openfeature
Difficulty 3/5 Half a day Newbie friendliness 30/100
EasyCorp/EasyAdminBundle#7956 ·
Maintainers usually reply within 2 days
All issues in EasyCorp/EasyAdminBundle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
taskforcesh/bullmq#5238 ·
Maintainers usually reply within 1 day
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itPossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/jetpack#55517 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
area/import type/enhancement when/later
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day