Skip to content

Commit

Permalink
fbcheck for production version v2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
CIP-RIU committed Aug 2, 2018
1 parent 905cc04 commit 2aea53c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: fbcheck
Title: Web Interface for Data Quality and Processing
Version: 2.0.4
Version: 2.0.5
Authors@R: c(
person("Omar","Benites",,"[email protected]",c("aut","cre"))
)
Expand Down
16 changes: 16 additions & 0 deletions R/fbcheck_server_sbase.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fbcheck_server_sbase <- function(input, output, session, values) {
}

####### Show Warnings to users #######
#ToDo: Include plot_id
if(!is.element("plot_name", names(dt))){
shinysky::showshinyalert(session, "alert_fbapp_warning_sbase", paste("ERROR: The file imported does not has 'plot_name' header."), styleclass = "danger")
} else if(nrow(dt)==1){
Expand Down Expand Up @@ -175,6 +176,20 @@ fbcheck_server_sbase <- function(input, output, session, values) {
incProgress(2/6, detail = paste("Formatting hidap file..."))
fb<- DF #hidap2fbApp(fieldbook = DF)

exportFormat <- input$fbcheck_fbapp_ExportFormat_sbase
if(exportFormat=="Simple"){
names(fb)[1] <- "observationunit_name"
#Remove unncesary columns for simple format
#ToDo: ask if user need 'plot_id' column in 'simple' format for sweetpotatobase
fb$accession_name <- fb$plot_id <- fb$plot_number <- fb$block_number <- fb$is_a_control <- fb$rep_number <- fb$row_number <- fb$col_number <- NULL
fb <- fb

} else {
fb
}



incProgress(3/6, detail = paste("Downloading FieldBookApp-SPBase file..."))
incProgress(4/6, detail = paste("Refreshing HIDAP..."))
Sys.sleep(3)
Expand Down Expand Up @@ -251,6 +266,7 @@ fbcheck_server_sbase <- function(input, output, session, values) {
xdate <- Sys.time()

v_study <- input$file_fbapp_sbase$name
v_study <- gsub(".csv", "", v_study)

uploadDate <- as.character(xdate, "%Y%m%d%H%M%S")
uploadDate_s <- as.character(xdate, "%Y-%m-%d %H:%M:%S")
Expand Down
12 changes: 10 additions & 2 deletions R/fbcheck_ui_sbase.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,22 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na
# condition = "input.fbdesign_dsource_sbase == 'FieldBookApp-SPBase'",
column(6,
shiny::fileInput(inputId = "file_fbapp_sbase", label = "Choose CSV File", multiple = FALSE,
accept = c("text/csv","text/comma-separated-values,text/plain", ".csv"))
accept = c("text/csv","text/comma-separated-values,text/plain", ".csv")),

selectInput(inputId = "fbcheck_fbapp_ExportFormat_sbase",label = "Spreadsheet format download",choices = c("Simple","Standard"), selected = 2)


),
column(6,
# HTML('<div style="float: right; margin: 0 5px 5px 10px;">'),
HTML('<div style="float: right;">'),
br(),
shiny::downloadButton('downloadData', 'Download', class = "btn-primary",style="color: #fff;"),
actionButton('saveData', 'Save', icon=icon("save"), width = 100),

################## HIDAP REGISTRY #########################################
#actionButton('saveData', 'Save', icon=icon("save"), width = 100),
######################################### ##################################

HTML('</div>')

),
Expand Down

0 comments on commit 2aea53c

Please sign in to comment.