diff --git a/R/init.R b/R/init.R index a2c1fac786..72a61380d4 100644 --- a/R/init.R +++ b/R/init.R @@ -103,16 +103,6 @@ init <- function(data, # argument checking (independent) ## `data` - if (inherits(data, "TealData")) { - lifecycle::deprecate_stop( - when = "0.15.0", - what = "init(data)", - paste( - "TealData is no longer supported. Use teal_data() instead.", - "Please follow migration instructions https://github.com/insightsengineering/teal/discussions/988." - ) - ) - } checkmate::assert_multi_class(data, c("teal_data", "teal_data_module")) checkmate::assert_class(landing_popup, "teal_module_landing", null.ok = TRUE) diff --git a/R/modules.R b/R/modules.R index a021187e61..f6d5bfcbe1 100644 --- a/R/modules.R +++ b/R/modules.R @@ -196,6 +196,7 @@ module <- function(label = "module", "\n - `...` server_args elements will be passed to the module named argument or to the `...`" ) } + if ("datasets" %in% server_formals) { warning( sprintf("Called from module(label = \"%s\", ...)\n ", label), @@ -205,7 +206,6 @@ module <- function(label = "module", ) } - ## UI checkmate::assert_function(ui) ui_formals <- names(formals(ui)) @@ -217,6 +217,7 @@ module <- function(label = "module", "\n - `...` ui_args elements will be passed to the module argument of the same name or to the `...`" ) } + if (any(c("data", "datasets") %in% ui_formals)) { stop( sprintf("Called from module(label = \"%s\", ...)\n ", label), @@ -226,7 +227,6 @@ module <- function(label = "module", ) } - ## `filters` if (!missing(filters)) { datanames <- filters diff --git a/man/teal_data_module.Rd b/man/teal_data_module.Rd index 9c3cbd29f9..9765ce4504 100644 --- a/man/teal_data_module.Rd +++ b/man/teal_data_module.Rd @@ -35,7 +35,9 @@ App user will be able to interact and change the data output from the module mul \item{object}{(\code{teal_data_module})} -\item{code}{(\code{character} or \code{language}) code to evaluate. If \code{character}, comments are retained.} +\item{code}{(\code{character}, \code{language} or \code{expression}) code to evaluate. +It is possible to preserve original formatting of the \code{code} by providing a \code{character} or an +\code{expression} being a result of \code{parse(keep.source = TRUE)}.} \item{data}{(\code{teal_data_module}) object} diff --git a/tests/testthat/test-modules.R b/tests/testthat/test-modules.R index b1658af98c..65295a363d 100644 --- a/tests/testthat/test-modules.R +++ b/tests/testthat/test-modules.R @@ -31,7 +31,6 @@ testthat::test_that("module warns when server contains datasets argument", { ) }) - testthat::test_that("module expects server being a shiny server module with any argument", { testthat::expect_no_error(module(server = function(id) NULL))