Skip to content

Commit

Permalink
updates in namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
CIP-RIU committed Jan 17, 2019
1 parent cd6f400 commit 5f48dea
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Maintainer: Omar Benites <[email protected]>
Description: fbcheck is a package which containt a user interface for data quality and processing.
Depends:
R (>= 3.2.1),
traittools
Imports:
stringr,
magrittr,
Expand All @@ -19,6 +18,7 @@ Imports:
doBy,
shiny,
sbformula,
traittools,
data.table,
date,
purrr,
Expand All @@ -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
38 changes: 19 additions & 19 deletions R/fbcheck_server_sbase.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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..."))
Expand All @@ -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:[email protected]/brapi/v1/token",
urlput= "sgn:[email protected]/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:[email protected]/brapi/v1/token",
urlput= "sgn:[email protected]/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()

Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]/brapi/v1/observations"
body<- fbjson #from fb2json
Expand Down

0 comments on commit 5f48dea

Please sign in to comment.