-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
CIP-RIU
committed
Jan 17, 2019
1 parent
cd6f400
commit 5f48dea
Showing
3 changed files
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[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() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|