diff --git a/DESCRIPTION b/DESCRIPTION index 26c47c7..4db3e17 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashboard Title: What the Package Does (One Line, Title Case) -Version: 0.2.0.003 +Version: 0.2.1 Authors@R: person(given = "First", family = "Last", diff --git a/R/editors-airtable.R b/R/editors-airtable.R index dfd29ce..daff76e 100644 --- a/R/editors-airtable.R +++ b/R/editors-airtable.R @@ -5,12 +5,13 @@ #' these indicate that an editor is away, on vacation, or otherwise unavailable, #' then the `away` column will be set to `TRUE`. #' +#' @param airtable_id The 'id' string of the airtable table. #' @return A `data.frame` with one row per editor and information on current #' vacation status. #' @export -editor_vacation_status <- function () { +editor_vacation_status <- function (airtable_id) { - edvac_airtable <- edvac_status_airtable () + edvac_airtable <- edvac_status_airtable (airtable_id) slack_status <- get_slack_editors_status () vacation_ptn <- "away|vacation|holiday|unavailable" vacation <- grep (vacation_ptn, slack_status$status, ignore.case = TRUE) @@ -36,9 +37,9 @@ editor_vacation_status <- function () { return (edvac) } -edvac_status_airtable <- function () { +edvac_status_airtable <- function (airtable_id) { editor_vacation <- airtabler::airtable ( - base = "app8dssb6a7PG6Vwj", table = "editor-vacation-status" + base = airtable_id, table = "editor-vacation-status" ) fields <- list ("editor", "Action", "Start Date", "Return Date") editor_vacation <- @@ -51,7 +52,7 @@ edvac_status_airtable <- function () { edvac <- editor_vacation [which (index), ] rev_prod <- airtabler::airtable ( - base = "app8dssb6a7PG6Vwj", table = "reviewers-prod" + base = airtable_id, table = "reviewers-prod" ) rev_prod <- rev_prod$`reviewers-prod`$select_all (fields = list ("github", "name")) @@ -75,9 +76,9 @@ edvac_status_airtable <- function () { #' from \link{editor_status}. #' @return A modified version of `editors` with additional columns. #' @export -add_editor_airtable_data <- function (editors) { +add_editor_airtable_data <- function (editors, airtable_id) { rev_prod <- airtabler::airtable ( - base = "app8dssb6a7PG6Vwj", table = "reviewers-prod" + base = airtable_id, table = "reviewers-prod" ) fields <- list ("github", "name", "editor", "other_langs", "domain_expertise") rev_prod <- rev_prod$`reviewers-prod`$select_all (fields = fields) diff --git a/R/editors.R b/R/editors.R index e984376..d0ce483 100644 --- a/R/editors.R +++ b/R/editors.R @@ -1,3 +1,5 @@ +airtable_base_id <- "app8dssb6a7PG6Vwj" + #' Get current status of all rOpenSci editors. #' #' @param aggregation_period The time period for aggregation of timeline for @@ -352,13 +354,13 @@ editor_status <- function (quiet = FALSE, aggregation_period = "quarter") { dplyr::arrange (dplyr::desc (inactive_days), .by_group = TRUE) |> dplyr::ungroup () - edvac <- editor_vacation_status () # in editors-airtable.R + edvac <- editor_vacation_status (airtable_base_id) # in editors-airtable.R # Note that next line presumes slack 'name' == GitHub handle: editors_on_vacation <- edvac$name [which (edvac$away)] status$status [status$editor %in% editors_on_vacation] <- "ON LEAVE" # Add additional columns from airtable data: - status <- add_editor_airtable_data (status) + status <- add_editor_airtable_data (status, airtable_base_id) # Then editor timelines month <- name <- NULL # Suppress no visible binding notes diff --git a/codemeta.json b/codemeta.json index 14ee30b..395b0a1 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.2.0.003", + "version": "0.2.1", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/man/add_editor_airtable_data.Rd b/man/add_editor_airtable_data.Rd index c2bcb88..aad30aa 100644 --- a/man/add_editor_airtable_data.Rd +++ b/man/add_editor_airtable_data.Rd @@ -5,7 +5,7 @@ \title{Add additional columns to 'editors' data from rOpenSci's airtable database, and remove any "emeritus" editors.} \usage{ -add_editor_airtable_data(editors) +add_editor_airtable_data(editors, airtable_id) } \arguments{ \item{editors}{The `data.frame` of editors returned as the "status" component diff --git a/man/editor_vacation_status.Rd b/man/editor_vacation_status.Rd index bc717a9..89d087f 100644 --- a/man/editor_vacation_status.Rd +++ b/man/editor_vacation_status.Rd @@ -4,7 +4,10 @@ \alias{editor_vacation_status} \title{Get current vacation status of all rOpenSci editors.} \usage{ -editor_vacation_status() +editor_vacation_status(airtable_id) +} +\arguments{ +\item{airtable_id}{The 'id' string of the airtable table.} } \value{ A `data.frame` with one row per editor and information on current