Skip to content

Commit

Permalink
add error msg for prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohnso005 committed Mar 2, 2024
1 parent 1d6ac20 commit 2790446
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions inst/shiny/custom_modules/rep_biomodelos.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rep_biomodelos_module_server <- function(input, output, session, common) {

spp <- common$spp
bioSp <- common$bioSp
curSp <- common$curSp

output$bioSpUI <- renderUI({
# check that a species is in the list already -- if not, don't proceed
Expand All @@ -36,15 +37,23 @@ rep_biomodelos_module_server <- function(input, output, session, common) {
})

observeEvent(input$pushBiomod, {
if (is.null(spp[[curSp()]]$visualization$mapPred)) {
#add warning
shinyalert::shinyalert(
"You need a map prediction built on Wallace in order to push payload to BioModelos. ",
type = "error")
return()
} else {

if (spp[[bioSp()]]$rmm$data$occurrence$sources != "Biomodelos") {
shinyalert::shinyalert(
"You must submit a model built with occurrences from BioModelos (**)",
"You must submit a model built with occurrences from BioModelos. ",
type = "error")
return()
}
if (is.null(spp[[bioSp()]]$biomodelos$prediction)) {
shinyalert::shinyalert(
"You need a map prediction build on Wallace before pushing to BioModelos (**).",
"You need a map prediction built on Wallace before pushing to BioModelos. ",
type = "error")
return()
}
Expand Down Expand Up @@ -303,6 +312,7 @@ rep_biomodelos_module_server <- function(input, output, session, common) {
type = "error")
return()
}
}
})
}

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/custom_modules/rep_biomodelos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
component: "rep"
short_name: "BioModelos payload"
long_name: "BioModelos payload"
authors: "GEPB (**)"
authors: "Gonzalo E. Pinilla-Buitrago, Bethany A. Johnson"
package: []

0 comments on commit 2790446

Please sign in to comment.