Skip to content

Commit

Permalink
Merge pull request #761 from pharmaR/bm-752
Browse files Browse the repository at this point in the history
`bm-752` Adds 'About' tab
  • Loading branch information
jthompson-arcus authored Apr 15, 2024
2 parents 0ad3888 + 0133a7a commit 1619e2b
Show file tree
Hide file tree
Showing 43 changed files with 248 additions and 37 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: riskassessment
Title: A web app designed to interface with the `riskmetric` package
Version: 3.0.0.9017
Version: 3.0.0.9018
Authors@R: c(
person("Aaron", "Clark", role = c("aut", "cre"), email = "aaron.clark@biogen.com"),
person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"),
person("Robert", "Krajcik", role = "aut", email = "robert.krajcik@biogen.com"),
person("Jeff", "Thompson", role = "aut", email = "jeff.thompson51317@gmail.com"),
person("Lars", "Andersen", role = "aut", email = "lars.andersen@boehringer-ingelheim.com"),
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ importFrom(sortable,sortable_js)
importFrom(sortable,sortable_js_capture_input)
importFrom(sortable,sortable_options)
importFrom(stats,lm)
importFrom(stats,na.omit)
importFrom(stats,predict)
importFrom(stringr,regex)
importFrom(stringr,str_extract)
Expand All @@ -144,6 +145,7 @@ importFrom(tools,Rd2HTML)
importFrom(tools,package_dependencies)
importFrom(utils,adist)
importFrom(utils,available.packages)
importFrom(utils,capture.output)
importFrom(utils,download.file)
importFrom(utils,getParseData)
importFrom(utils,head)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Utilize `{archive}` to parse DESCRIPTION file in package upload process
* Incorporates table to show reverse dependencies included in the database
* updated manifest file and deployments article
* Adds about page to help users understand the project a little more, providing useful resources and attribution

# riskassessment 3.0.0

Expand Down
13 changes: 10 additions & 3 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ app_server <- function(input, output, session) {
value = "admin-mode-tab",
h2("Administrative Tools & Options", align = "center", `padding-bottom`="20px"),
br(),

fluidRow(
column(
width = 10, offset = 1,
tabsetPanel(
id = "credentials",
if (res_auth$admin)
Expand All @@ -102,6 +106,7 @@ app_server <- function(input, output, session) {
title = "Assessment Reweighting",
reweightViewUI("reweightInfo")
)
))
),
tags$script(HTML("document.getElementById('admin-add_user').style.width = 'auto';"))
))
Expand Down Expand Up @@ -210,12 +215,14 @@ app_server <- function(input, output, session) {
})

observeEvent(input$apptabs, {
req(input$apptabs %in% c("risk-assessment-tab", "database-tab"))
req(input$apptabs %in% c("about-tab", "database-tab"))
session$userData$trigger_events$update_report_pref_inclusions <- session$userData$trigger_events$update_report_pref_inclusions + 1
})

# Load server of the assessment criteria module.
assessmentInfoServer("assessmentInfo", metric_weights = metric_weights)


# Load server of the about tab module
aboutInfoServer("aboutInfo", metric_weights)

# Load server of the database view module.
#parentSession <- .subset2(session, "parent")
Expand Down
20 changes: 12 additions & 8 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ app_ui <- function(request) {

theme = app_theme(), # defined in data-raw/interanl-data.R

div(id = "raa-logo", shiny::a(img(src="www/raa-alt-image-lt-ug2.png"), href = "https://pharmar.github.io/riskassessment/", target="_blank")),
div(id = "raa-logo", shiny::a(img(src="www/images/raa-alt-image-lt-ug2.png"), href = "https://pharmar.github.io/riskassessment/", target="_blank")),

tabsetPanel(
id = "apptabs",
Expand Down Expand Up @@ -98,13 +98,17 @@ app_ui <- function(request) {
value = "database-tab"
),

tabPanel(
title = "Assessment Criteria",
icon = icon("circle-info"),
assessmentInfoUI("assessmentInfo"),
value = "assessment-criteria-tab"
)
),

tabPanel(
title = "About",
icon = icon("circle-info"),
aboutInfoUI("aboutInfo"),
value = "about-tab"
)



),

