The tl:InfoService and the tl:ErrorRenderer allow to generate three types of messages: warnings, information and errors.
Improvement
Newly, the different messages should not only have different icons in the title to distinguish them from each other, but also look different. The messages will be separated by color as follows:
- Warnings have a yellow background
- Information have a blue background
- Errors have a red background
To make it easier to identify the messages in the logs, a timestamp is now added for each warning and error message. This timestamp indicates when the message was created.
HTML templates now exist for tl:DefaultInfoServiceItem and tl:InfoServiceItemMessageFragment.
Application
To achieve this behavior, when a tl:DefaultInfoServiceItem object was created in tl:InfoService, a CSS class was also provided. A message that receives this CSS class then automatically gets the desired design. If a command is to be drawn as an Info Service item, then a new tl:DefaultInfoServiceItem object is created.
The new CSS classes are:
- Warnings: "infoServiceWarning".
- Information: "infoServiceInfo
- Errors: "infoServiceError"
Testing
Start the application and replicate situations where messages are thrown to client side. Go to the following tabs in the application:
For info service messages: Technical Demo>Layout Framework #1>Forms>Error Page.
The documentation in the Main ToolRowView generates a tl:InfoService info message. To replicate such a message, the documentation can be pressed while on a page that has no documentation - for example, the Error Page in the Technical Demo.
For messages generated by the tl:ErrorRenderer: Technical Demo>Layout Framework #1>Forms>Form Controls(inline) and look for the "failWithTopLogicExceptionWarning" button. Test all fail buttons.
To be able to test a dialog box display drawn by the tl:ErrorRenderer, the following button was introduced in the demo: ThrowErrorDialogWindow.