Skip to content

Commit

Permalink
rm airtable 'emeritus' editors from editor data
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Apr 16, 2024
1 parent 79e2ed5 commit e1b4c55
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 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.7.009
Version: 0.1.7.010
Authors@R:
person(given = "First",
family = "Last",
Expand Down
17 changes: 15 additions & 2 deletions R/editors-airtable.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ edvac_status_airtable <- function () {
return (edvac)
}

#' Add additional columns to 'editors' data from rOpenSci's airtable database.
#' Add additional columns to 'editors' data from rOpenSci's airtable database,
#' and remove any "emeritus" editors.
#'
#' @param editors The `data.frame` of editors returned as the "status" component
#' from \link{editor_status}.
Expand All @@ -78,7 +79,7 @@ add_editor_airtable_data <- function (editors) {
rev_prod <- airtabler::airtable (
base = "app8dssb6a7PG6Vwj", table = "reviewers-prod"
)
fields <- list ("github", "name", "other_langs", "domain_expertise")
fields <- list ("github", "name", "editor", "other_langs", "domain_expertise")
rev_prod <- rev_prod$`reviewers-prod`$select_all (fields = fields)

editors$other_langs <- editors$domain_expertise <- NA_character_
Expand All @@ -94,5 +95,17 @@ add_editor_airtable_data <- function (editors) {
paste0 (i [which (!grepl ("^Other", i))], collapse = ", ")
}, character (1L))

# Finally, remove "emeritus" editors
emeritus <- vapply (rev_prod$editor, function (i) {
res <- length (i) > 0L
if (res) res <- any (grepl ("emeritus", i, ignore.case = TRUE))
return (res)
}, logical (1L))
emeritus <- rev_prod$github [which (emeritus)]
index <- which (editors$editor %in% emeritus)
if (length (index) > 0L) {
editors <- editors [-index, ]
}

return (editors)
}
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.7.009",
"version": "0.1.7.010",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit e1b4c55

Please sign in to comment.