Skip to content

Commit

Permalink
Merge pull request #829 from pharmaR/jt-fix_else_cond_bug
Browse files Browse the repository at this point in the history
Fix ELSE condition bug
  • Loading branch information
aclark02-arcus authored Jan 16, 2025
2 parents ce8b196 + 175ccb1 commit 40520d9
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 226 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- 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
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: riskassessment
Title: A web app designed to interface with the `riskmetric` package
Version: 3.1.1.9001
Version: 3.1.1.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"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# riskassessment (development version)

* Open hyperlinks in a new tab from cards.
* Fix bug causing app to crash with ELSE condition in rules

# riskassessment 3.1.1

Expand Down
3 changes: 2 additions & 1 deletion R/mod_decision_automation_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ assign_decisions <- function(rule_list, package, db_name = golem::get_golem_opti
if (!is.na(decision)) break
rule <- rule_list[[i]]

fn <- purrr::possibly(rule$mapper, otherwise = FALSE)
if (rlang::is_function(rule$mapper) || rlang::is_formula(rule$mapper))
fn <- purrr::possibly(rule$mapper, otherwise = FALSE)
if (rule$type == "overall_score") {
decision <- if (fn(get_pkg_info(package)$score)) rule$decision else NA_character_
log_message <- glue::glue("Decision for the package {package} was assigned {decision} because the risk score returned TRUE for `{rule$condition}`")
Expand Down
Loading

0 comments on commit 40520d9

Please sign in to comment.