Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve title in applications() #690

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rsconnect 0.8.30 (development version)

* `applications()` now returns the application title, if available (#484).

* `addConnectServer()` is slightly more robust to incorrect specification
(#603).

Expand Down
10 changes: 6 additions & 4 deletions R/applications.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' \tabular{ll}{
#' `id` \tab Application unique id \cr
#' `name` \tab Name of application \cr
#' `title` \tab Application title \cr
#' `url` \tab URL where application can be accessed \cr
#'
#' `status` \tab Current status of application. Valid values are `pending`,
Expand Down Expand Up @@ -49,6 +50,7 @@ applications <- function(account = NULL, server = NULL) {
c(
"id",
"name",
"title",
"url",
"build_status",
"created_time",
Expand All @@ -74,6 +76,7 @@ applications <- function(account = NULL, server = NULL) {
# set size and instance to NA since Connect doesn't return this info
x$size <- NA
x$instances <- NA
x$title <- x$title %||% NA_character_
x
})
} else {
Expand All @@ -87,6 +90,7 @@ applications <- function(account = NULL, server = NULL) {
x$instances <- NA
x$deployment <- NULL
x$guid <- NA
x$title <- NA_character_
x
})
}
Expand All @@ -104,10 +108,8 @@ applications <- function(account = NULL, server = NULL) {
})

# convert to data frame
rbindWithoutFactors <- function(...) {
rbind.data.frame(..., stringsAsFactors = FALSE)
}
res <- do.call(rbindWithoutFactors, res)
res <- lapply(res, as.data.frame, stringsAsFactors = FALSE)
res <- do.call("rbind", res)

# Ensure the Connect and ShinyApps.io data frames have same column names
idx <- match("last_deployed_time", names(res))
Expand Down
1 change: 1 addition & 0 deletions man/applications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.