Skip to content

Commit

Permalink
Add display comment output, move warnings to top right
Browse files Browse the repository at this point in the history
Closes #63
  • Loading branch information
tofof committed May 4, 2023
1 parent 32bb062 commit d9664e2
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ ui <- fluidPage(
),
),
textOutput("requirements"),

conditionalPanel(
condition = "output.plotWeight",
h4(textOutput("displaycomment")),
),
conditionalPanel(
condition = "output.fatal_error == 'TRUE'",
actionButton("btnReset", label = "Reset Form", class = "btn btn-danger", width = "250px"),
Expand Down Expand Up @@ -184,16 +187,19 @@ server <- function(input, output, session) {
# Name validation
rats = rat_archive$Rat_name %>% str_to_upper()
name_clean <- reactive({
req(input$name, cancelOutput = TRUE)
input$name %>% str_trim %>% str_replace_all(" ", "") %>% str_to_upper()
})
known_rat <- reactive ({
req(name_clean(), cancelOutput = TRUE)
name_clean() %in% rats
})
name_good <- reactive({
req(known_rat(), cancelOutput = TRUE)
name_clean()
})
id_good <- reactive({
req(name_good(), cancelOutput = TRUE)
rat_archive %>% dplyr::filter(str_to_upper(Rat_name) == name_good()) %>% .$Rat_ID
})
observeEvent(input$name, {
Expand Down Expand Up @@ -340,9 +346,14 @@ server <- function(input, output, session) {
}
})

output$text2 <- renderText({
id_good()
})
output$displaycomment <- renderText({
req(id_good)
if(id_good() > 0) {
rat_archive %>% dplyr::filter(Rat_ID %in% id_good()) %>% .$Display_Comment
} else {
id_good()
}
})

# output$text3 <- renderText({
# req(input$btnAnalyze)
Expand Down

0 comments on commit d9664e2

Please sign in to comment.