Skip to content

Commit 5143912

Browse files
authored
Merge branch 'main' into 211_subset@main
Signed-off-by: Marcin <[email protected]>
2 parents e27dad6 + 3e4499e commit 5143912

28 files changed

+74
-97
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ repos:
3737
- insightsengineering/teal.slice
3838
- insightsengineering/teal.widgets
3939
- utils
40+
- shinytest2 # Necessary for documentation
41+
- shinyvalidate # Necessary for documentation
42+
- rvest # Necessary for documentation
4043
- id: spell-check
4144
name: Check spelling with `spelling`
4245
exclude: >

DESCRIPTION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: teal
33
Title: Exploratory Web Apps for Analyzing Clinical Trials Data
4-
Version: 0.15.2.9081
5-
Date: 2024-11-07
4+
Version: 0.15.2.9082
5+
Date: 2024-11-08
66
Authors@R: c(
77
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre"),
88
comment = c(ORCID = "0000-0001-9533-457X")),
@@ -37,7 +37,7 @@ BugReports: https://github.com/insightsengineering/teal/issues
3737
Depends:
3838
R (>= 4.0),
3939
shiny (>= 1.8.1),
40-
teal.data (>= 0.6.0.9014),
40+
teal.data (>= 0.6.0.9015),
4141
teal.slice (>= 0.5.1.9009)
4242
Imports:
4343
checkmate (>= 2.1.0),
@@ -49,7 +49,7 @@ Imports:
4949
rlang (>= 1.0.0),
5050
shinyjs,
5151
stats,
52-
teal.code (>= 0.5.0.9011),
52+
teal.code (>= 0.5.0.9012),
5353
teal.logger (>= 0.2.0),
5454
teal.reporter (>= 0.3.1.9004),
5555
teal.widgets (>= 0.4.0),

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# teal 0.15.2.9081
1+
# teal 0.15.2.9082
22

33
### New features
44

R/dummy_functions.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ example_module <- function(label = "example teal module", datanames = "all", tra
2020
server = function(id, data) {
2121
checkmate::assert_class(isolate(data()), "teal_data")
2222
moduleServer(id, function(input, output, session) {
23-
datanames_rv <- reactive(ls(teal.code::get_env((req(data())))))
23+
datanames_rv <- reactive(names(req(data())))
2424
observeEvent(datanames_rv(), {
2525
selected <- input$dataname
2626
if (identical(selected, "")) {

R/init.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,16 @@ init <- function(data,
207207

208208
## `data` - `modules`
209209
if (inherits(data, "teal_data")) {
210-
if (length(ls(teal.code::get_env(data))) == 0) {
210+
if (length(data) == 0) {
211211
stop("The environment of `data` is empty.")
212212
}
213213

214-
is_modules_ok <- check_modules_datanames(modules, ls(teal.code::get_env(data)))
214+
is_modules_ok <- check_modules_datanames(modules, names(data))
215215
if (!isTRUE(is_modules_ok) && length(unlist(extract_transformers(modules))) == 0) {
216216
warning(is_modules_ok, call. = FALSE)
217217
}
218218

219-
is_filter_ok <- check_filter_datanames(filter, ls(teal.code::get_env(data)))
219+
is_filter_ok <- check_filter_datanames(filter, names(data))
220220
if (!isTRUE(is_filter_ok)) {
221221
warning(is_filter_ok)
222222
# we allow app to continue if applied filters are outside

R/module_data_summary.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ srv_data_summary <- function(id, teal_data) {
6464

6565
summary_table <- reactive({
6666
req(inherits(teal_data(), "teal_data"))
67-
if (!length(ls(teal.code::get_env(teal_data())))) {
67+
if (!length(teal_data())) {
6868
return(NULL)
6969
}
7070
get_filter_overview_wrapper(teal_data)
@@ -142,7 +142,8 @@ srv_data_summary <- function(id, teal_data) {
142142

143143
#' @rdname module_data_summary
144144
get_filter_overview_wrapper <- function(teal_data) {
145-
datanames <- teal.data::datanames(teal_data())
145+
# Sort datanames in topological order
146+
datanames <- names(teal_data())
146147
joinkeys <- teal.data::join_keys(teal_data())
147148

148149
current_data_objs <- sapply(

R/module_init_data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ srv_init_data <- function(id, data) {
101101
list(code = trimws(c(teal.code::get_code(data), hashes), which = "right")),
102102
list(join_keys = teal.data::join_keys(data)),
103103
sapply(
104-
ls(teal.code::get_env(data)),
104+
names(data),
105105
teal.code::get_var,
106106
object = data,
107107
simplify = FALSE
@@ -121,7 +121,7 @@ srv_init_data <- function(id, data) {
121121
#' @return A character vector with the code lines.
122122
#' @keywords internal
123123
#'
124-
.get_hashes_code <- function(data, datanames = ls(teal.code::get_env(data))) {
124+
.get_hashes_code <- function(data, datanames = names(data)) {
125125
vapply(
126126
datanames,
127127
function(dataname, datasets) {

R/module_nested_tabs.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,11 @@ srv_teal_module.teal_module <- function(id,
364364
.resolve_module_datanames <- function(data, modules) {
365365
stopifnot("data_rv must be teal_data object." = inherits(data, "teal_data"))
366366
if (is.null(modules$datanames) || identical(modules$datanames, "all")) {
367-
.topologically_sort_datanames(ls(teal.code::get_env(data)), teal.data::join_keys(data))
367+
names(data)
368368
} else {
369369
intersect(
370-
.include_parent_datanames(modules$datanames, teal.data::join_keys(data)),
371-
ls(teal.code::get_env(data))
370+
names(data), # Keep topological order from teal.data::names()
371+
.include_parent_datanames(modules$datanames, teal.data::join_keys(data))
372372
)
373373
}
374374
}

R/module_teal.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ srv_teal <- function(id, data, modules, filter = teal_slices()) {
195195
)
196196
data_rv <- reactive({
197197
req(inherits(data_validated(), "teal_data"))
198-
is_filter_ok <- check_filter_datanames(filter, ls(teal.code::get_env(data_validated())))
198+
is_filter_ok <- check_filter_datanames(filter, names(data_validated()))
199199
if (!isTRUE(is_filter_ok)) {
200200
showNotification(
201201
"Some filters were not applied because of incompatibility with data. Contact app developer.",

R/module_teal_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ srv_check_shiny_warnings <- function(id, data, modules) {
223223
output$message <- renderUI({
224224
if (inherits(data(), "teal_data")) {
225225
is_modules_ok <- check_modules_datanames_html(
226-
modules = modules, datanames = ls(teal.code::get_env(data()))
226+
modules = modules, datanames = names(data())
227227
)
228228
if (!isTRUE(is_modules_ok)) {
229229
tags$div(is_modules_ok, class = "teal-output-warning")

0 commit comments

Comments
 (0)