[Feature Request] Create associated entities directly from an Association Field

Aperta
#7,874 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php, symfony

Direzione di ricerca

Start by locating AssociationField and the form components that render association inputs in EasyAdmin. Trace how the associated entity’s CRUD form configuration is resolved, then examine how modal forms submit and return results to their parent form. Done means the optional button opens the associated CRUD form, refreshes and selects the new entity after success, and works in both create and edit forms.

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

Descrizione

Description

It would be great to have the ability to create a new associated entity directly from an AssociationField in EasyAdmin, without leaving the current form.

Currently, when creating or editing an entity, if I want to associate it with another entity that does not exist yet, I need to leave the current form, navigate to the CRUD section of the associated entity, create it, and then return to the original form.

I would like to propose adding a button next to the AssociationField that allows users to create a new associated entity directly from the current form.

Proposed solution

Add an optional button next to the AssociationField that opens a modal containing the creation form for the associated entity.

The expected workflow would be:

The user opens a form to create or edit an entity.
Next to an AssociationField, the user clicks a button such as "Create new".
A modal opens with the creation form for the associated entity.
The user fills in the form and submits it.
After successful creation, the modal closes and the newly created entity becomes available in the AssociationField.
Ideally, the newly created entity is automatically selected in the field.

This would allow users to create and associate related entities without losing the data they have already entered in the current form.

Motivation

This feature would improve the user experience when working with related entities, especially in applications with complex entity relationships.

For example, when creating an Order, a user might need to create a new Customer or Address that does not exist yet. Being able to do this directly from the association field would make the workflow much more convenient.

A similar feature is available in SonataAdmin, which could serve as a reference for the user experience.

Additional considerations

The feature could be optional and configurable per AssociationField.
The modal should use the CRUD form configuration of the associated entity.
After successful creation, the association field should be refreshed to include the newly created entity.
Automatically selecting the newly created entity would make the workflow even more convenient.
The solution should ideally work with both entity creation and entity editing forms.

Would this feature be a good fit for EasyAdmin?

Thank you for your work on EasyAdmin!

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.