diff --git a/DESCRIPTION b/DESCRIPTION index c2c91158fb..a08465d30d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -55,7 +55,7 @@ Imports: stats, teal.code (>= 0.6.1), teal.logger (>= 0.4.0), - teal.reporter (>= 0.4.0.9004), + teal.reporter (>= 0.4.0.9005), teal.widgets (>= 0.4.3.9001), tools, utils diff --git a/NAMESPACE b/NAMESPACE index 514221adf7..a9563f1a8d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,19 +1,17 @@ # Generated by roxygen2: do not edit by hand +S3method(.srv_teal_module,default) +S3method(.srv_teal_module,teal_module) +S3method(.srv_teal_module,teal_modules) +S3method(.ui_teal_module,default) +S3method(.ui_teal_module,teal_module) +S3method(.ui_teal_module,teal_modules) S3method(c,teal_slices) S3method(format,teal_module) S3method(format,teal_modules) S3method(join_keys,tdata) S3method(print,teal_module) S3method(print,teal_modules) -S3method(srv_teal_module,default) -S3method(srv_teal_module,teal_module) -S3method(srv_teal_module,teal_modules) -S3method(ui_teal_module,default) -S3method(ui_teal_module,teal_module) -S3method(ui_teal_module,teal_modules) -S3method(ui_teal_modules_nav_dropdown,teal_module) -S3method(ui_teal_modules_nav_dropdown,teal_modules) S3method(within,teal_data_module) export(TealReportCard) export(add_landing_modal) diff --git a/NEWS.md b/NEWS.md index f1f8f6f54b..e1c7b4c1e7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,20 @@ # teal 0.16.0.9015 +### Breaking changes + +* The `reporter_previewer_module()` is deprecated and will be removed in the future release. The custom `server_args` values can be set using `options()`: + - `teal.reporter.nav_buttons` to control which buttons will be displayed in the "Report" drop-down. + - `teal.reporter.rmd_outputs` to customize the R Markdown outputs types for the report. + - `teal.reporter.rmd_yaml_args` to customize the widget inputs in the download report modal. + - `teal.reporter.knitr_global` to customize the global `knitr` options for the report. + +### Enhancement + +* General repositioning of key navigation components across the app: + - Modules: The module navigation is moved from a nested tab selection to a "Module" drop-down selection. The module selection can be done from the nested button of modules. + - Reporter: The Report previewer is no longer displayed as yet another teal module, it is placed inside a "Report" drop-down right next to the "Module" drop-down. The Report previewer is a modal that displays the added report cards. The "Report" drop-down also contains other global report options like download/load/reset the Report. + - Teal Data Module: The UI created by the `teal_data_module()` is now placed inside a modal that can only be closed when it returns `teal_data`. + # teal 0.16.0 ### New features diff --git a/R/init.R b/R/init.R index 55f32501ff..5df6505c94 100644 --- a/R/init.R +++ b/R/init.R @@ -204,6 +204,8 @@ init <- function(data, list( ui = function(request) { bslib::page_fluid( + theme = get_teal_bs_theme(), + style = "--bs-gutter-x: 0;", title = tags$div( id = "teal-app-title", tags$head( @@ -217,6 +219,7 @@ init <- function(data, ), tags$header( id = "teal-header", + style = "margin: 0.5em", tags$div(id = "teal-header-content") ), ui_teal( @@ -225,6 +228,7 @@ init <- function(data, ), tags$footer( id = "teal-footer", + style = "margin: 0.5em", tags$div(id = "teal-footer-content"), ui_session_info("teal-footer-session_info") ) diff --git a/R/module_bookmark_manager.R b/R/module_bookmark_manager.R index 80cddf93ef..e76511eb0d 100644 --- a/R/module_bookmark_manager.R +++ b/R/module_bookmark_manager.R @@ -50,21 +50,11 @@ ui_bookmark_panel <- function(id, modules) { is_unbookmarkable <- need_bookmarking(modules) shinyOptions(bookmarkStore = bookmark_option) - # Render bookmark warnings count if (!all(is_unbookmarkable) && identical(bookmark_option, "server")) { - tags$button( + .expand_button( id = ns("do_bookmark"), - class = "btn action-button wunder_bar_button bookmark_manager_button", - title = "Add bookmark", - tags$span( - suppressMessages(icon("fas fa-bookmark")), - if (any(is_unbookmarkable)) { - tags$span( - sum(is_unbookmarkable), - class = "badge-warning badge-count text-white bg-danger" - ) - } - ) + label = "Bookmark", + icon = "bookmark-fill" ) } } @@ -136,7 +126,8 @@ srv_bookmark_panel <- function(id, modules) { id = ns("bookmark_modal"), title = "Bookmarked teal app url", modal_content, - easyClose = TRUE + easyClose = TRUE, + footer = NULL ) ) ) diff --git a/R/module_data_summary.R b/R/module_data_summary.R index c06a51b44d..b204f0e7fb 100644 --- a/R/module_data_summary.R +++ b/R/module_data_summary.R @@ -12,7 +12,7 @@ #' Module includes also "Show/Hide unsupported" button to toggle rows of the summary table #' containing datasets where number of observations are not calculated. #' -#' @inheritParams module_teal_modules_nav +#' @inheritParams module_teal_module #' #' @name module_data_summary #' @rdname module_data_summary diff --git a/R/module_filter_data.R b/R/module_filter_data.R index 509fb702fd..f5b84e1060 100644 --- a/R/module_filter_data.R +++ b/R/module_filter_data.R @@ -11,7 +11,7 @@ #' - tab is selected (`is_active`) #' - when filters are changed (`get_filter_expr` is different than previous) #' -#' @inheritParams module_teal_modules_nav +#' @inheritParams module_teal_module #' @param active_datanames (`reactive` returning `character`) this module's data names #' @name module_filter_data #' @keywords internal diff --git a/R/module_filter_manager.R b/R/module_filter_manager.R index 26f1373ec4..6c1e4fa869 100644 --- a/R/module_filter_manager.R +++ b/R/module_filter_manager.R @@ -54,11 +54,10 @@ NULL #' @rdname module_filter_manager ui_filter_manager_panel <- function(id) { ns <- NS(id) - tags$button( + .expand_button( id = ns("show_filter_manager"), - class = "btn action-button wunder_bar_button", - title = "View filter mapping", - suppressMessages(icon("fas fa-grip")) + label = "Filter Manager", + icon = "funnel-fill" ) } diff --git a/R/module_nested_tabs.R b/R/module_nested_tabs.R index 05ae8f74ae..5ecf07dbb9 100644 --- a/R/module_nested_tabs.R +++ b/R/module_nested_tabs.R @@ -1,32 +1,24 @@ #' Calls all `modules` #' -#' Module calls `modules` with `id` according to their location in the tree. There are multiple modules -#' managing this process: -#' - `ui/srv_teal_modules_nav` container module where `input$active_module_id` exists. -#' - `ui_teal_modules_nav_dropdown` creates drop-down menu to select active module. -#' - `ui/srv_teal_module` creates tab containers for each module. Only one module is visible at the time as a result -#' of selecting in `ui_teal_modules_nav_dropdown`. +#' Modules create navigation bar with drop-down menu and tab content. Each `teal_module` is called recursively +#' according to the structure of `modules` argument. This is a custom module which utilizes shiny/Bootstrap +#' `.nav` class. `modules` are called with an `id` derived from `teal_module`'s label and labels of its +#' ancestors (if any). #' -#' ### UI +#' ### Functions #' -#' On the UI side, a drop-down is created that lists buttons labeled with the labels of all `teal_module`s. -#' The buttons in the drop-down are grouped according to their respective groups. -#' These UI components are created in a way to utilize navigation-bar functionality of shiny. -#' To achieve this, the buttons need to be placed inside a `