diff --git a/NAMESPACE b/NAMESPACE index b785b27827..fbf4258c0c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -19,7 +19,6 @@ S3method(ui_nested_tabs,teal_modules) export("%>%") export(TealReportCard) export(as.teal_slices) -export(card_template) export(example_module) export(get_code_tdata) export(get_join_keys) @@ -28,6 +27,7 @@ export(init) export(module) export(modules) export(new_tdata) +export(report_card_template) export(reporter_previewer_module) export(show_rcode_modal) export(srv_teal_with_splash) diff --git a/R/utils.R b/R/utils.R index 285ccdf513..3899fa05d2 100644 --- a/R/utils.R +++ b/R/utils.R @@ -62,7 +62,7 @@ include_parent_datanames <- function(dataname, join_keys) { #' @return (`TealReportCard`) populated with a title, description and filter state #' #' @export -card_template <- function(title, label, description = NULL, with_filter, filter_panel_api) { +report_card_template <- function(title, label, description = NULL, with_filter, filter_panel_api) { checkmate::assert_string(title) checkmate::assert_string(label) checkmate::assert_string(description, null.ok = TRUE) diff --git a/_pkgdown.yml b/_pkgdown.yml index 4438b1c611..9525fbdd7a 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -106,7 +106,7 @@ reference: contents: - reporter_previewer_module - TealReportCard - - card_template + - report_card_template - title: Functions for Module Developers contents: - tdata diff --git a/man/card_template.Rd b/man/report_card_template.Rd similarity index 84% rename from man/card_template.Rd rename to man/report_card_template.Rd index f445325511..3674634c6a 100644 --- a/man/card_template.Rd +++ b/man/report_card_template.Rd @@ -1,10 +1,16 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R -\name{card_template} -\alias{card_template} +\name{report_card_template} +\alias{report_card_template} \title{Template function to generate reporter card.} \usage{ -card_template(title, label, description = NULL, with_filter, filter_panel_api) +report_card_template( + title, + label, + description = NULL, + with_filter, + filter_panel_api +) } \arguments{ \item{title}{(\code{character(1)}) title of the card (unless overwritten by label)} diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 3abeb31353..e64f4265cf 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -11,11 +11,11 @@ testthat::test_that("get_teal_bs_theme", { }) }) -testthat::test_that("card_template function returns TealReportCard object with appropriate content and labels", { +testthat::test_that("report_card_template function returns TealReportCard object with appropriate content and labels", { fd <- teal.slice::init_filtered_data(list(iris = list(dataset = iris))) filter_panel_api <- teal.slice::FilterPanelAPI$new(fd) - card <- shiny::isolate(card_template( + card <- shiny::isolate(report_card_template( title = "Card title", label = "Card label", description = "Sample description", @@ -26,7 +26,7 @@ testthat::test_that("card_template function returns TealReportCard object with a testthat::expect_equal(card$get_name(), "Card label") testthat::expect_length(card$get_content(), 4) - card <- shiny::isolate(card_template( + card <- shiny::isolate(report_card_template( title = "Card title", label = "", with_filter = FALSE,