Skip to content

Commit f67584f

Browse files
committed
chore: rename ui/srv_teal_transform_data to ui/srv_transform_teal_data
1 parent 0f9565c commit f67584f

11 files changed

+27
-27
lines changed

NAMESPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ export(reporter_previewer_module)
3131
export(set_datanames)
3232
export(show_rcode_modal)
3333
export(srv_teal)
34-
export(srv_teal_transform_data)
3534
export(srv_teal_with_splash)
35+
export(srv_transform_teal_data)
3636
export(tdata2env)
3737
export(teal_data_module)
3838
export(teal_slices)
3939
export(teal_transform_module)
4040
export(ui_teal)
41-
export(ui_teal_transform_data)
4241
export(ui_teal_with_splash)
42+
export(ui_transform_teal_data)
4343
export(validate_has_data)
4444
export(validate_has_elements)
4545
export(validate_has_variable)

R/dummy_functions.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ example_module <- function(label = "example teal module",
6060
)
6161
})
6262

63-
table_data_decorated_no_print <- srv_teal_transform_data(
63+
table_data_decorated_no_print <- srv_transform_teal_data(
6464
"decorate",
6565
data = table_data,
6666
transformators = decorators
@@ -87,7 +87,7 @@ example_module <- function(label = "example teal module",
8787
output = verbatimTextOutput(ns("text")),
8888
encoding = tags$div(
8989
selectInput(ns("dataname"), "Choose a dataset", choices = NULL),
90-
ui_teal_transform_data(ns("decorate"), transformators = decorators),
90+
ui_transform_teal_data(ns("decorate"), transformators = decorators),
9191
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
9292
)
9393
)

R/module_nested_tabs.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ui_teal_module.teal_module <- function(id, modules, depth = 0L) {
125125
width = 3,
126126
ui_data_summary(ns("data_summary")),
127127
ui_filter_data(ns("filter_panel")),
128-
ui_teal_transform_data(ns("data_transform"), transformators = modules$transformators, class = "well"),
128+
ui_transform_teal_data(ns("data_transform"), transformators = modules$transformators, class = "well"),
129129
class = "teal_secondary_col"
130130
)
131131
)
@@ -261,7 +261,7 @@ srv_teal_module.teal_module <- function(id,
261261
is_active = is_active
262262
)
263263
is_transform_failed <- reactiveValues()
264-
transformed_teal_data <- srv_teal_transform_data(
264+
transformed_teal_data <- srv_transform_teal_data(
265265
"data_transform",
266266
data = filtered_teal_data,
267267
transformators = modules$transformators,

R/module_transform_data.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ NULL
1414

1515
#' @export
1616
#' @rdname module_transform_data
17-
ui_teal_transform_data <- function(id, transformators, class = "well") {
17+
ui_transform_teal_data <- function(id, transformators, class = "well") {
1818
checkmate::assert_string(id)
1919
if (length(transformators) == 0L) {
2020
return(NULL)
@@ -56,7 +56,7 @@ ui_teal_transform_data <- function(id, transformators, class = "well") {
5656
tags$div(
5757
id = transform_wrapper_id,
5858
if (is.null(data_mod$ui)) {
59-
NULL
59+
return(NULL)
6060
} else {
6161
data_mod$ui(id = ns("transform"))
6262
},
@@ -74,7 +74,7 @@ ui_teal_transform_data <- function(id, transformators, class = "well") {
7474

7575
#' @export
7676
#' @rdname module_transform_data
77-
srv_teal_transform_data <- function(id, data, transformators, modules = NULL, is_transform_failed = reactiveValues()) {
77+
srv_transform_teal_data <- function(id, data, transformators, modules = NULL, is_transform_failed = reactiveValues()) {
7878
checkmate::assert_string(id)
7979
assert_reactive(data)
8080
checkmate::assert_class(modules, "teal_module", null.ok = TRUE)
@@ -91,7 +91,7 @@ srv_teal_transform_data <- function(id, data, transformators, modules = NULL, is
9191
module_output <- Reduce(
9292
function(data_previous, name) {
9393
moduleServer(name, function(input, output, session) {
94-
logger::log_debug("srv_teal_transform_data initializing for { name }.")
94+
logger::log_debug("srv_transform_teal_data initializing for { name }.")
9595
is_transform_failed[[name]] <- FALSE
9696
data_out <- transformators[[name]]$server("transform", data = data_previous)
9797
data_handled <- reactive(tryCatch(data_out(), error = function(e) e))

R/teal_transform_module.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#' `teal_transform_module` also allows developers to modify any object created within [`teal.data::teal_data`].
2121
#' This means you can use it to customize not only datasets but also tables, listings, and graphs.
2222
#' Some [`teal_modules`] permit developers to inject custom `shiny` modules to enhance displayed outputs.
23-
#' To manage these `decorators` within your module, use [`ui_teal_transform_data()`] and [`srv_teal_transform_data()`].
23+
#' To manage these `decorators` within your module, use [`ui_transform_teal_data()`] and [`srv_teal_transform_data()`].
2424
#' (For further guidance on managing decorators, refer to `ui_args` and `srv_args` in the vignette documentation.)
2525
#'
2626
#' See the vignette `vignette("decorate-modules-output", package = "teal")` for additional examples.

man/module_transform_data.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/teal_transform_module.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-module_teal.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,7 @@ testthat::describe("srv_teal teal_module(s) transformator", {
20512051
expr = {
20522052
session$setInputs(`teal_modules-active_tab` = "mod1")
20532053
session$setInputs(`teal_modules-mod1-module-dataname` = "x1")
2054-
session$setInputs(`teal_modules-mod1-module-decorate-decorator_name-transform-text` = "lorem ipsum dolor")
2054+
session$setInputs(`teal_modules-mod1-module-decorate-transform_1-transform-text` = "lorem ipsum dolor")
20552055
session$flushReact()
20562056

20572057
testthat::expect_identical(modules_output$mod1()()[["object"]], "ABC lorem ipsum dolor")

tests/testthat/test-shinytest2-decorators.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ testthat::test_that("e2e: module with decorator UI and output is modified intera
3535

3636
input_id <- Reduce(
3737
shiny::NS,
38-
c("decorate", "transform_module", "transform", "append_text")
38+
c("decorate", "transform_1", "transform", "append_text")
3939
)
4040

4141
testthat::expect_true(

tests/testthat/test-teal_transform_module.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ testthat::describe("make_teal_transform_server produces a valid teal_transform_m
99
)
1010

1111
shiny::testServer(
12-
app = srv_teal_transform_data,
12+
app = srv_transform_teal_data,
1313
args = list(
1414
id = "test",
1515
data = reactive(teal.data::teal_data(data1 = iris, data2 = mtcars)),
@@ -32,7 +32,7 @@ testthat::describe("make_teal_transform_server produces a valid teal_transform_m
3232
)
3333

3434
shiny::testServer(
35-
app = srv_teal_transform_data,
35+
app = srv_transform_teal_data,
3636
args = list(
3737
id = "test",
3838
data = reactive(teal.data::teal_data(data1 = iris, data2 = mtcars)),
@@ -47,7 +47,7 @@ testthat::describe("make_teal_transform_server produces a valid teal_transform_m
4747
})
4848

4949
testthat::test_that(
50-
"ui_teal_transform_dataname and srv_teal_transform_dataname have the same namespace for transform module",
50+
"ui_transform_teal_data and srv_transform_teal_data have the same namespace for transform module",
5151
{
5252
ttm <- teal_transform_module(
5353
ui = function(id) tags$div(id = NS(id, "a_div"), "a div"),
@@ -60,12 +60,12 @@ testthat::test_that(
6060
)
6161

6262
initial_id <- "a-path-to-an-inner-namespace"
63-
ui <- ui_teal_transform_data(initial_id, ttm)
63+
ui <- ui_transform_teal_data(initial_id, ttm)
6464
# Find element that ends in "-a_div"
6565
expected_id <- unname(unlist(ui)[grepl(".*-a_div$", unlist(ui))][1])
6666

6767
testServer(
68-
app = srv_teal_transform_data,
68+
app = srv_transform_teal_data,
6969
args = list(
7070
id = initial_id,
7171
data = reactive(within(teal_data(), iris <- iris)),

0 commit comments

Comments
 (0)