Skip to content

Commit

Permalink
refactoring card_template to report_card_template
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeyakirar committed Oct 12, 2023
1 parent 267e3d8 commit e2f5b2f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ reference:
contents:
- reporter_previewer_module
- TealReportCard
- card_template
- report_card_template
- title: Functions for Module Developers
contents:
- tdata
Expand Down
12 changes: 9 additions & 3 deletions man/card_template.Rd → man/report_card_template.Rd

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

6 changes: 3 additions & 3 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down

0 comments on commit e2f5b2f

Please sign in to comment.