wellPanel(
id = "footer",
Expand Down
2 changes: 2 additions & 0 deletions R/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ utils::globalVariables(
'old_role',
'package',
'Package',
'path',
'Published',
'Role',
'role',
'row_n',
'rpt_choices',
'score',
'setNames',
'size',
'status',
'succ_icon',
'text',
Expand Down
152 changes: 152 additions & 0 deletions R/mod_aboutInfo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
#' UI for 'About' Module
#'
#' @param id a module id name
#'
#' @importFrom DT dataTableOutput
#'
#' @keywords internal
#'
aboutInfoUI <- function(id) {
fluidPage(
fluidRow(
column(
width = 10, offset = 1,
h2("About", align = "center", `padding-bottom`="20px"),
br(),
# Assessment criteria sub-tab
tabsetPanel(
tabPanel(
title = "Assessment Criteria",
icon = icon("circle-info"),
br(),
fluidRow(
column(
width = 10, offset = 1,
assessmentInfoUI(NS(id,"assessmentInfo")) # call assessment module UI
))
),
# Contacts sub-tab
tabPanel(
title = "Contact",
icon = icon("envelope"),

# contacts description.
br(),
h2("Contact", align = "center", `padding-bottom`="20px"),
br(),
fluidRow(
column(
width = 10, offset = 1,
br(),
shiny::HTML(
"<h3><i class='fa fa-github' aria-hidden='true'></i> Report Issues </h3>
<p> To propose new features or report a bug, please review our open issues first on our
<a target='_blank' href='https://github.com/pharmaR/riskassessment/issues' > GitHub page</a>. If your topic hasn't been addressed, we highly encourage you to <a target='_blank' href='https://github.com/pharmaR/riskassessment/issues/new' >open a new issue</a>!</p>
<br>
<br>
<h3><i class='fa fa-coffee' aria-hidden='true'></i> Development Team </h3>
<p> Most all inquiries should flow through the GitHub page reference above (start there), but you may reach out to the lead developer at any time, especially if you would like to start contributing to the project!</p>
<br>
<ul>
<li>Aaron Clark [ <a href= 'mailto:clark.aaronchris@gmail.com?subject={riskassessment} inquiry'> Send Email </a> ] </li>
</ul>
<br>
<h3><img src='www/images/R_validation_hub_logo.png' alt='R Validation Hub Logo' style = 'height:50px;padding-right:8px;'>R Validation Hub </h3>
<p> To learn more about the work and initiatives of R Validation Hub, please visit <a target='_blank' href= 'https://www.pharmar.org/about/'>
https://www.pharmar.org/about/</a>. </p> ")
))
),
# Contributors sub-tab
tabPanel(
title = "Contributors and Companies",
icon = icon("address-card"),

br(),
h2("Contributors and Companies", align = "center", `padding-bottom`="20px"),
br(),
fluidRow(
column(
width = 10, offset = 1,
br(),
shiny::HTML(
"<h3> Official Workstream of the <a target='_blank' href='https://www.pharmar.org/'>R Validation Hub</a>.
<br/>Sponsored by the <a target='_blank' href='https://www.r-consortium.org//'>R Consortium</a></h3>
<br>
<img src='www/images/pharmaRlogo_large.png' alt='R Validation Hub Logo' style = 'height:130px;padding-right:50px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/rc_logo.png' alt = 'ProCogia logo' style='height:130px;padding-top:15px;padding-bottom:15px;'>
<br>
<br>
<h3> Collaborative Deployment hosted by <a target='_blank' href='https://procogia.com/'> ProCogia </a> </h3>
<br>
<img src='www/images/procogia_logo.png' alt = 'ProCogia logo' style='height:100px'>
<br>
<br>
<h3> Current Contributors </h3>
<ul>
<li> Aaron Clark, Arcus Biosciences </li>
<li> Narayanan Iyer, Pfizer </li>
<li> Robert Krajcik, Cytel </li>
<li> Barbara Mikulasova, Katalyze Data </li>
<li> Jeff Thompson, Arcus Biosciences </li>
</ul>
<br>
<h3> Past Contributors </h3>
<ul>
<li> Eduardo Almeida, Appsilon </li>
<li> Lars Andersen, Boehringer Ingelheim </li>
<li> Andrew Borgman, Biogen </li>
<li> Maya Gans, Cytel </li>
<li> Marly Gotti, Biogen </li>
<li> Munshi Imran Hossain, Cytel </li>
<li> Aravid Reddy Kallem, Fission Labs </li>
<li> Scott Schumacker, Canary Medical </li>
</ul>
<br>
<h3> Contributing Companies </h3>
<img src='www/images/appsilon_logo.jpg' alt='Appsilon' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/arcus_logo.png' alt='Arcus Biosciences' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/bi_logo.png' alt='Boehringer Ingelheim' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/biogen_logo.jpg' alt='Biogen' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/cytel.png' alt='Cytel' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/fission_logo.png' alt='Fission Labs India Pvt Ltd' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/gcp_logo.png' alt='GCP-Service International' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/GSK_logo.jpg' alt='GSK' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/katalyzedata_logo.jpg' alt='Katalyze Data' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/merck_logo.png' alt='Merck' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/pfizer_logo.png' alt='Pfizer' style = 'height:100px;padding-right:40px;padding-top:15px;padding-bottom:15px;'>
<img src='www/images/roche_logo.png' alt='Roche' style = 'height:100px;padding-top:15px;padding-bottom:15px;'>
<br>
<br>
<br>
<br>
")
))
)
)
)))
}

#' Server Logic for 'About' Module
#'
#' @param id a module id name
#' @param metric_weights object outputted from reweightViewServer()
#'
#' @keywords internal
#'
aboutInfoServer <- function(id, metric_weights) {
moduleServer(id, function(input, output, session) {

# Load server of the assessment criteria module.
assessmentInfoServer("assessmentInfo", metric_weights = metric_weights)

})
}
13 changes: 8 additions & 5 deletions R/mod_assessmentInfo.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#'
assessmentInfoUI <- function(id) {
fluidPage(
fluidRow(
column(
width = 8, offset = 2,
# fluidRow(
# column(
# width = 8, offset = 2,
h2("Assessment Criteria Overview", align = "center", `padding-bottom`="20px"),
br(),
tabsetPanel(
Expand All @@ -19,7 +19,9 @@ assessmentInfoUI <- function(id) {
h6("About Risk Calculation"),
uiOutput(NS(id, "riskcalc_desc")), # Maintenance metrics description.
br(),
DT::dataTableOutput(NS(id, "riskcalc_weights_table"))
column(width = 8, #offset = 2,
DT::dataTableOutput(NS(id, "riskcalc_weights_table"))
)
),
tabPanel(
title = "Maintenance Metrics",
Expand All @@ -42,7 +44,8 @@ assessmentInfoUI <- function(id) {
br(),
DT::dataTableOutput(NS(id, "testing_table")) # data table for testing metrics.
)
))))
# ))
))
}

#' Server Logic for 'Assessment Info' Module
Expand Down
5 changes: 3 additions & 2 deletions R/mod_code_explorer.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ mod_code_explorer_ui <- function(id){
#'
#' @importFrom tools Rd2HTML
#' @importFrom purrr map_dfr
#' @importFrom archive archive_read archive
#' @importFrom archive archive_read archive
#' @importFrom utils capture.output
mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal(), creating_dir = reactiveVal(TRUE), user, credentials){
moduleServer( id, function(input, output, session){
ns <- session$ns
Expand Down Expand Up @@ -158,7 +159,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal(
file = fp)
Rdfile <-tools::parse_Rd(con)
close(con)
HTML(paste0(capture.output(tools::Rd2HTML(Rdfile,
HTML(paste0(utils::capture.output(tools::Rd2HTML(Rdfile,
package = c(selected_pkg$name(),
selected_pkg$version()), out = "")), collapse = "\n"))
}) %>%
Expand Down
7 changes: 5 additions & 2 deletions R/mod_code_explorer_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ get_exported_functions <- function(pkg_name, pkg_version) {
#' @noRd
#'
#' @importFrom utils getParseData
#' @importFrom stats na.omit
#'
get_parse_data <- function(type = c("test", "source"), pkgarchive, pkg_name, pkg_version, funcnames = NULL) {

type <- match.arg(type)
Expand All @@ -52,7 +54,7 @@ get_parse_data <- function(type = c("test", "source"), pkgarchive, pkg_name, pkg
,
source = file.path(glue::glue("{pkg_name}"), "R")
)
filenames <- na.omit((str_extract(pkgarchive$path,paste0(dirpath, ".+\\.[R|r]$"))))
filenames <- stats::na.omit((str_extract(pkgarchive$path,paste0(dirpath, ".+\\.[R|r]$"))))
dplyr::bind_rows(lapply(filenames, function(filename) {
con <- archive::archive_read(file.path("tarballs",
glue::glue("{pkg_name}_{pkg_version}.tar.gz")),
Expand Down Expand Up @@ -119,10 +121,11 @@ get_source_files <- function(funcname, parse_data) {
#' @param funcname The name of the function to evaluate
#' @param pkgArchive The package directory
#'
#' @importFrom stats na.omit
#' @noRd
get_man_files <- function(funcname, pkgarchive, pkg_name, pkg_version) {

man_files <- na.omit((str_extract(pkgarchive$path,
man_files <- stats::na.omit((str_extract(pkgarchive$path,
paste(glue::glue("{pkg_name}"), "man", ".+\\.Rd$", sep ="/"))))
funcname_regex <-
gsub("([.|()\\^{}+$*?]|\\[|\\])", "\\\\\\1", funcname) %>%
Expand Down
6 changes: 5 additions & 1 deletion R/mod_databaseView.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ databaseViewUI <- function(id) {
tagList(
h2("Database Overview", align = "center", `padding-bottom`="20px"),
br(),
fluidRow(
column(
width = 10, offset = 1,
tabsetPanel(
tabPanel(
"Uploaded Packages",
column(
width = 8, offset = 2, align = "center",
width = 10, offset = 1, align = "center",
tags$section(
div(class = "box",
div(class = "box-header",
Expand Down Expand Up @@ -90,6 +93,7 @@ databaseViewUI <- function(id) {
))
)
)
))
}

#' Server logic for 'Database View' module
Expand Down
4 changes: 2 additions & 2 deletions R/mod_introJS_utils_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ sidebar_steps <-
# appui tab widgets
apptab_steps <- data.frame(
element = c(
"[data-value=assessment-criteria-tab]", "[data-value=database-tab]"),
intro = c("Discover the package assessment process & criteria",
"[data-value=about-tab]", "[data-value=database-tab]"),
intro = c("Discover more about the project, including the package assessment process & how to contact the maintainers.",
"Review the R packages that already exist in the database"),
position = c(rep("bottom", 2))
)
Expand Down
Loading

0 comments on commit 1619e2b

Please sign in to comment.