From c1e2ad6e2484ca0525f91b464f1ede2504359bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zxBIB=20Lech=C3=B3n=2CMiguel=20=28MED=20BDS=29=20EXTERNAL?= Date: Mon, 2 Dec 2024 15:11:28 +0100 Subject: [PATCH] Drop server_wrapper_function. --- R/check_call_auto.R | 6 +---- R/mod_hierarchical_count_table.R | 34 ++++++++++------------------- man/mod_hierarchical_count_table.Rd | 3 +-- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/R/check_call_auto.R b/R/check_call_auto.R index d6ccd2d..97b6311 100644 --- a/R/check_call_auto.R +++ b/R/check_call_auto.R @@ -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) @@ -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) diff --git a/R/mod_hierarchical_count_table.R b/R/mod_hierarchical_count_table.R index 44914ad..0739a57 100644 --- a/R/mod_hierarchical_count_table.R +++ b/R/mod_hierarchical_count_table.R @@ -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 @@ -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) { @@ -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 @@ -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( @@ -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() @@ -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 ) diff --git a/man/mod_hierarchical_count_table.Rd b/man/mod_hierarchical_count_table.Rd index d7f7f4b..eef89ae 100644 --- a/man/mod_hierarchical_count_table.Rd +++ b/man/mod_hierarchical_count_table.Rd @@ -26,8 +26,7 @@ mod_hierarchical_count_table( show_modal_on_click = FALSE, default_hierarchy = NULL, default_group = NULL, - receiver_id = NULL, - server_wrapper_func = identity + receiver_id = NULL ) } \arguments{