From bda83c2a1d33cf11036fd77d8dff3e0f5f735631 Mon Sep 17 00:00:00 2001 From: m7pr Date: Thu, 9 May 2024 11:40:47 +0200 Subject: [PATCH 1/7] test for tm_a_pca --- R/tm_a_pca.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index a87a437cf..576b504c9 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -298,6 +298,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl 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") + response <- dat for (i in seq_along(response)) { From 5612f0553c4e5d58dff2709ac957e0e1518ce0b2 Mon Sep 17 00:00:00 2001 From: m7pr Date: Thu, 9 May 2024 11:42:17 +0200 Subject: [PATCH 2/7] bring back logger --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4ca87a3e8..631c01ac7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,6 +35,7 @@ Imports: DT (>= 0.13), forcats (>= 1.0.0), grid, + logger (>= 0.3.0), scales, shinyjs, shinyTree (>= 0.2.8), @@ -65,7 +66,6 @@ Suggests: jsonlite, knitr (>= 1.42), lattice (>= 0.18-4), - logger (>= 0.2.0), MASS, nestcolor (>= 0.1.0), pkgload, From fd89b57f460ff66dc46329acf2f8882e41fd7fb7 Mon Sep 17 00:00:00 2001 From: m7pr Date: Thu, 9 May 2024 11:56:14 +0200 Subject: [PATCH 3/7] 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 From 7145e25fc6053f42c69a77888d640b450550fc9e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 10:00:46 +0000 Subject: [PATCH 4/7] [skip style] [skip vbump] Restyle files --- R/tm_a_pca.R | 1 - R/tm_a_regression.R | 1 - R/tm_data_table.R | 1 - R/tm_file_viewer.R | 1 - R/tm_front_page.R | 1 - R/tm_g_association.R | 1 - R/tm_g_bivariate.R | 1 - R/tm_g_distribution.R | 1 - R/tm_g_response.R | 1 - R/tm_g_scatterplot.R | 1 - R/tm_g_scatterplotmatrix.R | 1 - R/tm_missing_data.R | 1 - R/tm_outliers.R | 1 - R/tm_t_crosstable.R | 1 - R/tm_variable_browser.R | 1 - 15 files changed, 15 deletions(-) diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index 576b504c9..8d6a7af02 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -298,7 +298,6 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl 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") response <- dat diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index bc96a0933..b23ec6ceb 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -372,7 +372,6 @@ 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 diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 773cd9906..297bd76a2 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -182,7 +182,6 @@ 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)) diff --git a/R/tm_file_viewer.R b/R/tm_file_viewer.R index 58fef434c..83117806c 100644 --- a/R/tm_file_viewer.R +++ b/R/tm_file_viewer.R @@ -124,7 +124,6 @@ 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() diff --git a/R/tm_front_page.R b/R/tm_front_page.R index 122fda525..e524d8cbc 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -137,7 +137,6 @@ 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 diff --git a/R/tm_g_association.R b/R/tm_g_association.R index e50c951c3..730e42ce3 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -286,7 +286,6 @@ 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( diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index f5ec1fbf8..0ab97acd6 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -460,7 +460,6 @@ 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 diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index f4d93a898..4c91a0694 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -357,7 +357,6 @@ 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") diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 2699f60b2..b5a4ca393 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -314,7 +314,6 @@ 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) diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index c57007e72..937eabe85 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -495,7 +495,6 @@ 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( diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index 047d9a373..a33f22c51 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -267,7 +267,6 @@ 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( diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index a94d25ecb..07ce78068 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -170,7 +170,6 @@ 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())) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index c1334b39c..873c2c934 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -333,7 +333,6 @@ 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 diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 236932351..8ac3ff704 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -242,7 +242,6 @@ 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( diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 43803c317..e3470ef27 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -201,7 +201,6 @@ 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 From 2399cbde680e8e9a4f17bdf85d2dec31db16e0c2 Mon Sep 17 00:00:00 2001 From: m7pr Date: Mon, 13 May 2024 12:06:54 +0200 Subject: [PATCH 5/7] updated NEWS --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index 14e92477c..c8c00f0cf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ * Removed `Show Warnings` modals from modules. +### Enhancements +* Added `{logger}` functionality for logging changes in shiny inputs in all modules. `{logger}` was added to Imports. + # teal.modules.general 0.3.0 ### Enhancements From db0e840ec9590ab8e7e7888dcc7729198db32816 Mon Sep 17 00:00:00 2001 From: m7pr Date: Mon, 13 May 2024 12:07:21 +0200 Subject: [PATCH 6/7] change order of Config/Needs/verdepcheck --- DESCRIPTION | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d89d4236b..2641c4d2f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -81,7 +81,7 @@ VignetteBuilder: Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2, rstudio/shiny, insightsengineering/teal, insightsengineering/teal.transform, mllg/checkmate, tidyverse/dplyr, - rstudio/DT, tidyverse/forcats, r-lib/scales, daattali/shinyjs, + rstudio/DT, tidyverse/forcats, daroczig/logger, r-lib/scales, daattali/shinyjs, shinyTree/shinyTree, rstudio/shinyvalidate, dreamRs/shinyWidgets, tidyverse/stringr, insightsengineering/teal.code, insightsengineering/teal.data, insightsengineering/teal.logger, @@ -90,8 +90,7 @@ Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2, tidymodels/broom, daattali/colourpicker, daattali/ggExtra, aphalo/ggpmisc, aphalo/ggpp, slowkow/ggrepel, baddstats/goftest, gridExtra, ramnathv/htmlwidgets, jeroen/jsonlite, yihui/knitr, - deepayan/lattice, daroczig/logger, MASS, - insightsengineering/nestcolor, r-lib/rlang, + deepayan/lattice, MASS, insightsengineering/nestcolor, r-lib/rlang, insightsengineering/rtables, tidyverse/rvest, sparkline, rstudio/shinytest2, insightsengineering/teal.data, r-lib/testthat, r-lib/withr From 492601ec3db6883700649cfef0c6d5f453d1e088 Mon Sep 17 00:00:00 2001 From: m7pr Date: Wed, 15 May 2024 15:21:19 +0200 Subject: [PATCH 7/7] add shiny::isRunning before logger::log_shiny_input_changes --- NEWS.md | 2 +- R/tm_a_pca.R | 2 +- R/tm_a_regression.R | 2 +- R/tm_data_table.R | 2 +- R/tm_file_viewer.R | 2 +- R/tm_front_page.R | 2 +- R/tm_g_association.R | 2 +- R/tm_g_bivariate.R | 2 +- R/tm_g_distribution.R | 2 +- R/tm_g_response.R | 2 +- R/tm_g_scatterplot.R | 2 +- R/tm_g_scatterplotmatrix.R | 2 +- R/tm_missing_data.R | 2 +- R/tm_outliers.R | 2 +- R/tm_t_crosstable.R | 2 +- R/tm_variable_browser.R | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/NEWS.md b/NEWS.md index c8c00f0cf..a00bd650c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ * Removed `Show Warnings` modals from modules. ### Enhancements -* Added `{logger}` functionality for logging changes in shiny inputs in all modules. `{logger}` was added to Imports. +* Added `logger` functionality for logging changes in shiny inputs in all modules. `logger` was added to Imports. # teal.modules.general 0.3.0 diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index c305fea57..2c7f53045 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -297,7 +297,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl 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 (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") response <- dat diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index aaca4b34b..7ee905466 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -371,7 +371,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") ns <- session$ns diff --git a/R/tm_data_table.R b/R/tm_data_table.R index 297bd76a2..9ffb96207 100644 --- a/R/tm_data_table.R +++ b/R/tm_data_table.R @@ -182,7 +182,7 @@ 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 (shiny::isRunning()) 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 83117806c..48b755ad5 100644 --- a/R/tm_file_viewer.R +++ b/R/tm_file_viewer.R @@ -124,7 +124,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") temp_dir <- tempfile() if (!dir.exists(temp_dir)) { diff --git a/R/tm_front_page.R b/R/tm_front_page.R index e524d8cbc..250f46433 100644 --- a/R/tm_front_page.R +++ b/R/tm_front_page.R @@ -137,7 +137,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") ns <- session$ns diff --git a/R/tm_g_association.R b/R/tm_g_association.R index 3d68cb7b9..e9c6d7a19 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -285,7 +285,7 @@ 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") + if (shiny::isRunning()) 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), diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 81fe2e808..4c14af171 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -459,7 +459,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") ns <- session$ns diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index df656aa75..42f65f4ff 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -356,7 +356,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") setBookmarkExclude("params_reset") diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 14e2ef68c..9abe0c78f 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -313,7 +313,7 @@ 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") + if (shiny::isRunning()) 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) diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index a67ec2238..525d18f68 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -494,7 +494,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") data_extract <- list( x = x, diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index df21d2015..9b872d81e 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -266,7 +266,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list(variables = variables), diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 271abc897..baa7f257f 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -170,7 +170,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") datanames <- isolate(teal.data::datanames(data())) datanames <- Filter(function(name) { diff --git a/R/tm_outliers.R b/R/tm_outliers.R index 272ad6d66..c7c1f8440 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -332,7 +332,7 @@ 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") + if (shiny::isRunning()) logger::log_shiny_input_changes(input, namespace = "teal.modules.general") ns <- session$ns diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 74bbd0e4b..7e91da5fb 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -241,7 +241,7 @@ 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") + if (shiny::isRunning()) 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), diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index e3470ef27..233616d43 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -201,7 +201,7 @@ 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 (shiny::isRunning()) 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