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

[Feature Request]: Find the way to skip reporter for a single module. #847

Closed
3 tasks done
gogonzo opened this issue Jun 13, 2023 · 3 comments
Closed
3 tasks done
Labels
core enhancement New feature or request

Comments

@gogonzo
Copy link
Contributor

gogonzo commented Jun 13, 2023

Feature description

The way how reporter is implemented in teal causes reporter to be always present if any of the modules has a reporter argument in server formals. We need to expose argument in the module to disable reporter.

See example and analyse module_variable_browser object (class teal_module) and see the way how the module is called in teal

Acceptance criteria:
Solution should allow any app developer to disable reporter for a single module

library(teal.modules.general)
library(scda)

ADSL <- synthetic_cdisc_data("latest")$adsl
ADTTE <- synthetic_cdisc_data("latest")$adtte

module_variable_browser <- tm_variable_browser(
  label = "Variable browser",
  ggplot2_args = teal.widgets::ggplot2_args(
    labs = list(subtitle = "Plot generated by Variable Browser Module")
  )
)

app <- init(
  data = cdisc_data(
    cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
    cdisc_dataset("ADTTE", ADTTE, code = "ADTTE <- synthetic_cdisc_data(\"latest\")$adtte"),
    check = TRUE
  ),
  modules(
    module_variable_browser 
  )
)

if (interactive()) {
  shinyApp(app$ui, app$server)
}

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.
@kartikeyakirar
Copy link
Contributor

kartikeyakirar commented Oct 19, 2023

Proposed solution:

To allow user to skip reporter , we introduce an additional argument, preferably named allow_reporter or any more suitable name as per recommendations. This new argument should be incorporated into the function which return teal_module class fun: module(), serving as a flag to replace the need for checking the reporter argument within the module server formal parameters.

Instead of verifying the presence of the reporter argument within thesrv_tealand srv_nested_tabs.teal.module functions, these functions should inspect the allow_reporter flag. This flag will determine whether the reporter_preview_module should be appended in modules in module_teal.R and whether the reporter argument should be appended to the srv_argument list in module_nested_tabs.R.

Additionally, it's essential to extend the inclusion of this parameter to other module packages, such as tmg and tmc, .

@kartikeyakirar
Copy link
Contributor

kartikeyakirar commented Oct 20, 2023

@gogonzo The Reporter-UI is defined through the teal.reporter::simple_reporter_ui function within the module's UI. When I skip reporter arg with additional argument to the module, the reporter functionality becomes non-operational, but the UI remains visible. I want to verify whether this behaviour is acceptable. given that the task involves disabling the reporter. In this scenario, the UI is still displayed but lacks functionality.

image

I would prefer to hide this from the user entirely. and manage the reporter UI, similar to how it's handled in the server using the with_reporter flag.

@gogonzo
Copy link
Contributor Author

gogonzo commented Feb 12, 2025

Duplicate of #678

@gogonzo gogonzo marked this as a duplicate of #678 Feb 12, 2025
@gogonzo gogonzo closed this as completed Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants