Skip to content

Commit

Permalink
fix update saved query for codelistBuilder module; available saved qu…
Browse files Browse the repository at this point in the history
…eries are now correctly listed (excluding any downstream dependencies)
  • Loading branch information
rmgpanw committed Nov 29, 2023
1 parent 5925e40 commit e40176e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/mod_codelistBuilder.R
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,6 @@ sessioninfo::session_info()
observeEvent(input$btn_update_query, {
selected_saved_query <- input$select_qb_load_saved_query


available_saved_queries <-
as.list(saved_queries()$objects[[input$code_type]]) %>%
purrr::discard(\(x) x == selected_saved_query) %>%
Expand All @@ -828,11 +827,11 @@ sessioninfo::session_info()
# ensure saved query filter only shows upstream dependencies for selected
# query
if (!is.null(dag_igraph())) {
dependencies <- find_node_dependencies(graph = dag_igraph(),
downstream_dependencies <- find_node_dependencies(graph = dag_igraph(),
node = selected_saved_query,
mode = "in")
mode = "out")

available_saved_queries <- subset(available_saved_queries,!available_saved_queries %in% dependencies)
available_saved_queries <- subset(available_saved_queries,!available_saved_queries %in% downstream_dependencies)
}

# new filter
Expand Down

0 comments on commit e40176e

Please sign in to comment.