From 121c6f7a705e59d93a6370272ff377026d304e19 Mon Sep 17 00:00:00 2001 From: Stephanie Pennington Date: Tue, 19 Dec 2023 14:53:09 -0500 Subject: [PATCH] Start trying to delete runs --- h2/components/modules/mod_run.R | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/h2/components/modules/mod_run.R b/h2/components/modules/mod_run.R index dbb4db0..93d829e 100644 --- a/h2/components/modules/mod_run.R +++ b/h2/components/modules/mod_run.R @@ -138,16 +138,30 @@ run_server <- function(id, r6) { }) %>% bindEvent(input$run, ignoreNULL = TRUE, ignoreInit = FALSE) + # Clear text input for run save after toggle switch is off observe({ updateTextInput(session = session, "run_name", value = NA) }) %>% bindEvent(input$savetoggle == FALSE) + # Create a table to show saved runs in session + observe({ + + savetable <- reactive(tibble("Run Name" = names(r6$output))) + output$savetable <- renderDataTable({savetable()}) + + }) %>% bindEvent(input$run) + + # Create delete entry in saved output list based on user-selected row + observe({ + + #this should work in theory, but savetable isn't getting passed into the observe? + delete <- savetable()$`Run Name`[input$savetable_rows_selected] + + r6$output[[delete]] <- NULL + + }) %>% bindEvent(input$deleteRuns) - save_table <- reactive(as.data.frame(names(r6$output))) - output$savetable <- renderDataTable({ - save_table() - }) }) }