Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Dec 10, 2024
1 parent c57d6de commit 0d776a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ srv_teal_module.teal_module <- function(id,

.resolve_module_datanames <- function(data, modules) {
stopifnot("data_rv must be teal_data object." = inherits(data, "teal_data"))
if (is.null(modules$datanames) || identical(modules$datanames, "all")) {
names(data)
if (is.null(modules$datanames) || setequal(modules$datanames, "all")) {
setdiff(names(data), attr(modules$datanames, "excluded"))
} else {
intersect(
names(data), # Keep topological order from teal.data::names()
Expand Down
8 changes: 7 additions & 1 deletion R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,13 @@ set_datanames <- function(modules, datanames) {
modules$children <- lapply(modules$children, set_datanames, datanames)
} else {
if (identical(modules$datanames, "all")) {
modules$datanames <- datanames
included <- grep("^[^-]", datanames, value = TRUE)
if (length(included)) {
modules$datanames <- included
} else {
excluded <- gsub("^-", "", grep("^-", datanames, value = TRUE))
attr(modules$datanames, "excluded") <- excluded
}
} else {
warning(
"Not possible to modify datanames of the module ", modules$label,
Expand Down

0 comments on commit 0d776a4

Please sign in to comment.