diff --git a/DESCRIPTION b/DESCRIPTION index 9e976ea2..8d835ccf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,6 +32,7 @@ Imports: formatters (>= 0.3.1), ggplot2 (>= 3.4.0), lifecycle (>= 0.2.0), + logger (>= 0.3.0), shinyvalidate, teal.code (>= 0.4.1.9009), teal.logger (>= 0.1.3.9013), @@ -41,7 +42,6 @@ Imports: tidyr (>= 0.8.3) Suggests: knitr (>= 1.42), - logger (>= 0.2.0), nestcolor (>= 0.1.0), rmarkdown (>= 2.19), teal.data (>= 0.3.0.9018), @@ -50,11 +50,11 @@ Suggests: Config/Needs/verdepcheck: insightsengineering/osprey, rstudio/shiny, insightsengineering/teal, insightsengineering/teal.transform, mllg/checkmate, tidyverse/dplyr, insightsengineering/formatters, - tidyverse/ggplot2, r-lib/lifecycle, rstudio/shinyvalidate, + tidyverse/ggplot2, r-lib/lifecycle, daroczig/logger, rstudio/shinyvalidate, insightsengineering/teal.code, insightsengineering/teal.logger, insightsengineering/teal.reporter, insightsengineering/teal.widgets, insightsengineering/tern, tidyverse/tidyr, yihui/knitr, - daroczig/logger, insightsengineering/nestcolor, rstudio/rmarkdown, + insightsengineering/nestcolor, rstudio/rmarkdown, insightsengineering/teal.data, r-lib/testthat, r-lib/withr Config/Needs/website: insightsengineering/nesttemplate Encoding: UTF-8 diff --git a/NEWS.md b/NEWS.md index ff735fd4..fe01260a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,9 @@ ### Breaking Changes * Adapted all modules to use `teal_data` objects. +### Enhancements +* Added `logger` functionality for logging changes in shiny inputs in all modules. `logger` was added to Imports. + ### Miscellaneous * Specified minimal version of package dependencies. diff --git a/R/tm_g_ae_oview.R b/R/tm_g_ae_oview.R index ba5b690d..430d6f9c 100644 --- a/R/tm_g_ae_oview.R +++ b/R/tm_g_ae_oview.R @@ -208,6 +208,7 @@ srv_g_ae_oview <- function(id, checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ ANL <- data()[[dataname]] diff --git a/R/tm_g_ae_sub.R b/R/tm_g_ae_sub.R index 2f556da6..e8032c96 100644 --- a/R/tm_g_ae_sub.R +++ b/R/tm_g_ae_sub.R @@ -185,6 +185,7 @@ srv_g_ae_sub <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ ANL <- data()[[dataname]] ADSL <- data()[["ADSL"]] diff --git a/R/tm_g_butterfly.R b/R/tm_g_butterfly.R index 64562d95..e29efd9b 100644 --- a/R/tm_g_butterfly.R +++ b/R/tm_g_butterfly.R @@ -269,6 +269,7 @@ srv_g_butterfly <- function(id, data, filter_panel_api, reporter, dataname, labe checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ ADSL <- data()[["ADSL"]] ANL <- data()[[dataname]] diff --git a/R/tm_g_decorate.R b/R/tm_g_decorate.R index 604513e1..c0248bfd 100644 --- a/R/tm_g_decorate.R +++ b/R/tm_g_decorate.R @@ -47,6 +47,7 @@ srv_g_decorate <- function(id, plot_height, plot_width) { moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") plot_g <- reactive({ g <- tern::decorate_grob( plt(), diff --git a/R/tm_g_events_term_id.R b/R/tm_g_events_term_id.R index e4c6cd93..9e06e093 100644 --- a/R/tm_g_events_term_id.R +++ b/R/tm_g_events_term_id.R @@ -213,6 +213,7 @@ srv_g_events_term_id <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ iv <- shinyvalidate::InputValidator$new() iv$add_rule("term", shinyvalidate::sv_required( diff --git a/R/tm_g_heat_bygrade.R b/R/tm_g_heat_bygrade.R index a7e40ce8..89c5870b 100644 --- a/R/tm_g_heat_bygrade.R +++ b/R/tm_g_heat_bygrade.R @@ -296,6 +296,7 @@ srv_g_heatmap_bygrade <- function(id, if (!is.na(cm_dataname)) checkmate::assert_names(cm_dataname, subset.of = names(data)) moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ ADSL <- data()[[sl_dataname]] ADEX <- data()[[ex_dataname]] diff --git a/R/tm_g_patient_profile.R b/R/tm_g_patient_profile.R index 82af536c..989282a9 100644 --- a/R/tm_g_patient_profile.R +++ b/R/tm_g_patient_profile.R @@ -362,6 +362,7 @@ srv_g_patient_profile <- function(id, if (!is.na(cm_dataname)) checkmate::assert_names(cm_dataname, subset.of = names(data)) checkboxes <- c(ex_dataname, ae_dataname, rs_dataname, lb_dataname, cm_dataname) moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") select_plot <- reactive( vapply(checkboxes, function(x) x %in% input$select_ADaM, logical(1L)) ) diff --git a/R/tm_g_spiderplot.R b/R/tm_g_spiderplot.R index 5945e25b..edb2884f 100644 --- a/R/tm_g_spiderplot.R +++ b/R/tm_g_spiderplot.R @@ -243,6 +243,7 @@ srv_g_spider <- function(id, data, filter_panel_api, reporter, dataname, label, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ ADSL <- data()[["ADSL"]] ADTR <- data()[[dataname]] diff --git a/R/tm_g_swimlane.R b/R/tm_g_swimlane.R index 3fa0484b..247a9f6f 100644 --- a/R/tm_g_swimlane.R +++ b/R/tm_g_swimlane.R @@ -279,6 +279,7 @@ srv_g_swimlane <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ iv <- shinyvalidate::InputValidator$new() iv$add_rule("bar_var", shinyvalidate::sv_required( diff --git a/R/tm_g_waterfall.R b/R/tm_g_waterfall.R index 7250139b..b9f59074 100644 --- a/R/tm_g_waterfall.R +++ b/R/tm_g_waterfall.R @@ -287,6 +287,7 @@ srv_g_waterfall <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.osprey") iv <- reactive({ adsl <- data()[["ADSL"]] adtr <- data()[[dataname_tr]]