From 2e1b437ae23284db711f3497d5f38227a107c0ef Mon Sep 17 00:00:00 2001 From: Erik Leppo Date: Thu, 14 Sep 2023 17:15:39 -0400 Subject: [PATCH] v2.0.7.9020 * refactor: Added config file display name + Main Functions - Run Functions + Main Functions - QC Thresholds - Upload Custom Thresholds --- DESCRIPTION | 2 +- NEWS | 10 ++++++- NEWS.md | 10 ++++++- NEWS.rmd | 7 +++++ .../ContDataQC/external/tab_3_MainFunc.R | 2 +- .../ContDataQC/external/tab_3c_QCThresh.R | 2 ++ inst/shiny-examples/ContDataQC/server.R | 27 ++++++++++++++++++- inst/shiny-examples/ContDataQC/ui.R | 2 +- 8 files changed, 56 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 842569d..62620e9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ContDataQC Title: Quality Control (QC) of Continous Monitoring Data -Version: 2.0.7.9019 +Version: 2.0.7.9020 Authors@R: c( person("Erik W", "Leppo", email="Erik.Leppo@tetratech.com",role=c("aut","cre")), person("Ann","Roseberry Lincoln", role="ctb"), diff --git a/NEWS b/NEWS index 8ce2f7c..5e53bc3 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ NEWS-ContDataQC - #> Last Update: 2023-09-14 16:55:51.688632 + #> Last Update: 2023-09-14 17:11:42.524289 # Version History @@ -11,6 +11,14 @@ NEWS-ContDataQC 2023-09-14 +- refactor: Added config file display name + - Main Functions - Run Functions + - Main Functions - QC Thresholds - Upload Custom Thresholds + +## v2.0.7.9019 + +2023-09-14 + - refactor: Edits to Shiny tabs ## v2.0.7.9018 diff --git a/NEWS.md b/NEWS.md index 8ce2f7c..5e53bc3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ NEWS-ContDataQC - #> Last Update: 2023-09-14 16:55:51.688632 + #> Last Update: 2023-09-14 17:11:42.524289 # Version History @@ -11,6 +11,14 @@ NEWS-ContDataQC 2023-09-14 +- refactor: Added config file display name + - Main Functions - Run Functions + - Main Functions - QC Thresholds - Upload Custom Thresholds + +## v2.0.7.9019 + +2023-09-14 + - refactor: Edits to Shiny tabs ## v2.0.7.9018 diff --git a/NEWS.rmd b/NEWS.rmd index 4572d73..d686af7 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -21,6 +21,13 @@ cat(paste0("Last Update: ",Sys.time())) # Version History +## v2.0.7.9020 +2023-09-14 + +* refactor: Added config file display name + + Main Functions - Run Functions + + Main Functions - QC Thresholds - Upload Custom Thresholds + ## v2.0.7.9019 2023-09-14 diff --git a/inst/shiny-examples/ContDataQC/external/tab_3_MainFunc.R b/inst/shiny-examples/ContDataQC/external/tab_3_MainFunc.R index 9446587..ee420df 100644 --- a/inst/shiny-examples/ContDataQC/external/tab_3_MainFunc.R +++ b/inst/shiny-examples/ContDataQC/external/tab_3_MainFunc.R @@ -15,7 +15,7 @@ function(){ sidebarPanel( p("1. Upload customized QC test thresholds if desired; otherwise, the default thresholds will be used.") , p("2. Confirm correct configuration file is being used.") - , p(textOutput("fn_input_display_config")) + , p(textOutput("fn_input_display_config_main")) , p("3. Upload input files.") #The selected input file #Tool tip code from https://stackoverflow.com/questions/16449252/tooltip-on-shiny-r diff --git a/inst/shiny-examples/ContDataQC/external/tab_3c_QCThresh.R b/inst/shiny-examples/ContDataQC/external/tab_3c_QCThresh.R index 7a89ec3..dfce342 100644 --- a/inst/shiny-examples/ContDataQC/external/tab_3c_QCThresh.R +++ b/inst/shiny-examples/ContDataQC/external/tab_3c_QCThresh.R @@ -27,6 +27,8 @@ function() { , accept = ".R") ) # tag$div ~ END , br() + , p("Configuration file being used.") + , p(textOutput("fn_input_display_config_config")) , br() #Only shows the "Default configuration" button after a user-selected file has been used diff --git a/inst/shiny-examples/ContDataQC/server.R b/inst/shiny-examples/ContDataQC/server.R index d43f6a4..e3cfea9 100644 --- a/inst/shiny-examples/ContDataQC/server.R +++ b/inst/shiny-examples/ContDataQC/server.R @@ -102,7 +102,8 @@ shinyServer(function(input, output, session) { # Display Import FileNames---- - output$fn_input_display_config <- renderText({ + output$fn_input_display_config_main <- renderText({ + #**SAME CODE AS CONFIG** #Allows users to use their own configuration/threshold files for QC. #Copies the status of the config file to this event. @@ -123,6 +124,30 @@ shinyServer(function(input, output, session) { return(paste0(config_type, "; ", basename(config))) + })## fn_input_display_config + + output$fn_input_display_config_config <- renderText({ + #**SAME CODE AS MAIN** + + #Allows users to use their own configuration/threshold files for QC. + #Copies the status of the config file to this event. + config_type <- config$x + + if (config_type == "uploaded") { + #If a configuration file has been uploaded, the app uses it + + config <- file.path("data", input$configFile$name) + + } else { + #If no configuration file has been uploaded, the default is used + + config <- system.file("extdata", "Config.ORIG.R", package="ContDataQC") + + }## IF ~ config_type ~ END + + return(paste0(config_type, "; ", basename(config))) + + })## fn_input_display_config # Reactive, Main ---- diff --git a/inst/shiny-examples/ContDataQC/ui.R b/inst/shiny-examples/ContDataQC/ui.R index 3d26918..ec93e55 100644 --- a/inst/shiny-examples/ContDataQC/ui.R +++ b/inst/shiny-examples/ContDataQC/ui.R @@ -25,7 +25,7 @@ tab_5b_Console <- source("external/tab_5b_Console.R", local = TRUE)$value shinyUI( # VERSION, 1, current [non-EPA] ---- - navbarPage("Continuous data QC, summary, and statistics - v2.0.7.9019", + navbarPage("Continuous data QC, summary, and statistics - v2.0.7.9020", theme = shinytheme("spacelab") ,tab_1_About() #,tab_1a_Overview()