diff --git a/app/server.R b/app/server.R index 74b5419..5029c71 100644 --- a/app/server.R +++ b/app/server.R @@ -843,11 +843,19 @@ server <- function(input, output, session) { }) }) - ## reset trouble + observe({ + matching_ids <- reactive_buttons() + lapply(matching_ids, function(id) { + observeEvent(input[[id]], { + nav_select("proof", "Workflow Details") + shinyFeedback::resetLoadingButton(id) + }) + }) + }) + + ## reset tracking workflows filters observeEvent(input$resetTrackingFilters, { - reset_inputs("workName") - reset_inputs("workStatus") - reset_inputs("runs_date") + reset_inputs(c("workName", "workStatus", "runs_date")) }) output$selectedWorkflowUI <- renderUI({ @@ -950,22 +958,17 @@ server <- function(input, output, session) { )) }) - output$workflowOpt <- renderUI({ - if (NROW(workflowOptions()) > 0) { - renderDT( - expr = workflowOptions(), - class = "compact", - filter = "top", - options = list(scrollX = TRUE), - selection = "single", - rownames = FALSE - ) - } else { - div( - "No options data found", - class = "alert alert-primary", - role = "alert" - ) + output$workflowOpt <- renderDT( + expr = workflowOptions(), + class = "compact", + filter = "top", + options = list(scrollX = TRUE), + selection = "single", + rownames = FALSE + ) + output$workflowOptAlert <- renderUI({ + if (NROW(workflowOptions()) == 0) { + alert("No options data found") } }) @@ -1070,7 +1073,10 @@ server <- function(input, output, session) { ) ## Failure data - failsUpdate <- eventReactive(input$getFailedData, + failsUpdate <- eventReactive(c( + input$selectedWorkflowId, + input$getFailedData + ), { suppressWarnings(cromwell_failures( workflow_id = input$selectedWorkflowId, @@ -1093,17 +1099,8 @@ server <- function(input, output, session) { options = list(scrollX = TRUE), rownames = FALSE ) - - output$failurelistBatch <- renderUI({ - if (NROW(failsUpdate()) > 0) { - renderDT( - expr = failsUpdate(), - class = "compact", - filter = "top", - options = list(scrollX = TRUE), - rownames = FALSE - ) - } else { + output$failuresAlert <- renderUI({ + if (NROW(failsUpdate()) == 0) { alert("No failures data found") } }) @@ -1118,7 +1115,10 @@ server <- function(input, output, session) { ) ### Call Caching data - cacheUpdate <- eventReactive(input$getCacheData, + cacheUpdate <- eventReactive(c( + input$selectedWorkflowId, + input$getCacheData + ), { theseCache <- cromwell_cache( workflow_id = input$selectedWorkflowId, @@ -1135,23 +1135,22 @@ server <- function(input, output, session) { ignoreNULL = TRUE ) - output$cachingListBatch <- renderUI({ - if (NROW(cacheUpdate()) > 0) { - renderDT( - expr = cacheUpdate() %>% - select( - any_of( - c("workflow_name", "workflow_id", "callName", - "shardIndex", "executionStatus")), - everything() - ) %>% - unique(), - class = "compact", - filter = "top", - options = list(scrollX = TRUE), - rownames = FALSE - ) - } else { + output$cachingListBatch <- renderDT( + expr = cacheUpdate() %>% + select( + any_of( + c("workflow_name", "workflow_id", "callName", + "shardIndex", "executionStatus")), + everything() + ) %>% + unique(), + class = "compact", + filter = "top", + options = list(scrollX = TRUE), + rownames = FALSE + ) + output$cachingAlert <- renderUI({ + if (NROW(cacheUpdate()) == 0) { alert("No call caching data found") } }) @@ -1167,7 +1166,10 @@ server <- function(input, output, session) { ## Outputs Data ### Go get the output data for the selected workflow - outputsUpdate <- eventReactive(input$getOutputData, + outputsUpdate <- eventReactive(c( + input$selectedWorkflowId, + input$getOutputData + ), { cromwell_outputs( workflow_id = input$selectedWorkflowId, @@ -1178,16 +1180,15 @@ server <- function(input, output, session) { ignoreNULL = TRUE ) ## render outputs list to a table - output$outputslistBatch <- renderUI({ - if (NROW(outputsUpdate()) > 0) { - renderDT( - expr = outputsUpdate(), - class = "compact", - filter = "top", - options = list(scrollX = TRUE), - rownames = FALSE - ) - } else { + output$outputslistBatch <- renderDT( + expr = outputsUpdate(), + class = "compact", + filter = "top", + options = list(scrollX = TRUE), + rownames = FALSE + ) + output$outputsAlert <- renderUI({ + if (NROW(outputsUpdate()) == 0) { alert("No output data found") } }) diff --git a/app/tab-troubleshoot.R b/app/tab-troubleshoot.R index 2a9b195..d5811bc 100644 --- a/app/tab-troubleshoot.R +++ b/app/tab-troubleshoot.R @@ -2,7 +2,9 @@ library(shinyjs) source("utils.R") -panel_troublehsoot <- nav_panel(title = "Troubleshoot", +panel_troublehsoot <- nav_panel( + title = "Troubleshoot", + id = "detailsTroubleshoot", card( class = "border border-primary", full_screen = TRUE, diff --git a/app/tab-workflow_details.R b/app/tab-workflow_details.R index 63bb542..f1087cd 100644 --- a/app/tab-workflow_details.R +++ b/app/tab-workflow_details.R @@ -5,6 +5,7 @@ source("utils.R") panel_job_list <- nav_panel( title = "Job List", + id = "detailsJobs", card_header( downloadButton( outputId = "downloadJobs", @@ -27,6 +28,7 @@ panel_job_list <- nav_panel( panel_workflow_description <- nav_panel( title = "Workflow Description", + id = "detailsWorkflowDesc", card_body( load_spinner( uiOutput("workflowDescribe") @@ -36,6 +38,7 @@ panel_workflow_description <- nav_panel( panel_diagram <- nav_panel( title = "Diagram", + id = "detailsDiagram", load_spinner( uiOutput("mermaid_diagram") ) @@ -43,6 +46,7 @@ panel_diagram <- nav_panel( panel_job_failures <- nav_panel( title = "Job Failures", + id = "detailsJobFailures", p("Specific information for jobs with a status of 'Failed', only available upon request."), actionButton( inputId = "getFailedData", @@ -55,11 +59,13 @@ panel_job_failures <- nav_panel( label = "Download Call Failure Data", style = "width:300px;" ), - uiOutput("failurelistBatch") + uiOutput("failuresAlert"), + DTOutput("failurelistBatch") ) panel_call_caching <- nav_panel( title = "Call Caching ", + id = "detailsCallCaching", p("Only available upon request. Note: this can be slow for very complex workflows. "), actionButton( inputId = "getCacheData", @@ -72,21 +78,25 @@ panel_call_caching <- nav_panel( label = "Download Call Caching Data", style = "width:300px;" ), + uiOutput("cachingAlert"), load_spinner( - uiOutput("cachingListBatch") + DTOutput("cachingListBatch") ) ) panel_options <- nav_panel( title = "Workflow Options", + id = "detailsWorkflowOptions", br(), + uiOutput("workflowOptAlert"), load_spinner( - uiOutput("workflowOpt") + DTOutput("workflowOpt") ) ) panel_inputs <- nav_panel( title = "Workflow Inputs", + id = "detailsWorkflowInputs", load_spinner( reactjsonOutput("workflowInp", height = "100%") ) @@ -94,6 +104,7 @@ panel_inputs <- nav_panel( panel_outputs <- nav_panel( title = "Workflow Outputs", + id = "detailsWorkflowOutputs", p("The specific outputs to the entire workflow itself are listed here only upon request and only if they are all available. "), actionButton( inputId = "getOutputData", @@ -106,7 +117,8 @@ panel_outputs <- nav_panel( label = "Download Workflow Output Data", style = "width:350px;" ), - uiOutput("outputslistBatch") + uiOutput("outputsAlert"), + DTOutput("outputslistBatch") ) tab_workflow_details <- card(