Skip to content

Commit b723d61

Browse files
authored
Fixes tm_g_distribtution from not properly creating report (#921)
# Pull Request - Fixes #920 ### Changes description - Fixes problem in code - Adds missing section in `NEWS.md` with reporter refactor. ### Notes for reviewer: - Test this module beyond the original issue scope - Both plots and more combinations of enconding
1 parent 7c8f7a3 commit b723d61

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# teal.modules.general 0.5.0.9003
22

3+
### Enhancements
4+
5+
- Modules now return a `teal_report` object that contains the data, code and reporter. All the reporter buttons were removed from the modules' UI.
6+
37
# teal.modules.general 0.5.0
48

59
### Breaking changes

R/tm_g_distribution.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,13 +1272,13 @@ srv_distribution <- function(id,
12721272
output_dist_q <- reactive(c(common_q(), req(dist_q())))
12731273
output_qq_q <- reactive(c(common_q(), req(qq_q())))
12741274

1275-
# Summary table listing has to be created separately to allow for qenv join
1276-
q_common <- common_q()
1277-
teal.reporter::teal_card(q_common) <- c(
1278-
teal.reporter::teal_card(q_common),
1279-
"## Statistics table"
1280-
)
12811275
output_summary_q <- reactive({
1276+
# Summary table listing has to be created separately to allow for qenv join
1277+
q_common <- common_q()
1278+
teal.reporter::teal_card(q_common) <- c(
1279+
teal.reporter::teal_card(q_common),
1280+
"## Statistics table"
1281+
)
12821282
if (iv_r()$is_valid()) {
12831283
within(q_common, {
12841284
summary_table <- rtables::df_to_tt(summary_table_data)
@@ -1358,7 +1358,7 @@ srv_distribution <- function(id,
13581358
output$summary_table <- DT::renderDataTable(summary_r())
13591359

13601360
tests_r <- reactive({
1361-
q <- req(output_test_q())
1361+
q <- req(decorated_output_test_q())
13621362
DT::datatable(q[["test_table_data"]])
13631363
})
13641364

@@ -1384,7 +1384,7 @@ srv_distribution <- function(id,
13841384

13851385
decorated_output_q <- reactive({
13861386
tab <- req(input$tabs) # tab is NULL upon app launch, hence will crash without this statement
1387-
test_q_out <- output_test_q()
1387+
test_q_out <- decorated_output_test_q()
13881388

13891389
out_q <- switch(tab,
13901390
Histogram = decorated_output_dist_dims_q(),

0 commit comments

Comments
 (0)