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

Fix: Improves Support + Bugfix #7

Merged
merged 13 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
11 changes: 7 additions & 4 deletions app/logic/api_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ get_api_url <- function(

#' Function to get a list of all apps belonging to the token
#'
#' @param app_mode_filter Character. The filter for app_mode in the API
#' response. Default is "shiny".
#' @param app_mode_filter Character list. The filter for app_mode in the API
#' response. Default is list("shiny", "python-shiny", "quarto-shiny").
#' @param endpoint Character. Default is "content"
#' @param dry_run Logical. Whether to dry run the API for debugging.
#' Default is FALSE
#' @export
get_app_list <- function(
app_mode_filter = "shiny",
app_mode_filter = list("shiny", "python-shiny", "quarto-shiny"),
endpoint = "content",
dry_run = FALSE
) {
Expand All @@ -70,7 +70,10 @@ get_app_list <- function(
req_perform() %>%
resp_body_string() %>%
fromJSON() %>%
filter(app_mode == app_mode_filter)
filter(
app_mode %in% app_mode_filter,
app_role == "owner"
DeepanshKhurana marked this conversation as resolved.
Show resolved Hide resolved
)
}
}

Expand Down
60 changes: 37 additions & 23 deletions app/view/mod_job_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ box::use(
getReactableState,
reactable,
reactableOutput,
renderReactable
renderReactable,
reactableLang
],
shiny[
moduleServer,
NS,
reactive,
req
req,
isTruthy
DeepanshKhurana marked this conversation as resolved.
Show resolved Hide resolved
],
shinycssloaders[withSpinner],
)
Expand Down Expand Up @@ -48,25 +50,31 @@ server <- function(id, state) {

output$job_list_table <- renderReactable({

processed_jobs <- job_list_data() %>%
select(id, key, start_time, end_time) %>%
mutate(
job = paste(
id,
key,
start_time,
end_time,
sep = "_-_"
)
) %>%
select(
-c(
id,
key,
start_time,
end_time
if (length(job_list_data())) {
processed_jobs <- job_list_data() %>%
select(id, key, start_time, end_time) %>%
mutate(
job = paste(
id,
key,
start_time,
end_time,
sep = "_-_"
)
) %>%
select(
-c(
id,
key,
start_time,
end_time
)
)
} else {
processed_jobs <- data.frame(
job = character()
)
}
DeepanshKhurana marked this conversation as resolved.
Show resolved Hide resolved

reactable(
data = processed_jobs,
Expand All @@ -79,16 +87,22 @@ server <- function(id, state) {
process_job_data(job_data)
}
)
),
language = reactableLang(
noData = "No jobs found."
)
)

})

state$selected_job <- reactive({
index <- getReactableState("job_list_table", "selected")
list(
"key" = job_list_data()[index, ]$key,
"id" = job_list_data()[index, ]$id
)
if (isTruthy(index)) {
list(
"key" = job_list_data()[index, ]$key,
"id" = job_list_data()[index, ]$id
)
}
})

})
Expand Down
Loading