Skip to content

Commit

Permalink
Merge pull request #171 from FredHutch/clear-old-details-data
Browse files Browse the repository at this point in the history
clear/reset ui outputs in workflow details page
  • Loading branch information
tefirman authored Nov 7, 2024
2 parents 0c71dcf + 7ab80d2 commit 7335ef6
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 66 deletions.
123 changes: 62 additions & 61 deletions app/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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")
}
})

Expand Down Expand Up @@ -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,
Expand All @@ -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")
}
})
Expand All @@ -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,
Expand All @@ -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")
}
})
Expand All @@ -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,
Expand All @@ -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")
}
})
Expand Down
4 changes: 3 additions & 1 deletion app/tab-troubleshoot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 16 additions & 4 deletions app/tab-workflow_details.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source("utils.R")

panel_job_list <- nav_panel(
title = "Job List",
id = "detailsJobs",
card_header(
downloadButton(
outputId = "downloadJobs",
Expand All @@ -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")
Expand All @@ -36,13 +38,15 @@ panel_workflow_description <- nav_panel(

panel_diagram <- nav_panel(
title = "Diagram",
id = "detailsDiagram",
load_spinner(
uiOutput("mermaid_diagram")
)
)

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",
Expand All @@ -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",
Expand All @@ -72,28 +78,33 @@ 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%")
)
)

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",
Expand All @@ -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(
Expand Down

0 comments on commit 7335ef6

Please sign in to comment.