Context/Problem
Liferay interfaces aimed at displaying and managing data are too rigid for the user. However, in case of need to modify how this information is displayed it is needed to involve IT for custom developments. With the data set manager now users can customize and define which data to show as well as the pagination options. However, the first iteration is limited, and users need to have more capabilities at their disposal.
Desired Outcomes
The goal of this feature is to enable admins with more capabilities to customize what users can do on a data view via UI. This means that users will be able to look for the data they need, perform actions on them and all with localization support to correctly understand the data.
What we have done
We have enhanced the “Data Set Manager” so administrators can define through a UI data set views filters, actions and the default sort. We have also introduced the support for localization, so now it is possible to provide translations for field and filter names as well as process correctly the localized data coming from the headless API. Let’s see in detail each of the different features:
Default sorting
Now admins can define the default sorting for a dataset view. You can select the field to sort by when users access the page with the data set view as well as the direction (ascending or descending). It is possible to add more than one field. In this case, results will be sorted following the order of the fields, so it will start sorting based on the first field, for elements with the same value for that field; it will continue sorting them based on the second field and so on.
Filtering capabilities
Admins can define filters to make them available for end users visiting pages with the dataset fragment. There are 3 types of filters available:
- Date filters: compatible with fields of type date. Admins can provide a name to the filter as well as provide a “From” and “To” dates to be pre-applied if needed.
- Selection filters: This filter allows admins to configure a picklist as the source of the options for the filter.
- Client extension: This new client extension enables admins and developers to fully customize the filter experience and add new types of filters depending on their needs.
Multi-language support
Admins now can define views and select fields that are localized, so users will access the corresponding translation when visiting the page. Additionally, the names of the columns and filters are also localizable.
Link Item Actions
Apart from exposing information in tables, with the Data Set Manager now admins will be able to define actions linked to each of the elements of the data set. For each action:
- Admins can provide a localized label.
- Choose the icon to be used.
- Provide the URL to redirect the user to. In case you need to parametrize it so each row has a different URL, you can do it by adding it between brackets as part of the URL, for example myURL/{id}/editPage will look for “id” in the Headless response and substitute for the corresponding value in the URL.
- With “Headless Action Key” admins can associate an action to a headless endpoint, which takes permissions into account, so the action will only be shown to the user if the corresponding headless action is present in the response. For example, you can link an “edit” action to the “update” Headless Key.
- Provide an optional Confirmation Message if needed.