Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
105f304
small change to run_dev.R
AARON-CLARK Feb 17, 2023
a99823b
Adjust initial auto-decision values
AARON-CLARK Feb 17, 2023
a30658b
Add the default login note, because we want to deploy with a demo use…
AARON-CLARK Feb 20, 2023
fe147ec
updated app.R
Feb 22, 2023
0f25cf7
update renv.lock and add demo credentials to credentials.sqlite on st…
AARON-CLARK Feb 24, 2023
d1841af
updated login note in app.R
AARON-CLARK Feb 24, 2023
f013e7e
fix merge conflicts in run_app()
AARON-CLARK Mar 15, 2023
8b943f1
fixed merge conflicts
AARON-CLARK Jun 22, 2023
219863b
get rid of url checker
AARON-CLARK Jun 22, 2023
4d052ad
uncomment upload_pkgs00(NULL)
AARON-CLARK Jun 23, 2023
335f29e
attempted fix for known riskmetric weighting bug #293
AARON-CLARK Jul 5, 2023
fa4a93e
remove print statements
AARON-CLARK Jul 5, 2023
7f26c90
get rid of database.sql... what is that?
AARON-CLARK Jul 6, 2023
6fbc9d4
Merge pull request #566 from pharmaR/dev-demo-shiniyapp.io-v100
AARON-CLARK Jul 6, 2023
f58dc8d
update config with new decision rules
AARON-CLARK Jul 10, 2023
db06cef
track database.sqlite
AARON-CLARK Jul 10, 2023
3dedbb5
track credentials temporarily
AARON-CLARK Jul 11, 2023
8ce5bcb
Use configuration file for demo databases
Jeff-Thompson12 Jul 11, 2023
e537989
Correctly specify demo configuration
Jeff-Thompson12 Jul 11, 2023
3c0c8a8
fix bug with re-scoring
AARON-CLARK Jul 12, 2023
ffbb826
fixed merge conflict with credentials_demo.sqlite
AARON-CLARK Jul 12, 2023
a78d15e
Resolve v2.0.0 merge conflicts
Jeff-Thompson12 Aug 11, 2023
dbc7134
Update databases
Jeff-Thompson12 Aug 11, 2023
fecdafc
Add an RSConnect ignore file
Jeff-Thompson12 Aug 11, 2023
966d461
Merge branch 'master' into dev-demo-shinyapp.io-v2.0.0
Jeff-Thompson12 Aug 14, 2023
e30dc9e
Merge branch 'master' into dev-demo-shinyapp.io-v2.0.0
AARON-CLARK Aug 15, 2023
7ab635d
fix broken package dependency table
AARON-CLARK Aug 15, 2023
266a00d
Merge branch 'master' into dev-demo-shinyapp.io-v2.0.0
AARON-CLARK Aug 15, 2023
a7a76a5
update database and config with some extra content
AARON-CLARK Aug 15, 2023
3871b84
Merge pull request #610 from pharmaR/dev-demo-shinyapp.io-v2.0.0
AARON-CLARK Aug 15, 2023
30452dd
fix merge conflicts in mod_uploadPackage regarding URL checker
AARON-CLARK Oct 20, 2023
55e9a24
initialize new creds and assessment db for demo
AARON-CLARK Oct 20, 2023
cfeaf35
update default demo crednetials and login notes
AARON-CLARK Oct 20, 2023
3958ee1
Initialize roles as well
Jeff-Thompson12 Oct 20, 2023
263bf9b
Move rules to demo configuration
Jeff-Thompson12 Oct 20, 2023
ff10aa7
fix typo in credentials initiatlization for demo branch and turn on f…
AARON-CLARK Oct 20, 2023
590f147
Add base:: prefix onto parse()
AARON-CLARK Oct 20, 2023
dd6689c
Verify app will not crash if `get_parse_data()` never runs
Jeff-Thompson12 Oct 20, 2023
c1fccdf
Verify app fails at first parsing
Jeff-Thompson12 Oct 20, 2023
9ae5731
Make sure value isn't being overwritten with global option
Jeff-Thompson12 Oct 20, 2023
86b7257
Merge branch 'dev' into demo-shinyapps.io
AARON-CLARK Oct 23, 2023
5f5d260
add placeholder file into source/ folder
AARON-CLARK Oct 23, 2023
83c6ed7
testing dummy pkg in source file with new unlink() call, exluding dum…
AARON-CLARK Oct 24, 2023
7fa9fe7
create demo database of 10 pkgs
AARON-CLARK Oct 24, 2023
0fccec3
revert back to original unlink
AARON-CLARK Oct 24, 2023
5ef937a
update database with other half of 300 pkgs, and rewrite login_note
AARON-CLARK Oct 24, 2023
c36a06d
Add the dummy file back again
AARON-CLARK Oct 24, 2023
f665c4c
ignore sources again
AARON-CLARK Oct 24, 2023
845143d
remove demo database and reset config file
AARON-CLARK Oct 24, 2023
adb1fb1
update databases
AARON-CLARK Oct 25, 2023
3ce522a
resolve merge conflicts
aclark02-arcus Jun 18, 2024
e000f04
Merge pull request #801 from pharmaR/master
aclark02-arcus Jul 8, 2024
0735bba
Merge pull request #809 from pharmaR/dev
aclark02-arcus Jul 25, 2024
95eed27
initiate a new credentials db and create pkg list csv for easy upload…
aclark02-arcus Jan 6, 2025
fb5f36d
update admin col when credentials are initiatlized
aclark02-arcus Jan 6, 2025
380c0ec
add a webinardemo config
aclark02-arcus Jan 16, 2025
abbb4b7
Merge pull request #831 from pharmaR/dev
aclark02-arcus Jan 16, 2025
8d8c27b
Merge branch 'demo-shinyapps.io-v311' of https://github.com/pharmaR/r…
aclark02-arcus Jan 16, 2025
9b2e170
update config with 'rule_else'
aclark02-arcus Jan 16, 2025
d6e44a8
update config
aclark02-arcus Jan 23, 2025
a2c2831
Merge branch 'dev' into demo-shinyapps.io-v311
aclark02-arcus Jan 23, 2025
fb5dd17
add csv's and db's for 'demo' and 'webinar_demo' config
aclark02-arcus Jan 25, 2025
8b5d543
update the credentials_demo db so that users don't have expiration da…
aclark02-arcus Jan 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
rsconnect/
/*.sqlite
.Rproj.user
.Rhistory
.RData
Expand All @@ -12,6 +11,8 @@ inst/doc
auto_decisions.json
^docs$
docs/
*.sqlite
!*demo.sqlite
tarballs/
report_preferences/
.Renviron
111 changes: 57 additions & 54 deletions R/mod_uploadPackage.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,75 +302,78 @@ uploadPackageServer <- function(id, user, auto_list, credentials, parent) {

})

checking_urls <- reactiveValues()

observeEvent(input$check_urls, {
checking_urls$finished <- FALSE
removeModal()
})

observe({
req(input$check_urls, !isTRUE(checking_urls$finished))
invalidateLater(60*1000)

withProgress({
good_urls <- purrr::map_lgl(checking_urls$url_lst,
~ try(curlGetHeaders(.x, verify = FALSE), silent = TRUE) %>%
{class(.) != "try-error" && attr(., "status") != 404})
Sys.sleep(.5)
}, message = "Checking URLs")

checking_urls$finished <- all(good_urls)
})

observeEvent(checking_urls$finished, {
req(checking_urls$finished)
showModal(modalDialog(
title = h2("Data Connection Issues"),
h5("The needed URLs are now reachable. Please try to upload the desired packages now."),
))
})
# Commented out only for shinyapps.io deployment!
# checking_urls <- reactiveValues()
#
# observeEvent(input$check_urls, {
# checking_urls$finished <- FALSE
# removeModal()
# })
#
# observe({
# req(input$check_urls, !isTRUE(checking_urls$finished))
# invalidateLater(60*1000)
#
# withProgress({
# good_urls <- purrr::map_lgl(checking_urls$url_lst,
# ~ try(curlGetHeaders(.x, verify = FALSE), silent = TRUE) %>%
# {class(.) != "try-error" && attr(., "status") != 404})
# Sys.sleep(.5)
# }, message = "Checking URLs")
#
# checking_urls$finished <- all(good_urls)
# })
#
# observeEvent(checking_urls$finished, {
# req(checking_urls$finished)
# showModal(modalDialog(
# title = h2("Data Connection Issues"),
# h5("The needed URLs are now reachable. Please try to upload the desired packages now."),
# ))
# })

uploaded_pkgs <- reactiveVal(data.frame())
# Save all the uploaded packages, marking them as 'new', 'not found',
# 'duplicate' or 'removed'
observeEvent(uploaded_pkgs00(), {

uploaded_packages <- uploaded_pkgs00()
uploaded_pkgs00(NULL)
uploaded_pkgs00(NULL) # keep!
uploaded_packages$score <- NA_real_
if (!rlang::is_empty(auto_list())) {
uploaded_packages$decision <- dplyr::coalesce(uploaded_packages$decision, "")
uploaded_packages$decision_rule <- ""
}
np <- nrow(uploaded_packages)

if (!isTRUE(getOption("shiny.testmode"))) {
url_lst <- c(
"https://cran.r-project.org",
"https://cranlogs.r-pkg.org"
)

good_urls <- purrr::map_lgl(url_lst,
~ try(curlGetHeaders(.x, verify = FALSE), silent = TRUE) %>%
{class(.) != "try-error" && attr(., "status") != 404})

if (!all(good_urls)) {
checking_urls$url_lst <- url_lst[!good_urls]
showModal(modalDialog(
title = h2("Data Connection Issues"),
h5("The process has been cancelled because at least one of the URLs used to populate the metrics is unreachable at this time."),
br(),
h5("Notify when URLs are reachable?"),
footer = tagList(
actionButton(ns("check_urls"), "Yes"),
modalButton("No")
)
))
}

req(all(good_urls))
}
# if (!isTRUE(getOption("shiny.testmode"))) {
# url_lst <- list(
# "https://cran.rstudio.com",
# "https://cran.r-project.org",
# "https://cranlogs.r-pkg.org"
# )
#
# good_urls <- purrr::map_lgl(url_lst,
# ~ try(curlGetHeaders(.x, verify = FALSE), silent = TRUE) %>%
# {class(.) != "try-error" && attr(., "status") != 404})
#
# if (!all(good_urls)) {
# checking_urls$url_lst <- url_lst[!good_urls]
# showModal(modalDialog(
# title = h2("Data Connection Issues"),
# h5("The process has been cancelled because at least one of the URLs used to populate the metrics is unreachable at this time."),
# br(),
# h5("Notify when URLs are reachable?"),
# footer = tagList(
# actionButton(ns("check_urls"), "Yes"),
# modalButton("No")
# )
# ))
# }
#
# req(all(good_urls))
# }

if (!isTruthy(session$userData$repo_pkgs())) {
if (isTRUE(getOption("shiny.testmode"))) {
Expand Down
2 changes: 1 addition & 1 deletion R/utils_insert_db.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ insert_riskmetric_to_db <- function(pkg_name, pkg_version = "",
# Get the metrics weights to be used during pkg_score.
metric_weights <- metric_weights_df$weight
names(metric_weights) <- metric_weights_df$name

riskmetric_score <-
riskmetric_assess %>%
riskmetric::pkg_score(weights = metric_weights)
Expand Down
11 changes: 6 additions & 5 deletions R/utils_startup.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ create_credentials_db <- function(db_name, admin_role = ""){

# Init the credentials table for credentials database
credentials <- data.frame(
user = "ADMIN",
password = "QWERTY1",
user = c("demo_admin", "demo_lead", "demo_reviewer", "demo_viewer"),
password = c("Admin@1", "Lead@1", "Reviewer@1", "Viewer@1"),
# password will automatically be hashed
admin = TRUE,
admin = c(TRUE,rep(FALSE,3)),
expire = as.character(get_Date()),
role = admin_role,
role = c("admin", "lead", "reviewer", "viewer"),
stringsAsFactors = FALSE
)

Expand All @@ -101,7 +101,8 @@ create_credentials_db <- function(db_name, admin_role = ""){
con, name = "pwd_mngt",
passphrase = passphrase) %>%
dplyr::mutate(must_change = ifelse(
have_changed == "TRUE", must_change, as.character(TRUE)))
user == "ADMIN" & have_changed == "FALSE",
as.character(TRUE), must_change))

shinymanager::write_db_encrypt(
con,
Expand Down
18 changes: 17 additions & 1 deletion app.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
# To deploy, run: rsconnect::deployApp()
# Or use the blue button on top of this file

Sys.setenv(GOLEM_CONFIG_ACTIVE = "demo")
# Sys.setenv(GOLEM_CONFIG_ACTIVE = "webinardemo")
# options(rsconnect.max.bundle.files = 20000)
options(shiny.fullstacktrace = TRUE)
pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE)
options( "golem.app.prod" = TRUE)
riskassessment::run_app() # add parameters here (if any)
riskassessment::run_app(
login_note = shiny::HTML(
"<em>Note:</em><br>
Use the following credentials to log on with varying roles & privileges in the app, expanded upon <a href='https://pharmar.github.io/riskassessment/articles/User_Roles_and_Privileges.html#roles' target='_blank'>here</a>:
<br><br>
U: <span style='text-transform:none;'><u>demo_admin</u></span>; &nbsp;&nbsp;&nbsp; P: <u><span style='text-transform:none;'>Admin@1</span></u>
<br>
U: <span style='text-transform:none;'><u>demo_lead</u></span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; P: <u><span style='text-transform:none;'>Lead@1</span></u>
<br>
U: <span style='text-transform:none;'><u>demo_reviewer</u></span>; P: <u><span style='text-transform:none;'>Reviewer@1</span></u>
<br>
U: <span style='text-transform:none;'><u>demo_viewer</u></span>; &nbsp;&nbsp; P: <u><span style='text-transform:none;'>Viewer@1</span></u>")
)
Binary file added credentials_demo.sqlite
Binary file not shown.
Binary file added credentials_webinar_demo.sqlite
Binary file not shown.
Binary file added database_demo.sqlite
Binary file not shown.
Binary file added database_webinar_demo.sqlite
Binary file not shown.
29 changes: 29 additions & 0 deletions dev/02_dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,32 @@ devtools::release(check = FALSE, args = "--no-build-vignettes")
# go to dev/03_deploy.R
rstudioapi::navigateToFile("dev/03_deploy.R")









install.packages("pharmaverse")

# June 2023
# 32 pkgs
pharmaverse2023 <-
c("admiral","tidytlg","tern","teal.slice","admiralvaccine","scda","scda.2022",
"sdtmcecks","ggsurvfit","logrx","tfrmt","riskassessment","xportr","rtables",
"teal.widgets","teal.logger","teal.data","admiralonco","admiralophtha",
"teal.code","teal.transform","teal","teal.reporter","riskmetric","covtracer",
"envsetup","pkglite","tidyCDISC","datacutr","covr","metatools","metacore",
"Tplyr","visR","synthetic.cdisc.data","valtools","respectables","pharmaRTF")
length(pharmaverse2023)

# Look at the APIs text string.
# https://pharmaverse.r-universe.dev/apis

# Jan 2025
# Should be 82 pkgs, but there is only 81
pharmaverse <- c("admiral","admiral.test","admiralonco","admiralophtha","admiralvaccine","autoslider.core","cards","cardx","chevron","covtracer","crmPack","CTP","datacutr","descem","dunlin","envsetup","facetsr","flexsurvPlus","formatters","gemtcPlus","ggplot2.utils","ggsurvfit","goshawk","hermes","logrx","MAIC","metacore","metatools","mmrm","mtdesign","nestcolor","nesttemplate","osprey","pharmaRTF","pharmaverseadam","pharmaversesdtm","psborrow","r.pkg.template","r2rtf","random.cdisc.data","rbmi","RDO","respectables","riskassessment","rlistings","roxy.shinylive","rpsftmPlus","rtables","rtables.officer","scda","scda.2021","scda.2022","sdtmchecks","simaerep","simIDM","staged.dependencies","syntrial","teal","teal.code","teal.data","teal.goshawk","teal.logger","teal.modules.clinical","teal.modules.general","teal.modules.hermes","teal.osprey","teal.reporter","teal.slice","teal.transform","teal.widgets","tern","tern.gee","tern.mmrm","tern.rbmi","tfrmt","tidyCDISC","tidytlg","Tplyr","valtools","visR","xportr")
length(pharmaverse)
data.frame(pharmaverse) |> write.csv("pharmaverse_Jan2025.csv")
82 changes: 82 additions & 0 deletions dev/pharmaverse_Jan2025.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
"","pharmaverse"
"1","admiral"
"2","admiral.test"
"3","admiralonco"
"4","admiralophtha"
"5","admiralvaccine"
"6","autoslider.core"
"7","cards"
"8","cardx"
"9","chevron"
"10","covtracer"
"11","crmPack"
"12","CTP"
"13","datacutr"
"14","descem"
"15","dunlin"
"16","envsetup"
"17","facetsr"
"18","flexsurvPlus"
"19","formatters"
"20","gemtcPlus"
"21","ggplot2.utils"
"22","ggsurvfit"
"23","goshawk"
"24","hermes"
"25","logrx"
"26","MAIC"
"27","metacore"
"28","metatools"
"29","mmrm"
"30","mtdesign"
"31","nestcolor"
"32","nesttemplate"
"33","osprey"
"34","pharmaRTF"
"35","pharmaverseadam"
"36","pharmaversesdtm"
"37","psborrow"
"38","r.pkg.template"
"39","r2rtf"
"40","random.cdisc.data"
"41","rbmi"
"42","RDO"
"43","respectables"
"44","riskassessment"
"45","rlistings"
"46","roxy.shinylive"
"47","rpsftmPlus"
"48","rtables"
"49","rtables.officer"
"50","scda"
"51","scda.2021"
"52","scda.2022"
"53","sdtmchecks"
"54","simaerep"
"55","simIDM"
"56","staged.dependencies"
"57","syntrial"
"58","teal"
"59","teal.code"
"60","teal.data"
"61","teal.goshawk"
"62","teal.logger"
"63","teal.modules.clinical"
"64","teal.modules.general"
"65","teal.modules.hermes"
"66","teal.osprey"
"67","teal.reporter"
"68","teal.slice"
"69","teal.transform"
"70","teal.widgets"
"71","tern"
"72","tern.gee"
"73","tern.mmrm"
"74","tern.rbmi"
"75","tfrmt"
"76","tidyCDISC"
"77","tidytlg"
"78","Tplyr"
"79","valtools"
"80","visR"
"81","xportr"
Loading