From 6657b0282c60133bdd6f17fdee5f105301bfe93d Mon Sep 17 00:00:00 2001 From: mpadge Date: Tue, 23 Apr 2024 13:27:43 +0200 Subject: [PATCH] add 'sortBy' radio button stage/urgency for #12 --- DESCRIPTION | 2 +- codemeta.json | 2 +- quarto/reviews.qmd | 45 +++++++++++++++++++++++++++++++++------------ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6c5222a..1fe24d0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashboard Title: What the Package Does (One Line, Title Case) -Version: 0.1.8.039 +Version: 0.1.8.040 Authors@R: person(given = "First", family = "Last", diff --git a/codemeta.json b/codemeta.json index 8a0d9ad..f3b5ab4 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.1.8.039", + "version": "0.1.8.040", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/quarto/reviews.qmd b/quarto/reviews.qmd index 4927cd0..0208ad4 100644 --- a/quarto/reviews.qmd +++ b/quarto/reviews.qmd @@ -86,16 +86,23 @@ rOpenSci software peer-review is currently handling:
- `r sub_types [["Standard"]]` standard `r sub_type_end [["Standard"]]`
- `r sub_types [["Stats"]]` stats `r sub_type_end [["Stats"]]` -The following table provides details of each issue, defined by the "Submission -Stage" listed in the check-boxes. There is also a "Holding" check box which can -be used to inspect reviews which are currently on hold. Some rows in the table -are highlighted to visually indicate degrees of urgency according to the scheme -defined in the following sub-section. Rows with no highlight may be considered -up-to-date, and require no action. +The following table provides details of each issue, with results filtered by +the following controls: + +- "Submission Stage" to list issues with the specified stage. +- "Holding" to list issues which are on hold (true) or not (false). +- "Sort By" to sort results either by the Submission Stage ("stage", 0-5), or + "urgency", as described below. + +Some rows in the table are highlighted to visually indicate degrees of urgency +according to the scheme defined in the following sub-section. Rows with no +highlight may be considered up-to-date, and require no action. ```{r rev-dat-prepro} -# Final pre-processing to add 'holding' column +# Final pre-processing to add 'holding' column, and an 'urgency_rev' column so +# urgency can be sorted via same code as stage. rev_dat$holding <- grepl ("holding", rev_dat$labels) +rev_dat$urgency_rev <- max (rev_dat$urgency) - rev_dat$urgency ``` @@ -145,10 +152,10 @@ viewof stage = { value: [ "0/presubmission", "1/editor-checks", - // "2/seeking-reviewer(s)", - // "3/reviewer(s)-assigned", - // "4/review(s)-in-awaiting-changes", - // "5/awaiting-reviewer(s)-response" + "2/seeking-reviewer(s)", + "3/reviewer(s)-assigned", + "4/review(s)-in-awaiting-changes", + "5/awaiting-reviewer(s)-response" ], label: htl.html`Submission Stage:`, } @@ -181,12 +188,26 @@ viewof holding = Inputs.checkbox(
+```{ojs} +viewof sortBy = Inputs.radio( + ["stage", "urgency"], + { + value: "stage", + label: htl.html`Sort by:`, + } +) +``` + +
+ ```{ojs} filtered = submissionsIn.filter(function(submission) { return stage.includes(submission.stage) && holding.includes(submission.holding) }) -sortCol1 = "stage" +// Only sort by urgency if there are any: +anyUrgent = filtered.some(submission => submission.urgency > 0) +sortCol1 = sortBy === "stage" ? "stage" : anyUrgent ? "urgency_rev" : "stage" sortCol2 = "elapsed_days" // Sorts by both stage and elapsed days: