Skip to content

Commit

Permalink
Drop server_wrapper_function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-ebs-ext committed Dec 2, 2024
1 parent ddce7a6 commit c1e2ad6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 29 deletions.
6 changes: 1 addition & 5 deletions R/check_call_auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

# dv.tables::mod_hierarchical_count_table
check_mod_hierarchical_count_table_auto <- function(afmm, datasets, module_id, table_dataset_name, pop_dataset_name,
subjid_var, show_modal_on_click, default_hierarchy, default_group, receiver_id, server_wrapper_func,
warn, err) {
subjid_var, show_modal_on_click, default_hierarchy, default_group, receiver_id, warn, err) {
OK <- logical(0)
used_dataset_names <- new.env(parent = emptyenv())
OK[["module_id"]] <- CM$check_module_id("module_id", module_id, warn, err)
Expand All @@ -28,9 +27,6 @@ check_mod_hierarchical_count_table_auto <- function(afmm, datasets, module_id, t
OK[["default_group"]] <- OK[["pop_dataset_name"]] && CM$check_dataset_colum_name("default_group",
default_group, subkind, flags, pop_dataset_name, datasets[[pop_dataset_name]], warn, err)
"TODO: receiver_id (character)"
flags <- list(optional = TRUE)
OK[["server_wrapper_func"]] <- CM$check_function("server_wrapper_func", server_wrapper_func, 1, flags,
warn, err)
for (ds_name in names(used_dataset_names)) {
OK[["subjid_var"]] <- OK[["subjid_var"]] && CM$check_subjid_col(datasets, ds_name, get(ds_name),
"subjid_var", subjid_var, warn, err)
Expand Down
34 changes: 12 additions & 22 deletions R/mod_hierarchical_count_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,6 @@ hierarchical_count_table_server <- function(
#' **This functionality is not ready yet** please
#' open an issue or contact the developers if you are interested in using it.
#'
# @param server_wrapper_func `[function()]`
#
# A function that will be applied to the server
#'
#'
#' @keywords main
#'
#' @export
Expand All @@ -616,8 +611,7 @@ mod_hierarchical_count_table <- function(module_id,
show_modal_on_click = FALSE,
default_hierarchy = NULL,
default_group = NULL,
receiver_id = NULL,
server_wrapper_func = identity) {
receiver_id = NULL) {
mod <- list(
ui = hierarchical_count_table_ui,
server = function(afmm) {
Expand All @@ -629,15 +623,13 @@ mod_hierarchical_count_table <- function(module_id,
}
}

server_wrapper_func(
hierarchical_count_table_server(
id = module_id,
table_dataset = shiny::reactive(afmm[["filtered_dataset"]]()[[table_dataset_name]]),
pop_dataset = shiny::reactive(afmm[["filtered_dataset"]]()[[pop_dataset_name]]),
subjid_var = subjid_var,
show_modal_on_click = show_modal_on_click,
default_hierarchy = default_hierarchy, default_group = default_group
)
hierarchical_count_table_server(
id = module_id,
table_dataset = shiny::reactive(afmm[["filtered_dataset"]]()[[table_dataset_name]]),
pop_dataset = shiny::reactive(afmm[["filtered_dataset"]]()[[pop_dataset_name]]),
subjid_var = subjid_var,
show_modal_on_click = show_modal_on_click,
default_hierarchy = default_hierarchy, default_group = default_group
)
},
module_id = module_id
Expand All @@ -656,8 +648,7 @@ mod_hierarchical_count_table_API_docs <- list(
show_modal_on_click = "",
default_hierarchy = "",
default_group = "",
receiver_id = "",
server_wrapper_func = ""
receiver_id = ""
)

mod_hierarchical_count_table_API_spec <- TC$group(
Expand All @@ -668,14 +659,13 @@ mod_hierarchical_count_table_API_spec <- TC$group(
show_modal_on_click = TC$logical(),
default_hierarchy = TC$col("table_dataset_name", TC$or(TC$character(), TC$factor())) |> TC$flag("zero_or_more"),
default_group = TC$col("pop_dataset_name", TC$or(TC$character(), TC$factor())) |> TC$flag("optional"),
receiver_id = TC$character() |> TC$flag("optional"),
server_wrapper_func = TC$fn(arg_count = 1) |> TC$flag("optional")
receiver_id = TC$character() |> TC$flag("optional")
) |> TC$attach_docs(mod_hierarchical_count_table_API_docs)


check_mod_hierarchical_count_table <- function(
afmm, datasets, module_id, table_dataset_name, pop_dataset_name, subjid_var, show_modal_on_click,
default_hierarchy, default_group, receiver_id, server_wrapper_func) {
default_hierarchy, default_group, receiver_id) {
warn <- CM$container()
err <- CM$container()

Expand All @@ -685,7 +675,7 @@ check_mod_hierarchical_count_table <- function(
OK <- check_mod_hierarchical_count_table_auto( # nolint unused
afmm, datasets,
module_id, table_dataset_name, pop_dataset_name, subjid_var, show_modal_on_click,
default_hierarchy, default_group, receiver_id, server_wrapper_func,
default_hierarchy, default_group, receiver_id,
warn, err
)

Expand Down
3 changes: 1 addition & 2 deletions man/mod_hierarchical_count_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c1e2ad6

Please sign in to comment.