IcCube - How to add Help on Custom widgets / Custom cell renderers?

41 views Asked by At

I created some Custom widget types and cell renderers using IcCube reporting V8 (ic3-reporting-api). Is there a way to link some help to these as it exists for original components ?

Custom widget : enter image description here

Custom cell renderer :

enter image description here

1

There are 1 answers

2
Marc Polizzi On BEST ANSWER

Widgets

You can add some documentation/help that will be available in the editor via the (?) icon. The framework is searching in the server Docs for an MD file located either in the ic3-reporting/app-local folder or in the official documentation folder (i.e., ic3-reporting/doc).

The name of the file is built from the widget template as following:

"widgets." + pluginId + "." + templateType + "." + templateId

So, let's say you've created a custom table widget named SimpleTable in your plugin named MyPluginJS and register this widget into the chart section, then the MD filename would be:

widgets.MyPluginJS.chart.SimpleTable.md

This name is then translated into a path:

widgets/MyPluginJS/chart/SimpleTable.md

And it is searched first in ic3-reporting/app-local using first the user's locale and then English:

/icCube/report/ic3-reporting/app-local/doc/
    fr/widgets/MyPluginJS/chart/SimpleTable.md
    en/widgets/MyPluginJS/chart/SimpleTable.md

Eventually, it is searched in the ic3-reporting/doc folder for the English locale only:

/icCube/report/ic3-reporting/doc/
    en/widgets/MyPluginJS/chart/SimpleTable.md

But, adding your documentation to the ic3-reporting/doc folder is not recommended as this directory will be overwritten on each installation of a new version of the reporting application.

Transformations

The same mechanism is used for the transformations. The path would be as following:

tidyTable/transformations/MyPluginJS/SimpleRenderer.md

Note that the pluginId is not used for the transformations path in v8.2.2 (this will be fixed in v8.3).

Edit: Forgot to mention the app-local/ic3report-config.js must be updated as folllowing:

// extra. doc. localization folder
options.appDocUrlEx = "doc";