diff --git a/DESCRIPTION b/DESCRIPTION index 659dc1b..5555a6d 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,7 +8,6 @@ Maintainer: Omar Benites Description: fbcheck is a package which containt a user interface for data quality and processing. Depends: R (>= 3.2.1), - traittools Imports: stringr, magrittr, @@ -19,6 +18,7 @@ Imports: doBy, shiny, sbformula, + traittools, data.table, date, purrr, @@ -27,7 +27,8 @@ Imports: httr, RMySQL, DT +Remotes: CIP-RIU/traittools License: MIT + file LICENSE LazyData: true -RoxygenNote: 6.0.1 +RoxygenNote: 6.1.0 Suggests: testthat diff --git a/R/fbcheck_server_sbase.R b/R/fbcheck_server_sbase.R index fd97b1c..5c087bc 100755 --- a/R/fbcheck_server_sbase.R +++ b/R/fbcheck_server_sbase.R @@ -125,17 +125,17 @@ fbcheck_server_sbase <- function(input, output, session, values) { DF <- NULL # ####### Detect if hot_btable_fbapp_sbase has data ####### - if(!is.null(input$hot_btable_fbapp_sbase)) { - print("if 1") - DF = hot_to_r(input$hot_btable_fbapp_sbase) - #values[["hot_btable_fbapp_sbase"]] = DF - if(file.exists(fileNameExtFile)) { - former_datapath <- readRDS(file = fileNameExtFile) - if(hot_fbapp_path()!= former_datapath){ - DF <- hot_bdata_sbase2 - } - } - } + # if(!is.null(input$hot_btable_fbapp_sbase)) { + # print("if 1") + # DF = hot_to_r(input$hot_btable_fbapp_sbase) + # #values[["hot_btable_fbapp_sbase"]] = DF + # if(file.exists(fileNameExtFile)) { + # former_datapath <- readRDS(file = fileNameExtFile) + # if(hot_fbapp_path()!= former_datapath){ + # DF <- hot_bdata_sbase2 + # } + # } + # } ############## end detefct if ###################################### if(!is.null(input$hot_btable_fbapp_sbase)) { @@ -217,7 +217,7 @@ fbcheck_server_sbase <- function(input, output, session, values) { fb<- hot_to_r(input$hot_btable_fbapp_sbase) } - res<- check_fbapp(dfr=fb) + res<- fbcheck::check_fbapp(dfr=fb) shiny::withProgress(message = "Uploading file...", value = 0, { incProgress(1/6, detail = paste("Checking data...")) @@ -229,18 +229,18 @@ fbcheck_server_sbase <- function(input, output, session, values) { else { incProgress(2/6, detail = paste("Checking data...")) - user <- str_trim(input$fbchecksbaseUser,side = "both") - password <- str_trim(input$fbchecksbasePass,side = "both") - out<- upload_studies(dbname= "sweetpotatobase", - urltoken = "sgn:eggplant@sweetpotatobase-test.sgn.cornell.edu/brapi/v1/token", - urlput= "sgn:eggplant@sweetpotatobase-test.sgn.cornell.edu/brapi/v1/observations", - user= user, password=password, dfr=fb) + user <- stringr::str_trim(input$fbchecksbaseUser,side = "both") + password <- stringr::str_trim(input$fbchecksbasePass,side = "both") + out<- fbcheck::upload_studies(dbname= "sweetpotatobase", + urltoken = "sgn:eggplant@sweetpotatobase-test.sgn.cornell.edu/brapi/v1/token", + urlput= "sgn:eggplant@sweetpotatobase-test.sgn.cornell.edu/brapi/v1/observations", + user= user, password=password, dfr=fb) if(out$metadata$status[[6]]$code=="200"){ shinysky::showshinyalert(session, "alert_fbappsbase_upload", paste(res$msg), styleclass = "success") incProgress(5/6, detail = paste("Finishing upload to SweetPotatoBase...")) - incProgress(6/6, detail = paste("Refreshing page...")) + incProgress(6/6, detail = paste("Refreshing page... ")) session$reload() diff --git a/R/utils.R b/R/utils.R index 25793d6..d092a84 100755 --- a/R/utils.R +++ b/R/utils.R @@ -465,7 +465,7 @@ upload_studies<- function(dbname= "sweetpotatobase", #jsonview::json_tree_view(xout) #json tree view fbjson <- fbapp2json(dfr = dfr, token = con$token) - jsonview::json_tree_view(fbjson) + #jsonview::json_tree_view(fbjson) #----- PUT to sweetpotatobase -------------------------------------------------------------- url <- urlput #"sgn:eggplant@sweetpotatobase-test.sgn.cornell.edu/brapi/v1/observations" body<- fbjson #from fb2json