From 178d35dfa45c4139d2e01ac7a45ad51375fbc604 Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:37:25 +0530 Subject: [PATCH 01/39] update --- R/mod_code_explorer.R | 51 +++++++++++++++++++++++++++++++++++++ R/mod_code_explorer_utils.R | 11 ++++++++ 2 files changed, 62 insertions(+) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 0a74d3337..ff2011fbd 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -31,6 +31,14 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( } else { div(introJSUI(NS(id, "introJS")), br(), + fluidRow(column(2,offset = 8, + conditionalPanel( + condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", + actionButton(ns("next_button"),label = "Next"))), + column(2, + conditionalPanel( + condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", + actionButton(ns("prev_button"),label = "Prev")))), fluidRow( column(3, wellPanel( @@ -166,6 +174,49 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( introJSServer("introJS", text = reactive(fe_steps), user, credentials) + observeEvent(input$next_button,{ + if (input$next_button > 0){ + shinyjs::runjs(' + // debugger; + var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + if( $index == window.$highlights_list.length -1) { + + var $gh = window.$highlights_list[0] + + } + else + { + var $gh = window.$highlights_list[$index +1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + ') + } + + }) + + observeEvent(input$prev_button,{ + if (input$next_button > 0){ + shinyjs::runjs(' + // debugger; + var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + if( $index ==0) { + var $gh = window.$highlights_list[window.$highlights_list.length -1] + + + } + else + { + var $gh = window.$highlights_list[$index -1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + ') + } + + }) output$file_output <- renderUI({ switch (input$file_type, test = test_code(), diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index f0cbcd6bf..f9bd5edea 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -169,9 +169,20 @@ renderCode <- function(lines, hlindex) { }) ), tags$script(HTML(" + document.querySelectorAll('.code pre').forEach(bl => { hljs.highlightBlock(bl); }); + + debugger; + var $highlights_list = document.querySelectorAll('.highlight') + if(typeof($highlights_list) != 'undefined'){ + var $gh = document.querySelector('.highlight') + var $target = document.querySelector('#code_explorer-file_viewer') + // debugger; + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + } ")) ) } From 687dfd435e9af17c9ac10428a37c9227fbea990e Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:37:25 +0530 Subject: [PATCH 02/39] update --- R/mod_code_explorer.R | 51 +++++++++++++++++++++++++++++++++++++ R/mod_code_explorer_utils.R | 11 ++++++++ 2 files changed, 62 insertions(+) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 7d0ebffda..288dcf229 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -32,6 +32,14 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( } else { div(introJSUI(NS(id, "introJS")), br(), + fluidRow(column(2,offset = 8, + conditionalPanel( + condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", + actionButton(ns("next_button"),label = "Next"))), + column(2, + conditionalPanel( + condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", + actionButton(ns("prev_button"),label = "Prev")))), fluidRow( column(3, wellPanel( @@ -167,6 +175,49 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( introJSServer("introJS", text = reactive(fe_steps), user, credentials) + observeEvent(input$next_button,{ + if (input$next_button > 0){ + shinyjs::runjs(' + // debugger; + var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + if( $index == window.$highlights_list.length -1) { + + var $gh = window.$highlights_list[0] + + } + else + { + var $gh = window.$highlights_list[$index +1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + ') + } + + }) + + observeEvent(input$prev_button,{ + if (input$next_button > 0){ + shinyjs::runjs(' + // debugger; + var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + if( $index ==0) { + var $gh = window.$highlights_list[window.$highlights_list.length -1] + + + } + else + { + var $gh = window.$highlights_list[$index -1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + ') + } + + }) output$file_output <- renderUI({ switch (input$file_type, test = test_code(), diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index 9d73ceec6..621524b0d 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -172,9 +172,20 @@ renderCode <- function(lines, hlindex) { }) ), tags$script(HTML(" + document.querySelectorAll('.code pre').forEach(bl => { hljs.highlightBlock(bl); }); + + debugger; + var $highlights_list = document.querySelectorAll('.highlight') + if(typeof($highlights_list) != 'undefined'){ + var $gh = document.querySelector('.highlight') + var $target = document.querySelector('#code_explorer-file_viewer') + // debugger; + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + } ")) ) } From 56df0cc77beb7eea70fab5cbb6e0f3b75dfd5fbc Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 14 May 2024 17:50:51 +0530 Subject: [PATCH 03/39] update --- R/mod_code_explorer.R | 29 +++++++++++++++-------------- R/mod_code_explorer_utils.R | 6 +++--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 288dcf229..eaaeee44f 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -135,7 +135,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( close(con) func_list <- c(input$exported_function, paste0("`", input$exported_function, "`")) highlight_index <- parse_data() %>% - filter(stringr::str_ends(file, input$test_files) & func %in% func_list) %>% + filter(basename(file) == input$test_files & func %in% func_list) %>% pull(line) renderCode(lines, highlight_index) }) %>% @@ -152,7 +152,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( close(con) func_list <- c(input$exported_function, paste0("`", input$exported_function, "`")) highlight_index <- parse_data() %>% - filter(stringr::str_ends(file, input$source_files) & func %in% func_list) %>% + filter(basename(file) == input$source_files & func %in% func_list) %>% pull(line) renderCode(lines, highlight_index) }) %>% @@ -178,42 +178,43 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$next_button,{ if (input$next_button > 0){ shinyjs::runjs(' - // debugger; - var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); - if( $index == window.$highlights_list.length -1) { + + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); + if( $index == $highlights_list.length -1) { - var $gh = window.$highlights_list[0] + $gh = $highlights_list[0] } else { - var $gh = window.$highlights_list[$index +1] + $gh = $highlights_list[$index +1] } + var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + $target.scrollTop =$gh.offsetTop -40; ') } }) observeEvent(input$prev_button,{ - if (input$next_button > 0){ + if (input$prev_button > 0){ shinyjs::runjs(' - // debugger; - var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); if( $index ==0) { - var $gh = window.$highlights_list[window.$highlights_list.length -1] + $gh = $highlights_list[$highlights_list.length -1] } else { - var $gh = window.$highlights_list[$index -1] + $gh = $highlights_list[$index -1] } var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + $target.scrollTop = $gh.offsetTop - 40; ') } diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index 621524b0d..299c39076 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -177,14 +177,14 @@ renderCode <- function(lines, hlindex) { hljs.highlightBlock(bl); }); - debugger; var $highlights_list = document.querySelectorAll('.highlight') if(typeof($highlights_list) != 'undefined'){ + var $gh = document.querySelector('.highlight') + var $target = document.querySelector('#code_explorer-file_viewer') - // debugger; $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + $target.scrollTop = $gh.offsetTop - 40; } ")) ) From 252f7ad29851ab5090e740cf90b46ae0d0aeb58a Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 14 May 2024 20:55:39 +0530 Subject: [PATCH 04/39] update --- R/mod_code_explorer.R | 69 ++++++++++++++++++++----------------- R/mod_code_explorer_utils.R | 4 +-- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index eaaeee44f..97d6ca78f 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -31,15 +31,24 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( showHelperMessage(message = glue::glue("Source code not available for {{{selected_pkg$name()}}}")) } else { div(introJSUI(NS(id, "introJS")), - br(), - fluidRow(column(2,offset = 8, + fluidRow(style = "height:35px !important;", + column(2,offset = 10, conditionalPanel( condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", - actionButton(ns("next_button"),label = "Next"))), - column(2, + actionButton(ns("prev_button"),label = "",icon = icon("chevron-left"), + style ="width: 32px !important; + height: 32px !important; + font-size: 16px !important; + line-height: 5px !important; + padding: 0px !important;") |>bslib::tooltip("Previous occurence"), style = "display: inline-block;"), conditionalPanel( condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", - actionButton(ns("prev_button"),label = "Prev")))), + actionButton(ns("next_button"),label = "",icon = icon("chevron-right"), + style = "width: 32px !important; + height: 32px !important; + font-size: 16px !important; + line-height: 5px !important; + padding: 0px !important;")|>bslib::tooltip("Next occurence",placement ="right"), style = "display: inline-block;"))), fluidRow( column(3, wellPanel( @@ -178,21 +187,21 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$next_button,{ if (input$next_button > 0){ shinyjs::runjs(' - - var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); - if( $index == $highlights_list.length -1) { + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); + if( $index == $highlights_list.length -1) + { - $gh = $highlights_list[0] + $curr_sel = $highlights_list[0] - } - else - { - $gh = $highlights_list[$index +1] - } + } + else + { + $curr_sel = $highlights_list[$index +1] + } - var $target = document.querySelector("#code_explorer-file_viewer") - $target.scrollTop = 0; - $target.scrollTop =$gh.offsetTop -40; + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop =$curr_sel.offsetTop -40; ') } @@ -201,20 +210,18 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$prev_button,{ if (input$prev_button > 0){ shinyjs::runjs(' - - var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); - if( $index ==0) { - $gh = $highlights_list[$highlights_list.length -1] - - - } - else - { - $gh = $highlights_list[$index -1] - } - var $target = document.querySelector("#code_explorer-file_viewer") - $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - 40; + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); + if( $index ==0) + { + $curr_sel = $highlights_list[$highlights_list.length -1] + } + else + { + $curr_sel = $highlights_list[$index -1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; # scroll to the top + $target.scrollTop = $curr_sel.offsetTop - 40; ') } diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index 299c39076..69300b70d 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -180,11 +180,11 @@ renderCode <- function(lines, hlindex) { var $highlights_list = document.querySelectorAll('.highlight') if(typeof($highlights_list) != 'undefined'){ - var $gh = document.querySelector('.highlight') + var $curr_sel = document.querySelector('.highlight') var $target = document.querySelector('#code_explorer-file_viewer') $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - 40; + $target.scrollTop = $curr_sel.offsetTop - 40; } ")) ) From 397f5ad5dee942b1283c4fbdc0e6f305f5078f7a Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 14 May 2024 22:09:41 +0530 Subject: [PATCH 05/39] add navigation controls Add navigation controls to function explorer tab --- DESCRIPTION | 2 +- NEWS.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 09e7f6ba0..f0b818e91 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package -Version: 3.0.0.9020 +Version: 3.0.0.9021 Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Robert", "Krajcik", role = "aut", email = "robert.krajcik@biogen.com"), diff --git a/NEWS.md b/NEWS.md index d9261afc7..2c2d89d0c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -23,6 +23,7 @@ * Added more context to the metric score card visuals by inserting tool tips & creating a legend modal that describes & interprets all possible visuals (#652) * Added `{riskmetric}` assessment documentation URLs to About tab, on Risk Assessment Criteria page. * Updated the Dependency Cards to be slightly more informative +* Added navigation controls in Function Explorer tab. # riskassessment 3.0.0 From bca68f948c515faab9d4b3f76a92467c6086a199 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Tue, 14 May 2024 19:37:26 +0000 Subject: [PATCH 06/39] Re-build manifest file --- manifest.json | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/manifest.json b/manifest.json index f65595aed..878846f90 100644 --- a/manifest.json +++ b/manifest.json @@ -80,14 +80,7 @@ "Maintainer": "Marcel Ramos ", "Repository": "RSPM", "Date/Publication": "2023-08-08 23:40:06 UTC", - "Built": "R 4.3.0; ; 2023-08-09 11:24:46 UTC; unix", - "RemoteType": "standard", - "RemotePkgRef": "BiocManager", - "RemoteRef": "BiocManager", - "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", - "RemoteReposName": "CRAN", - "RemotePkgPlatform": "source", - "RemoteSha": "1.30.22" + "Built": "R 4.3.0; ; 2023-08-09 11:24:46 UTC; unix" } }, "DBI": { @@ -947,7 +940,7 @@ "RoxygenNote": "7.3.0", "Author": "Sebastien Rochette [aut, cre] (),\n Vincent Guyader [aut] (),\n Arthur Bréant [aut] (),\n Murielle Delmotte [aut] (),\n ThinkR [cph]", "Maintainer": "Sebastien Rochette ", - "Built": "R 4.3.3; ; 2024-04-30 19:03:05 UTC; unix", + "Built": "R 4.3.3; ; 2024-05-14 16:45:15 UTC; unix", "RemoteType": "github", "RemoteUsername": "thinkr-open", "RemoteRepo": "checkhelper", @@ -1310,7 +1303,7 @@ "Imports": "callr,\ncranlike (>= 1.0.2),\ncurl,\ndesc (>= 1.1.0),\ndigest,\nparsedate,\nrappdirs,\nrematch2,\ntools,\nutils,\nwithr", "Suggests": "covr,\npingr,\ntestthat,\nzip", "Encoding": "UTF-8", - "Built": "R 4.3.3; ; 2024-04-30 19:03:13 UTC; unix", + "Built": "R 4.3.3; ; 2024-05-14 16:45:23 UTC; unix", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "r-lib", @@ -4410,7 +4403,7 @@ "RoxygenNote": "7.2.3", "Author": "Gábor Csárdi [cre, aut, cph],\n Hadley Wickham [aut],\n RConsortium [cph],\n RStudio [cph, fnd]", "Maintainer": "Gábor Csárdi ", - "Built": "R 4.3.3; ; 2024-04-30 19:03:46 UTC; unix", + "Built": "R 4.3.3; ; 2024-05-14 16:45:55 UTC; unix", "RemoteType": "github", "RemoteUsername": "r-lib", "RemoteRepo": "revdepcheck", @@ -4528,7 +4521,7 @@ "Config/testthat/edition": "3", "Author": "R Validation Hub [aut],\n Doug Kelkhoff [aut],\n Marly Gotti [aut],\n Eli Miller [cre, aut],\n Kevin K [aut],\n Yilong Zhang [aut],\n Eric Milliman [aut],\n Juliane Manitz [aut],\n Mark Padgham [ctb],\n PSI special interest group Application and Implementation of\n Methodologies in Statistics [cph]", "Maintainer": "Eli Miller ", - "Built": "R 4.3.3; ; 2024-04-30 19:03:52 UTC; unix", + "Built": "R 4.3.3; ; 2024-05-14 16:46:00 UTC; unix", "RemoteType": "github", "RemoteUsername": "pharmaR", "RemoteRepo": "riskmetric", @@ -5101,7 +5094,7 @@ "Maintainer": "Barret Schloerke ", "Repository": "RSPM", "Date/Publication": "2023-08-26 13:50:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-12-04 11:55:11 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-08-28 11:40:29 UTC; unix" } }, "sortable": { @@ -6205,7 +6198,7 @@ "checksum": "77a60b438dc99504d00b3f1b8bbc68c8" }, "DESCRIPTION": { - "checksum": "ed68114e40c06e742a6cdb0d34f5ddf9" + "checksum": "0e46a273454297087402bede0202718b" }, "inst/app/www/css/community_metrics.css": { "checksum": "f08eb25c2ee48ac22ed63b0d18994a04" @@ -6409,7 +6402,7 @@ "checksum": "60c2908e00b99b39cc28bdab6d6a5f3c" }, "NEWS.md": { - "checksum": "3a683ee2adb456bdc7a58ab604c4c241" + "checksum": "e2459a4b82048dcb48db23f08b33f5b2" }, "R/app_config.R": { "checksum": "c2b61f270b86b6833f0ee39c44a1a440" @@ -6433,10 +6426,10 @@ "checksum": "61459e71d1e62587597ac1dac2c7c650" }, "R/mod_code_explorer_utils.R": { - "checksum": "fe3bd5c1243d0ba649d070a6ecf29560" + "checksum": "8c8d69c2431385b76971f6b413923c7e" }, "R/mod_code_explorer.R": { - "checksum": "72a36a8c4d7f15e0da013104177328b1" + "checksum": "4be660d4a8b6f4b9835ec236d4f14dd5" }, "R/mod_communityMetrics.R": { "checksum": "fdd39bd2a7e19b8dccc195aaec57a3d8" From cea4988d12a7f3c1da662a9a0a07a6298e3f1504 Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:37:25 +0530 Subject: [PATCH 07/39] update --- R/mod_code_explorer.R | 51 +++++++++++++++++++++++++++++++++++++ R/mod_code_explorer_utils.R | 11 ++++++++ 2 files changed, 62 insertions(+) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 7d0ebffda..288dcf229 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -32,6 +32,14 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( } else { div(introJSUI(NS(id, "introJS")), br(), + fluidRow(column(2,offset = 8, + conditionalPanel( + condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", + actionButton(ns("next_button"),label = "Next"))), + column(2, + conditionalPanel( + condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", + actionButton(ns("prev_button"),label = "Prev")))), fluidRow( column(3, wellPanel( @@ -167,6 +175,49 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( introJSServer("introJS", text = reactive(fe_steps), user, credentials) + observeEvent(input$next_button,{ + if (input$next_button > 0){ + shinyjs::runjs(' + // debugger; + var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + if( $index == window.$highlights_list.length -1) { + + var $gh = window.$highlights_list[0] + + } + else + { + var $gh = window.$highlights_list[$index +1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + ') + } + + }) + + observeEvent(input$prev_button,{ + if (input$next_button > 0){ + shinyjs::runjs(' + // debugger; + var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + if( $index ==0) { + var $gh = window.$highlights_list[window.$highlights_list.length -1] + + + } + else + { + var $gh = window.$highlights_list[$index -1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + ') + } + + }) output$file_output <- renderUI({ switch (input$file_type, test = test_code(), diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index 9d73ceec6..621524b0d 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -172,9 +172,20 @@ renderCode <- function(lines, hlindex) { }) ), tags$script(HTML(" + document.querySelectorAll('.code pre').forEach(bl => { hljs.highlightBlock(bl); }); + + debugger; + var $highlights_list = document.querySelectorAll('.highlight') + if(typeof($highlights_list) != 'undefined'){ + var $gh = document.querySelector('.highlight') + var $target = document.querySelector('#code_explorer-file_viewer') + // debugger; + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + } ")) ) } From 5bf11796335ac59bbcf4eb61b8e332ee7b79567f Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 14 May 2024 17:50:51 +0530 Subject: [PATCH 08/39] update --- R/mod_code_explorer.R | 29 +++++++++++++++-------------- R/mod_code_explorer_utils.R | 6 +++--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 288dcf229..eaaeee44f 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -135,7 +135,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( close(con) func_list <- c(input$exported_function, paste0("`", input$exported_function, "`")) highlight_index <- parse_data() %>% - filter(stringr::str_ends(file, input$test_files) & func %in% func_list) %>% + filter(basename(file) == input$test_files & func %in% func_list) %>% pull(line) renderCode(lines, highlight_index) }) %>% @@ -152,7 +152,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( close(con) func_list <- c(input$exported_function, paste0("`", input$exported_function, "`")) highlight_index <- parse_data() %>% - filter(stringr::str_ends(file, input$source_files) & func %in% func_list) %>% + filter(basename(file) == input$source_files & func %in% func_list) %>% pull(line) renderCode(lines, highlight_index) }) %>% @@ -178,42 +178,43 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$next_button,{ if (input$next_button > 0){ shinyjs::runjs(' - // debugger; - var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); - if( $index == window.$highlights_list.length -1) { + + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); + if( $index == $highlights_list.length -1) { - var $gh = window.$highlights_list[0] + $gh = $highlights_list[0] } else { - var $gh = window.$highlights_list[$index +1] + $gh = $highlights_list[$index +1] } + var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + $target.scrollTop =$gh.offsetTop -40; ') } }) observeEvent(input$prev_button,{ - if (input$next_button > 0){ + if (input$prev_button > 0){ shinyjs::runjs(' - // debugger; - var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); if( $index ==0) { - var $gh = window.$highlights_list[window.$highlights_list.length -1] + $gh = $highlights_list[$highlights_list.length -1] } else { - var $gh = window.$highlights_list[$index -1] + $gh = $highlights_list[$index -1] } var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + $target.scrollTop = $gh.offsetTop - 40; ') } diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index 621524b0d..299c39076 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -177,14 +177,14 @@ renderCode <- function(lines, hlindex) { hljs.highlightBlock(bl); }); - debugger; var $highlights_list = document.querySelectorAll('.highlight') if(typeof($highlights_list) != 'undefined'){ + var $gh = document.querySelector('.highlight') + var $target = document.querySelector('#code_explorer-file_viewer') - // debugger; $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + $target.scrollTop = $gh.offsetTop - 40; } ")) ) From 7a83009ca2aa8d97d5d0b28d9f3d10649c71de94 Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 14 May 2024 20:55:39 +0530 Subject: [PATCH 09/39] update --- R/mod_code_explorer.R | 69 ++++++++++++++++++++----------------- R/mod_code_explorer_utils.R | 4 +-- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index eaaeee44f..97d6ca78f 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -31,15 +31,24 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( showHelperMessage(message = glue::glue("Source code not available for {{{selected_pkg$name()}}}")) } else { div(introJSUI(NS(id, "introJS")), - br(), - fluidRow(column(2,offset = 8, + fluidRow(style = "height:35px !important;", + column(2,offset = 10, conditionalPanel( condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", - actionButton(ns("next_button"),label = "Next"))), - column(2, + actionButton(ns("prev_button"),label = "",icon = icon("chevron-left"), + style ="width: 32px !important; + height: 32px !important; + font-size: 16px !important; + line-height: 5px !important; + padding: 0px !important;") |>bslib::tooltip("Previous occurence"), style = "display: inline-block;"), conditionalPanel( condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", - actionButton(ns("prev_button"),label = "Prev")))), + actionButton(ns("next_button"),label = "",icon = icon("chevron-right"), + style = "width: 32px !important; + height: 32px !important; + font-size: 16px !important; + line-height: 5px !important; + padding: 0px !important;")|>bslib::tooltip("Next occurence",placement ="right"), style = "display: inline-block;"))), fluidRow( column(3, wellPanel( @@ -178,21 +187,21 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$next_button,{ if (input$next_button > 0){ shinyjs::runjs(' - - var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); - if( $index == $highlights_list.length -1) { + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); + if( $index == $highlights_list.length -1) + { - $gh = $highlights_list[0] + $curr_sel = $highlights_list[0] - } - else - { - $gh = $highlights_list[$index +1] - } + } + else + { + $curr_sel = $highlights_list[$index +1] + } - var $target = document.querySelector("#code_explorer-file_viewer") - $target.scrollTop = 0; - $target.scrollTop =$gh.offsetTop -40; + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop =$curr_sel.offsetTop -40; ') } @@ -201,20 +210,18 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$prev_button,{ if (input$prev_button > 0){ shinyjs::runjs(' - - var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($gh)); - if( $index ==0) { - $gh = $highlights_list[$highlights_list.length -1] - - - } - else - { - $gh = $highlights_list[$index -1] - } - var $target = document.querySelector("#code_explorer-file_viewer") - $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - 40; + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); + if( $index ==0) + { + $curr_sel = $highlights_list[$highlights_list.length -1] + } + else + { + $curr_sel = $highlights_list[$index -1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; # scroll to the top + $target.scrollTop = $curr_sel.offsetTop - 40; ') } diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index 299c39076..69300b70d 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -180,11 +180,11 @@ renderCode <- function(lines, hlindex) { var $highlights_list = document.querySelectorAll('.highlight') if(typeof($highlights_list) != 'undefined'){ - var $gh = document.querySelector('.highlight') + var $curr_sel = document.querySelector('.highlight') var $target = document.querySelector('#code_explorer-file_viewer') $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - 40; + $target.scrollTop = $curr_sel.offsetTop - 40; } ")) ) From 866c0591cc215bd2b90d4c266aba00bfb5ef98f9 Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:37:25 +0530 Subject: [PATCH 10/39] update --- R/mod_code_explorer.R | 17 +++++++++++++++++ R/mod_code_explorer_utils.R | 9 ++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 97d6ca78f..03de377ea 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -49,6 +49,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( font-size: 16px !important; line-height: 5px !important; padding: 0px !important;")|>bslib::tooltip("Next occurence",placement ="right"), style = "display: inline-block;"))), + fluidRow( column(3, wellPanel( @@ -202,12 +203,27 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; $target.scrollTop =$curr_sel.offsetTop -40; + + var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); + if( $index == window.$highlights_list.length -1) { + + var $gh = window.$highlights_list[0] + + } + else + { + var $gh = window.$highlights_list[$index +1] + } + var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; ') } }) observeEvent(input$prev_button,{ + if (input$prev_button > 0){ shinyjs::runjs(' var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); @@ -222,6 +238,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; # scroll to the top $target.scrollTop = $curr_sel.offsetTop - 40; + ') } diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index 69300b70d..c86a8627b 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -176,7 +176,6 @@ renderCode <- function(lines, hlindex) { document.querySelectorAll('.code pre').forEach(bl => { hljs.highlightBlock(bl); }); - var $highlights_list = document.querySelectorAll('.highlight') if(typeof($highlights_list) != 'undefined'){ @@ -185,6 +184,14 @@ renderCode <- function(lines, hlindex) { var $target = document.querySelector('#code_explorer-file_viewer') $target.scrollTop = 0; $target.scrollTop = $curr_sel.offsetTop - 40; + var $highlights_list = document.querySelectorAll('.highlight') + if(typeof($highlights_list) != 'undefined'){ + var $gh = document.querySelector('.highlight') + var $target = document.querySelector('#code_explorer-file_viewer') + + $target.scrollTop = 0; + $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + } ")) ) From 6305885b7726ed5da4de0de03a6c6d830b80de62 Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 14 May 2024 22:09:41 +0530 Subject: [PATCH 11/39] add js to create and update search index --- DESCRIPTION | 2 ++ NEWS.md | 2 +- R/mod_code_explorer.R | 49 ++++++++++++++++++++++++++++++++++--- R/mod_code_explorer_utils.R | 5 +++- 4 files changed, 53 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fd83d1722..f1dcfbb73 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,8 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package + Version: 3.0.0.9023 + Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Robert", "Krajcik", role = "aut", email = "robert.krajcik@biogen.com"), diff --git a/NEWS.md b/NEWS.md index bf828f38b..c771cb016 100644 --- a/NEWS.md +++ b/NEWS.md @@ -27,7 +27,7 @@ * Allow users to specify decisions in the CSV upload file (#663) * Fix bug causing application to crash when trying to delete zero packages (#781) * Add `Decision` column to Package Dependencies tab so that users (#774) - +* Added navigation controls in Function Explorer tab. # riskassessment 3.0.0 diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 03de377ea..1b4cca209 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -31,6 +31,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( showHelperMessage(message = glue::glue("Source code not available for {{{selected_pkg$name()}}}")) } else { div(introJSUI(NS(id, "introJS")), + fluidRow(style = "height:35px !important;", column(2,offset = 10, conditionalPanel( @@ -50,6 +51,8 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( line-height: 5px !important; padding: 0px !important;")|>bslib::tooltip("Next occurence",placement ="right"), style = "display: inline-block;"))), + + fluidRow( column(3, wellPanel( @@ -87,7 +90,28 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( div(id = ns("file_viewer"), uiOutput(ns("file_output"), class = "file_browser"), style = "height: 62vh; overflow: auto; border: 1px solid var(--bs-border-color-translucent);" - ) + ), + br(), + fluidRow(style = "height:35px !important;", + column(4,offset = 8, + conditionalPanel( + condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", + actionButton(ns("prev_button"),label = "",icon = icon("chevron-left"), + style ="width: 32px !important; + height: 32px !important; + font-size: 16px !important; + line-height: 5px !important; + padding: 0px !important;") |>bslib::tooltip("Previous occurence"), style = "display: inline-block;", + + div(id = "search_index","",style ="display:inline"), + actionButton(ns("next_button"),label = "",icon = icon("chevron-right"), + style = "width: 32px !important; + height: 32px !important; + font-size: 16px !important; + line-height: 5px !important; + padding: 0px !important; + display:inline; + ")|>bslib::tooltip("Next occurence",placement ="right"), style = "display: inline-block;"))) ) ), br(), br(), @@ -184,24 +208,30 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( bindEvent(input$man_files, input$exported_function, ignoreNULL = FALSE) introJSServer("introJS", text = reactive(fe_steps), user, credentials) + search_index_value <- reactiveVal(1) + highlight_list <- reactiveVal(1) observeEvent(input$next_button,{ if (input$next_button > 0){ shinyjs::runjs(' + var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); if( $index == $highlights_list.length -1) { $curr_sel = $highlights_list[0] + search_index.innerHTML = 1 + " of " + $highlights_list.length; } else { $curr_sel = $highlights_list[$index +1] + search_index.innerHTML = ( $index+2) + " of " + $highlights_list.length; } var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; + $target.scrollTop =$curr_sel.offsetTop -40; var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); @@ -217,6 +247,10 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + + $target.scrollTop =$curr_sel.offsetTop -40; + + ') } @@ -225,21 +259,30 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$prev_button,{ if (input$prev_button > 0){ - shinyjs::runjs(' - var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); + + shinyjs::runjs('var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); if( $index ==0) { $curr_sel = $highlights_list[$highlights_list.length -1] + search_index.innerHTML = $highlights_list.length + " of " + $highlights_list.length; } else { $curr_sel = $highlights_list[$index -1] + search_index.innerHTML = ($index) + " of " + $highlights_list.length; } var $target = document.querySelector("#code_explorer-file_viewer") + $target.scrollTop = 0; # scroll to the top $target.scrollTop = $curr_sel.offsetTop - 40; ') + + $target.scrollTop = 0; // scroll to the top + $target.scrollTop = $curr_sel.offsetTop - 40; + + ') + } }) diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index c86a8627b..e0efe02da 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -183,7 +183,7 @@ renderCode <- function(lines, hlindex) { var $target = document.querySelector('#code_explorer-file_viewer') $target.scrollTop = 0; - $target.scrollTop = $curr_sel.offsetTop - 40; + $target.scrollTop = $curr_sel.offsetTop - 40; var $highlights_list = document.querySelectorAll('.highlight') if(typeof($highlights_list) != 'undefined'){ var $gh = document.querySelector('.highlight') @@ -192,6 +192,9 @@ renderCode <- function(lines, hlindex) { $target.scrollTop = 0; $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; + var $index1 =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)) +1; + + search_index.innerHTML = $index1 + ' of ' + $highlights_list.length; } ")) ) From d2d94608e803e81dd4e650218ff7d464b7602d5c Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 14 May 2024 22:09:41 +0530 Subject: [PATCH 12/39] add navigation controls Add navigation controls to function explorer tab --- DESCRIPTION | 2 -- 1 file changed, 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f1dcfbb73..fd83d1722 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package - Version: 3.0.0.9023 - Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Robert", "Krajcik", role = "aut", email = "robert.krajcik@biogen.com"), From d3703567e4ce92250427daedbe6d4372271a2f20 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Tue, 14 May 2024 19:37:26 +0000 Subject: [PATCH 13/39] Add navigation in function explorer --- R/mod_code_explorer.R | 52 ++----------------------------------- R/mod_code_explorer_utils.R | 13 +--------- manifest.json | 4 +-- 3 files changed, 5 insertions(+), 64 deletions(-) diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 1b4cca209..d04d3d6e5 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -31,28 +31,6 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( showHelperMessage(message = glue::glue("Source code not available for {{{selected_pkg$name()}}}")) } else { div(introJSUI(NS(id, "introJS")), - - fluidRow(style = "height:35px !important;", - column(2,offset = 10, - conditionalPanel( - condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", - actionButton(ns("prev_button"),label = "",icon = icon("chevron-left"), - style ="width: 32px !important; - height: 32px !important; - font-size: 16px !important; - line-height: 5px !important; - padding: 0px !important;") |>bslib::tooltip("Previous occurence"), style = "display: inline-block;"), - conditionalPanel( - condition = "typeof(window.$highlights_list) != 'undefined' && window.$highlights_list.length > 1", - actionButton(ns("next_button"),label = "",icon = icon("chevron-right"), - style = "width: 32px !important; - height: 32px !important; - font-size: 16px !important; - line-height: 5px !important; - padding: 0px !important;")|>bslib::tooltip("Next occurence",placement ="right"), style = "display: inline-block;"))), - - - fluidRow( column(3, wellPanel( @@ -214,7 +192,6 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( observeEvent(input$next_button,{ if (input$next_button > 0){ shinyjs::runjs(' - var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); if( $index == $highlights_list.length -1) { @@ -232,32 +209,12 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( var $target = document.querySelector("#code_explorer-file_viewer") $target.scrollTop = 0; - $target.scrollTop =$curr_sel.offsetTop -40; - - var $index =Array.from(window.$highlights_list).findIndex(node => node.isEqualNode(window.$gh)); - if( $index == window.$highlights_list.length -1) { - - var $gh = window.$highlights_list[0] - - } - else - { - var $gh = window.$highlights_list[$index +1] - } - var $target = document.querySelector("#code_explorer-file_viewer") - $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; - - $target.scrollTop =$curr_sel.offsetTop -40; - - - ') + $target.scrollTop =$curr_sel.offsetTop -40; ') } }) observeEvent(input$prev_button,{ - if (input$prev_button > 0){ shinyjs::runjs('var $index =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)); @@ -273,16 +230,11 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( } var $target = document.querySelector("#code_explorer-file_viewer") - $target.scrollTop = 0; # scroll to the top + $target.scrollTop = 0; $target.scrollTop = $curr_sel.offsetTop - 40; ') - $target.scrollTop = 0; // scroll to the top - $target.scrollTop = $curr_sel.offsetTop - 40; - - ') - } }) diff --git a/R/mod_code_explorer_utils.R b/R/mod_code_explorer_utils.R index e0efe02da..d2e1a2ab9 100644 --- a/R/mod_code_explorer_utils.R +++ b/R/mod_code_explorer_utils.R @@ -177,23 +177,12 @@ renderCode <- function(lines, hlindex) { hljs.highlightBlock(bl); }); var $highlights_list = document.querySelectorAll('.highlight') - if(typeof($highlights_list) != 'undefined'){ - var $curr_sel = document.querySelector('.highlight') - + if(typeof($highlights_list) != 'undefined' & $curr_sel != null){ var $target = document.querySelector('#code_explorer-file_viewer') $target.scrollTop = 0; $target.scrollTop = $curr_sel.offsetTop - 40; - var $highlights_list = document.querySelectorAll('.highlight') - if(typeof($highlights_list) != 'undefined'){ - var $gh = document.querySelector('.highlight') - var $target = document.querySelector('#code_explorer-file_viewer') - - $target.scrollTop = 0; - $target.scrollTop = $gh.offsetTop - $target.offsetTop + $target.scrollTop; - var $index1 =Array.from($highlights_list).findIndex(node => node.isEqualNode($curr_sel)) +1; - search_index.innerHTML = $index1 + ' of ' + $highlights_list.length; } ")) diff --git a/manifest.json b/manifest.json index 83cfda632..b3286df63 100644 --- a/manifest.json +++ b/manifest.json @@ -6490,10 +6490,10 @@ "checksum": "61459e71d1e62587597ac1dac2c7c650" }, "R/mod_code_explorer_utils.R": { - "checksum": "fe3bd5c1243d0ba649d070a6ecf29560" + "checksum": "8c8d69c2431385b76971f6b413923c7e" }, "R/mod_code_explorer.R": { - "checksum": "72a36a8c4d7f15e0da013104177328b1" + "checksum": "4be660d4a8b6f4b9835ec236d4f14dd5" }, "R/mod_communityMetrics.R": { "checksum": "fdd39bd2a7e19b8dccc195aaec57a3d8" From fd2cd34d1033ad8ce3e1b3bb1f80cc68a07db8d5 Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:09:11 +0530 Subject: [PATCH 14/39] Add navigation to function explorer --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fd83d1722..20686c2b5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package -Version: 3.0.0.9023 +Version: 3.0.0.9024 Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Robert", "Krajcik", role = "aut", email = "robert.krajcik@biogen.com"), diff --git a/NEWS.md b/NEWS.md index c771cb016..d047b7e8e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -27,7 +27,7 @@ * Allow users to specify decisions in the CSV upload file (#663) * Fix bug causing application to crash when trying to delete zero packages (#781) * Add `Decision` column to Package Dependencies tab so that users (#774) -* Added navigation controls in Function Explorer tab. +* Added navigation controls in Function Explorer tab (#644) # riskassessment 3.0.0 From 4820531ec909af10e78638b1d4eddaa3d98c18d1 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 12 Jun 2024 12:31:20 +0000 Subject: [PATCH 15/39] Re-build manifest file --- manifest.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index b3286df63..b86583d36 100644 --- a/manifest.json +++ b/manifest.json @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-06-06 17:15:02 UTC; unix" + "Built": "R 4.3.3; ; 2024-06-12 12:30:38 UTC; unix" } }, "reprex": { @@ -6220,7 +6220,7 @@ "checksum": "99c5575cb81828e20a7fe1d205551316" }, "DESCRIPTION": { - "checksum": "c4ce70d1592eea23d969d53b917c4a5b" + "checksum": "c7e19a728e7d1cb04961c5695ed151c2" }, "inst/app/www/css/community_metrics.css": { "checksum": "f08eb25c2ee48ac22ed63b0d18994a04" @@ -6463,7 +6463,7 @@ "checksum": "97d1232340e04c53088bc8f814133dcd" }, "NEWS.md": { - "checksum": "f9bc97131b3753ea173bff4248b97e1f" + "checksum": "876dad435c429e277f1f9b234ed8ec5c" }, "R/app_config.R": { "checksum": "c2b61f270b86b6833f0ee39c44a1a440" @@ -6490,10 +6490,10 @@ "checksum": "61459e71d1e62587597ac1dac2c7c650" }, "R/mod_code_explorer_utils.R": { - "checksum": "8c8d69c2431385b76971f6b413923c7e" + "checksum": "2588e180a69a79b7be4e3818eb3931dc" }, "R/mod_code_explorer.R": { - "checksum": "4be660d4a8b6f4b9835ec236d4f14dd5" + "checksum": "13c706c439a980b617e960b93414ad5c" }, "R/mod_communityMetrics.R": { "checksum": "fdd39bd2a7e19b8dccc195aaec57a3d8" From 2c6c0b726ff717afa500216225fff4a60656fe35 Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:14:01 -0400 Subject: [PATCH 16/39] Initialize developmental version 3.1.0.9000 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index cae55f247..2b0b0f030 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package -Version: 3.1.0 +Version: 3.1.0.9000 Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Robert", "Krajcik", role = "aut", email = "robert.krajcik@biogen.com"), diff --git a/NEWS.md b/NEWS.md index 8882138a5..a492a3ca3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# riskassessment (development version) + # riskassessment 3.1.0 ### User Enhancements From c0ddf6bc4e68c2f62961d1e8dd9f54887526ffa6 Mon Sep 17 00:00:00 2001 From: narayanan-iyer-pfizer <114721252+narayanan-iyer-pfizer@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:50:05 +0530 Subject: [PATCH 17/39] update code to handle help pages --- DESCRIPTION | 2 +- R/mod_code_explorer.R | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4527f72f8..19b5e74ba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package -Version: 3.1.0.9001 +Version: 3.1.0.9002 Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Jeff", "Thompson", role = c("aut"), email = "jeff.thompson51317@gmail.com", comment = "Co-Lead"), diff --git a/R/mod_code_explorer.R b/R/mod_code_explorer.R index 537fa7470..2259f2158 100644 --- a/R/mod_code_explorer.R +++ b/R/mod_code_explorer.R @@ -31,6 +31,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( showHelperMessage(message = glue::glue("Source code not available for {{{selected_pkg$name()}}}")) } else { div(introJSUI(NS(id, "introJS")), + br(), fluidRow( column(3, wellPanel( @@ -177,8 +178,12 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( con <- archive::archive_read(file.path("tarballs", glue::glue("{selected_pkg$name()}_{selected_pkg$version()}.tar.gz")), file = fp) + Rdfile <-tools::parse_Rd(con) close(con) + shinyjs::runjs(' + $highlights_list = undefined;') + HTML(paste0(utils::capture.output(tools::Rd2HTML(Rdfile, package = c(selected_pkg$name(), selected_pkg$version()), out = "")), collapse = "\n")) @@ -222,6 +227,7 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal( { $curr_sel = $highlights_list[$highlights_list.length -1] search_index.innerHTML = $highlights_list.length + " of " + $highlights_list.length; + } else { $curr_sel = $highlights_list[$index -1] From a360341490338f8b269ee91d59b6567c82e0d5e8 Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Mon, 8 Jul 2024 08:26:21 -0400 Subject: [PATCH 18/39] Update DESCRIPTION --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 19b5e74ba..4527f72f8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package -Version: 3.1.0.9002 +Version: 3.1.0.9001 Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Jeff", "Thompson", role = c("aut"), email = "jeff.thompson51317@gmail.com", comment = "Co-Lead"), From e6d8f8f1c05b8fd3536ec31622cd7d4b424a5976 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Mon, 8 Jul 2024 12:37:34 +0000 Subject: [PATCH 19/39] Re-build manifest file --- manifest.json | 126 +++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/manifest.json b/manifest.json index b86583d36..149014a82 100644 --- a/manifest.json +++ b/manifest.json @@ -495,7 +495,7 @@ "Repository": "RSPM", "Date/Publication": "2019-03-21 14:53:46 UTC", "Encoding": "UTF-8", - "Built": "R 4.3.0; ; 2023-04-21 23:12:04 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:08:11 UTC; unix" } }, "attachment": { @@ -884,7 +884,7 @@ "Maintainer": "Gábor Csárdi ", "Repository": "RSPM", "Date/Publication": "2024-03-25 13:30:06 UTC", - "Built": "R 4.3.0; ; 2024-03-26 04:09:18 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:13:07 UTC; unix" } }, "cellranger": { @@ -940,7 +940,7 @@ "RoxygenNote": "7.3.0", "Author": "Sebastien Rochette [aut, cre] (),\n Vincent Guyader [aut] (),\n Arthur Bréant [aut] (),\n Murielle Delmotte [aut] (),\n ThinkR [cph]", "Maintainer": "Sebastien Rochette ", - "Built": "R 4.3.3; ; 2024-05-31 13:18:53 UTC; unix", + "Built": "R 4.3.3; ; 2024-06-26 14:09:33 UTC; unix", "RemoteType": "github", "RemoteUsername": "thinkr-open", "RemoteRepo": "checkhelper", @@ -1091,7 +1091,7 @@ "Maintainer": "Gábor Csárdi ", "Repository": "RSPM", "Date/Publication": "2017-05-21 17:19:19 UTC", - "Built": "R 4.3.0; ; 2023-04-21 23:59:26 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:08:30 UTC; unix" } }, "codetools": { @@ -1113,7 +1113,7 @@ "Repository": "RSPM", "Date/Publication": "2024-03-31 20:10:06 UTC", "Encoding": "UTF-8", - "Built": "R 4.3.0; ; 2024-04-01 04:31:41 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:09:39 UTC; unix" } }, "colorspace": { @@ -1168,7 +1168,7 @@ "Maintainer": "Jeroen Ooms ", "Repository": "RSPM", "Date/Publication": "2024-01-30 12:40:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-01-31 11:23:09 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:11:40 UTC; unix" } }, "config": { @@ -1303,7 +1303,7 @@ "Imports": "callr,\ncranlike (>= 1.0.2),\ncurl,\ndesc (>= 1.1.0),\ndigest,\nparsedate,\nrappdirs,\nrematch2,\ntools,\nutils,\nwithr", "Suggests": "covr,\npingr,\ntestthat,\nzip", "Encoding": "UTF-8", - "Built": "R 4.3.3; ; 2024-05-31 13:19:02 UTC; unix", + "Built": "R 4.3.3; ; 2024-06-26 14:09:41 UTC; unix", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "r-lib", @@ -1619,7 +1619,7 @@ "Author": "Gábor Csárdi [aut, cre],\n Kirill Müller [aut],\n Jim Hester [aut],\n Maëlle Salmon [ctb] (),\n Posit Software, PBC [cph, fnd]", "Repository": "RSPM", "Date/Publication": "2023-12-10 11:40:08 UTC", - "Built": "R 4.3.0; ; 2023-12-11 11:23:17 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:12:53 UTC; unix" } }, "devtools": { @@ -1678,7 +1678,7 @@ "Maintainer": "Brodie Gaslam ", "Repository": "RSPM", "Date/Publication": "2021-10-05 07:10:17 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-12-05 15:53:05 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:10:14 UTC; unix" } }, "digest": { @@ -1763,7 +1763,7 @@ "Maintainer": "Hadley Wickham ", "Repository": "RSPM", "Date/Publication": "2023-11-17 16:50:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-11-20 11:24:11 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:19:26 UTC; unix" } }, "dtplyr": { @@ -1874,7 +1874,7 @@ "Maintainer": "Brodie Gaslam ", "Repository": "RSPM", "Date/Publication": "2023-12-08 03:30:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-12-11 11:22:55 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:12:46 UTC; unix" } }, "farver": { @@ -1976,7 +1976,7 @@ "License_is_FOSS": "yes", "Repository": "RSPM", "Date/Publication": "2017-02-01 00:53:34", - "Built": "R 4.3.0; ; 2023-04-21 23:12:59 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:12:25 UTC; unix" } }, "fontLiberation": { @@ -2000,7 +2000,7 @@ "Repository": "RSPM", "Date/Publication": "2016-10-15 11:24:18", "License_is_FOSS": "yes", - "Built": "R 4.3.0; ; 2023-04-21 23:16:26 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:17:44 UTC; unix" } }, "fontawesome": { @@ -2055,7 +2055,7 @@ "Maintainer": "Lionel Henry ", "Repository": "RSPM", "Date/Publication": "2017-02-01 00:52:56", - "Built": "R 4.3.0; ; 2023-04-21 23:17:27 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:19:02 UTC; unix" } }, "forcats": { @@ -2085,7 +2085,7 @@ "Maintainer": "Hadley Wickham ", "Repository": "RSPM", "Date/Publication": "2023-01-29 22:20:02 UTC", - "Built": "R 4.3.0; ; 2023-04-21 21:48:15 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:18:24 UTC; unix" } }, "formattable": { @@ -2206,7 +2206,7 @@ "Maintainer": "David Gohel ", "Repository": "RSPM", "Date/Publication": "2024-03-05 05:30:36 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-03-06 12:27:04 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:20:08 UTC; unix" } }, "generics": { @@ -2291,7 +2291,7 @@ "Maintainer": "Victor Perrier ", "Repository": "RSPM", "Date/Publication": "2023-01-08 18:50:02 UTC", - "Built": "R 4.3.0; ; 2023-04-21 23:24:33 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:18:39 UTC; unix" } }, "ggplot2": { @@ -2735,7 +2735,7 @@ "Maintainer": "Carson Sievert ", "Repository": "RSPM", "Date/Publication": "2024-04-04 05:03:00 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-04-05 04:36:19 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:13:22 UTC; unix" } }, "htmlwidgets": { @@ -2788,7 +2788,7 @@ "Maintainer": "Scott Chamberlain ", "Repository": "RSPM", "Date/Publication": "2020-04-10 06:20:02 UTC", - "Built": "R 4.3.0; ; 2023-04-21 23:12:24 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:09:47 UTC; unix" } }, "httpuv": { @@ -2846,7 +2846,7 @@ "Maintainer": "Hadley Wickham ", "Repository": "RSPM", "Date/Publication": "2023-08-15 09:00:02 UTC", - "Built": "R 4.3.0; ; 2023-08-16 11:12:55 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:13:00 UTC; unix" } }, "httr2": { @@ -3036,7 +3036,7 @@ "Author": "Jeroen Ooms [aut, cre] (),\n Duncan Temple Lang [ctb],\n Lloyd Hilaiel [cph] (author of bundled libyajl)", "Repository": "RSPM", "Date/Publication": "2023-12-04 15:20:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-12-05 15:35:32 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:11:19 UTC; unix" } }, "kableExtra": { @@ -3177,7 +3177,7 @@ "Repository": "RSPM", "Date/Publication": "2024-03-20 06:10:02 UTC", "Encoding": "UTF-8", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-03-21 04:08:18 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:09:33 UTC; unix" } }, "lazyeval": { @@ -3323,7 +3323,7 @@ "Author": "Vitalie Spinu [aut, cre],\n Garrett Grolemund [aut],\n Hadley Wickham [aut],\n Davis Vaughan [ctb],\n Ian Lyttle [ctb],\n Imanuel Costigan [ctb],\n Jason Law [ctb],\n Doug Mitarotonda [ctb],\n Joseph Larmarange [ctb],\n Jonathan Boiser [ctb],\n Chel Hee Lee [ctb]", "Repository": "RSPM", "Date/Publication": "2023-09-27 09:20:06 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-09-28 17:36:46 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:11:33 UTC; unix" } }, "magrittr": { @@ -3728,7 +3728,7 @@ "Maintainer": "Gábor Csárdi ", "Repository": "RSPM", "Date/Publication": "2024-03-17 14:40:02 UTC", - "Built": "R 4.3.0; ; 2024-03-18 15:33:34 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:13:21 UTC; unix" } }, "pkgconfig": { @@ -3813,7 +3813,7 @@ "Maintainer": "Lionel Henry ", "Repository": "RSPM", "Date/Publication": "2024-01-16 12:20:04 UTC", - "Built": "R 4.3.0; ; 2024-01-17 20:14:30 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:13:45 UTC; unix" } }, "plogr": { @@ -3913,7 +3913,7 @@ "Repository": "RSPM", "Date/Publication": "2015-08-11 08:22:28", "Encoding": "UTF-8", - "Built": "R 4.3.0; ; 2023-04-21 22:20:15 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:08:12 UTC; unix" } }, "prettyunits": { @@ -3966,7 +3966,7 @@ "Maintainer": "Gábor Csárdi ", "Repository": "RSPM", "Date/Publication": "2024-03-16 14:50:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-03-18 14:03:48 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:12:45 UTC; unix" } }, "profvis": { @@ -4020,7 +4020,7 @@ "Maintainer": "Gábor Csárdi ", "Repository": "RSPM", "Date/Publication": "2023-12-06 10:30:02 UTC", - "Built": "R 4.3.0; ; 2023-12-07 11:15:15 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:17:54 UTC; unix" } }, "promises": { @@ -4079,7 +4079,7 @@ "Maintainer": "Gábor Csárdi ", "Repository": "RSPM", "Date/Publication": "2024-01-18 06:40:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-01-19 11:18:37 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:12:26 UTC; unix" } }, "purrr": { @@ -4110,7 +4110,7 @@ "Maintainer": "Hadley Wickham ", "Repository": "RSPM", "Date/Publication": "2023-08-10 08:20:07 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-12-12 11:29:03 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-22 04:22:05 UTC; unix" } }, "ragg": { @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-06-12 12:30:38 UTC; unix" + "Built": "R 4.3.3; ; 2024-07-08 12:36:44 UTC; unix" } }, "reprex": { @@ -4425,7 +4425,7 @@ "RoxygenNote": "7.2.3", "Author": "Gábor Csárdi [cre, aut, cph],\n Hadley Wickham [aut],\n RConsortium [cph],\n RStudio [cph, fnd]", "Maintainer": "Gábor Csárdi ", - "Built": "R 4.3.3; ; 2024-05-31 13:19:35 UTC; unix", + "Built": "R 4.3.3; ; 2024-06-26 14:10:12 UTC; unix", "RemoteType": "github", "RemoteUsername": "r-lib", "RemoteRepo": "revdepcheck", @@ -4543,7 +4543,7 @@ "Config/testthat/edition": "3", "Author": "R Validation Hub [aut],\n Doug Kelkhoff [aut],\n Marly Gotti [aut],\n Eli Miller [cre, aut],\n Kevin K [aut],\n Yilong Zhang [aut],\n Eric Milliman [aut],\n Juliane Manitz [aut],\n Mark Padgham [ctb],\n PSI special interest group Application and Implementation of\n Methodologies in Statistics [cph]", "Maintainer": "Eli Miller ", - "Built": "R 4.3.3; ; 2024-05-31 13:19:40 UTC; unix", + "Built": "R 4.3.3; ; 2024-06-26 14:10:18 UTC; unix", "RemoteType": "github", "RemoteUsername": "pharmaR", "RemoteRepo": "riskmetric", @@ -4697,7 +4697,7 @@ "Maintainer": "Kirill Müller ", "Repository": "RSPM", "Date/Publication": "2023-11-05 10:20:02 UTC", - "Built": "R 4.3.0; ; 2023-11-06 22:20:26 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:09:48 UTC; unix" } }, "rstudioapi": { @@ -4807,7 +4807,7 @@ "Maintainer": "Carson Sievert ", "Repository": "RSPM", "Date/Publication": "2024-03-15 22:30:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-03-17 04:06:04 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:13:49 UTC; unix" } }, "scales": { @@ -4949,7 +4949,7 @@ "Maintainer": "Winston Chang ", "Repository": "RSPM", "Date/Publication": "2024-04-02 17:22:03 UTC", - "Built": "R 4.3.0; ; 2024-04-03 04:13:26 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:17:24 UTC; unix" } }, "shinyAce": { @@ -5606,7 +5606,7 @@ "Packaged": "2023-03-04 21:40:31 UTC; ironholds", "Repository": "RSPM", "Date/Publication": "2023-03-04 23:30:07 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-01-11 13:07:40 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:11:40 UTC; unix" } }, "tzdb": { @@ -5691,7 +5691,7 @@ "Packaged": "2019-04-14 22:25:08 UTC; ironholds", "Repository": "RSPM", "Date/Publication": "2019-04-14 23:02:47 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-01-11 13:12:34 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:13:32 UTC; unix" } }, "usethis": { @@ -5771,7 +5771,7 @@ "Repository": "RSPM", "Date/Publication": "2024-01-14 15:20:05 UTC", "Encoding": "UTF-8", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-01-15 15:43:14 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:08:39 UTC; unix" } }, "vctrs": { @@ -5801,7 +5801,7 @@ "Maintainer": "Davis Vaughan ", "Repository": "RSPM", "Date/Publication": "2023-12-01 23:50:02 UTC", - "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2023-12-04 11:50:37 UTC; unix" + "Built": "R 4.3.0; x86_64-pc-linux-gnu; 2024-06-25 22:13:43 UTC; unix" } }, "viridisLite": { @@ -5889,7 +5889,7 @@ "Maintainer": "Hadley Wickham ", "Repository": "RSPM", "Date/Publication": "2023-11-02 13:10:02 UTC", - "Built": "R 4.3.0; ; 2023-11-03 18:33:22 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:19:41 UTC; unix" } }, "websocket": { @@ -5996,7 +5996,7 @@ "Maintainer": "Lionel Henry ", "Repository": "RSPM", "Date/Publication": "2024-01-16 14:20:02 UTC", - "Built": "R 4.3.0; ; 2024-01-17 20:13:58 UTC; unix" + "Built": "R 4.3.0; ; 2024-06-25 22:08:10 UTC; unix" } }, "xfun": { @@ -6202,7 +6202,7 @@ "checksum": "b92bdc0d72dbb64e7cf767514486ec62" }, "data-raw/internal-data.R": { - "checksum": "33c0142c3bb1bbba56e83fa0439778e7" + "checksum": "1012b9a74fd027e081b3a81bc863358e" }, "data-raw/maintenance.csv": { "checksum": "f5bb530b482daa092e9e20f6a069f1aa" @@ -6220,7 +6220,7 @@ "checksum": "99c5575cb81828e20a7fe1d205551316" }, "DESCRIPTION": { - "checksum": "c7e19a728e7d1cb04961c5695ed151c2" + "checksum": "ea81f750b1ae3fa6b3ebf79e5668a3ee" }, "inst/app/www/css/community_metrics.css": { "checksum": "f08eb25c2ee48ac22ed63b0d18994a04" @@ -6400,13 +6400,13 @@ "checksum": "d3436d70ab382e65f2979ca0c4c20041" }, "inst/report_downloads/reportDocx.Rmd": { - "checksum": "788fc881cc4446504a88888fa55e2cfa" + "checksum": "449e8dcb07732ecd9a0963bada90e53e" }, "inst/report_downloads/reportHtml.Rmd": { - "checksum": "dc9c51d3badaf67a4f13fe5a5bbb57f4" + "checksum": "0e49db815a61c6698acad37894a9c0c1" }, "inst/report_downloads/reportPdf.Rmd": { - "checksum": "86b922fc17ccc912a82a6cb881281b0a" + "checksum": "3c7cfa456a7a171df1f10f9c1690718c" }, "inst/sql_queries/create_comments_table.sql": { "checksum": "514c169e358f7613d8026e6a9fd211ce" @@ -6451,7 +6451,7 @@ "checksum": "5fc0bfdb844b4ce7df8a183e2a4a2f96" }, "inst/WORDLIST": { - "checksum": "ad214434052cd9e20e2542994162b5f7" + "checksum": "52903eb411c9301dc68168bbca5bc4c1" }, "LICENSE": { "checksum": "ab496eda3728cf54db7cbf3e6f752572" @@ -6463,7 +6463,7 @@ "checksum": "97d1232340e04c53088bc8f814133dcd" }, "NEWS.md": { - "checksum": "876dad435c429e277f1f9b234ed8ec5c" + "checksum": "29db451dbb57771e940e1911eac5407f" }, "R/app_config.R": { "checksum": "c2b61f270b86b6833f0ee39c44a1a440" @@ -6475,13 +6475,13 @@ "checksum": "50d68f46171151cd36457a7154e5a7a3" }, "R/global.R": { - "checksum": "3b969b3b79cfdf02d2a66fe78b3106c5" + "checksum": "dec06e3d38ec3811b87ecb8c85a0c38f" }, "R/mod_aboutInfo_utils.R": { "checksum": "23ff3c99869bd59ed973d031ee2962fd" }, "R/mod_aboutInfo.R": { - "checksum": "5240534ac7d4291a0514c01106442e6f" + "checksum": "1ccb24c4960467461139c1050aafc91e" }, "R/mod_addComment.R": { "checksum": "9a4f5a5b10f127040705dbdaa312b693" @@ -6493,7 +6493,7 @@ "checksum": "2588e180a69a79b7be4e3818eb3931dc" }, "R/mod_code_explorer.R": { - "checksum": "13c706c439a980b617e960b93414ad5c" + "checksum": "1ec3f3aac096efff1e0c360b347e2d32" }, "R/mod_communityMetrics.R": { "checksum": "fdd39bd2a7e19b8dccc195aaec57a3d8" @@ -6508,7 +6508,7 @@ "checksum": "e22e1f4c044bc9f11c46a5fcdba33063" }, "R/mod_downloadHandler.R": { - "checksum": "20126728855935201f75b0e36d444175" + "checksum": "9c00f033ca9565f3a466e7381025e368" }, "R/mod_introJS_utils_text.R": { "checksum": "d98620a891752cf54b0d0282ddaa4af6" @@ -6532,7 +6532,7 @@ "checksum": "a894eb9114e258feb99b76cdca557cd2" }, "R/mod_packageDependencies.R": { - "checksum": "05b1fbde1ace35aa787552552744b057" + "checksum": "6fffb51829775826e242824f268062b6" }, "R/mod_pkg_explorer_utils.R": { "checksum": "b7792e08cc4a67296c9df0f452c0a72a" @@ -6541,7 +6541,7 @@ "checksum": "dbbfdfde47d106e0deaf20822c69bf94" }, "R/mod_reportPreview.R": { - "checksum": "56d62f285d64f5846cf266c79bac5b6a" + "checksum": "1fff75a23e54c9d8dac895731b03ac3a" }, "R/mod_reweightView.R": { "checksum": "d3988b7b6168f0560dc9525f1c6138ed" @@ -6550,7 +6550,7 @@ "checksum": "23b9449e99966583e564db213543ff97" }, "R/mod_uploadPackage.R": { - "checksum": "2c71c26d2377612815435bf641100d29" + "checksum": "abe41b854f1f97505cd3230386f5e3c3" }, "R/mod_user_roles.R": { "checksum": "269c932105ac12a53c92759e5d2c8a84" @@ -6562,31 +6562,31 @@ "checksum": "6c4740fd1aea22825c231eec5d8d9578" }, "R/sysdata.rda": { - "checksum": "b610fc73187b7cd23521deb9339d54cf" + "checksum": "e5835b81f48d93ee0175507abbb3186f" }, "R/utils_build_cards.R": { - "checksum": "d18d58e66e64b22eb2fcf5a3a0f59694" + "checksum": "f79316fe637bb1f4038f085621d298f5" }, "R/utils_config_db.R": { "checksum": "74cf2ee5e7283483a88f08d60e3728b0" }, "R/utils_get_db.R": { - "checksum": "270a240f5882ec130989f252fe18011f" + "checksum": "6e87d4d43f93b4a4b556d72b848dc3f1" }, "R/utils_insert_db.R": { - "checksum": "ee28bd9e4f053e7ee936d7d8ef5fe887" + "checksum": "2c02e4eab4d9262ef8c8e64eb0f1b4f5" }, "R/utils_startup.R": { "checksum": "b689ee96f0761480ac65ca22cbbb4980" }, "R/utils.R": { - "checksum": "dd8cda3fb9deb392b6f82798f26bd668" + "checksum": "995d947896038bdcec381ff4b4e94fd0" }, "README.md": { - "checksum": "d7e84fce2c891619912b6cc552eecc94" + "checksum": "3050edd46ad46d37978030b0026d5d1f" }, "README.Rmd": { - "checksum": "633aa5476aee5b230f43f1b935be34d7" + "checksum": "a2eefba927d32d8c78d4e385178a93b7" }, "renv.lock": { "checksum": "d7b9816932ef58733e25081235f6fc78" From ffb1dad13353baa6a75ec4cbcf8f6bd426782529 Mon Sep 17 00:00:00 2001 From: "Aaron Clark (Arcus)" Date: Mon, 8 Jul 2024 09:51:06 -0400 Subject: [PATCH 20/39] fix bug crashing the app on pkg deps for pkgs with no dep information. --- R/mod_packageDependencies.R | 8 ++++- R/utils_build_cards.R | 1 - R/utils_get_db.R | 72 +++++++++++++++++++------------------ 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/R/mod_packageDependencies.R b/R/mod_packageDependencies.R index 78f6ed05a..72cadaac4 100644 --- a/R/mod_packageDependencies.R +++ b/R/mod_packageDependencies.R @@ -123,7 +123,13 @@ packageDependenciesServer <- function(id, selected_pkg, user, credentials, paren } ) # this is so the dependencies is also a 0x2 tibble like suggests - if (rlang::is_empty(pkgref()$dependencies[[1]])) depends(dplyr::tibble(package = character(0), type = character(0), name = character(0))) + if (rlang::is_empty(pkgref()$dependencies[[1]])) { + depends( + dplyr::tibble(package = character(0), type = character(0), name = character(0), + version = character(0), score = character(0), decision = character(0), + decision_id = character(0)) + ) + } revdeps(pkgref()$reverse_dependencies[[1]] %>% as.vector()) diff --git a/R/utils_build_cards.R b/R/utils_build_cards.R index 48ff9ae8e..f10d56f51 100644 --- a/R/utils_build_cards.R +++ b/R/utils_build_cards.R @@ -256,7 +256,6 @@ build_dep_cards <- function(data, loaded, toggled){ is_url = numeric(), type = character() ) - deps <- data %>% mutate(base = if_else(name %in% c(rownames(installed.packages(priority = "base"))), "Base", "Non-Base")) %>% diff --git a/R/utils_get_db.R b/R/utils_get_db.R index 04f957d7a..3836be4ee 100644 --- a/R/utils_get_db.R +++ b/R/utils_get_db.R @@ -239,6 +239,42 @@ get_metric_data <- function(pkg_name, metric_class = 'maintenance', db_name = go ) } +#' Get Dependency Pkg Versions and Scores +#' +#' +#' @param pkg_name character name of the package +#' @param verify_data a data.frame used to verify whether a pkg exists in the db +#' @param cran_pkgs a data.frame containing all available cran package names/versions +#' +#' @returns a list +#' @noRd +get_versnScore <- function(pkg_name, verify_data, cran_pkgs) { + + if (rlang::is_empty(pkg_name)) + return(list(name = character(), version = character(), score = character(), + decision_id = character(), decision = character())) + + if (pkg_name %in% verify_data$name) { #loaded2_db()$name + tmp_df <- verify_data %>% filter(name == pkg_name) %>% select(score, version, decision_id, decision) + pkg_score <- tmp_df %>% pull(score) %>% as.character + pkg_versn <- tmp_df %>% pull(version) %>% as.character + pkg_decision_id <- tmp_df %>% pull(decision_id) %>% as.character + pkg_decision <- tmp_df %>% pull(decision) %>% as.character + } else { + pkg_score <- "" + pkg_versn <- if_else(pkg_name %in% c(rownames(installed.packages(priority="base"))), "", + subset(cran_pkgs, Package == pkg_name, c("Version")) %>% as.character()) + pkg_decision_id <- "" + pkg_decision <- "" + } + + return(list(name = pkg_name, version = pkg_versn, score = pkg_score, + decision_id = pkg_decision_id, decision = pkg_decision + )) +} + + + #' The 'Get Dependencies Metrics Data' function #' #' Pull the depenencies data for a specific package id, and create @@ -277,7 +313,7 @@ get_depends_data <- function(pkg_name, deps_decision_data <- purrr::map_df(deep_ends$name, ~get_versnScore(.x, loaded2_db, repo_pkgs)) if(nrow(deps_decision_data) == 0) { deps_w_decision <- dplyr::tibble(name = character(0), version = character(0), - score = character(0), decision = character(0), decision_id = character(0)) + score = character(0), decision = character(0), decision_id = character(0)) } else { deps_w_decision <- deps_decision_data } @@ -407,40 +443,6 @@ get_assess_blob <- function(pkg_lst, db_name = golem::get_golem_options('assessm } -#' Get Dependency Pkg Versions and Scores -#' -#' -#' @param pkg_name character name of the package -#' @param verify_data a data.frame used to verify whether a pkg exists in the db -#' @param cran_pkgs a data.frame containing all available cran package names/versions -#' -#' @returns a list -#' @noRd -get_versnScore <- function(pkg_name, verify_data, cran_pkgs) { - - if (rlang::is_empty(pkg_name)) - return(list(name = character(), version = character(), score = character(), - decision_id = character(), decision = character())) - - if (pkg_name %in% verify_data$name) { #loaded2_db()$name - tmp_df <- verify_data %>% filter(name == pkg_name) %>% select(score, version, decision_id, decision) - pkg_score <- tmp_df %>% pull(score) %>% as.character - pkg_versn <- tmp_df %>% pull(version) %>% as.character - pkg_decision_id <- tmp_df %>% pull(decision_id) %>% as.character - pkg_decision <- tmp_df %>% pull(decision) %>% as.character - } else { - pkg_score <- "" - pkg_versn <- if_else(pkg_name %in% c(rownames(installed.packages(priority="base"))), "", - subset(cran_pkgs, Package == pkg_name, c("Version")) %>% as.character()) - pkg_decision_id <- "" - pkg_decision <- "" - } - - return(list(name = pkg_name, version = pkg_versn, score = pkg_score, - decision_id = pkg_decision_id, decision = pkg_decision - )) -} - ##### End of get_* functions ##### From c92797c6566d34cb59711d1670dd2bdd137624e4 Mon Sep 17 00:00:00 2001 From: "Aaron Clark (Arcus)" Date: Mon, 8 Jul 2024 10:04:12 -0400 Subject: [PATCH 21/39] fixed issue with 'package object not found' --- R/mod_packageDependencies.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/mod_packageDependencies.R b/R/mod_packageDependencies.R index 72cadaac4..1b0a03650 100644 --- a/R/mod_packageDependencies.R +++ b/R/mod_packageDependencies.R @@ -64,7 +64,7 @@ packageDependenciesServer <- function(id, selected_pkg, user, credentials, paren req(pkgref()) tryCatch( expr = { - deep_ends <- pkgref()$dependencies[[1]] %>% dplyr::as_tibble() %>% + deep_ends <- {if(suppressWarnings(is.null(nrow(pkgref()$dependencies[[1]])) || nrow(pkgref()$dependencies[[1]]) == 0)) dplyr::tibble(package = character(0), type = character(0)) else pkgref()$dependencies[[1]] %>% dplyr::as_tibble()} %>% mutate(package = stringr::str_replace(package, "\n", " ")) %>% mutate(name = stringr::str_extract(package, "^((([[A-z]]|[.][._[A-z]])[._[A-z0-9]]*)|[.])")) @@ -94,7 +94,8 @@ packageDependenciesServer <- function(id, selected_pkg, user, credentials, paren ) tryCatch( expr = { - shrug_jests <- pkgref()$suggests[[1]] %>% dplyr::as_tibble()%>% + shrug_jests <- + {if(suppressWarnings(is.null(nrow(pkgref()$suggests[[1]])) || nrow(pkgref()$suggests[[1]]) == 0)) dplyr::tibble(package = character(0), type = character(0)) else pkgref()$suggests[[1]] %>% dplyr::as_tibble()} %>% mutate(package = stringr::str_replace(package, "\n", " ")) %>% mutate(name = stringr::str_extract(package, "^((([[A-z]]|[.][._[A-z]])[._[A-z0-9]]*)|[.])")) From b03f3b8234e64f9279b4925fbb87a2ccff643187 Mon Sep 17 00:00:00 2001 From: "Aaron Clark (Arcus)" Date: Mon, 8 Jul 2024 10:04:55 -0400 Subject: [PATCH 22/39] Increment version number to 3.1.0.9002 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4527f72f8..19b5e74ba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package -Version: 3.1.0.9001 +Version: 3.1.0.9002 Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Jeff", "Thompson", role = c("aut"), email = "jeff.thompson51317@gmail.com", comment = "Co-Lead"), From 3a32aec89652efdf5af09785e3081d2bdf54b5e5 Mon Sep 17 00:00:00 2001 From: "Aaron Clark (Arcus)" Date: Mon, 8 Jul 2024 10:05:59 -0400 Subject: [PATCH 23/39] update news --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 5a9e345af..1f151aa96 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # riskassessment (development version) * Added navigation controls in Function Explorer tab (#644) +* Fixed bug that crashed the Package Dependencies tab for pkgs without any dependency info available (#802) # riskassessment 3.1.0 From 147bf34e50f66e804a5e9133abed3477b16790b0 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Mon, 8 Jul 2024 14:09:35 +0000 Subject: [PATCH 24/39] Re-build manifest file --- manifest.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 149014a82..ae704ffb5 100644 --- a/manifest.json +++ b/manifest.json @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-07-08 12:36:44 UTC; unix" + "Built": "R 4.3.3; ; 2024-07-08 14:08:48 UTC; unix" } }, "reprex": { @@ -6220,7 +6220,7 @@ "checksum": "99c5575cb81828e20a7fe1d205551316" }, "DESCRIPTION": { - "checksum": "ea81f750b1ae3fa6b3ebf79e5668a3ee" + "checksum": "b5ee23e93cf6e02fbaf74b0f44ec8a7c" }, "inst/app/www/css/community_metrics.css": { "checksum": "f08eb25c2ee48ac22ed63b0d18994a04" @@ -6463,7 +6463,7 @@ "checksum": "97d1232340e04c53088bc8f814133dcd" }, "NEWS.md": { - "checksum": "29db451dbb57771e940e1911eac5407f" + "checksum": "2a60a34e769071b45f30ee1f0bbacf47" }, "R/app_config.R": { "checksum": "c2b61f270b86b6833f0ee39c44a1a440" @@ -6532,7 +6532,7 @@ "checksum": "a894eb9114e258feb99b76cdca557cd2" }, "R/mod_packageDependencies.R": { - "checksum": "6fffb51829775826e242824f268062b6" + "checksum": "ff0b276e6d166a922415e68cc2267360" }, "R/mod_pkg_explorer_utils.R": { "checksum": "b7792e08cc4a67296c9df0f452c0a72a" @@ -6565,13 +6565,13 @@ "checksum": "e5835b81f48d93ee0175507abbb3186f" }, "R/utils_build_cards.R": { - "checksum": "f79316fe637bb1f4038f085621d298f5" + "checksum": "a7cfdc1f9a4ad1c2835cd22eb279d8dc" }, "R/utils_config_db.R": { "checksum": "74cf2ee5e7283483a88f08d60e3728b0" }, "R/utils_get_db.R": { - "checksum": "6e87d4d43f93b4a4b556d72b848dc3f1" + "checksum": "6c0e6fb4b3716cdd0c0d2953a1cf4393" }, "R/utils_insert_db.R": { "checksum": "2c02e4eab4d9262ef8c8e64eb0f1b4f5" From 13d3cb6f313eb941b4c0ce60ef66235aed45678e Mon Sep 17 00:00:00 2001 From: "Aaron Clark (Arcus)" Date: Tue, 9 Jul 2024 09:23:00 -0400 Subject: [PATCH 25/39] Increment version number to 3.1.1 --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 19b5e74ba..66601712e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: riskassessment Title: A web app designed to interface with the `riskmetric` package -Version: 3.1.0.9002 +Version: 3.1.1 Authors@R: c( person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"), person("Jeff", "Thompson", role = c("aut"), email = "jeff.thompson51317@gmail.com", comment = "Co-Lead"), diff --git a/NEWS.md b/NEWS.md index 1f151aa96..49bb2eb2e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# riskassessment (development version) +# riskassessment 3.1.1 * Added navigation controls in Function Explorer tab (#644) * Fixed bug that crashed the Package Dependencies tab for pkgs without any dependency info available (#802) From 7386c1552f63a5e3a46c7096541b318d648fbeaf Mon Sep 17 00:00:00 2001 From: "Aaron Clark (Arcus)" Date: Tue, 9 Jul 2024 09:24:46 -0400 Subject: [PATCH 26/39] reword news file --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 49bb2eb2e..c24df3cfb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,7 @@ # riskassessment 3.1.1 * Added navigation controls in Function Explorer tab (#644) -* Fixed bug that crashed the Package Dependencies tab for pkgs without any dependency info available (#802) +* Fixed bug that crashed the Package Dependencies page for pkgs without any dependency info available (#802) # riskassessment 3.1.0 From a1aafcc39f4f8b8a087656e255201c204a573ea7 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Tue, 9 Jul 2024 13:27:58 +0000 Subject: [PATCH 27/39] Re-build manifest file --- manifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index ae704ffb5..0eec13146 100644 --- a/manifest.json +++ b/manifest.json @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-07-08 14:08:48 UTC; unix" + "Built": "R 4.3.3; ; 2024-07-09 13:27:11 UTC; unix" } }, "reprex": { @@ -6220,7 +6220,7 @@ "checksum": "99c5575cb81828e20a7fe1d205551316" }, "DESCRIPTION": { - "checksum": "b5ee23e93cf6e02fbaf74b0f44ec8a7c" + "checksum": "43f16dae5ba2122f4fd55e23f7229a40" }, "inst/app/www/css/community_metrics.css": { "checksum": "f08eb25c2ee48ac22ed63b0d18994a04" @@ -6463,7 +6463,7 @@ "checksum": "97d1232340e04c53088bc8f814133dcd" }, "NEWS.md": { - "checksum": "2a60a34e769071b45f30ee1f0bbacf47" + "checksum": "72bdae63c42eb2750d86e97fc0996a79" }, "R/app_config.R": { "checksum": "c2b61f270b86b6833f0ee39c44a1a440" From f2e3ff0c3f43c412312086a49da1a0263228ac7a Mon Sep 17 00:00:00 2001 From: "Aaron Clark (Arcus)" Date: Tue, 9 Jul 2024 09:52:13 -0400 Subject: [PATCH 28/39] remove redunant code --- R/mod_packageDependencies.R | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/R/mod_packageDependencies.R b/R/mod_packageDependencies.R index 1b0a03650..4145769ac 100644 --- a/R/mod_packageDependencies.R +++ b/R/mod_packageDependencies.R @@ -123,14 +123,7 @@ packageDependenciesServer <- function(id, selected_pkg, user, credentials, paren decision_id = character(0))) } ) - # this is so the dependencies is also a 0x2 tibble like suggests - if (rlang::is_empty(pkgref()$dependencies[[1]])) { - depends( - dplyr::tibble(package = character(0), type = character(0), name = character(0), - version = character(0), score = character(0), decision = character(0), - decision_id = character(0)) - ) - } + revdeps(pkgref()$reverse_dependencies[[1]] %>% as.vector()) From 32c31371fb8e3c61bf90350b1173e847dff718d4 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Tue, 9 Jul 2024 14:02:46 +0000 Subject: [PATCH 29/39] Re-build manifest file --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 0eec13146..ceee46fcb 100644 --- a/manifest.json +++ b/manifest.json @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-07-09 13:27:11 UTC; unix" + "Built": "R 4.3.3; ; 2024-07-09 14:01:48 UTC; unix" } }, "reprex": { @@ -6532,7 +6532,7 @@ "checksum": "a894eb9114e258feb99b76cdca557cd2" }, "R/mod_packageDependencies.R": { - "checksum": "ff0b276e6d166a922415e68cc2267360" + "checksum": "f8cee3c4845b4d3c3c2f66796af28359" }, "R/mod_pkg_explorer_utils.R": { "checksum": "b7792e08cc4a67296c9df0f452c0a72a" From 4035e6e1265c06602622a7f6e44edaf0ebaecb24 Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:09:12 -0400 Subject: [PATCH 30/39] Correctly parse `riskmetric` dependency assessment --- R/utils_insert_db.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils_insert_db.R b/R/utils_insert_db.R index 3b9f9cb1e..0c95e09ae 100644 --- a/R/utils_insert_db.R +++ b/R/utils_insert_db.R @@ -202,7 +202,7 @@ insert_riskmetric_to_db <- function(pkg_name, pkg_version = "", metric_value <- case_when( "pkg_metric_error" %in% class(riskmetric_assess[[metric$name]][[1]]) ~ "pkg_metric_error", - metric$name == "dependencies" ~ as.character(length(unlist(as.vector(riskmetric_assess[[metric$name]][[1]][1])))), + metric$name == "dependencies" ~ as.character(NROW(riskmetric_assess[[metric$name]][[1]])), metric$name == "reverse_dependencies" ~ as.character(length(as.vector(riskmetric_assess[[metric$name]][[1]]))), metric$is_perc == 1L ~ as.character(round(riskmetric_score[[metric$name]]*100, 2)[[1]]), TRUE ~ as.character(riskmetric_assess[[metric$name]][[1]][1:length(riskmetric_assess[[metric$name]])]) From f46c7035c34820e346b596243143119f1fe80de9 Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:33:25 -0400 Subject: [PATCH 31/39] Update NEWS --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index c24df3cfb..72307ff70 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ * Added navigation controls in Function Explorer tab (#644) * Fixed bug that crashed the Package Dependencies page for pkgs without any dependency info available (#802) +* Fixed bug that incorrectly displayed 0 dependencies as 1 (#805) # riskassessment 3.1.0 From d2c3900f4e31f71735f5beecb6a67ecf76eef693 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Tue, 9 Jul 2024 17:39:05 +0000 Subject: [PATCH 32/39] Re-build manifest file --- manifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index ceee46fcb..2e41d9790 100644 --- a/manifest.json +++ b/manifest.json @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-07-09 14:01:48 UTC; unix" + "Built": "R 4.3.3; ; 2024-07-09 17:38:19 UTC; unix" } }, "reprex": { @@ -6463,7 +6463,7 @@ "checksum": "97d1232340e04c53088bc8f814133dcd" }, "NEWS.md": { - "checksum": "72bdae63c42eb2750d86e97fc0996a79" + "checksum": "2273640b8da14304bc919f4fc83a58d7" }, "R/app_config.R": { "checksum": "c2b61f270b86b6833f0ee39c44a1a440" @@ -6574,7 +6574,7 @@ "checksum": "6c0e6fb4b3716cdd0c0d2953a1cf4393" }, "R/utils_insert_db.R": { - "checksum": "2c02e4eab4d9262ef8c8e64eb0f1b4f5" + "checksum": "5eaa94311e33014f000eb3cc5aec8282" }, "R/utils_startup.R": { "checksum": "b689ee96f0761480ac65ca22cbbb4980" From 14f5e97abe779a3ca1c8848894518ee2c7431a0f Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:20:07 -0400 Subject: [PATCH 33/39] Access new token --- .github/workflows/test-coverage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index dffb85e7c..76e51cde3 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -15,6 +15,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} RENV_CONFIG_SANDBOX_ENABLED: false + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - name: Install TexLive From d7bcdf3e7c5dbf8ce95de0068017931497b46d2c Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Wed, 10 Jul 2024 08:57:47 -0400 Subject: [PATCH 34/39] Try newer workflow --- .github/workflows/test-coverage.yaml | 43 ++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 76e51cde3..ff2b70458 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -9,13 +9,14 @@ on: name: test-coverage +permissions: read-all + jobs: test-coverage: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} RENV_CONFIG_SANDBOX_ENABLED: false - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - name: Install TexLive @@ -25,21 +26,45 @@ jobs: sudo apt-get update sudo apt-get install -y texlive-xetex - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 - uses: r-lib/actions/setup-r@v2 with: - use-public-rspm: true + use-public-rspm: false r-version: 'renv' - uses: r-lib/actions/setup-renv@v2 - - name: Install riskassessment - shell: bash - run: R CMD INSTALL --preclean . - - name: Test coverage - run: covr::codecov() + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + covr::to_cobertura(cov) shell: Rscript {0} + + - uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package From b226994952cb6aa4f841242b1e43b03b661d5291 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 10 Jul 2024 13:12:32 +0000 Subject: [PATCH 35/39] Re-build manifest file --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index ceee46fcb..98a26535f 100644 --- a/manifest.json +++ b/manifest.json @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-07-09 14:01:48 UTC; unix" + "Built": "R 4.3.3; ; 2024-07-10 13:11:46 UTC; unix" } }, "reprex": { @@ -6175,7 +6175,7 @@ "checksum": "d74482ddef0a4941a51c077f5ea60e10" }, ".github/workflows/test-coverage.yaml": { - "checksum": "c0baef024db9ec1299aae4098e904e9c" + "checksum": "a854cdb9e1cfbcbbf5ccffdf4755606b" }, ".github/workflows/write-manifest.yaml": { "checksum": "cdfc1470af653982867daed2b99d5b97" From 934df7deb25268b3e9c5b34a7cf8872873bd438b Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:51:38 -0400 Subject: [PATCH 36/39] Add `available_packages_filters` to session options --- R/app_server.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/app_server.R b/R/app_server.R index 98bc3e974..3c9de0f5b 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -13,7 +13,13 @@ app_server <- function(input, output, session) { onStop(function() { options(old) }) - options(repos = get_db_config("package_repo")) + options( + # Set session repo to value specified in configuration file + repos = get_db_config("package_repo"), + # Removes filters based on R version, OS type, sub-architecture. Only + # duplicates will be removed from the available package list + available_packages_filters = "duplicates" + ) # Collect user info. user <- reactiveValues() From caa65e298de5fefe3816676a26a792b78bd9f246 Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:07:35 -0400 Subject: [PATCH 37/39] Properly reset option on stopping application --- R/app_server.R | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/R/app_server.R b/R/app_server.R index 3c9de0f5b..6a9c86bfd 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -11,8 +11,13 @@ app_server <- function(input, output, session) { old <- options() onStop(function() { - options(old) - }) + options(c( + # Unsets available packages filter if unset previously. Will be overriden + # otherwise. + list(available_packages_filters = NULL), + old + )) + }) options( # Set session repo to value specified in configuration file repos = get_db_config("package_repo"), From 67b7852a00657c02c5f4c95f992d3802595134cb Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:43:12 -0400 Subject: [PATCH 38/39] Update NEWS --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 72307ff70..678888e23 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ * Added navigation controls in Function Explorer tab (#644) * Fixed bug that crashed the Package Dependencies page for pkgs without any dependency info available (#802) * Fixed bug that incorrectly displayed 0 dependencies as 1 (#805) +* Fixed bug that kept full list of available packages from populating (#776) # riskassessment 3.1.0 From 80833c95e8c8efc25d810bd92432a60fdcee27b9 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 10 Jul 2024 16:08:51 +0000 Subject: [PATCH 39/39] Re-build manifest file --- manifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index a17b9c101..2546af102 100644 --- a/manifest.json +++ b/manifest.json @@ -4367,7 +4367,7 @@ "Maintainer": "Kevin Ushey ", "Repository": "RSPM", "Date/Publication": "2024-02-29 01:10:07 UTC", - "Built": "R 4.3.3; ; 2024-07-10 13:11:46 UTC; unix" + "Built": "R 4.3.3; ; 2024-07-10 16:07:53 UTC; unix" } }, "reprex": { @@ -6463,13 +6463,13 @@ "checksum": "97d1232340e04c53088bc8f814133dcd" }, "NEWS.md": { - "checksum": "2273640b8da14304bc919f4fc83a58d7" + "checksum": "8f1dc97771e1911ac13a12a45300a516" }, "R/app_config.R": { "checksum": "c2b61f270b86b6833f0ee39c44a1a440" }, "R/app_server.R": { - "checksum": "e2a53d90bd4289198e29bec4ff19eba7" + "checksum": "8408e324004d2991c855c03040cb2dca" }, "R/app_ui.R": { "checksum": "50d68f46171151cd36457a7154e5a7a3"