From 0a1dd6adc4929205dd94ea0cf683b35c2d3d25ba Mon Sep 17 00:00:00 2001 From: mpadge Date: Wed, 20 Mar 2024 10:30:31 +0100 Subject: [PATCH] add info on multiple stages as attr of review data --- DESCRIPTION | 2 +- R/reviews.R | 29 ++++++++++++++++++----------- codemeta.json | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 31085de..686674d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashboard Title: What the Package Does (One Line, Title Case) -Version: 0.0.7.005 +Version: 0.0.7.006 Authors@R: person(given = "First", family = "Last", diff --git a/R/reviews.R b/R/reviews.R index d098a54..4045138 100644 --- a/R/reviews.R +++ b/R/reviews.R @@ -263,17 +263,20 @@ review_status <- function (open_only = TRUE, browse = TRUE, quiet = FALSE) { dplyr::relocate (editor, .after = labels) |> dplyr::relocate (editor_date, .after = editor) - if (any (dat$has_multiple_stages) && !quiet) { - numbers <- dat$number [which (dat$has_multiple_stages)] - txt <- ifelse ( - length (numbers) == 1, - "issue currently has", - "issues currently have" - ) - warning ( - "The following ", txt, " multiple 'stage' labels:\n ", - paste0 (numbers, collapse = ", ") - ) + has_multiple_stages <- any (dat$has_multiple_stages) + if (has_multiple_stages) { + multiple_stages <- dat$number [which (dat$has_multiple_stages)] + if (!quiet) { + txt <- ifelse ( + length (multiple_stages) == 1, + "issue currently has", + "issues currently have" + ) + warning ( + "The following ", txt, " multiple 'stage' labels:\n ", + paste0 (multiple_stages, collapse = ", ") + ) + } } # Collapse list columns: @@ -299,6 +302,10 @@ review_status <- function (open_only = TRUE, browse = TRUE, quiet = FALSE) { print (open_gt_table (dat)) } + if (has_multiple_stages) { + attr (dat, "multiple_stages") <- multiple_stages + } + return (dat) } diff --git a/codemeta.json b/codemeta.json index 42ff491..dddf6ec 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.7.005", + "version": "0.0.7.006", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R",