Skip to content

Commit

Permalink
1305 allow delayed data to pass in cs_to_des_select (#1306)
Browse files Browse the repository at this point in the history
FIxes #1305 

Tested under current CRAN release and development versions:
```
> packageVersion("teal.transform")
[1] '0.5.0.9018'
> packageVersion("teal.modules.clinical")
[1] '0.9.1.9042'
```

---------

Signed-off-by: Joe Zhu <sha.joe.zhu@gmail.com>
Co-authored-by: Joe Zhu <sha.joe.zhu@gmail.com>
  • Loading branch information
chlebowa and shajoezhu authored Dec 19, 2024
1 parent 85884b2 commit 9fe4999
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@
* Began deprecation cycle for the `show_labels` argument of `template_summary` which has no effect on the `tm_t_summary` module.
* Replaced instances of deprecated `strata` argument to `tern::control_lineplot_vars()` with `group_var`.

### Bug fixes
* Fixed bug in creating modules with `delayed_data` and `teal.transform::all_choices`.

# teal.modules.clinical 0.9.1

### Enhancements
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -300,8 +300,8 @@ cs_to_des_select <- function(cs, dataname, multiple = FALSE, ordered = FALSE, la
checkmate::check_class(cs, classes = "choices_selected"),
.var.name = cs_name
)
if (!multiple && length(cs$selected) != 1 && !is.null(cs$selected)) {
stop(cs_name, "must only have 1 selected value")
if (!inherits(cs$selected, "delayed_data") && !multiple && length(cs$selected) != 1 && !is.null(cs$selected)) {
stop(cs_name, " must only have 1 selected value")
}

if (inherits(cs, "choices_selected")) {

0 comments on commit 9fe4999

Please sign in to comment.