From 17fb575a6e4316f0a3294aa07bb51e1a598ea502 Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Thu, 24 Aug 2023 11:37:38 +0200 Subject: [PATCH] don't throw validation messages unnecessarily (#901) During rendering TLG-Catalog I noticed that each shiny app throws a message about `data` argument in the reporter previewer module. This fix aim to silent unnecessary messages https://github.com/insightsengineering/tlg-catalog/actions/runs/5888144351/job/15968763355 --- NEWS.md | 4 ++++ R/modules.R | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index c908a92df3..dbb288fa72 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # teal 0.14.0.9003 +### Miscellaneous + +* Enhance a `module` validation checks so that it won't throw messages about `data` argument unnecessarily. + # teal 0.14.0 ### New features diff --git a/R/modules.R b/R/modules.R index a80ac984c8..d5d7ce016b 100644 --- a/R/modules.R +++ b/R/modules.R @@ -232,7 +232,7 @@ module <- function(label = "module", ) } - if (!is.element("data", server_formals)) { + if (!is.element("data", server_formals) && !is.null(datanames)) { message(sprintf("module \"%s\" server function takes no data so \"datanames\" will be ignored", label)) datanames <- NULL }