Skip to content

Commit

Permalink
Revert from warning to stop for ui formals as requested.
Browse files Browse the repository at this point in the history
  • Loading branch information
llrs-roche committed Nov 15, 2024
1 parent 6555991 commit 2d1080a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ module <- function(label = "module",
}

if (any(c("data", "datasets") %in% ui_formals)) {
warning(
stop(
sprintf("Called from module(label = \"%s\", ...)\n ", label),
"UI with `data` or `datasets` argument is no longer accepted.\n ",
"If some UI inputs depend on data, please move the logic to your server instead.\n ",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-module_teal.R
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,9 @@ testthat::describe("srv_teal teal_modules", {
app = srv_teal,
args = list(
id = "test",
dataset = teal.data::teal_data(iris = iris, mtcars = mtcars),
data = teal.data::teal_data(iris = iris, mtcars = mtcars),
modules = modules(
module("module_1", server = function(id, data) data)
module("module_1", server = function(id, datasets) datasets)
)
),
expr = {
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ testthat::test_that("module requires ui_args argument to be a list", {
})

testthat::test_that("module throws when ui has data or datasets argument", {
testthat::expect_warning(module(ui = function(id, data) NULL))
testthat::expect_warning(module(ui = function(id, datasets) NULL))
testthat::expect_error(module(ui = function(id, data) NULL))
testthat::expect_error(module(ui = function(id, datasets) NULL))
})

testthat::test_that("module expects ui being a shiny ui module with any argument", {
Expand Down

0 comments on commit 2d1080a

Please sign in to comment.