Skip to content

Commit

Permalink
messages for displaying no data
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Sep 13, 2023
1 parent 6b90d4a commit a1f36db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
11 changes: 2 additions & 9 deletions R/components-data-viewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,8 @@ function filterMinValue(rows, columnId, filterValue) {
else{
data = newdf()[, input$dataCols, drop = FALSE]

Check warning on line 332 in R/components-data-viewer.R

View check run for this annotation

Codecov / codecov/patch

R/components-data-viewer.R#L332

Added line #L332 was not covered by tests
}
if(is.null(data)){
return(NULL)
}
if(nrow(data) == 0){
return(NULL)
}
# Display message when dat is empty
shiny::validate(shiny::need(hasData(data), "No data for selection"))
# set row height based on nchar of table
if(max(apply(data, 1, function(x) max(nchar(x))), na.rm = T) < 100){
height <- 40*3
Expand Down Expand Up @@ -407,9 +403,6 @@ function filterMinValue(rows, columnId, filterValue) {
})





# HELPERS
addTableActions <- function(
colDefsInput,
Expand Down
11 changes: 5 additions & 6 deletions R/evidence-synth-main.R
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ evidenceSynthesisServer <- function(
)
})

output$esSccsPlot <- shiny::renderPlot(
createPlotForSccsAnalysis(
sccsData()
)
)
output$esSccsPlot <- shiny::renderPlot({
sccsRes <- sccsData()
shiny::validate(shiny::need(hasData(sccsRes), "No valid data for selected target"))
createPlotForSccsAnalysis(sccsRes)

Check warning on line 286 in R/evidence-synth-main.R

View check run for this annotation

Codecov / codecov/patch

R/evidence-synth-main.R#L286

Added line #L286 was not covered by tests
})


resultTableServer(
Expand Down Expand Up @@ -697,7 +697,6 @@ getSccsEstimation <- function(
targetId,
outcomeId
){

if(is.null(targetId)){
return(NULL)

Check warning on line 701 in R/evidence-synth-main.R

View check run for this annotation

Codecov / codecov/patch

R/evidence-synth-main.R#L701

Added line #L701 was not covered by tests
}
Expand Down

0 comments on commit a1f36db

Please sign in to comment.