You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the list of tags for screens are defined in the web-ui.json file. This feature request proposes to load these lists from a custom code executed on demand via the Opfab API.
A custom function shall provide the list of tags as an array of {label,value}
Example :
[
{
"label": "Label for tag 1",
"value": "tag1"
},
{
"label": "Label for tag 2",
"value": "tag2"
}
]
The function shall take into parameter the screen name , possible list of screen names are : archives /logging/ processMonitoring
The function shall be asynchronous and so should return a Promise (this is due to the fact that the method can call a server to get the tags)
Each screen shall call this registered function via OpfabAPIService to get tags , if the function return undefined , the screen use tags defined in web-ui.json as in the actual implementation
Register a custom function to get tag is optional so OpfabAPIService should define a default implementation returning undefined
As an example : modify config/docker/externalJs/example.js to register a function that return a list of tags (hardcoded in the function itself) if screenName is processMonitoring otherwise undefined
freddidierRTE
changed the title
Get the list of tags for monitoring processus from a business data file
Get the list of tags for monitoring processus from a custom code
May 22, 2024
Currently, the list of tags for screens are defined in the web-ui.json file. This feature request proposes to load these lists from a custom code executed on demand via the Opfab API.
Example :
The function shall be defined in a custom js on opfab loading (using what has been done in Add the possiblity to load custom javascript on startup (#6457) #6466)
The function shall be registered via a new opfab API function (in ui/main/src/app/business/services/opfabAPI.service.ts) :
The function shall take into parameter the screen name , possible list of screen names are : archives /logging/ processMonitoring
The function shall be asynchronous and so should return a Promise (this is due to the fact that the method can call a server to get the tags)
Each screen shall call this registered function via OpfabAPIService to get tags , if the function return undefined , the screen use tags defined in web-ui.json as in the actual implementation
Register a custom function to get tag is optional so OpfabAPIService should define a default implementation returning undefined
As an example : modify config/docker/externalJs/example.js to register a function that return a list of tags (hardcoded in the function itself) if screenName is processMonitoring otherwise undefined
Add in documentation in https://opfab.github.io/documentation/current/reference_doc/#_frontend_api in a new chapter businessConfig API
The text was updated successfully, but these errors were encountered: