From ae5e090dc52531f680cf456e08b37fba50bd2bf0 Mon Sep 17 00:00:00 2001 From: jeromecambon Date: Fri, 20 Dec 2024 10:56:42 +0100 Subject: [PATCH 1/2] docs: Autocomplete widget does not update its displayed value (#2946) Covers [UID-733](https://bonitasoft.atlassian.net/browse/UID-733) --- .../pages-and-forms/pages/widgets-inputs.adoc | 2 ++ modules/pages-and-forms/pages/widgets.adoc | 36 +++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/modules/pages-and-forms/pages/widgets-inputs.adoc b/modules/pages-and-forms/pages/widgets-inputs.adoc index b301cceb69..3a38c7f3d3 100644 --- a/modules/pages-and-forms/pages/widgets-inputs.adoc +++ b/modules/pages-and-forms/pages/widgets-inputs.adoc @@ -45,6 +45,8 @@ image::widgets/autocomplete.png[autocomplete] Use an autocomplete widget to offer the user a list of possible values based on data entered in the field. For example, in a firstName field, if the user types _chri_, the values _chris_, _christine_, _christian_, _christiane_ are proposed. The user selects the correct value. To define the *available values*, bind a data source to initialize the suggestions. For suggestions that are an array of objects, you can specify a *displayed key* to identify the attribute to show as a suggestion in the widget. The value must be bound to a variable that will hold the selected suggestion. +See xref:ROOT:widgets.adoc#troubleshooting-ui-designer-widgets[Troubleshooting UI Designer widgets] to solve common issues with this widget. + === Select widget image::widgets/select.png[select] diff --git a/modules/pages-and-forms/pages/widgets.adoc b/modules/pages-and-forms/pages/widgets.adoc index e044bb49e1..7b66ccc401 100644 --- a/modules/pages-and-forms/pages/widgets.adoc +++ b/modules/pages-and-forms/pages/widgets.adoc @@ -42,6 +42,8 @@ Limitations: * The URL should have the file type as extension (e.g. \https://myhost/doc/sample.pdf) ==== +See <> to solve common issues with this widget. + [#rich-text-area] == Rich Text Area widget @@ -96,13 +98,11 @@ When the switch is completed, you still may have to set properties from the prop Switch feature not available for Internet Explorer 11 and Microsoft Edge. ==== +[#troubleshooting-ui-designer-widgets] [.troubleshooting-title] == Troubleshooting UI Designer widgets -[.troubleshooting-title] -=== Troubleshooting File Viewer - [.troubleshooting-section] -- [.symptom] @@ -117,3 +117,33 @@ The URL points on a file without extension (e.g. \https://myhost/doc/sample) [.solution]#Possible solution# Make a custom widget from the File Viewer widget, and adapt the `controller.isPDF` or `controller.isImage`. -- + +[.troubleshooting-section] +-- +[.symptom] +Autocomplete widget does not update its displayed value + +[.symptom-description] +Autocomplete widget does not update its displayed value when the value is changed by a variable. + +[.solution]#Possible solution# +Make a custom widget from the Autocomplete widget, and update the controller by replacing the function that set the `formatLabel` as follows: + +[source,javascript] +---- + this.formatLabel = function ($model) { + if (this.selectedItem) { + let sel = this.selectedItem; + this.selectedItem = undefined; + return this.getLabel(sel); + } else { + if (typeof $model === 'object') { + return this.getLabel($model); + } else { + return $model; + } + } + }; +---- +-- + From c12d4807f24a45705d5ed554dc2e5ba00976e569 Mon Sep 17 00:00:00 2001 From: Benjamin Parisel Date: Wed, 8 Jan 2025 10:00:02 +0100 Subject: [PATCH 2/2] feat: How to stream runtime logs as JSON ouptut to a remote server (#2952) Add a section on logging page to explain how to configure log4j to stream the log as JSON output to a remote server --------- Co-authored-by: Vincent HEMERY --- .../setup-dev-environment/pages/logging.adoc | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/modules/setup-dev-environment/pages/logging.adoc b/modules/setup-dev-environment/pages/logging.adoc index 519d02a6a0..f4e016aca1 100644 --- a/modules/setup-dev-environment/pages/logging.adoc +++ b/modules/setup-dev-environment/pages/logging.adoc @@ -46,6 +46,63 @@ Here is an example of the Log4j2 configuration for the logger used in the exampl ---- + +==== Use JSON format for logs + +The default configuration contains an unused `Console-JSON` appender which formats logs as JSON. + +[source, xml] +---- + + + + + + + + + +---- + +To use it, you can update the `AppenderRef` in the `Loggers` block or add a new one. + +[source, xml] +---- + + + + + +---- + +==== Stream logs to a remote server + +You need to declare a Socket appender in `log4j-appenders.xml` to stream to a remote server. You can choose to use Socket with various formats, such as JSONLayout or PatternLayout. + +As example, this configuration is used to stream JSON-formatted log entries to a remote server, such as Logstash, for further processing and analysis. + +[source, xml] +---- + + + + + +---- + +Then, do not forget to reference this new appender in `Loggers` block: + +[source, xml] +---- + + + + + + + +---- + === Bonita Studio To change the Bonita Studio log level (usually to debug Studio), go to the Studio installation folder, configuration directory, and edit the `config.ini` file. You need to set the property `eclipse.log.level` to one of the following values: INFO, WARNING or ERROR.