From e87f420e3cb6e327e86ea4d94cdd7be9d86bda05 Mon Sep 17 00:00:00 2001 From: mpadge Date: Tue, 12 Mar 2024 16:11:08 +0100 Subject: [PATCH] initial commit --- _quarto.yml | 16 ++++++++++ editors.qmd | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++ index.qmd | 7 +++++ styles.css | 1 + 4 files changed, 114 insertions(+) create mode 100644 _quarto.yml create mode 100644 editors.qmd create mode 100644 index.qmd create mode 100644 styles.css diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..21a8c23 --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,16 @@ +project: + type: website + +website: + title: "rOpenSci Dashboard" + navbar: + left: + - href: index.qmd + text: Home + - editors.qmd + +format: + html: + theme: cosmo + css: styles.css + toc: true diff --git a/editors.qmd b/editors.qmd new file mode 100644 index 0000000..28b48f6 --- /dev/null +++ b/editors.qmd @@ -0,0 +1,90 @@ +--- +title: "Editor Availability" +format: + html: + fig-width: 8 + fig-height: 4 + code-fold: false +--- + +```{r get-ed-dat, echo = FALSE} +library (dashboard) +library (gt) +ed_dat <- editor_status (quiet = TRUE) +``` + +The following table summarises the availability of general (not statistical) +editors. The `inactive_for` values are hyperlinked to the most recent +submission issue for each editor. + +```{r editor-vacantion-status, echo = FALSE} +editor_vacation <- airtabler::airtable ( + base = "app8dssb6a7PG6Vwj", table = "editor-vacation-status" +) +editor_vacation <- editor_vacation$`editor-vacation-status`$select_all (fields = list ("editor", "Action", "Start Date", "Return Date")) +index <- vapply (editor_vacation$editor, function (i) length (i) > 0L, logical (1L)) +edvac <- editor_vacation [which (index), ] + +rev_prod <- airtabler::airtable ( + base = "app8dssb6a7PG6Vwj", table = "reviewers-prod" +) +rev_prod <- rev_prod$`reviewers-prod`$select_all (fields = list ("github", "name")) +rev_prod <- rev_prod [match (edvac$editor, rev_prod$id), ] +edvac$github <- rev_prod$github +edvac$name <- rev_prod$name + +edvac$away <- FALSE +s <- edvac$`Start Date` [2] +index <- (!is.na (edvac$`Start Date`) & is.na (edvac$`Return Date`)) | + as.Date (edvac$`Return Date`) > Sys.Date () +index [which (is.na (index))] <- FALSE +edvac$away [index] <- TRUE + +editors_on_vacation <- edvac$github [which (edvac$away)] +ed_dat$status [ed_dat$editor %in% editors_on_vacation] <- "VACATION" +``` + + +```{r editor-table, echo = FALSE} +#| label: fig-editors-general +ed_dat_gen <- ed_dat [which (!ed_dat$stats), ] +ed_dat_gen$status <- factor (ed_dat_gen$status, levels = c ("FREE", "BUSY", "VACATION")) +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") + +gt::gt ( + ed_dat_gen, + groupname_col = "status" +) |> + gt::tab_header ("Editor Status Overview") |> + gt::cols_hide (c (stats, inactive_days, number, state)) |> + gt::tab_style ( + style = list (gt::cell_fill (color = "#FFFF8088")), + locations = gt::cells_body ( + columns = c (`editor`, `inactive_for`), + rows = status == "FREE" + ) + ) |> + gt::tab_options ( + heading.background.color = "#ACEACE", + row_group.background.color = "#ACEACE", + column_labels.background.color = "#9BD9BD", + heading.title.font.size = "200%" + ) +``` diff --git a/index.qmd b/index.qmd new file mode 100644 index 0000000..83caff4 --- /dev/null +++ b/index.qmd @@ -0,0 +1,7 @@ +--- +title: "rOpenSci Editor Dashboard" +--- + +Overview of [rOpenSci software review +issues](https://github.com/ropensci/software-review/issues), and editor +availability. diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..2ddf50c --- /dev/null +++ b/styles.css @@ -0,0 +1 @@ +/* css styles */