From 227cdeaeec0b986a46e95dbc73f721c8dac9ffc7 Mon Sep 17 00:00:00 2001 From: mpadge Date: Mon, 18 Mar 2024 16:56:53 +0100 Subject: [PATCH] fix all calls to pkg internal fn 'add_gt_html' --- DESCRIPTION | 2 +- R/gt-table.R | 16 ++-------------- codemeta.json | 2 +- quarto/editors.qmd | 16 ++-------------- quarto/reviews.qmd | 4 ++-- 5 files changed, 8 insertions(+), 32 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3876a67..e139b72 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashboard Title: What the Package Does (One Line, Title Case) -Version: 0.0.4.006 +Version: 0.0.4.007 Authors@R: person(given = "First", family = "Last", diff --git a/R/gt-table.R b/R/gt-table.R index 331c85a..6e83ba8 100644 --- a/R/gt-table.R +++ b/R/gt-table.R @@ -20,21 +20,9 @@ open_gt_table <- function (dat) { requireNamespace ("gt") u <- "https://github.com/ropensci/software-review/issues/" dat_url <- dat - add_html <- function (dat_url, what = "number") { - dat_url [[what]] <- paste0 ( - "

", - dat_url [[what]], - "" - ) - dat_url [[what]] <- lapply (dat_url [[what]], gt::html) - return (dat_url) - } # Number has to come last here!! - dat_url <- add_html (dat_url, "title") - dat_url <- add_html (dat_url, "number") + dat_url <- add_gt_html (dat_url, "title") + dat_url <- add_gt_html (dat_url, "number") dat_url$stage_elapsed <- Sys.Date () - dat_url$stage_date # Then create an "urgency" column used to highlight rows needing urgent diff --git a/codemeta.json b/codemeta.json index 7f6c743..3ec80b4 100644 --- a/codemeta.json +++ b/codemeta.json @@ -6,7 +6,7 @@ "name": "dashboard: What the Package Does (One Line, Title Case)", "codeRepository": "https://github.com/ropensci-review-tools/dashboard", "license": "https://spdx.org/licenses/MIT", - "version": "0.0.4.006", + "version": "0.0.4.007", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/quarto/editors.qmd b/quarto/editors.qmd index cbed9c4..3afee77 100644 --- a/quarto/editors.qmd +++ b/quarto/editors.qmd @@ -54,20 +54,8 @@ ed_dat_gen <- dplyr::group_by (ed_dat_gen, status) |> dplyr::arrange (dplyr::desc (inactive_days), .by_group = TRUE) |> dplyr::ungroup () -add_html <- function (dat, what = "inactive_for") { - u <- "https://github.com/ropensci/software-review/issues/" - dat [[what]] <- paste0 ( - "

", - dat [[what]], - "" - ) - dat [[what]] <- lapply (dat [[what]], gt::html) - return (dat) -} -ed_dat_gen <- add_html (ed_dat_gen, what = "inactive_for") +u <- "https://github.com/ropensci/software-review/issues/" +ed_dat_gen <- dashboard::add_gt_html (ed_dat_gen, u, what = "inactive_for") gt::gt ( ed_dat_gen, diff --git a/quarto/reviews.qmd b/quarto/reviews.qmd index 0c0baa0..4207427 100644 --- a/quarto/reviews.qmd +++ b/quarto/reviews.qmd @@ -19,8 +19,8 @@ rev_dat <- review_status (open_only = TRUE, browse = FALSE, quiet = TRUE) u <- "https://github.com/ropensci/software-review/issues/" dat <- rev_dat # Number has to come last here!! -dat <- dashboard:::add_html (dat, "titles") -dat <- dashboard:::add_html (dat, "number") +dat <- dashboard:::add_gt_html (dat, "titles") +dat <- dashboard:::add_gt_html (dat, "number") ``` ```{r add-urgency-column, echo = FALSE}