Configuring Custom Settings
MATRIXX Backoffice Customer Tool allows users to define custom event list views and additional or overriding fields for the event-details views. This setting allows users to define new list-view pages for events and define fields for the main key/value-pair view of the event-details pages.
Custom settings must be defined in the settings.json file, as parameters
to the EVENT_VIEW
setting. The EVENT_VIEW
setting defines an
array of event fields. The event
field for each item in the array is the
event type ID
; for example, the value of the
EventTypeIdPath
field in the event_types
response.
The following example of an EVENT_VIEW entry in the settings.json file
specifies an array that contains two events: notification_done
and
purchase
.
"EVENT_VIEW": [
{
"event": "13",
"fullName": "notification_done",
"translate": true,
"listViewFields": [
{
"field": "InitiatorId",
"translate": true
}
],
"detailsViewFields": [
{
"field": "WalletId",
"format": "string",
"translate": true
},
]
},
{
"event": "4",
"fullName": "purchase",
"detailsViewFields": [
{
"field": "InitiatorExternalId",
"format": "string"
},
{ "field": "WalletId" }
]
}
]
Objects Specified in the EVENT_VIEW Array
The
fullName
value specifies the full name of the event.
The
translate
value specifies whether the value can be
translated.
You can specify two objects, listViewFields
and
detailsViewFields
in the array of fields. The order of the fields in the
array defines the order the fields display on the details page. For each field, you can
specify a field (field
), format (format
), and optional
boolean for translation (translate
) may appear.
The listViewFields
object can contain:
field
— This is a required element and only matches a top-level field.format
— Theformat
("format") value can be either string, time, array, or object. A value ofstring
prints the value without any special formatting. A value oftime
attempts to parse and format the value as a pod-time field. A value ofarray
prints arrays of simple data types (string, number, boolean) as a comma-separated list; arrays of complex data types (array, object) are converted to strings before printing. A value ofobject
converts the value to a string before printing. This attribute (format) is optional; the default value is string.translate
— Specifies if the field label should be translated. Translations for these fields are always be found the assets/en.json file under the objecteventAttrs.customAttrs
. Thetranslate
attribute is optional; the default value isfalse
. Note thetranslate
field may appear at the event level itself to indicate there is a translation for the event name to be used for the custom event page link and page name.
The detailsViewFields object can contain fullName
and
translate
.
The fullName
option is the FullName value of the event description. This field
is optional but can help when viewing and editing the file as it may be more descriptive
than the EventTypeIdPath
keys.
The translate
option determines if the field label should be translated.
Translations for these fields will always be found in the file
assets/en.json under the object
eventAttrs.customAttrs.
The translate
attribute is
optional; the default value is false. Note the translate
field may appear
at the event level itself to indicate there is a translation for the event name to be used
for the custom event page link and page name.
Example of Translation Settings
If the event and is fields have translation enabled (translate
is set to
true
)(in the example, the notification event (13) and its fields
InitiatorId
and WalletId
have translations enabled),
update the en.json file with a translation for these fields for this
event (user changes are bolded). The following example shows a en.json
file:
"eventAttrs": {
…
"customAttrs": {
"13Attrs": {
"13": "Notifications",
"listViewFieldAttrs": {
"InitiatorId": "Initiator ID"
},
"detailsViewFieldAttrs": {
"WalletId": "Balance ID"
}
}
}
}