1+ tbl_as_named_list <- function (tbl , value_col , name_col ) {
2+ # Given a table and two columns, build a named list.
3+ # Copied from torgutil
4+ result <- tbl %> % dplyr :: pull({{value_col }}) %> % as.list()
5+ names(result ) <- tbl %> % dplyr :: pull({{name_col }}) %> % as.list()
6+ result
7+ }
8+
9+
110filter_ui_make_filter_value_choice_list <-
211 function (table , table_name , filter_name ) {
312 this_filter <- filters %> %
@@ -19,10 +28,10 @@ filter_ui_make_filter_value_choice_list <-
1928filter_ui_make_filter_choice_list <- function (table_name ) {
2029 single_value <- filters %> %
2130 dplyr :: filter(table == table_name , is.na(join_table ), filter != " all" ) %> %
22- torgutil :: tbl_as_named_list(filter , display_name )
31+ tbl_as_named_list(filter , display_name )
2332 multi_value <- filters %> %
2433 dplyr :: filter(table == table_name , ! is.na(join_table )) %> %
25- torgutil :: tbl_as_named_list(filter , display_name )
34+ tbl_as_named_list(filter , display_name )
2635 all <- filters %> %
2736 dplyr :: filter(table == table_name , filter == " all" ) %> %
2837 dplyr :: pull(display_name )
0 commit comments