From ba1451545b0343f7dfe62c8ce31bce61cd351228 Mon Sep 17 00:00:00 2001 From: Vedha Viyash <49812166+vedhav@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:26:42 +0530 Subject: [PATCH] Pass the check status to the main teal_data function call (#1070) Part of #1069 Please make sure that you also use the `teal.data` branch `1069-fix-code-warnings-when-data-is-verified@main` for testing the example from the issue. --------- Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com> --- DESCRIPTION | 2 +- R/module_nested_tabs.R | 8 +++++++- R/utils.R | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 70b576b913..ce3ba6295a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -76,7 +76,7 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.0 +RoxygenNote: 7.3.1 Collate: 'dummy_functions.R' 'get_rcode_utils.R' diff --git a/R/module_nested_tabs.R b/R/module_nested_tabs.R index 73afb01be8..dc84f86c75 100644 --- a/R/module_nested_tabs.R +++ b/R/module_nested_tabs.R @@ -23,6 +23,7 @@ #' @param is_module_specific (`logical(1)`)\cr #' flag determining if the filter panel is global or module-specific. #' When set to `TRUE`, a filter panel is called inside of each module tab. +#' #' @return depending on class of `modules`, `ui_nested_tabs` returns: #' - `teal_module`: instantiated UI of the module #' - `teal_modules`: `tabsetPanel` with each tab corresponding to recursively @@ -267,6 +268,7 @@ srv_nested_tabs.teal_module <- function(id, datasets, modules, is_module_specifi #' #' @param module (`teal_module`) module where needed filters are taken from #' @param datasets (`FilteredData`) object where needed data are taken from +#' #' @return A `teal_data` object. #' #' @keywords internal @@ -291,10 +293,14 @@ srv_nested_tabs.teal_module <- function(id, datasets, modules, is_module_specifi get_datasets_code(datanames, datasets, hashes) ) - do.call( + + data <- do.call( teal.data::teal_data, args = c(data, code = list(code), join_keys = list(datasets$get_join_keys()[datanames])) ) + + data@verified <- attr(datasets, "verification_status") + return(data) } #' Get the hash of a dataset diff --git a/R/utils.R b/R/utils.R index 99ba006535..63434747c7 100644 --- a/R/utils.R +++ b/R/utils.R @@ -66,6 +66,7 @@ teal_data_to_filtered_data <- function(x, datanames = teal_data_datanames(x)) { ) # Piggy-back entire pre-processing code so that filtering code can be appended later. attr(ans, "preprocessing_code") <- teal.code::get_code(x) + attr(ans, "verification_status") <- x@verified ans }