Skip to content

Commit

Permalink
include ed-reviews page within main editors page for #12
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Apr 25, 2024
1 parent a3f9294 commit 239daca
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dashboard
Title: What the Package Does (One Line, Title Case)
Version: 0.1.9.004
Version: 0.1.10
Authors@R:
person(given = "First",
family = "Last",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.9.004",
"version": "0.1.10",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
4 changes: 2 additions & 2 deletions quarto/ed-reviews.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ current editors only, with reviews listed from most to least recent. Open
reviews are highlighted in yellow.

```{ojs}
edReviewsIn = transpose (ed_reviews_in)
edReviewsIn = transpose(ed_reviews_in)
// And get array of unique eds for input selector:
editorsAll = edReviewsIn.map(function(item) {
return item.editor;
});
editors = Array.from(new Set(editorsAll));
// Adds 'rowColor' variable:
// Add 'rowColor' variable:
edReviews = {
return edReviewsIn.map(row => ({
...row,
Expand Down
81 changes: 79 additions & 2 deletions quarto/editors.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ chk <- addGFontHtmlDependency (family = "Open Sans")

```{r get-ed-dat, echo = FALSE, message = FALSE}
#| cache: true
aggregation_period <- "quarter"
ed_dat <- editor_status (aggregation_period = aggregation_period, quiet = TRUE)
aggregation_period <- "quarter" # default
ed_dat <- editor_status (quiet = TRUE, aggregation_period = aggregation_period)
ed_status <- ed_dat$status
ed_timeline_total <- ed_dat$timeline_total |>
dplyr::filter (name %in% ed_status$editor)
Expand Down Expand Up @@ -169,6 +169,83 @@ colorTable(filteredSorted,

<br><br>

## Editor Reviews {#editor-reviews}

```{r ojs-def-ed-rev}
#| cache: false
ed_reviews <- ed_dat$reviews
ojs_define (ed_reviews_in = ed_reviews)
```

This panel provides data on reviews handled by each editor. Data are shown for
current editors only, with reviews listed from most to least recent. Open
reviews are highlighted in yellow.

```{ojs}
edReviewsIn = transpose(ed_reviews_in)
// Get array of unique eds for input selector:
editorsAll = edReviewsIn.map(function(item) {
return item.editor;
});
editors = Array.from(new Set(editorsAll));
// Add 'rowColor' variable:
edReviews = {
return edReviewsIn.map(row => ({
...row,
rowColor: row.state === "OPEN" ? "yellow" : "transparent",
}));
}
```

```{ojs}
viewof editor = Inputs.select(editors, {multiple: false, label: "Editor:"})
viewof state = Inputs.checkbox(
["OPEN", "CLOSED"],
{ value: ["OPEN"], label: "Issue State:" }
)
```

```{ojs}
filteredRevs = edReviews.filter(function(ed) {
return editor.includes(ed.editor) && state.includes(ed.state)
})
```

```{ojs}
sortColumnRevs = "number"
// This sorts in reverse order:
filteredSortedRevs = filteredRevs.sort((a, b) => {
if (a[sortColumnRevs] < b[sortColumnRevs]) {
return 1;
}
if (a[sortColumnRevs] > b[sortColumnRevs]) {
return -1;
}
return 0;
});
```

```{ojs}
numberColumn = "number"
columnsRevs = ["number", "title", "state", "opened_at", "closed_at"]
console.log("-----filteredSortedRevs = ", filteredSortedRevs)
colorTable(filteredSortedRevs,
{
colorColumn: "rowColor",
editorColumn: "editor",
issueNumColumn: "number",
columns: columnsRevs,
format: {
[numberColumn]: d => htl.html`<a href="https://github.com/ropensci/software-review/issues/${d}">${d}</a>`,
},
height: 'auto',
}
)
```

## Editorial Load {#past-ed-load}

The following sections summarise the recent workload of our editorial team. We
Expand Down

0 comments on commit 239daca

Please sign in to comment.