From 4622e7173e3f0002422444b86981477d8ce71246 Mon Sep 17 00:00:00 2001 From: leopoldguyot Date: Fri, 5 Apr 2024 15:18:14 +0200 Subject: [PATCH] [FIX] - fixed dynamic content that do not update when removed (filter box and workflow steps) --- R/server_module_features_filtering_tab.R | 8 ++------ R/server_module_samples_filtering_tab.R | 7 ++----- R/server_module_workflow_config.R | 5 ++++- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/R/server_module_features_filtering_tab.R b/R/server_module_features_filtering_tab.R index d75debd..0ab5b61 100644 --- a/R/server_module_features_filtering_tab.R +++ b/R/server_module_features_filtering_tab.R @@ -19,10 +19,6 @@ server_module_features_filtering_tab <- function(id, step_number) { ) }) - observe({ - print(assays_to_process()) - }) - server_module_qc_metrics("psm_pre", assays_to_process) n_boxes <- reactiveVal(0) @@ -128,8 +124,8 @@ server_module_features_filtering_tab <- function(id, step_number) { reactiveValuesToList(filtering_conditions) }) entire_condition <- reactive({ - res <- lapply(filtering_conditions_list(), function(condition) { - condition + res <- lapply(seq_len(n_boxes()), function(index) { + paste0("qfeatures$", filtering_conditions_list()[[index]]) }) res <- unlist(res) if (length(filtering_conditions_list()) > 0) { diff --git a/R/server_module_samples_filtering_tab.R b/R/server_module_samples_filtering_tab.R index 14d9599..f6f1c3d 100644 --- a/R/server_module_samples_filtering_tab.R +++ b/R/server_module_samples_filtering_tab.R @@ -18,9 +18,6 @@ server_module_samples_filtering_tab <- function(id, step_number) { pattern = paste0("_(scpGUI#", step_number - 1, ")") ) }) - observe({ - print(assays_to_process()) - }) server_module_qc_metrics("psm_pre", assays_to_process) n_boxes <- reactiveVal(0) @@ -125,8 +122,8 @@ server_module_samples_filtering_tab <- function(id, step_number) { reactiveValuesToList(filtering_conditions) }) entire_condition <- reactive({ - res <- lapply(filtering_conditions_list(), function(condition) { - paste0("qfeatures$", condition) + res <- lapply(seq_len(n_boxes()), function(index) { + paste0("qfeatures$", filtering_conditions_list()[[index]]) }) res <- unlist(res) if (length(filtering_conditions_list()) > 0) { diff --git a/R/server_module_workflow_config.R b/R/server_module_workflow_config.R index 8408307..667dfc2 100644 --- a/R/server_module_workflow_config.R +++ b/R/server_module_workflow_config.R @@ -42,7 +42,10 @@ server_module_workflow_config <- function(id) { } }) steps_list <- reactive({ - reactiveValuesToList(steps) + full_list <- reactiveValuesToList(steps) + lapply(seq_len(n_steps()), function(i) { + full_list[[i]] + }) }) observeEvent(input$apply, {