Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the list of tags from a custom code #6239

Open
freddidierRTE opened this issue Mar 28, 2024 · 0 comments
Open

Get the list of tags from a custom code #6239

freddidierRTE opened this issue Mar 28, 2024 · 0 comments
Assignees
Labels
Enhancement New feature LetsCo Issues needed for letscoordinate project

Comments

@freddidierRTE
Copy link
Contributor

freddidierRTE commented Mar 28, 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.

  • 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"
    }
  ]
opfab.businessconfig.registerFunctionToGetTags(method) 
  • 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

@freddidierRTE freddidierRTE added Enhancement New feature LetsCo Issues needed for letscoordinate project Draft Issue not totally defined labels Mar 28, 2024
@vlo-rte vlo-rte assigned vlo-rte and unassigned vlo-rte May 13, 2024
@freddidierRTE 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
@freddidierRTE freddidierRTE removed the Draft Issue not totally defined label May 22, 2024
@freddidierRTE freddidierRTE changed the title Get the list of tags for monitoring processus from a custom code Get the list of tags from a custom code May 22, 2024
@quinarygio quinarygio self-assigned this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature LetsCo Issues needed for letscoordinate project
Projects
Status: Ready
Development

No branches or pull requests

3 participants