diff --git a/R/module_teal.R b/R/module_teal.R index 3dc31400e3..8624636dd2 100644 --- a/R/module_teal.R +++ b/R/module_teal.R @@ -25,7 +25,7 @@ #' ## Fallback on failure #' #' `teal` is designed in such way that app will never crash if the error is introduced in any -#' custom module provided by app developer (e.g. [teal_data_module()], [teal_transform_module()]). +#' custom `shiny` module provided by app developer (e.g. [teal_data_module()], [teal_transform_module()]). #' If any module returns a failing object, the app will halt the evaluation and display a warning message. #' App user should always have a chance to fix the improper input and continue without restarting the session. #' @@ -245,8 +245,7 @@ srv_teal <- function(id, data, modules, filter = teal_slices()) { observeEvent(data_rv(), once = TRUE, { logger::log_debug("srv_teal@2 removing data tab.") # when once = TRUE we pull data once and then remove data tab - removeUI(selector = sprintf("#%s a[data-value='teal_data_module']", session$ns("teal_modules-wrapper"))) - updateTabsetPanel(inputId = "teal_modules-active_tab", selected = names(modules$children)[1]) + removeTab("teal_modules-active_tab", target = "teal_data_module") }) } } else { diff --git a/R/module_teal_data.R b/R/module_teal_data.R index ee58c5cbc8..899ef14028 100644 --- a/R/module_teal_data.R +++ b/R/module_teal_data.R @@ -25,9 +25,9 @@ #' @param data_module (`teal_data_module`) #' @param modules (`teal_modules` or `teal_module`) For `datanames` validation purpose #' @param validate_shiny_silent_error (`logical`) If `TRUE`, then `shiny.silent.error` is validated and -#' @param is_transformer_failed (`reactiveValues`) that hosts `logical` flags of which transformers failed -#' error message is displayed. -#' Default is `FALSE` to handle empty reactive cycle on `init`. +#' @param is_transformer_failed (`reactiveValues`) contains `logical` flags named after each transformer. +#' Help to determine if any previous transformer failed, so that following transformers can be disabled +#' and display a generic failure message. #' #' @return `reactive` `teal_data` #' @@ -244,7 +244,6 @@ srv_check_shiny_warnings <- function(id, data, modules) { if (!identical(data(), out())) { out(data()) } - } else { } }) diff --git a/man/module_teal.Rd b/man/module_teal.Rd index 3f2391345f..f2bc5d95b5 100644 --- a/man/module_teal.Rd +++ b/man/module_teal.Rd @@ -73,7 +73,7 @@ performed: \subsection{Fallback on failure}{ \code{teal} is designed in such way that app will never crash if the error is introduced in any -custom module provided by app developer (e.g. \code{\link[=teal_data_module]{teal_data_module()}}, \code{\link[=teal_transform_module]{teal_transform_module()}}). +custom \code{shiny} module provided by app developer (e.g. \code{\link[=teal_data_module]{teal_data_module()}}, \code{\link[=teal_transform_module]{teal_transform_module()}}). If any module returns a failing object, the app will halt the evaluation and display a warning message. App user should always have a chance to fix the improper input and continue without restarting the session. } diff --git a/man/module_teal_data.Rd b/man/module_teal_data.Rd index 51e3ebff8a..dee0b1087e 100644 --- a/man/module_teal_data.Rd +++ b/man/module_teal_data.Rd @@ -37,9 +37,9 @@ srv_validate_reactive_teal_data( \item{validate_shiny_silent_error}{(\code{logical}) If \code{TRUE}, then \code{shiny.silent.error} is validated and} -\item{is_transformer_failed}{(\code{reactiveValues}) that hosts \code{logical} flags of which transformers failed -error message is displayed. -Default is \code{FALSE} to handle empty reactive cycle on \code{init}.} +\item{is_transformer_failed}{(\code{reactiveValues}) contains \code{logical} flags named after each transformer. +Help to determine if any previous transformer failed, so that following transformers can be disabled +and display a generic failure message.} \item{data}{(\verb{reactive teal_data})} } diff --git a/man/module_transform_data.Rd b/man/module_transform_data.Rd index 7bad5825ca..2a4a351062 100644 --- a/man/module_transform_data.Rd +++ b/man/module_transform_data.Rd @@ -23,9 +23,9 @@ srv_transform_data( \item{modules}{(\code{teal_modules} or \code{teal_module}) For \code{datanames} validation purpose} -\item{is_transformer_failed}{(\code{reactiveValues}) that hosts \code{logical} flags of which transformers failed -error message is displayed. -Default is \code{FALSE} to handle empty reactive cycle on \code{init}.} +\item{is_transformer_failed}{(\code{reactiveValues}) contains \code{logical} flags named after each transformer. +Help to determine if any previous transformer failed, so that following transformers can be disabled +and display a generic failure message.} } \value{ \code{reactive} \code{teal_data} diff --git a/tests/testthat/test-shinytest2-teal_data_module.R b/tests/testthat/test-shinytest2-teal_data_module.R index ec5ea92ecb..7ba75f4788 100644 --- a/tests/testthat/test-shinytest2-teal_data_module.R +++ b/tests/testthat/test-shinytest2-teal_data_module.R @@ -164,7 +164,7 @@ testthat::test_that("e2e: teal_data_module gets removed after successful data lo app$get_html('#teal-teal_modules-active_tab a[data-value="teal_data_module"]') ) - testthat::expect_false( + testthat::expect_null( app$is_visible(sprintf("#%s", submit)) )