diff --git a/R/init.R b/R/init.R index f1319828f..417d0e5c4 100644 --- a/R/init.R +++ b/R/init.R @@ -87,10 +87,7 @@ #' `Iris Sepal.Length histogram` = "new_iris Species", #' global_filters = "new_mtcars cyl" #' ) -#' ), -#' title = "App title", -#' header = tags$h1("Sample App"), -#' footer = tags$p("Sample footer") +#' ) #' ) #' if (interactive()) { #' shinyApp(app$ui, app$server) diff --git a/R/landing_popup_module.R b/R/landing_popup_module.R index 23b4c6606..204c0e18e 100644 --- a/R/landing_popup_module.R +++ b/R/landing_popup_module.R @@ -1,9 +1,10 @@ #' Landing popup module #' -#' @description Creates a landing welcome popup for `teal` applications. +#' @description `r lifecycle::badge("deprecated")` Creates a landing welcome popup for `teal` applications. #' #' This module is used to display a popup dialog when the application starts. #' The dialog blocks access to the application and must be closed with a button before the application can be viewed. +#' This function is deprecated, please use `add_landing_modal()` on the teal app object instead. #' #' @param label (`character(1)`) Label of the module. #' @param title (`character(1)`) Text to be displayed as popup title. @@ -13,51 +14,19 @@ #' #' @return A `teal_module` (extended with `teal_landing_module` class) to be used in `teal` applications. #' -#' @examples -#' app1 <- init( -#' data = teal_data(iris = iris), -#' modules = modules( -#' example_module(), -#' landing_popup_module( -#' content = "A place for the welcome message or a disclaimer statement.", -#' buttons = modalButton("Proceed") -#' ) -#' ) -#' ) -#' if (interactive()) { -#' shinyApp(app1$ui, app1$server) -#' } -#' -#' app2 <- init( -#' data = teal_data(iris = iris), -#' modules = modules( -#' example_module(), -#' landing_popup_module( -#' title = "Welcome", -#' content = tags$b( -#' "A place for the welcome message or a disclaimer statement.", -#' style = "color: red;" -#' ), -#' buttons = tagList( -#' modalButton("Proceed"), -#' actionButton("read", "Read more", -#' onclick = "window.open('http://google.com', '_blank')" -#' ), -#' actionButton("close", "Reject", onclick = "window.close()") -#' ) -#' ) -#' ) -#' ) -#' -#' if (interactive()) { -#' shinyApp(app2$ui, app2$server) -#' } -#' #' @export landing_popup_module <- function(label = "Landing Popup", title = NULL, content = NULL, buttons = modalButton("Accept")) { + lifecycle::deprecate_soft( + when = "0.15.3", + what = "landing_popup_module()", + details = paste( + "landing_popup_module() is deprecated.", + "Use add_landing_modal() on the teal app object instead." + ) + ) checkmate::assert_string(label) checkmate::assert_string(title, null.ok = TRUE) checkmate::assert_multi_class( diff --git a/man/init.Rd b/man/init.Rd index d646c16d8..f142e43b4 100644 --- a/man/init.Rd +++ b/man/init.Rd @@ -97,10 +97,7 @@ app <- init( `Iris Sepal.Length histogram` = "new_iris Species", global_filters = "new_mtcars cyl" ) - ), - title = "App title", - header = tags$h1("Sample App"), - footer = tags$p("Sample footer") + ) ) if (interactive()) { shinyApp(app$ui, app$server) diff --git a/man/landing_popup_module.Rd b/man/landing_popup_module.Rd index 43e15dd76..304c2cedb 100644 --- a/man/landing_popup_module.Rd +++ b/man/landing_popup_module.Rd @@ -25,49 +25,9 @@ Passed to \code{...} of \code{shiny::modalDialog}. See examples.} A \code{teal_module} (extended with \code{teal_landing_module} class) to be used in \code{teal} applications. } \description{ -Creates a landing welcome popup for \code{teal} applications. +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Creates a landing welcome popup for \code{teal} applications. This module is used to display a popup dialog when the application starts. The dialog blocks access to the application and must be closed with a button before the application can be viewed. -} -\examples{ -app1 <- init( - data = teal_data(iris = iris), - modules = modules( - example_module(), - landing_popup_module( - content = "A place for the welcome message or a disclaimer statement.", - buttons = modalButton("Proceed") - ) - ) -) -if (interactive()) { - shinyApp(app1$ui, app1$server) -} - -app2 <- init( - data = teal_data(iris = iris), - modules = modules( - example_module(), - landing_popup_module( - title = "Welcome", - content = tags$b( - "A place for the welcome message or a disclaimer statement.", - style = "color: red;" - ), - buttons = tagList( - modalButton("Proceed"), - actionButton("read", "Read more", - onclick = "window.open('http://google.com', '_blank')" - ), - actionButton("close", "Reject", onclick = "window.close()") - ) - ) - ) -) - -if (interactive()) { - shinyApp(app2$ui, app2$server) -} - +This function is deprecated, please use \code{add_landing_modal()} on the teal app object instead. }