-
Notifications
You must be signed in to change notification settings - Fork 351
Open
Labels
FeatureNew functionality not yet included in SuluNew functionality not yet included in Sulu
Description
Problem description
After some discussion with a developer from our partner Adesso I think it should be easier in Sulu to prefill a Add Form with data a PHP endpoint for new resource endpoint.
Proposed solution
I could think by something like this would be awesome:
sulu_admin:
resources:
events:
routes:
list: app.events
detail: app.event
+ prefill: app.event_prefillclass EventController {
#[Route('/admin/api/events/prefill', name: 'app.event_prefill']
public function prefillAction(): Response
{
return new JSONResponse(['someField' => 'somePrefilledValue']);
}
}I think it requires some adjustments to add prefill if !id is defined:
sulu/src/Sulu/Bundle/AdminBundle/Resources/js/stores/ResourceStore/ResourceStore.js
Line 74 in e648c1a
| this.requestRemoteData() |
The prefill endpoint can return a JSON which will prefill the form store if the form is in add and not edit mode.
Metadata
Metadata
Assignees
Labels
FeatureNew functionality not yet included in SuluNew functionality not yet included in Sulu