From a12192f69c82c60eeb855923a2da75d0065da8ea Mon Sep 17 00:00:00 2001 From: Mahmoud Hallal Date: Thu, 29 Sep 2022 12:50:35 +0200 Subject: [PATCH 1/6] update --- R/tm_g_ae_oview.R | 14 ++++++++++++-- R/tm_g_ae_sub.R | 14 ++++++++++++-- R/tm_g_butterfly.R | 14 ++++++++++++-- R/tm_g_events_term_id.R | 14 ++++++++++++-- R/tm_g_heat_bygrade.R | 14 ++++++++++++-- R/tm_g_patient_profile.R | 14 ++++++++++++-- R/tm_g_spiderplot.R | 14 ++++++++++++-- R/tm_g_swimlane.R | 14 ++++++++++++-- R/tm_g_waterfall.R | 14 ++++++++++++-- 9 files changed, 108 insertions(+), 18 deletions(-) diff --git a/R/tm_g_ae_oview.R b/R/tm_g_ae_oview.R index 269aaaf3..3f30639d 100644 --- a/R/tm_g_ae_oview.R +++ b/R/tm_g_ae_oview.R @@ -209,7 +209,10 @@ ui_g_ae_oview <- function(id, ...) { footnotes = "" ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ) ) } @@ -301,7 +304,7 @@ srv_g_ae_oview <- function(id, validate(need(all(c(input$arm_trt, input$arm_ref) %in% unique(ANL[[input$arm_var]])), "Plot loading")) q1 <- teal.code::eval_code( - teal.code::new_qenv(tdata2env(data), code = get_code(data)), + teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = as.expression(c( bquote(anl_labels <- formatters::var_labels(.(as.name(dataname)), fill = FALSE)), bquote(flags <- .(as.name(dataname)) %>% @@ -335,6 +338,13 @@ srv_g_ae_oview <- function(id, plot_r <- reactive(output_q()[["plot"]]) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", verbatim_content = reactive(teal.code::get_code(output_q())), diff --git a/R/tm_g_ae_sub.R b/R/tm_g_ae_sub.R index b15e595f..89a52004 100644 --- a/R/tm_g_ae_sub.R +++ b/R/tm_g_ae_sub.R @@ -161,7 +161,10 @@ ui_g_ae_sub <- function(id, ...) { ) ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ) ) } @@ -324,7 +327,7 @@ srv_g_ae_sub <- function(id, bquote(group_labels <- setNames(.(group_labels), .(input$groups))) } - q1 <- teal.code::eval_code(teal.code::new_qenv(tdata2env(data), code = get_code(data)), code = group_labels_call) + q1 <- teal.code::eval_code(teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = group_labels_call) q2 <- teal.code::eval_code(q1, code = "") teal.code::eval_code( q2, @@ -353,6 +356,13 @@ srv_g_ae_sub <- function(id, plot_r <- reactive(output_q()[["plot"]]) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", verbatim_content = reactive(teal.code::get_code(output_q())), diff --git a/R/tm_g_butterfly.R b/R/tm_g_butterfly.R index 791c06bd..8062b08b 100644 --- a/R/tm_g_butterfly.R +++ b/R/tm_g_butterfly.R @@ -252,7 +252,10 @@ ui_g_butterfly <- function(id, ...) { value = a$legend_on ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -395,7 +398,7 @@ srv_g_butterfly <- function(id, data, filter_panel_api, reporter, dataname, labe anl_vars <- unique(c("USUBJID", "STUDYID", varlist_from_anl)) # nolint q1 <- teal.code::eval_code( - teal.code::new_qenv(tdata2env(data), code = get_code(data)), + teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = bquote({ ADSL <- ADSL[, .(adsl_vars)] %>% as.data.frame() # nolint ANL <- .(as.name(dataname))[, .(anl_vars)] %>% as.data.frame() # nolint @@ -477,6 +480,13 @@ srv_g_butterfly <- function(id, data, filter_panel_api, reporter, dataname, labe width = plot_width ) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", title = paste("R code for", label), diff --git a/R/tm_g_events_term_id.R b/R/tm_g_events_term_id.R index d920155c..6ca65643 100644 --- a/R/tm_g_events_term_id.R +++ b/R/tm_g_events_term_id.R @@ -190,7 +190,10 @@ ui_g_events_term_id <- function(id, ...) { footnotes = "" ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ) ) } @@ -309,7 +312,7 @@ srv_g_events_term_id <- function(id, anl_vars <- c("USUBJID", "STUDYID", input$term) # nolint q1 <- teal.code::eval_code( - teal.code::new_qenv(tdata2env(data), code = get_code(data)), + teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = bquote( ANL <- merge( # nolint x = ADSL[, .(adsl_vars), drop = FALSE], @@ -351,6 +354,13 @@ srv_g_events_term_id <- function(id, plot_r <- reactive(output_q()[["plot"]]) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", title = paste("R code for", label), diff --git a/R/tm_g_heat_bygrade.R b/R/tm_g_heat_bygrade.R index 2f7e7b19..f75eb088 100644 --- a/R/tm_g_heat_bygrade.R +++ b/R/tm_g_heat_bygrade.R @@ -288,7 +288,10 @@ ui_g_heatmap_bygrade <- function(id, ...) { footnotes = "" ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ) ) ) } @@ -390,7 +393,7 @@ srv_g_heatmap_bygrade <- function(id, q1 <- if (input$plot_cm) { validate(need(!is.na(input$conmed_var), "Please select a conmed variable.")) teal.code::eval_code( - teal.code::new_qenv(tdata2env(data), code = get_code(data)), + teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = bquote({ conmed_data <- ADCM %>% filter(!!sym(.(input$conmed_var)) %in% .(input$conmed_level)) @@ -434,6 +437,13 @@ srv_g_heatmap_bygrade <- function(id, plot_r <- reactive(output_q()[["plot"]]) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", title = paste("R code for", label), diff --git a/R/tm_g_patient_profile.R b/R/tm_g_patient_profile.R index 9f1f78fa..71b2721d 100644 --- a/R/tm_g_patient_profile.R +++ b/R/tm_g_patient_profile.R @@ -394,7 +394,10 @@ ui_g_patient_profile <- function(id, ...) { value = a$x_limit ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -645,7 +648,7 @@ srv_g_patient_profile <- function(id, empty_lb <- FALSE q1 <- teal.code::eval_code( - teal.code::new_qenv(tdata2env(data), code = get_code(data)), + teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = bquote({ ADSL <- ADSL %>% # nolint group_by(.data$USUBJID) @@ -1063,6 +1066,13 @@ srv_g_patient_profile <- function(id, width = plot_width ) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", title = paste("R code for", label), diff --git a/R/tm_g_spiderplot.R b/R/tm_g_spiderplot.R index 1af7c0e8..5681a06a 100644 --- a/R/tm_g_spiderplot.R +++ b/R/tm_g_spiderplot.R @@ -209,7 +209,10 @@ ui_g_spider <- function(id, ...) { value = a$href_line ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -268,7 +271,7 @@ srv_g_spider <- function(id, data, filter_panel_api, reporter, dataname, label, # merge q1 <- teal.code::eval_code( - teal.code::new_qenv(tdata2env(data), code = get_code(data)), + teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = bquote({ ADSL <- ADSL[, .(adsl_vars)] %>% as.data.frame() # nolint ADTR <- .(as.name(dataname))[, .(adtr_vars)] %>% as.data.frame() # nolint @@ -376,6 +379,13 @@ srv_g_spider <- function(id, data, filter_panel_api, reporter, dataname, label, width = plot_width ) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", title = paste("R code for", label), diff --git a/R/tm_g_swimlane.R b/R/tm_g_swimlane.R index 2b03d7d1..62fcb773 100644 --- a/R/tm_g_swimlane.R +++ b/R/tm_g_swimlane.R @@ -243,7 +243,10 @@ ui_g_swimlane <- function(id, ...) { value = paste(a$vref_line, collapse = ", ") ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -311,7 +314,7 @@ srv_g_swimlane <- function(id, ADSL <- data[["ADSL"]]() # nolint - q1 <- teal.code::new_qenv(tdata2env(data), code = get_code(data)) + q1 <- teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)) # VARIABLE GETTERS # lookup bar variables @@ -508,6 +511,13 @@ srv_g_swimlane <- function(id, width = plot_width ) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", title = paste("R code for", label), diff --git a/R/tm_g_waterfall.R b/R/tm_g_waterfall.R index a1d6850e..99c0b48a 100644 --- a/R/tm_g_waterfall.R +++ b/R/tm_g_waterfall.R @@ -265,7 +265,10 @@ ui_g_waterfall <- function(id, ...) { value = a$gap_point_val ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -384,7 +387,7 @@ srv_g_waterfall <- function(id, # write variables to qenv q1 <- teal.code::eval_code( - teal.code::new_qenv(tdata2env(data), code = get_code(data)), + teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), code = bquote({ bar_var <- .(bar_var) bar_color_var <- .(bar_color_var) @@ -517,6 +520,13 @@ srv_g_waterfall <- function(id, width = plot_width ) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(output_q())), + title = "Warning", + disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + ) + # Show R Code teal.widgets::verbatim_popup_srv( id = "rcode", From 6e209db1b5fd59b6b362238a397835ee1b4db090 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 10:54:31 +0000 Subject: [PATCH 2/6] [skip actions] Restyle files --- R/tm_g_ae_oview.R | 2 +- R/tm_g_ae_sub.R | 2 +- R/tm_g_butterfly.R | 2 +- R/tm_g_events_term_id.R | 2 +- R/tm_g_heat_bygrade.R | 2 +- R/tm_g_patient_profile.R | 2 +- R/tm_g_spiderplot.R | 2 +- R/tm_g_swimlane.R | 2 +- R/tm_g_waterfall.R | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/tm_g_ae_oview.R b/R/tm_g_ae_oview.R index 3f30639d..45387f17 100644 --- a/R/tm_g_ae_oview.R +++ b/R/tm_g_ae_oview.R @@ -342,7 +342,7 @@ srv_g_ae_oview <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_ae_sub.R b/R/tm_g_ae_sub.R index 89a52004..c7b30870 100644 --- a/R/tm_g_ae_sub.R +++ b/R/tm_g_ae_sub.R @@ -360,7 +360,7 @@ srv_g_ae_sub <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_butterfly.R b/R/tm_g_butterfly.R index 8062b08b..af5d6dfc 100644 --- a/R/tm_g_butterfly.R +++ b/R/tm_g_butterfly.R @@ -484,7 +484,7 @@ srv_g_butterfly <- function(id, data, filter_panel_api, reporter, dataname, labe id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_events_term_id.R b/R/tm_g_events_term_id.R index 6ca65643..cef465d5 100644 --- a/R/tm_g_events_term_id.R +++ b/R/tm_g_events_term_id.R @@ -358,7 +358,7 @@ srv_g_events_term_id <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_heat_bygrade.R b/R/tm_g_heat_bygrade.R index f75eb088..e9917c06 100644 --- a/R/tm_g_heat_bygrade.R +++ b/R/tm_g_heat_bygrade.R @@ -441,7 +441,7 @@ srv_g_heatmap_bygrade <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_patient_profile.R b/R/tm_g_patient_profile.R index 71b2721d..2b5cac82 100644 --- a/R/tm_g_patient_profile.R +++ b/R/tm_g_patient_profile.R @@ -1070,7 +1070,7 @@ srv_g_patient_profile <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_spiderplot.R b/R/tm_g_spiderplot.R index 5681a06a..c48f70d4 100644 --- a/R/tm_g_spiderplot.R +++ b/R/tm_g_spiderplot.R @@ -383,7 +383,7 @@ srv_g_spider <- function(id, data, filter_panel_api, reporter, dataname, label, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_swimlane.R b/R/tm_g_swimlane.R index 62fcb773..3dcc137d 100644 --- a/R/tm_g_swimlane.R +++ b/R/tm_g_swimlane.R @@ -515,7 +515,7 @@ srv_g_swimlane <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_waterfall.R b/R/tm_g_waterfall.R index 99c0b48a..e3631a78 100644 --- a/R/tm_g_waterfall.R +++ b/R/tm_g_waterfall.R @@ -524,7 +524,7 @@ srv_g_waterfall <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled =reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) ) # Show R Code From 6f773b80aa1ca4c713dff01919a2b69654a5fc66 Mon Sep 17 00:00:00 2001 From: Mahmoud Hallal Date: Mon, 3 Oct 2022 16:54:18 +0200 Subject: [PATCH 3/6] fixes --- R/tm_g_heat_bygrade.R | 4 ++-- R/tm_g_patient_profile.R | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/R/tm_g_heat_bygrade.R b/R/tm_g_heat_bygrade.R index e9917c06..08c6556b 100644 --- a/R/tm_g_heat_bygrade.R +++ b/R/tm_g_heat_bygrade.R @@ -372,7 +372,7 @@ srv_g_heatmap_bygrade <- function(id, paste("Please de-select", input$id_var, "in annotation variable(s)", sep = " ") )) - if (input$plot_cm) { + if (!is.null(input$plot_cm) && input$plot_cm) { ADCM <- data[[cm_dataname]]() # nolint validate( need( @@ -390,7 +390,7 @@ srv_g_heatmap_bygrade <- function(id, )) } - q1 <- if (input$plot_cm) { + q1 <- if (!is.null(input$plot_cm) && input$plot_cm) { validate(need(!is.na(input$conmed_var), "Please select a conmed variable.")) teal.code::eval_code( teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)), diff --git a/R/tm_g_patient_profile.R b/R/tm_g_patient_profile.R index 2b5cac82..06adc6f9 100644 --- a/R/tm_g_patient_profile.R +++ b/R/tm_g_patient_profile.R @@ -630,9 +630,10 @@ srv_g_patient_profile <- function(id, lb_dataname ) input_select <- purrr::map_lgl(datanames, is.na) + select_plot <- purrr::map2_lgl( input_select, possible_plot, - ~ if (!.x) { + ~ if (!.x && paste("select", .y, sep = "_") %in% names(input)) { input[[paste("select", .y, sep = "_")]] } else { FALSE From 6c7b49d05f96b0a6a75eb6bba190304e814e78d2 Mon Sep 17 00:00:00 2001 From: Nikolas Burkoff Date: Tue, 25 Oct 2022 15:22:43 +0100 Subject: [PATCH 4/6] simplify warnings --- R/tm_g_ae_oview.R | 2 +- R/tm_g_ae_sub.R | 2 +- R/tm_g_butterfly.R | 2 +- R/tm_g_events_term_id.R | 2 +- R/tm_g_heat_bygrade.R | 2 +- R/tm_g_patient_profile.R | 2 +- R/tm_g_spiderplot.R | 2 +- R/tm_g_swimlane.R | 2 +- R/tm_g_waterfall.R | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/tm_g_ae_oview.R b/R/tm_g_ae_oview.R index 02d521ea..888ca51b 100644 --- a/R/tm_g_ae_oview.R +++ b/R/tm_g_ae_oview.R @@ -351,7 +351,7 @@ srv_g_ae_oview <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_ae_sub.R b/R/tm_g_ae_sub.R index 3d90a9f0..ebce6703 100644 --- a/R/tm_g_ae_sub.R +++ b/R/tm_g_ae_sub.R @@ -372,7 +372,7 @@ srv_g_ae_sub <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_butterfly.R b/R/tm_g_butterfly.R index 5f66fa91..09429401 100644 --- a/R/tm_g_butterfly.R +++ b/R/tm_g_butterfly.R @@ -496,7 +496,7 @@ srv_g_butterfly <- function(id, data, filter_panel_api, reporter, dataname, labe id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_events_term_id.R b/R/tm_g_events_term_id.R index 84e237de..8ea558d7 100644 --- a/R/tm_g_events_term_id.R +++ b/R/tm_g_events_term_id.R @@ -364,7 +364,7 @@ srv_g_events_term_id <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_heat_bygrade.R b/R/tm_g_heat_bygrade.R index 3416607c..6507d995 100644 --- a/R/tm_g_heat_bygrade.R +++ b/R/tm_g_heat_bygrade.R @@ -454,7 +454,7 @@ srv_g_heatmap_bygrade <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_patient_profile.R b/R/tm_g_patient_profile.R index 93b78219..2a5032aa 100644 --- a/R/tm_g_patient_profile.R +++ b/R/tm_g_patient_profile.R @@ -1076,7 +1076,7 @@ srv_g_patient_profile <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_spiderplot.R b/R/tm_g_spiderplot.R index b5fc09fc..51f01806 100644 --- a/R/tm_g_spiderplot.R +++ b/R/tm_g_spiderplot.R @@ -386,7 +386,7 @@ srv_g_spider <- function(id, data, filter_panel_api, reporter, dataname, label, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_swimlane.R b/R/tm_g_swimlane.R index d2ab694f..f7a28098 100644 --- a/R/tm_g_swimlane.R +++ b/R/tm_g_swimlane.R @@ -520,7 +520,7 @@ srv_g_swimlane <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) teal.widgets::verbatim_popup_srv( diff --git a/R/tm_g_waterfall.R b/R/tm_g_waterfall.R index 39f819e8..863cff0d 100644 --- a/R/tm_g_waterfall.R +++ b/R/tm_g_waterfall.R @@ -528,7 +528,7 @@ srv_g_waterfall <- function(id, id = "warning", verbatim_content = reactive(teal.code::get_warnings(output_q())), title = "Warning", - disabled = reactive(is.null(output_q()) || is.null(teal.code::get_warnings(output_q()))) + disabled = reactive(is.null(teal.code::get_warnings(output_q()))) ) # Show R Code From 5e661633e538061fa10d726b9602686c3796e5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ka=C5=82=C4=99dkowski?= Date: Thu, 27 Oct 2022 13:09:32 +0200 Subject: [PATCH 5/6] Remove inexisting ANL_UNFILTERED call --- R/tm_g_ae_oview.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/R/tm_g_ae_oview.R b/R/tm_g_ae_oview.R index 888ca51b..c64473e1 100644 --- a/R/tm_g_ae_oview.R +++ b/R/tm_g_ae_oview.R @@ -297,13 +297,12 @@ srv_g_ae_oview <- function(id, input$arm_trt, message_fmt = "Must not be equal to Treatment" )) - iv_comp$enable() - validate(need(iv_comp$is_valid(), "Misspecification error: please observe red flags in the encodings.")) + validate(need(iv_comp$is_valid(), "Misspecification error: please observe red flags in the encodings.")) validate(need(nlevels(ANL[[input$arm_var]]) > 1, "Arm needs to have at least 2 levels")) validate_has_data(ANL, min_nrow = 10) - if (all(c(input$arm_trt, input$arm_ref) %in% ANL_UNFILTERED[[input$arm_var]])) { + if (all(c(input$arm_trt, input$arm_ref) %in% ANL[[input$arm_var]])) { iv_an <- shinyvalidate::InputValidator$new() iv_an$add_rule("arm_ref", shinyvalidate::sv_in_set(set = ANL[[input$arm_var]])) iv_an$add_rule("arm_trt", shinyvalidate::sv_in_set(set = ANL[[input$arm_var]])) From 96227ff177ec56600ef12295c5bb0d1cd770e444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ka=C5=82=C4=99dkowski?= <6959016+gogonzo@users.noreply.github.com> Date: Thu, 27 Oct 2022 13:15:37 +0200 Subject: [PATCH 6/6] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit simplify if conditions Signed-off-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com> --- R/tm_g_heat_bygrade.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tm_g_heat_bygrade.R b/R/tm_g_heat_bygrade.R index 6507d995..a14ca8cb 100644 --- a/R/tm_g_heat_bygrade.R +++ b/R/tm_g_heat_bygrade.R @@ -380,7 +380,7 @@ srv_g_heatmap_bygrade <- function(id, paste("Please de-select", input$id_var, "in annotation variable(s)", sep = " ") )) - if (!is.null(input$plot_cm) && input$plot_cm) { + if (isTRUE(input$plot_cm)) { ADCM <- data[[cm_dataname]]() # nolint validate( need( @@ -398,7 +398,7 @@ srv_g_heatmap_bygrade <- function(id, )) } - q1 <- if (!is.null(input$plot_cm) && input$plot_cm) { + q1 <- if (isTRUE(input$plot_cm)) { iv_cm <- shinyvalidate::InputValidator$new() conmed_var <- input$conmed_var iv_cm$add_rule("conmed_var", shinyvalidate::sv_required())