diff --git a/R/dummy_functions.R b/R/dummy_functions.R index dd0b52800e..19abbaa16d 100644 --- a/R/dummy_functions.R +++ b/R/dummy_functions.R @@ -36,7 +36,7 @@ example_module <- function(label = "example teal module", datanames = "all") { ns <- NS(id) teal.widgets::standard_layout( output = verbatimTextOutput(ns("text")), - encoding = div( + encoding = tags$div( selectInput(ns("dataname"), "Choose a dataset", choices = NULL), teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") ) diff --git a/R/init.R b/R/init.R index f796df133d..9b43ae0397 100644 --- a/R/init.R +++ b/R/init.R @@ -55,7 +55,7 @@ #' module( #' label = "data source", #' server = function(input, output, session, data) {}, -#' ui = function(id, ...) div(p("information about data source")), +#' ui = function(id, ...) tags$div(p("information about data source")), #' datanames = "all" #' ), #' example_module(label = "example teal module"), diff --git a/R/module_filter_manager.R b/R/module_filter_manager.R index b51bc3a107..bf3fbd0c2a 100644 --- a/R/module_filter_manager.R +++ b/R/module_filter_manager.R @@ -65,7 +65,7 @@ filter_manager_modal_srv <- function(id, filtered_data_list, filter) { #' @rdname module_filter_manager filter_manager_ui <- function(id) { ns <- NS(id) - div( + tags$div( class = "filter_manager_content", tableOutput(ns("slices_table")), snapshot_manager_ui(ns("snapshot_manager")) diff --git a/R/module_nested_tabs.R b/R/module_nested_tabs.R index 2648c9751f..07825917ca 100644 --- a/R/module_nested_tabs.R +++ b/R/module_nested_tabs.R @@ -94,7 +94,7 @@ ui_nested_tabs.teal_module <- function(id, modules, datasets, depth = 0L, is_mod class = "teal_module", uiOutput(ns("data_reactive"), inline = TRUE), tagList( - if (depth >= 2L) div(style = "mt-6"), + if (depth >= 2L) tags$div(style = "mt-6"), do.call(modules$ui, args) ) ) diff --git a/R/module_snapshot_manager.R b/R/module_snapshot_manager.R index fb92f8919e..6335b2a69e 100644 --- a/R/module_snapshot_manager.R +++ b/R/module_snapshot_manager.R @@ -85,11 +85,11 @@ #' snapshot_manager_ui <- function(id) { ns <- NS(id) - div( + tags$div( class = "snapshot_manager_content", - div( + tags$div( class = "snapshot_table_row", - span(tags$b("Snapshot manager")), + tags$span(tags$b("Snapshot manager")), actionLink(ns("snapshot_add"), label = NULL, icon = icon("camera"), title = "add snapshot"), actionLink(ns("snapshot_load"), label = NULL, icon = icon("upload"), title = "upload snapshot"), actionLink(ns("snapshot_reset"), label = NULL, icon = icon("undo"), title = "reset initial state"), @@ -303,9 +303,9 @@ snapshot_manager_srv <- function(id, slices_global, mapping_matrix, filtered_dat } # Create a row for the snapshot table. if (!is.element(id_rowme, names(divs))) { - divs[[id_rowme]] <- div( + divs[[id_rowme]] <- tags$div( class = "snapshot_table_row", - span(h5(s)), + tags$span(tags$h5(s)), actionLink(inputId = ns(id_pickme), label = icon("circle-check"), title = "select"), downloadLink(outputId = ns(id_saveme), label = icon("save"), title = "save to file") ) @@ -317,7 +317,7 @@ snapshot_manager_srv <- function(id, slices_global, mapping_matrix, filtered_dat output$snapshot_list <- renderUI({ rows <- lapply(rev(reactiveValuesToList(divs)), function(d) d) if (length(rows) == 0L) { - div( + tags$div( class = "snapshot_manager_placeholder", "Snapshots will appear here." ) diff --git a/R/module_teal.R b/R/module_teal.R index ce5d3d2f67..cb12b09fd8 100644 --- a/R/module_teal.R +++ b/R/module_teal.R @@ -80,19 +80,19 @@ ui_teal <- function(id, ns <- NS(id) # Once the data is loaded, we will remove this element and add the real teal UI instead - splash_ui <- div( + splash_ui <- tags$div( # id so we can remove the splash screen once ready, which is the first child of this container id = ns("main_ui_container"), # we put it into a div, so it can easily be removed as a whole, also when it is a tagList (and not # just the first item of the tagList) - div(splash_ui) + tags$div(splash_ui) ) # show busy icon when `shiny` session is busy computing stuff # based on https://stackoverflow.com/questions/17325521/r-shiny-display-loading-message-while-function-is-running/22475216#22475216 # nolint: line_length. shiny_busy_message_panel <- conditionalPanel( condition = "(($('html').hasClass('shiny-busy')) && (document.getElementById('shiny-notification-panel') == null))", # nolint: line_length. - div( + tags$div( icon("arrows-rotate", "spin fa-spin"), "Computing ...", # CSS defined in `custom.css` @@ -110,7 +110,7 @@ ui_teal <- function(id, splash_ui, tags$hr(), tags$footer( - div( + tags$div( footer, teal.widgets::verbatim_popup_ui(ns("sessionInfo"), "Session Info", type = "link"), textOutput(ns("identifier")) @@ -185,7 +185,7 @@ srv_teal <- function(id, modules, teal_data_rv, filter = teal_slices()) { where = "beforeEnd", # we put it into a div, so it can easily be removed as a whole, also when it is a tagList (and not # just the first item of the tagList) - ui = div(ui_tabs_with_filters( + ui = tags$div(ui_tabs_with_filters( session$ns("main_ui"), modules = modules, datasets = datasets, diff --git a/R/module_teal_with_splash.R b/R/module_teal_with_splash.R index e9cd7b304e..47fd73c81f 100644 --- a/R/module_teal_with_splash.R +++ b/R/module_teal_with_splash.R @@ -84,11 +84,11 @@ ui_teal_with_splash <- function(id, splash_ui <- if (inherits(data, "teal_data_module")) { data$ui(ns("teal_data_module")) } else if (inherits(data, "teal_data")) { - div() + tags$div() } ui_teal( id = ns("teal"), - splash_ui = div(splash_ui, uiOutput(ns("error"))), + splash_ui = tags$div(splash_ui, uiOutput(ns("error"))), title = title, header = header, footer = footer diff --git a/R/validate_inputs.R b/R/validate_inputs.R index 4fa8645a44..ca97c3a94f 100644 --- a/R/validate_inputs.R +++ b/R/validate_inputs.R @@ -41,7 +41,7 @@ #' sidebarPanel( #' selectInput("letter", "select a letter:", c(letters[1:3], LETTERS[4:6])), #' selectInput("number", "select a number:", 1:6), -#' br(), +#' tags$br(), #' selectInput("color", "select a color:", #' c("black", "indianred2", "springgreen2", "cornflowerblue"), #' multiple = TRUE diff --git a/man/init.Rd b/man/init.Rd index 87847b2379..89a588328f 100644 --- a/man/init.Rd +++ b/man/init.Rd @@ -69,7 +69,7 @@ app <- init( module( label = "data source", server = function(input, output, session, data) {}, - ui = function(id, ...) div(p("information about data source")), + ui = function(id, ...) tags$div(p("information about data source")), datanames = "all" ), example_module(label = "example teal module"), diff --git a/man/validate_inputs.Rd b/man/validate_inputs.Rd index caf9bb4be8..30ac599dcd 100644 --- a/man/validate_inputs.Rd +++ b/man/validate_inputs.Rd @@ -49,7 +49,7 @@ ui <- fluidPage( sidebarPanel( selectInput("letter", "select a letter:", c(letters[1:3], LETTERS[4:6])), selectInput("number", "select a number:", 1:6), - br(), + tags$br(), selectInput("color", "select a color:", c("black", "indianred2", "springgreen2", "cornflowerblue"), multiple = TRUE diff --git a/tests/testthat/test-init.R b/tests/testthat/test-init.R index cc3d40e857..0392763b5f 100644 --- a/tests/testthat/test-init.R +++ b/tests/testthat/test-init.R @@ -11,7 +11,7 @@ testthat::test_that("init data accepts teal_data object", { testthat::test_that("init data accepts teal_data_module", { testthat::expect_no_error( init( - data = teal_data_module(ui = function(id) div(), server = function(id) NULL), + data = teal_data_module(ui = function(id) tags$div(), server = function(id) NULL), modules = modules(example_module()) ) ) diff --git a/tests/testthat/test-module_teal_with_splash.R b/tests/testthat/test-module_teal_with_splash.R index 58d36b79f6..7c5806f386 100644 --- a/tests/testthat/test-module_teal_with_splash.R +++ b/tests/testthat/test-module_teal_with_splash.R @@ -4,7 +4,7 @@ testthat::test_that("srv_teal_with_splash data accepts a teal_data_module", { app = srv_teal_with_splash, args = list( id = "id", - data = teal_data_module(ui = function(id) div(), server = function(id) reactive(NULL)), + data = teal_data_module(ui = function(id) tags$div(), server = function(id) reactive(NULL)), modules = modules(example_module()) ), expr = {} @@ -18,7 +18,7 @@ testthat::test_that("srv_teal_with_splash throws when teal_data_module doesn't r app = srv_teal_with_splash, args = list( id = "id", - data = teal_data_module(ui = function(id) div(), server = function(id) NULL), + data = teal_data_module(ui = function(id) tags$div(), server = function(id) NULL), modules = modules(example_module()) ), expr = {} @@ -32,7 +32,7 @@ testthat::test_that("srv_teal_with_splash teal_data_rv evaluates the server of t app = srv_teal_with_splash, args = list( id = "test", - data = teal_data_module(ui = function(id) div(), server = function(id) reactive("whatever")), + data = teal_data_module(ui = function(id) tags$div(), server = function(id) reactive("whatever")), modules = modules(example_module()) ), expr = { @@ -81,7 +81,7 @@ testthat::test_that("srv_teal_with_splash teal_data_rv_validate throws when teal args = list( id = "test", data = teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) reactive(stop("this error")) ), modules = modules(example_module()) @@ -99,7 +99,7 @@ testthat::test_that("srv_teal_with_splash teal_data_rv_validate throws then qenv args = list( id = "test", data = teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) reactive(within(teal.data::teal_data(), stop("not good"))) ), modules = modules(example_module()) @@ -119,7 +119,7 @@ testthat::test_that( args = list( id = "test", data = teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) reactive(data.frame()) ), modules = modules(example_module()) @@ -185,7 +185,7 @@ testthat::test_that("srv_teal_with_splash gets observe event from srv_teal", { }) testthat::test_that("srv_teal_with_splash accepts data after within.teal_data_module", { - tdm <- teal_data_module(ui = function(id) div(), server = function(id) reactive(teal_data(IRIS = iris))) + tdm <- teal_data_module(ui = function(id) tags$div(), server = function(id) reactive(teal_data(IRIS = iris))) tdm2 <- within(tdm, IRIS$id <- seq_len(NROW(IRIS$Species))) # nolint: object_name. testthat::expect_no_error( @@ -210,7 +210,7 @@ testthat::test_that("srv_teal_with_splash accepts data after within.teal_data_mo }) testthat::test_that("srv_teal_with_splash throws error when within.teal_data_module returns qenv.error", { - tdm <- teal_data_module(ui = function(id) div(), server = function(id) reactive(teal_data(IRIS = iris))) + tdm <- teal_data_module(ui = function(id) tags$div(), server = function(id) reactive(teal_data(IRIS = iris))) tdm2 <- within(tdm, non_existing_var + 1) testthat::expect_no_error( @@ -232,7 +232,7 @@ testthat::test_that("srv_teal_with_splash throws error when within.teal_data_mod }) testthat::test_that("srv_teal_with_splash throws error when within.teal_data_module returns NULL", { - tdm <- teal_data_module(ui = function(id) div(), server = function(id) reactive(NULL)) + tdm <- teal_data_module(ui = function(id) tags$div(), server = function(id) reactive(NULL)) tdm2 <- within(tdm, within(1 + 1)) testthat::expect_no_error( shiny::testServer( @@ -261,7 +261,7 @@ testthat::test_that( "(other than `teal_data` or `qenv.error`)" ), { - tdm <- teal_data_module(ui = function(id) div(), server = function(id) reactive(NULL)) + tdm <- teal_data_module(ui = function(id) tags$div(), server = function(id) reactive(NULL)) tdm2 <- within(tdm, 1 + 1) testthat::expect_no_error( shiny::testServer( diff --git a/tests/testthat/test-teal_data_module-eval_code.R b/tests/testthat/test-teal_data_module-eval_code.R index 9f3462e7d9..d011a170ed 100644 --- a/tests/testthat/test-teal_data_module-eval_code.R +++ b/tests/testthat/test-teal_data_module-eval_code.R @@ -1,6 +1,6 @@ testthat::test_that("within.teal_data_module returns an object with teal_data_module class", { tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { shiny::moduleServer(id, function(input, output, session) { shiny::reactive(teal.data::teal_data(IRIS = iris)) @@ -17,7 +17,7 @@ testthat::test_that("eval_code.teal_data_module ui has modified namespace for id tdm <- teal_data_module( ui = function(id) { ns <- NS(id) - div(id = ns("element")) + tags$div(id = ns("element")) }, server = function(id) NULL ) @@ -33,7 +33,7 @@ testthat::test_that("eval_code.teal_data_module ui has modified namespace for id testthat::test_that("within.teal_data_module modifies the reactive tea_data object", { tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { shiny::moduleServer(id, function(input, output, session) { shiny::reactive(teal.data::teal_data(IRIS = iris)) @@ -58,7 +58,7 @@ testthat::test_that("within.teal_data_module modifies the reactive tea_data obje testthat::test_that("eval_code.teal_data_module will execute several times until error", { tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { shiny::moduleServer(id, function(input, output, session) { shiny::reactive(teal.data::teal_data(IRIS = iris)) @@ -82,7 +82,7 @@ testthat::test_that("eval_code.teal_data_module will execute several times until testthat::test_that("eval_code.teal_data_module throws error when original teal_data_module result is not reactive", { tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { shiny::moduleServer(id, function(input, output, session) { "I am not reactive, I am a string" @@ -103,7 +103,7 @@ testthat::test_that("eval_code.teal_data_module throws error when original teal_ testthat::test_that("eval_code.teal_data_module propagates qenv error from the original/first call", { tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { shiny::moduleServer(id, function(input, output, session) { reactive( @@ -130,7 +130,7 @@ testthat::test_that("eval_code.teal_data_module propagates qenv error from the o testthat::test_that("eval_code.teal_data_module handles an arbitrary object (other than `teal_data` or `qenv.error`)", { tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { shiny::moduleServer(id, function(input, output, session) { reactive(list()) @@ -155,7 +155,7 @@ testthat::test_that("eval_code.teal_data_module handles an arbitrary object (oth testthat::test_that("eval_code.teal_data_module handles a `NULL` result", { tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { shiny::moduleServer(id, function(input, output, session) { reactive(NULL) diff --git a/tests/testthat/test-teal_data_module.R b/tests/testthat/test-teal_data_module.R index 93d20d203b..4578649eb1 100644 --- a/tests/testthat/test-teal_data_module.R +++ b/tests/testthat/test-teal_data_module.R @@ -1,20 +1,20 @@ testthat::test_that("teal_data_module returns teal_data_module", { testthat::expect_s3_class( - teal_data_module(ui = function(id) div(), server = function(id) NULL), + teal_data_module(ui = function(id) tags$div(), server = function(id) NULL), "teal_data_module" ) }) testthat::test_that("teal_data_module throws when ui has other formals than id only", { testthat::expect_error( - teal_data_module(ui = function(id, x) div(), server = function(id) NULL), + teal_data_module(ui = function(id, x) tags$div(), server = function(id) NULL), "Must have exactly 1 formal arguments" ) }) testthat::test_that("teal_data_module throws when server has other formals than id only", { testthat::expect_error( - teal_data_module(ui = function(id) div(), server = function(id, x) NULL), + teal_data_module(ui = function(id) tags$div(), server = function(id, x) NULL), "Must have exactly 1 formal arguments" ) }) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 54c7b6f484..67a0628c95 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -164,7 +164,7 @@ testthat::test_that("create_app_id: 'data' accepts teal_data or teal_data_module testthat::expect_no_error(create_app_id(teal.data::teal_data(), modules(example_module()))) tdm <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) NULL ) testthat::expect_no_error(create_app_id(tdm, modules(example_module()))) diff --git a/vignettes/adding-support-for-reporting.Rmd b/vignettes/adding-support-for-reporting.Rmd index c08a88ae5b..f5ebb24d16 100644 --- a/vignettes/adding-support-for-reporting.Rmd +++ b/vignettes/adding-support-for-reporting.Rmd @@ -335,7 +335,7 @@ example_reporter_module <- function(label = "Example") { sidebarLayout( sidebarPanel( - div( + tags$div( teal.reporter::add_card_button_ui(ns("addReportCard")), teal.reporter::download_report_button_ui(ns("downloadButton")), teal.reporter::reset_report_button_ui(ns("resetButton")) diff --git a/vignettes/data-as-shiny-module.Rmd b/vignettes/data-as-shiny-module.Rmd index d64dfa5f0c..48deac74cf 100644 --- a/vignettes/data-as-shiny-module.Rmd +++ b/vignettes/data-as-shiny-module.Rmd @@ -38,7 +38,7 @@ library(teal) ```{r} data_module <- teal_data_module( - ui = function(id) div(), + ui = function(id) tags$div(), server = function(id) { moduleServer(id, function(input, output, session) { reactive({ @@ -86,7 +86,7 @@ datanames(data) <- c("dataset1", "dataset2") data_module <- teal_data_module( ui = function(id) { ns <- NS(id) - div( + tags$div( selectInput(ns("species"), "Select species to keep", choices = unique(iris$Species), multiple = TRUE ), diff --git a/vignettes/getting-started-with-teal.Rmd b/vignettes/getting-started-with-teal.Rmd index 89187a0d77..342c7de059 100644 --- a/vignettes/getting-started-with-teal.Rmd +++ b/vignettes/getting-started-with-teal.Rmd @@ -43,7 +43,7 @@ app <- init( ), title = build_app_title(title = "My first teal app"), header = h3("My first teal application"), - footer = div(a("Powered by teal", href = "https://insightsengineering.github.io/teal/latest-tag/")) + footer = tags$div(a("Powered by teal", href = "https://insightsengineering.github.io/teal/latest-tag/")) ) if (interactive()) {