Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ELSE condition bug #829

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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