-
-
Notifications
You must be signed in to change notification settings - Fork 52
Description
What is your question?
This issue documents discussions about how teal should work around modifications to modules.
It grow up from #1597.
Need
App developers might want to change how some modules behave, both the UI and the server part.
Examples observed:
- Change the label of an input
- Remove code blocks from the reporter for some or all modules
- Modify output (customize plots, tables, ...)
- Modify data input (Filter data, apply custom modifications, ...)
- Disable sidebar:
disable_sidebarfunction #1601
Current state
There are several functions to allow modification of existing teal_modules:
make_teal_transform_server: creates a new module with a reactive evaluating the expression provided
It can modify the output of the module by modifying the code. It uses amoduleServer.teal_transform_module: it only modifies the output (but accept and ui function), usage ofmake_teal_transform_serveris suggested for the server argument. It uses amoduleServer.modify_header,modify_title,modify_footer: These functions can modify specific text/labels of the UI.after: Function that modifies the UI and the server (without restrictions)
There are also arguments in modules to modify them:
transformators: Modify data inputdecorators(experimental): Modify data output (viateal_transform_module)
Comments
During the addition of decorators and transformators arguments, it was considered whether to add a parameter or as an external function.
Some effort should be done to avoid having too many functions exported. Especially when the names can be confusing (all with transform on them).
after function has arguments that accept what looks like module functions but they are not. This could confuse users of the function.
Using a function like after should be compatible with using a decorator and/or a transformator as arguments on the module.
Open questions
UI
Developers might want to update, add or remove UI elements: How to help app-developers avoiding problems like not returning the UI, duplicating it, removing a necessary input, ...?
How should we give the freedom to place new UI elements? Using an argument like .cssSelector with some default or freely with unrestricted capabilities.
Server
Changes can be applied before module execution like transformators and/or after the module execution like decorators: How should we control that?
Where to allow them:
- As an expression evaluated on
data? - Inside a reactive object?
- Inside the server function module?
If the expressions are allowed on multiple places, how could the package distinguish each case?
Code of Conduct
- I agree to follow this project's Code of Conduct.
Contribution Guidelines
- I agree to follow this project's Contribution Guidelines.
Security Policy
- I agree to follow this project's Security Policy.