Repository navigation
654 pass reactive data@main - #674
Conversation
nikolas-burkoff
left a comment
There was a problem hiding this comment.
A couple of comments from me
| args <- c(args, datasets = datasets) | ||
| } | ||
|
|
||
| is_data_used <- isTRUE("data" %in% names(formals(modules$server))) |
There was a problem hiding this comment.
is_reporter_used works on module and modules objects (it's an S3 method) we should probably rename is_reporter_used to is_module_arg_used and pass in "reporter", "dataset", "id" etc. so we get consistent behaviour here?
There was a problem hiding this comment.
we will need is_module_ui_arg_used and is_module_srv_arg_used to cover all scenarios. Or add an argument is_module_arg_used(..., type = "srv" or "ui").
|
@nikolas-burkoff @Polkas @mhallal1 @kpagacz # 1. use expr, join_keys argument
srv_custom <- function(data = list(...), expr = <expr>, join_keys = <join_keys>, ....)
# 2. use attributes
srv_custom <- function(data = structure(list(...), expr = <expr>, join_keys = <join_keys>, ...)
# 3. use nested list
srv_custom <- function(data = list(data = list(....), expr = <expr>, join_keys = <join keys>, ...)Together with @pawelru we think that nested list (3) is to "complicated" to put reactive data into
Please let me know what is your opinion about this. |
Code Coverage SummaryResults for commit: 54545cf Minimum allowed coverage is ♻️ This comment has been updated with latest results |
nikolas-burkoff
left a comment
There was a problem hiding this comment.
A few comments from me
| #' @keywords internal | ||
| ui_nested_tabs.teal_module <- function(id, modules, datasets, depth = 0L) { | ||
| stopifnot(is(datasets, "FilteredData")) | ||
| checkmate::check_class(datasets, "FilteredData") |
There was a problem hiding this comment.
can we move this check into the if-statement in line 95 to avoid checking for it when not needed.
is checkmate::assert_class needed for a more strict check?
There was a problem hiding this comment.
ui_nested_tabs needs FilteredData and FilteredData will still be delivered here for a long time in the same shape. nested_tabs is the place where convertion from FIlteredData -> data happens.
Also, nested_tabs is not exported also which means that we don't have to simplify api for this one.
There was a problem hiding this comment.
ui_nested_tabs needs FilteredData and FilteredData will still be delivered here for a long time in the same shape. nested_tabs is the place where convertion from FIlteredData -> data happens.
Also, nested_tabs is not exported also which means that we don't have to simplify api for this one.
mhallal1
left a comment
There was a problem hiding this comment.
passing data and datasets to the same module seems to be possible also, is this by design?
| if (exists("progress")) { | ||
| progress$set(message = "Getting R Code", value = 1) | ||
| progress$close() | ||
| str_filter <- teal.slice::get_filter_expr(datasets, datanames) |
nikolas-burkoff
left a comment
There was a problem hiding this comment.
This looks good to me, a few minor comments. I'll let @mhallal1 approve as he's been much closer to this than me
closes #654
dataargument. I'm passing the list with attributes as I think it's easier thanlist(data = list(ADSL = reactive(), ...), attributes = list(expr = reactive(), ...))..... We can ease this requirement because some modules might not need datasets at all. inui_nested_tabsandsrv_nested_tabswe usedo.callwhich passargsby their name (doesn't care about order)I found some inconsistency. For example:
Sample app
Sample app with lightweight reproducible object