From 5b0d7e79ba181fb33670385e9837f2dbd9d13fb4 Mon Sep 17 00:00:00 2001 From: Marcin <133694481+m7pr@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:42:07 +0200 Subject: [PATCH] 317 log shiny input changes (#318) Closes #317 --- DESCRIPTION | 2 +- NEWS.md | 1 + R/tm_g_gh_boxplot.R | 1 + R/tm_g_gh_correlationplot.R | 1 + R/tm_g_gh_density_distribution_plot.R | 1 + R/tm_g_gh_lineplot.R | 1 + R/tm_g_gh_scatterplot.R | 1 + R/tm_g_gh_spaghettiplot.R | 1 + 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5f3181f9..5cba83d6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -48,7 +48,7 @@ Imports: shinyvalidate, stats, teal.code (>= 0.5.0), - teal.logger (>= 0.2.0), + teal.logger (>= 0.2.0.9011), teal.reporter (>= 0.2.0), teal.widgets (>= 0.4.0) Suggests: diff --git a/NEWS.md b/NEWS.md index 7266c410..31a5dc68 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ ### Enhancements * Updated the documentation and vignettes to demonstrate method to pass `teal_data` object to `teal::init()`. * Removed `Show Warnings` modals from modules. +* Added `teal.logger` functionality for logging changes in shiny inputs in all modules. ### Miscellaneous * Specified minimal version of package dependencies. diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index 9ba8989a..4f262c13 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -309,6 +309,7 @@ srv_g_boxplot <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + teal.logger::log_shiny_input_changes(input, namespace = "teal.goshawk") output$axis_selections <- renderUI({ env <- shiny::isolate(as.list(data()@env)) resolved_x <- teal.transform::resolve_delayed(module_args$xaxis_var, env) diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index a352ec01..f26a282b 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -374,6 +374,7 @@ srv_g_correlationplot <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + teal.logger::log_shiny_input_changes(input, namespace = "teal.goshawk") output$axis_selections <- renderUI({ env <- shiny::isolate(as.list(data()@env)) resolved_x_param <- teal.transform::resolve_delayed(module_args$xaxis_param, env) diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index b37b6277..3d3a2f85 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -260,6 +260,7 @@ srv_g_density_distribution_plot <- function(id, # nolint checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + teal.logger::log_shiny_input_changes(input, namespace = "teal.goshawk") output$axis_selections <- renderUI({ env <- shiny::isolate(as.list(data()@env)) resolved_x <- teal.transform::resolve_delayed(module_args$xaxis_var, env) diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index 7d6924ce..516c13fd 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -348,6 +348,7 @@ srv_lineplot <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + teal.logger::log_shiny_input_changes(input, namespace = "teal.goshawk") ns <- session$ns output$axis_selections <- renderUI({ diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index 636a77cd..916876b3 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -259,6 +259,7 @@ srv_g_scatterplot <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + teal.logger::log_shiny_input_changes(input, namespace = "teal.goshawk") output$axis_selections <- renderUI({ env <- shiny::isolate(as.list(data()@env)) resolved_x <- teal.transform::resolve_delayed(module_args$xaxis_var, env) diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 3a3ce894..3077d655 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -368,6 +368,7 @@ srv_g_spaghettiplot <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { + teal.logger::log_shiny_input_changes(input, namespace = "teal.goshawk") output$axis_selections <- renderUI({ env <- shiny::isolate(as.list(data()@env)) resolved_x <- teal.transform::resolve_delayed(module_args$xaxis_var, env)