Skip to content

Commit

Permalink
723 default header@main (#824)
Browse files Browse the repository at this point in the history
Closes [this
issue](insightsengineering/teal.modules.clinical#723).

Changed default values of `header` and `footer` in `init` from
`tags$p("Add title here")` to `tags$p()`.
  • Loading branch information
chlebowa authored Apr 12, 2023
1 parent 49dd295 commit 70807dd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Removed deprecated functions: `root_modules`, `default_filter`, `bookmarkableShinyApp`, as well as deprecated logging mechanism, including the functions `log_app_usage` and `.log`.
* Updated the "Teal and Bootstrap Themes" vignette to provide more details customizing a `teal` app with `bslib::run_with_themer`.
* Removed outdated diagram from `srv_nested_tabs` documentation.
* Changed default values of `header` and `footer` arguments in `init` to empty text.

# teal 0.12.0

Expand Down
12 changes: 7 additions & 5 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@
#' By adding the `filterable` attribute it is possible to control which variables can be filtered for each
#' dataset. See the example below where `ADSL` can only be filtered by `AGE`, `SEX` or `RACE`.
#'
#' @param header (`character` or `shiny.tag`) \cr
#' @param header (`shiny.tag` or `character`) \cr
#' the header of the app. Note shiny code placed here (and in the footer
#' argument) will be placed in the app's `ui` function so code which needs to be placed in the `ui` function
#' (such as loading css via [htmltools::htmlDependency()]) should be included here.
#' @param footer (`character` or `shiny.tag`)\cr
#' @param footer (`shiny.tag` or `character`)\cr
#' the footer of the app
#' @param id (`character`)\cr
#' module id to embed it, if provided,
Expand Down Expand Up @@ -155,17 +155,19 @@ init <- function(data,
modules,
title = NULL,
filter = list(),
header = tags$p("Add Title Here"),
footer = tags$p("Add Footer Here"),
header = tags$p(),
footer = tags$p(),
id = character(0)) {
logger::log_trace("init initializing teal app with: data ({ class(data)[1] }).")
data <- teal.data::to_relational_data(data = data)

checkmate::assert_string(title, null.ok = TRUE)
checkmate::assert_class(data, "TealData")
checkmate::assert_multi_class(modules, c("teal_module", "list", "teal_modules"))
checkmate::assert_string(title, null.ok = TRUE)
checkmate::assert_list(filter, min.len = 0, names = "unique")
checkmate::assert_subset(names(filter), choices = teal.data::get_dataname(data))
checkmate::assert_multi_class(header, c("shiny.tag", "character"))
checkmate::assert_multi_class(footer, c("shiny.tag", "character"))
checkmate::assert_character(id, max.len = 1, any.missing = FALSE)

teal.logger::log_system_info()
Expand Down
8 changes: 4 additions & 4 deletions man/init.Rd

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

4 changes: 2 additions & 2 deletions man/ui_teal.Rd

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

4 changes: 2 additions & 2 deletions man/ui_teal_with_splash.Rd

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

0 comments on commit 70807dd

Please sign in to comment.