Skip to content

Commit

Permalink
Start trying to delete runs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephpenn1 committed Dec 19, 2023
1 parent bb0b6b5 commit 121c6f7
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions h2/components/modules/mod_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

})
}
Expand Down

0 comments on commit 121c6f7

Please sign in to comment.