From fd89b57f460ff66dc46329acf2f8882e41fd7fb7 Mon Sep 17 00:00:00 2001 From: m7pr Date: Thu, 9 May 2024 11:56:14 +0200 Subject: [PATCH] add logger::log_shiny_input_changes(input, namespace = "teal.modules.general") for all modules --- R/tm_a_regression.R | 3 +++ R/tm_data_table.R | 3 +++ R/tm_file_viewer.R | 3 +++ R/tm_front_page.R | 3 +++ R/tm_g_association.R | 3 +++ R/tm_g_bivariate.R | 3 +++ R/tm_g_distribution.R | 3 +++ R/tm_g_response.R | 3 +++ R/tm_g_scatterplot.R | 3 +++ R/tm_g_scatterplotmatrix.R | 3 +++ R/tm_missing_data.R | 3 +++ R/tm_outliers.R | 3 +++ R/tm_t_crosstable.R | 3 +++ R/tm_variable_browser.R | 3 +++ 14 files changed, 42 insertions(+) diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index d276aaa2d..bc96a0933 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -372,6 +372,9 @@ srv_a_regression <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + ns <- session$ns rule_rvr1 <- function(value) { diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 7ef52606f..773cd9906 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -182,6 +182,9 @@ srv_page_data_table <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + if_filtered <- reactive(as.logical(input$if_filtered)) if_distinct <- reactive(as.logical(input$if_distinct)) diff --git a/R/tm_file_viewer.R b/R/tm_file_viewer.R index 8564cf6ab..58fef434c 100644 --- a/R/tm_file_viewer.R +++ b/R/tm_file_viewer.R @@ -124,6 +124,9 @@ ui_viewer <- function(id, ...) { # Server function for the file viewer module srv_viewer <- function(id, input_path) { moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + temp_dir <- tempfile() if (!dir.exists(temp_dir)) { dir.create(temp_dir, recursive = TRUE) diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 45bde2fe7..122fda525 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -137,6 +137,9 @@ srv_front_page <- function(id, data, tables, show_metadata) { checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + ns <- session$ns setBookmarkExclude("metadata_button") diff --git a/R/tm_g_association.R b/R/tm_g_association.R index ae1ccebe6..e50c951c3 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -286,6 +286,9 @@ srv_tm_g_association <- function(id, checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list(ref = ref, vars = vars), datasets = data, diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 570f56a89..f5ec1fbf8 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -460,6 +460,9 @@ srv_g_bivariate <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + ns <- session$ns data_extract <- list( diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 758db9038..f4d93a898 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -357,6 +357,9 @@ srv_distribution <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + setBookmarkExclude("params_reset") ns <- session$ns diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 78d7cc05b..2699f60b2 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -314,6 +314,9 @@ srv_g_response <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + data_extract <- list(response = response, x = x, row_facet = row_facet, col_facet = col_facet) rule_diff <- function(other) { diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index e1ee34d10..c57007e72 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -495,6 +495,9 @@ srv_g_scatterplot <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + data_extract <- list( x = x, y = y, diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index ef329c3d7..047d9a373 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -267,6 +267,9 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list(variables = variables), datasets = data, diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 34737766e..a94d25ecb 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -170,6 +170,9 @@ srv_page_missing_data <- function(id, data, reporter, filter_panel_api, parent_d with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + datanames <- isolate(teal.data::datanames(data())) datanames <- Filter(function(name) { is.data.frame(isolate(data())[[name]]) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index 84b323008..c1334b39c 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -333,6 +333,9 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + ns <- session$ns vars <- list(outlier_var = outlier_var, categorical_var = categorical_var) diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 61f236df4..236932351 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -242,6 +242,9 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list(x = x, y = y), datasets = data, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 00bb91e99..43803c317 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -201,6 +201,9 @@ srv_variable_browser <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + + logger::log_shiny_input_changes(input, namespace = "teal.modules.general") + # if there are < this number of unique records then a numeric # variable can be treated as a factor and all factors with < this groups # have their values plotted