[Feature Request] Scoped CRUD / Global Scope for CRUD Controllers

Aperta
#7,855 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php, symfony
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Main menu Image

Another exemple of design (using menu header style for the dropdown) from another project (red block are scoped CRUDs):

Image Image
Lingua principale
PHP
Stelle
4.3k
Fork
1.1k
Merge medio
2g 9h
PR unite (30g)
52

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di EasyCorp/EasyAdminBundle

Tutte le issue di EasyCorp/EasyAdminBundle

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.