Skip to content

Commit 2c5cfcf

Browse files
averissimom7prgithub-actions[bot]gogonzovedhav
authored
📑 Refactor: Adds new teal_report, teal_card class and revamps reporter UI (#331)
# Pull Request Fixes: - insightsengineering/teal#1526 Built on top of: - #307 - _(#307 will be closed once this PR is stable)_ ### Companion PRs: - insightsengineering/teal#1541 - insightsengineering/teal.code#255 - insightsengineering/teal.data#370 - #331 - insightsengineering/teal.modules.general#884 - insightsengineering/teal.modules.clinical#1392 ### Changes description - Adds new object called `teal_report` that extends `teal_data` - The card/report for a module is built automatically with `eval_code()` and `eval_code(cache = TRUE)` - (adding code and print objects respectively) - Report slot can be manipulated with `report(<teal_report>)` - Rename of `report_document` to `doc`/`document`/`page` (final name TBD) --------- Signed-off-by: Marcin <[email protected]> Signed-off-by: André Veríssimo <[email protected]> Co-authored-by: m7pr <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dawid Kaledkowski <[email protected]> Co-authored-by: Marcin <[email protected]> Co-authored-by: vedhav <[email protected]> Co-authored-by: Lluís Revilla <[email protected]> Co-authored-by: Pawel Rucki <[email protected]>
1 parent e8dd172 commit 2c5cfcf

File tree

108 files changed

+4681
-4632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+4681
-4632
lines changed

‎.lintr‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
linters: linters_with_defaults(
22
line_length_linter = line_length_linter(120),
3-
cyclocomp_linter = NULL,
43
object_usage_linter = NULL,
54
indentation_linter = NULL
65
)

‎.pre-commit-config.yaml‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,32 @@ repos:
1414
- id: roxygenize
1515
name: Regenerate package documentation
1616
additional_dependencies:
17+
- bsicons
1718
- bslib
1819
- checkmate
19-
#- flextable
20-
- davidgohel/flextable # Error: package 'flextable' is not available
21-
- davidgohel/gdtools # for flextable
20+
- commonmark
21+
- flextable
2222
- grid
23-
- htmltools
23+
- gtsummary
2424
- knitr
2525
- lifecycle
2626
- R6
27+
- rlang
28+
- insightsengineering/rlistings # for rtables
2729
- rmarkdown
30+
- insightsengineering/rtables
31+
- insightsengineering/rtables.officer
32+
- davidgohel/officer # for rtables.officer
33+
- insightsengineering/formatters # for rtables
2834
- shiny
2935
- shinybusy
36+
- shinyjs
3037
- shinyWidgets
38+
- sortable
39+
- insightsengineering/teal.code
40+
- insightsengineering/teal.data
3141
- yaml
3242
- zip
33-
- rlistings
34-
- rtables
35-
- rtables.officer
3643
- id: spell-check
3744
name: Check spelling with `spelling`
3845
exclude: >

‎DESCRIPTION‎

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,30 @@ Imports:
2525
bsicons,
2626
bslib (>= 0.8.0),
2727
checkmate (>= 2.1.0),
28+
commonmark (>= 1.9.2),
2829
flextable (>= 0.9.2),
2930
grid,
31+
gtsummary (>= 1.7.0),
3032
htmltools (>= 0.5.4),
33+
jsonlite (>= 1.8.9),
3134
knitr (>= 1.42),
3235
lifecycle (>= 0.2.0),
36+
methods,
3337
R6,
38+
rlang (>= 1.0.0),
3439
rlistings (>= 0.2.10),
3540
rmarkdown (>= 2.23),
3641
rtables (>= 0.6.11),
3742
rtables.officer (>= 0.0.2),
3843
shiny (>= 1.8.1),
3944
shinybusy (>= 0.3.2),
40-
shinyjs,
45+
shinyjs (>= 2.1.0),
4146
shinyWidgets (>= 0.5.1),
4247
sortable (>= 0.5.0),
48+
teal.code (>= 0.6.1.9002),
49+
teal.data (>= 0.7.0.9002),
50+
tools,
51+
utils,
4352
yaml (>= 1.1.0),
4453
zip (>= 1.1.0)
4554
Suggests:
@@ -49,25 +58,29 @@ Suggests:
4958
ggplot2 (>= 3.4.3),
5059
lattice (>= 0.18-4),
5160
png,
61+
shinytest2,
5262
testthat (>= 3.2.2),
5363
tinytex,
64+
waldo (>= 0.2.0),
5465
withr (>= 2.0.0)
5566
VignetteBuilder:
5667
knitr,
5768
rmarkdown
58-
RdMacros:
59-
lifecycle
60-
Config/Needs/verdepcheck: rstudio/bslib, mllg/checkmate,
61-
davidgohel/flextable, rstudio/htmltools, yihui/knitr, r-lib/lifecycle,
62-
r-lib/R6, insightsengineering/rlistings, rstudio/rmarkdown,
69+
Config/Needs/verdepcheck: rstudio/bsicons,rstudio/bslib, mllg/checkmate,
70+
r-lib/commonmark, davidgohel/flextable, ddsjoberg/gtsummary, rstudio/htmltools,
71+
jeroen/jsonlite, yihui/knitr, r-lib/lifecycle, r-lib/R6, r-lib/rlang,
72+
insightsengineering/rlistings, rstudio/rmarkdown,
6373
insightsengineering/rtables, insightsengineering/rtables.officer,
64-
rstudio/shiny, dreamRs/shinybusy, dreamRs/shinyWidgets,
74+
rstudio/shiny, dreamRs/shinybusy, daattali/shinyjs, dreamRs/shinyWidgets,
75+
rstudio/sortable, insightsengineering/teal.code, insightsengineering/teal.data,
6576
yaml=vubiostat/r-yaml, r-lib/zip, rstudio/DT, yihui/formatR,
6677
insightsengineering/formatters, tidyverse/ggplot2, deepayan/lattice,
67-
cran/png, r-lib/testthat, rstudio/tinytex, r-lib/withr
78+
cran/png, rstudio/shinytest2, r-lib/testthat, rstudio/tinytex, r-lib/waldo,
79+
r-lib/withr
6880
Config/Needs/website: insightsengineering/nesttemplate
6981
Encoding: UTF-8
7082
Language: en-US
7183
LazyData: true
7284
Roxygen: list(markdown = TRUE)
7385
RoxygenNote: 7.3.2
86+
Config/testthat/edition: 3

‎NAMESPACE‎

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method("[",teal_card)
4+
S3method("[",teal_report)
5+
S3method("[[<-",teal_card)
6+
S3method("metadata<-",ReportCard)
7+
S3method("metadata<-",teal_card)
8+
S3method(c,teal_card)
9+
S3method(c,teal_report)
10+
S3method(format,code_chunk)
11+
S3method(length,ReportCard)
12+
S3method(metadata,ReportCard)
13+
S3method(metadata,teal_card)
314
S3method(print,rmd_yaml_header)
15+
S3method(srv_editor_block,default)
16+
S3method(teal_card,default)
17+
S3method(teal_card,qenv)
18+
S3method(teal_card,teal_card)
19+
S3method(teal_card,teal_report)
20+
S3method(toHTML,default)
21+
S3method(ui_editor_block,default)
22+
export("metadata<-")
23+
export("teal_card<-")
424
export(ReportCard)
525
export(Reporter)
626
export(add_card_button_srv)
727
export(add_card_button_ui)
28+
export(as.teal_card)
29+
export(as.teal_report)
830
export(as_yaml_auto)
31+
export(code_chunk)
932
export(download_report_button_srv)
1033
export(download_report_button_ui)
34+
export(metadata)
1135
export(preview_report_button_srv)
1236
export(preview_report_button_ui)
37+
export(render)
1338
export(report_load_srv)
1439
export(report_load_ui)
1540
export(reporter_previewer_srv)
@@ -20,9 +45,10 @@ export(rmd_output_arguments)
2045
export(rmd_outputs)
2146
export(simple_reporter_srv)
2247
export(simple_reporter_ui)
23-
importFrom(R6,R6Class)
24-
importFrom(checkmate,assert_string)
25-
importFrom(grid,grid.newpage)
26-
importFrom(lifecycle,badge)
27-
importFrom(rmarkdown,render)
28-
importFrom(yaml,as.yaml)
48+
export(srv_editor_block)
49+
export(teal_card)
50+
export(teal_report)
51+
export(ui_editor_block)
52+
importFrom(teal.code,eval_code)
53+
importFrom(teal.data,teal_data)
54+
importFrom(tools,toHTML)

‎NEWS.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# teal.reporter 0.5.0.9000
22

3+
### New features
4+
5+
* Adds editing capabilities to report cards in the previewer modal for the title and text contents.
6+
* Adds `teal_card` class that replaces `ReportCard` R6 class. It retains all its functionalities in a S4 with less complexity. It allows for easier modifications and insertion of new report content.
7+
* Adds `teal_report` class that extends from `teal.data::teal_data` that allows to keep contents of the report card.
8+
* `teal_report` is updated automatically with executed code and its outputs are stored as well.
9+
* Supports `flextable` and `gtsummary` objects.
10+
311
# teal.reporter 0.5.0
412

513
### Breaking changes

‎R/ContentBlock.R‎

Lines changed: 0 additions & 80 deletions
This file was deleted.

‎R/FileBlock.R‎

Lines changed: 0 additions & 65 deletions
This file was deleted.

‎R/HTMLBlock.R‎

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)