sulu-workshop icon indicating copy to clipboard operation
sulu-workshop copied to clipboard

07 - Display the registrations for each event in the admin interface

Open luca-rath opened this issue 4 years ago • 0 comments

Display submitted event registrations in the admin interface

Goal

Our event managers need to keep track of all the incoming event registrations. Therefore we want to display a list of all registrations for each of our events in the admin interface.

Steps

  • Create a new admin API-Controller App\Controller\Admin\EventRegistrationController to query event-registrations
  • Register the controller in your config/routes_admin.yaml
  • Configure a new event_registrations resource in your config/packages/sulu_admin.yaml
  • Add a new list configuration for event_registrations in a config/lists/event_registrations.xml
  • Use the ListRouteBuilder to add a new admin route in your src/Admin/EventAdmin.php
  • Log into the admin UI with user "admin" and password "admin"
  • Navigate to the event you registered yourself in the previous assignment and see your submitted values

Hints

  • Have a look at the admin API-Controller App\Controller\Admin\EventController for the Event entity
  • Have a look at the existing list configuration config/lists/events.xml for the Event entity
  • Have a look at the existing admin-routes for the Event entity in src/Admin/AppAdmin.php file

More Information

The Admin classes are used to configure available navigation items and routes in the Sulu administration interface. Each route is associated to a javascript view and can customize the behaviour of the view by passing options to the view. Sulu is shipped with several configurable javascript views, including a flexible form view and a list view.

The Sulu administration interface is implemented as a single-page application with React. It requires a standardized REST API for loading and manipulating the different resources available in the system. For custom entities you need to implement this REST endpoint by yourself.

Passing your REST API URLs to to each view of the JS application would be quite inconvenient. Therefore, Sulu utilizes a concept called resources that associates entity specific API URLs used by the JS application to a unique resourceKey. This resource key is then used to configure entity specific views of the JS application.

Another concept of the Sulu frontend application is the utilization of metadata when rendering javascript views. For example, the list view utilizes metadata that is configured in XML files to determine the available columns and the type of the data inside of these columns. This concepts enables the developer to built feature-rich UIs without the need of writing javascript code.

Links

luca-rath avatar Jul 07 '20 10:07 luca-rath