Skip to content
Merged
Show file tree
Hide file tree
Changes from 230 commits
Commits
Show all changes
322 commits
Select commit Hold shift + click to select a range
d58f4cc
[skip style] [skip vbump] Restyle files
github-actions[bot] Apr 1, 2025
8cc6788
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Apr 1, 2025
2c85ee8
update Reporter documentation for ReportDocument
m7pr Apr 2, 2025
30007bd
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr Apr 2, 2025
c76d665
update ReportDocument documentation
m7pr Apr 2, 2025
445b454
[skip style] [skip vbump] Restyle files
github-actions[bot] Apr 2, 2025
682db6d
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Apr 2, 2025
69633cc
tests for ReportDocument
m7pr Apr 2, 2025
8d9ed72
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr Apr 2, 2025
1fd15b0
[skip style] [skip vbump] Restyle files
github-actions[bot] Apr 2, 2025
847750a
allow setting a template fun to be added to every ReportDocument card
m7pr Apr 10, 2025
42d1547
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr Apr 10, 2025
2c4c0cb
fix reorder_cards for ReportDocument
m7pr Apr 28, 2025
ef89896
edit previewer modal
m7pr Apr 30, 2025
106fa7f
add text button
m7pr Apr 30, 2025
192136d
cleanup
m7pr Apr 30, 2025
05d97ff
cleanup
m7pr Apr 30, 2025
f1cb160
bring back observser for loading the reporter
m7pr Apr 30, 2025
cd59203
prefixes
m7pr Apr 30, 2025
166a21c
tidyup previewer and editor
gogonzo May 2, 2025
285c015
WIP editor
gogonzo May 5, 2025
501b5e9
remove add new card button
m7pr May 5, 2025
6ed5301
set class to ReportDocument after editing
m7pr May 5, 2025
c22ccae
remove comments
m7pr May 5, 2025
a4876f6
change assrtion in edit_report_document
m7pr May 6, 2025
4a6cda5
feat: modify the add to reporter button
vedhav May 6, 2025
4456334
add empty text block button
m7pr May 6, 2025
1b6e5a4
bring back cards sorting
m7pr May 6, 2025
7c3752e
Update R/Reporter.R
m7pr May 6, 2025
83c9293
fixes #317
gogonzo May 7, 2025
5afc410
editor
gogonzo May 8, 2025
e557679
debounce content edition for character input
m7pr May 8, 2025
f2d55d1
remove sorting of cards
m7pr May 8, 2025
cba3d6a
increase debounce
m7pr May 8, 2025
51165f1
remove comment
m7pr May 8, 2025
d5699de
Edit Functionality for the Report Previewer module (#312)
m7pr May 8, 2025
76ecba6
[skip style] [skip vbump] Restyle files
github-actions[bot] May 8, 2025
a1c8a71
extend documentation and tests for report_document
m7pr May 8, 2025
83207be
merge documentation cleanup and tests extension
m7pr May 8, 2025
5a61f5a
[skip style] [skip vbump] Restyle files
github-actions[bot] May 8, 2025
c224c2f
merge cleanup
m7pr May 8, 2025
b689adb
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr May 8, 2025
336a3fe
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] May 8, 2025
e83b392
fix accordion panel:
gogonzo May 9, 2025
76d8404
bring back cards sorting
m7pr May 9, 2025
6bad2bb
[skip style] [skip vbump] Restyle files
github-actions[bot] May 9, 2025
e91cdf2
fix tests
m7pr May 12, 2025
4f7a58f
[skip style] [skip vbump] Restyle files
github-actions[bot] May 12, 2025
79fb6d9
documentation fixes
m7pr May 12, 2025
5a13e83
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr May 12, 2025
57bd1f0
cleanup dependencies
m7pr May 12, 2025
eae6a0f
fix r cmd check documentation
m7pr May 12, 2025
62c6378
shinytest2 tests for previewer
m7pr May 16, 2025
d0e5cce
[skip style] [skip vbump] Restyle files
github-actions[bot] May 16, 2025
c6986b4
missing prefixes
m7pr May 16, 2025
d854fbd
merge
m7pr May 16, 2025
7f091a4
[skip style] [skip vbump] Restyle files
github-actions[bot] May 16, 2025
f15a511
use new card system for testing
m7pr May 16, 2025
a6315bc
add prefixes
m7pr May 16, 2025
7c8469d
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr May 16, 2025
0df9765
[skip style] [skip vbump] Restyle files
github-actions[bot] May 16, 2025
61e460d
Fixes 1-card problem in refactor (#325)
averissimo May 20, 2025
564b5ce
Improves `ReportDocument` editor (#326)
averissimo May 27, 2025
ada0651
[skip style] [skip vbump] Restyle files
github-actions[bot] May 27, 2025
4098f55
fix x and code_chunk
gogonzo May 27, 2025
b7bce2e
introduce teal_reportable (WIP)
gogonzo May 27, 2025
7c413cc
roxy fixes
gogonzo May 27, 2025
5b9d899
as.reportable:
gogonzo May 27, 2025
1fd5ebe
small fix
gogonzo May 27, 2025
b73f1db
ReportDocument to doc
gogonzo May 27, 2025
32072a6
teal_reportable -> teal_report
gogonzo May 27, 2025
58a31fd
feat: simplify eval_code and part of consistent naming
averissimo May 28, 2025
2f436f2
chore: last of consisent naming
averissimo May 28, 2025
f023f09
chore: rename as.reportable
averissimo May 28, 2025
6946350
fix: c.doc should merge multiple docs with a flat result
averissimo May 28, 2025
9707699
fix: download report works as expected
averissimo May 29, 2025
8f1d2c1
Merge branch 'redesign@main' into teal_reportable
averissimo May 29, 2025
6b74814
cleanup: remove print debug
averissimo May 29, 2025
70511e8
fix: adding regression when adding multiple blocks
averissimo May 29, 2025
996f9e4
Merge branch 'redesign@main' into teal_reportable
averissimo May 29, 2025
c8b5ff4
cleanup: remove print debug
averissimo May 29, 2025
8b7cc7c
chore: rename R and test files for doc class
averissimo May 29, 2025
73903de
chore: import tests from reportable branch
averissimo May 29, 2025
33734ba
Merge branch 'redesign@main' into teal_reportable
averissimo May 29, 2025
fcabc9f
chore: fix linter errors
averissimo May 29, 2025
1d32c4e
[skip style] [skip vbump] Restyle files
github-actions[bot] May 29, 2025
43a1f13
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] May 29, 2025
88915bf
Fixes tests in `ReporterCard` feature branch (#328)
averissimo Jun 2, 2025
46b11e2
chore: remove code dispatch parameter in eval_code
averissimo Jun 2, 2025
994251f
Merge branch 'redesign@main' into teal_reportable
averissimo Jun 2, 2025
98ce221
remaining report_document -> doc
gogonzo Jun 2, 2025
26a809e
feat: add title to report in ReportDocument and trim separator (#330)
averissimo Jun 2, 2025
1adc0bf
docs: update site and add accessibility
averissimo Jun 2, 2025
7bb1080
fix: only add title to blocks if title exists
averissimo Jun 2, 2025
e00ca50
chore: remove newlines in separator of cards/docs
averissimo Jun 2, 2025
3debdbe
Merge branch 'redesign@main' into teal_reportable
averissimo Jun 2, 2025
6eb4410
fix: minor issues with rename of report_document -> doc
averissimo Jun 2, 2025
35c39d9
chore: add a default title for unnamed cards
averissimo Jun 2, 2025
7af6f3c
Merge branch 'redesign@main' into teal_reportable
averissimo Jun 2, 2025
bccefb4
- include_echo to include_results
gogonzo Jun 3, 2025
4870485
tests: reflect new block element with title
averissimo Jun 3, 2025
7c70953
tests: reflect new block element with title
averissimo Jun 3, 2025
4f10fa0
Merge branch 'redesign@main' into teal_reportable
averissimo Jun 3, 2025
c6dead1
remove code_output (#332)
gogonzo Jun 4, 2025
c0966a0
Support to override methods `to_rmd` `toHTML` and `ui/srv_editor_bloc…
averissimo Jun 5, 2025
eb5fcd2
fix: add title argument to test_card helpers and fix leftover fun name
averissimo Jun 5, 2025
38cf94f
[skip style] [skip vbump] Restyle files
github-actions[bot] Jun 5, 2025
8845870
chore: linter changes
averissimo Jun 5, 2025
b791939
chore: add remotes and missing verdepcheck
averissimo Jun 5, 2025
d4c9266
docs: add missing function to yaml
averissimo Jun 5, 2025
6c4e8aa
fix: correct arg name and remove some code
averissimo Jun 5, 2025
3a935fc
chore: update pre-commit
averissimo Jun 5, 2025
3fd2873
chore: import class definition
averissimo Jun 5, 2025
ed3ed47
chore: move lifecycle to suggests
averissimo Jun 5, 2025
ba2521a
chore: remove import
averissimo Jun 5, 2025
6907c2d
empty: trigger ci
averissimo Jun 6, 2025
d142964
Naming (#334)
m7pr Jun 6, 2025
53d2b16
[skip style] [skip vbump] Restyle files
github-actions[bot] Jun 6, 2025
93f8673
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Jun 6, 2025
bd93e4f
chore: fix linter
averissimo Jun 6, 2025
40f0a4a
chore: spelling fixes
averissimo Jun 6, 2025
8764bfe
chore: spelling fixes
averissimo Jun 6, 2025
c9ba7f9
teal_report class vignette
m7pr Jun 6, 2025
e9052f9
Merge branch 'teal_reportable' of https://github.com/insightsengineer…
m7pr Jun 6, 2025
6d38378
chore: rcmdcheck with 0 erros and warnings
averissimo Jun 6, 2025
b7c4623
feat: support DT output
averissimo Jun 6, 2025
78bcf29
cleanup: shinytest2 tests
averissimo Jun 11, 2025
37516bf
fix: warning message on AppDriver creation
averissimo Jun 11, 2025
508d79b
chore: clean tests that are not implemented
averissimo Jun 11, 2025
baf9700
remove edit_teal_card and keep_in_report
gogonzo Jun 11, 2025
1cf0fc9
fix pkgdown
gogonzo Jun 11, 2025
95cbdd3
feat: move keep_output to eval_code.teal_report
averissimo Jun 12, 2025
560d815
chore: remove keep_output logical support
averissimo Jun 12, 2025
69c8caa
docs: add eval_code method documentation for new parameters
averissimo Jun 12, 2025
3b01d8c
chunks produce outputs which are excluded for rmd (#337)
gogonzo Jun 12, 2025
26fda50
Merge branch 'teal_reportable' of https://github.com/insightsengineer…
m7pr Jun 13, 2025
b2aebd2
[skip style] [skip vbump] Restyle files
github-actions[bot] Jun 13, 2025
37a7bf8
extend toHTML methods
m7pr Jun 16, 2025
a73eede
[skip style] [skip vbump] Restyle files
github-actions[bot] Jun 16, 2025
99a6612
cleanup vignette - remove teal-report-class.Rmd
m7pr Jun 16, 2025
7498b6c
to_rmd method for summary.lm
m7pr Jun 16, 2025
3baf8fb
preserve metadata of the first element when combining teal_card objects
m7pr Jun 16, 2025
0994baf
chore: revert back to main branch in description
averissimo Jun 16, 2025
77d2d2a
revert current metadata preserving
m7pr Jun 16, 2025
eb9dee9
very provisional WIP
gogonzo Jun 17, 2025
d677b84
Fix tests in reportable branch and renames file (#341)
averissimo Jun 18, 2025
b3adb0b
Update tests/testthat/helper-waldo_compare.R
averissimo Jun 18, 2025
00ed56c
Merge metadata of teal cards in `c.teal_card` (#342)
averissimo Jun 19, 2025
dc7e795
fix pkgdown build (#343)
m7pr Jun 19, 2025
da1e318
c.teal_report method (#338)
m7pr Jun 19, 2025
2b4f8de
fix pkgdown
m7pr Jun 19, 2025
0a90326
Fix `c.teal_card` to append only new element (#345)
gogonzo Jun 26, 2025
71c4110
Use evaluate (#344)
gogonzo Jun 26, 2025
3eeb473
fix: empty title
averissimo Jun 26, 2025
63b17ea
fix: s4 cannot be of class chunk_output
averissimo Jul 1, 2025
19d4524
Add seamless conversion of `teal_data` to `teal_report` object (#346)
averissimo Jul 1, 2025
5853596
[skip style] [skip vbump] Restyle files
github-actions[bot] Jul 1, 2025
063c636
fix reset
gogonzo Jul 2, 2025
74c8023
`to_flextable` handles empty data.frames (#349)
m7pr Jul 2, 2025
9059987
Exclude conditions (#350)
gogonzo Jul 3, 2025
e10fd20
fix: load functionality of reporter
averissimo Jul 4, 2025
68c8abf
fix: typo on assignment of `%||%` before 4.4
averissimo Jul 7, 2025
bfbd49f
tests: missing template testing
averissimo Jul 7, 2025
09a89fb
[skip style] [skip vbump] Restyle files
github-actions[bot] Jul 7, 2025
a74a916
fix: typo on method dispatch
averissimo Jul 7, 2025
c820dc0
Remove `ContentBlock` from `ReportCard` (#351)
averissimo Jul 8, 2025
0e22756
feat: only header is draggable
averissimo Jul 8, 2025
9bad3fa
feat: wrong option was commited, reverting to correct
averissimo Jul 8, 2025
cb51eda
fix: typo on render
averissimo Jul 8, 2025
7f40a0d
fix: bookmark
averissimo Jul 9, 2025
1720401
feat: support direct assignment
averissimo Jul 9, 2025
2fe8ec2
fix: detect code chunks in teal_card
averissimo Jul 9, 2025
5d7fc8d
fix: smaller fixes to tests and styler
averissimo Jul 9, 2025
a9e97cd
chore: more precise ignore of attributes
averissimo Jul 9, 2025
0400956
[skip style] [skip vbump] Restyle files
github-actions[bot] Jul 9, 2025
92b2441
fix: remove left padding in code element when inside pre
averissimo Jul 10, 2025
a669a29
Supports `gtsummary` outputs (#355)
averissimo Jul 14, 2025
faf72c4
Use teal card internally in `teal_reportable` feature branch (#353)
averissimo Jul 29, 2025
58283de
Implement conversion of `ggplot` → `recordedplot` to save space in Re…
averissimo Jul 29, 2025
514400c
Merge remote-tracking branch 'origin/main' into merge@teal_reportable
averissimo Aug 20, 2025
4c78233
feat: previewer merged
averissimo Aug 22, 2025
09b94b6
feat: more reorganizations and prevent modal card to be initalized mu…
averissimo Aug 22, 2025
2241924
fix: cached objects
averissimo Aug 22, 2025
4fae8e1
fix: minor cleanup of todos
averissimo Aug 25, 2025
379b6dd
chore: remove unused code
averissimo Aug 25, 2025
2f77185
[skip style] [skip vbump] Restyle files
github-actions[bot] Aug 25, 2025
a4856ef
docs: update documentation
averissimo Aug 26, 2025
65e4d24
docs: test not using collate
averissimo Aug 26, 2025
2390727
chore: fix lintr
averissimo Aug 25, 2025
02ac937
chore: minor formatting
averissimo Aug 25, 2025
fbe1638
feat: disable add card button
averissimo Aug 25, 2025
1e43b04
tests: minor fix to tests
averissimo Aug 26, 2025
df35258
docs: update documentation
averissimo Aug 26, 2025
bd4aedd
docs: test not using collate
averissimo Aug 26, 2025
8d0cff3
[skip style] [skip vbump] Restyle files
github-actions[bot] Aug 26, 2025
bb79a52
feat: improvement on coercion to teal_report
averissimo Aug 26, 2025
4025f54
Merge branch 'merge@teal_reportable' into teal_reportable
averissimo Aug 26, 2025
494184b
chore: remove extra line
averissimo Aug 26, 2025
2b78601
fix: remove empty lines
averissimo Aug 28, 2025
d4de3f1
missing imports in NAMESAPCE
m7pr Aug 28, 2025
77f9fb1
chore: import teal_data class in roxygen2
averissimo Aug 28, 2025
fdac6c0
[skip style] [skip vbump] Restyle files
github-actions[bot] Aug 28, 2025
fd3cb92
chore: fix R CMD checks errors
averissimo Aug 28, 2025
c69249e
chore: re-add htmltools to dependencies
averissimo Aug 28, 2025
7595b55
chore: rename
averissimo Aug 28, 2025
56d2389
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Aug 28, 2025
aa2c207
refactor: Render images to a folder when exporting the reporter (#384)
averissimo Aug 29, 2025
1c4b26c
[skip style] [skip vbump] Restyle files
github-actions[bot] Aug 29, 2025
75c73f3
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Aug 29, 2025
ceb35a2
Apply suggestions from code review
m7pr Sep 1, 2025
0919321
Update R/teal_card.R
m7pr Sep 1, 2025
d3eafad
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Sep 1, 2025
a6dfced
Use basename in `.content_to_rmd` for Windows paths (#385)
m7pr Sep 2, 2025
499505b
357 proper header for downloaded report (#389)
m7pr Sep 2, 2025
dbcd438
asserts for code_chunk named parameters
m7pr Sep 2, 2025
28b4824
[skip style] [skip vbump] Restyle files
github-actions[bot] Sep 2, 2025
1d7427c
Extend `shinyjs` to allow title edits in reporter previewer (#392)
m7pr Sep 2, 2025
de625e0
Update R/download.R
averissimo Sep 3, 2025
63b8bef
Update R/previewer_card.R
averissimo Sep 3, 2025
f3267b5
Update R/teal_card.R
averissimo Sep 3, 2025
fd06a4b
chore: todo now has an issue in github
averissimo Sep 3, 2025
f0b5456
deprecate: Reporter()
averissimo Sep 3, 2025
96ee9a6
chore: fix todo in tests
averissimo Sep 3, 2025
0a01cde
fix: last todos in code and tests
averissimo Sep 3, 2025
80c4c15
[skip style] [skip vbump] Restyle files
github-actions[bot] Sep 3, 2025
2598149
fix 2 test
m7pr Sep 3, 2025
450fa73
suppress deprecation
m7pr Sep 3, 2025
33a59f7
fix 2 test
m7pr Sep 3, 2025
fdc3bf4
suppress deprecation
m7pr Sep 3, 2025
2443501
fix: tests in Reporter
averissimo Sep 3, 2025
2856846
fix: prevent conversion of ggplot2 to recordedplot
averissimo Sep 3, 2025
b5c6006
refactor: adds custom plot sizes for figures in previewer & reporter …
averissimo Sep 3, 2025
6791d87
[skip style] [skip vbump] Restyle files
github-actions[bot] Sep 3, 2025
b914ea4
fix: test error with missing objects
averissimo Sep 3, 2025
4d84637
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Sep 3, 2025
c94d9a2
fix: problem with PR merge
averissimo Sep 3, 2025
9e22b4f
387 Only show loading placeholder for cards that are being initialize…
m7pr Sep 3, 2025
9428e1e
[skip style] [skip vbump] Restyle files
github-actions[bot] Sep 3, 2025
b729a3e
chore: fix linter
averissimo Sep 3, 2025
564fd5f
chore: fix spelling
averissimo Sep 3, 2025
c069466
chore: adds missing verdepcheck
averissimo Sep 4, 2025
2d6998d
docs: update NEWS.md
averissimo Sep 4, 2025
af5f5d6
chore: uses simpler api
averissimo Sep 4, 2025
03aedc6
chore: add jsonlite and promote lifecycle to top-level
averissimo Sep 4, 2025
2fce65b
chore: improve on deprecation messags
averissimo Sep 4, 2025
db8c9fe
chore: spelling
averissimo Sep 4, 2025
91f621c
chore: update precommit
averissimo Sep 4, 2025
af43e5b
chore: fix nolint
averissimo Sep 4, 2025
386ef9c
chore: remove chromote
averissimo Sep 4, 2025
656c502
fix: add jsonlite to dummy
averissimo Sep 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
linters: linters_with_defaults(
line_length_linter = line_length_linter(120),
cyclocomp_linter = NULL,
object_usage_linter = NULL,
indentation_linter = NULL
)
20 changes: 12 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.3.9005
rev: v0.4.3.9009
hooks:
- id: style-files
name: Style code with `styler`
Expand All @@ -16,23 +16,27 @@ repos:
additional_dependencies:
- bslib
- checkmate
#- flextable
- davidgohel/flextable # Error: package 'flextable' is not available
- davidgohel/gdtools # for flextable
- commonmark
- flextable
- grid
- htmltools
- knitr
- lifecycle
- R6
- insightsengineering/rlistings # for rtables
- rmarkdown
- insightsengineering/rtables
- insightsengineering/rtables.officer
- davidgohel/officer # for rtables.officer
- insightsengineering/formatters # for rtables
- shiny
- shinybusy
- shinyjs
- shinyWidgets
- sortable
- insightsengineering/teal.data
- insightsengineering/teal.code
- yaml
- zip
- rlistings
- rtables
- rtables.officer
- id: spell-check
name: Check spelling with `spelling`
exclude: >
Expand Down
57 changes: 51 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,55 @@ BugReports: https://github.com/insightsengineering/teal.reporter/issues
Imports:
bslib (>= 0.8.0),
checkmate (>= 2.1.0),
commonmark (>= 1.9.2),
flextable (>= 0.9.2),
grid,
htmltools (>= 0.5.4),
knitr (>= 1.42),
lifecycle (>= 0.2.0),
methods,
R6,
rlang (>= 1.0.0),
rlistings (>= 0.2.10),
rmarkdown (>= 2.23),
rtables (>= 0.6.11),
rtables.officer (>= 0.0.2),
shiny (>= 1.6.0),
shinybusy (>= 0.3.2),
shinyjs (>= 2.1.0),
shinyWidgets (>= 0.5.1),
sortable (>= 0.5.0),
teal.code (>= 0.6.1.9002),
teal.data (>= 0.7.0.9002),
tools,
utils,
yaml (>= 1.1.0),
zip (>= 1.1.0)
Suggests:
chromote,
DT (>= 0.13),
formatR (>= 1.5),
formatters (>= 0.5.10),
ggplot2 (>= 3.4.3),
lattice (>= 0.18-4),
lifecycle (>= 0.2.0),
png,
shinytest2,
testthat (>= 3.2.2),
tinytex,
waldo (>= 0.2.0),
withr (>= 2.0.0)
VignetteBuilder:
knitr,
rmarkdown
RdMacros:
lifecycle
Remotes:
insightsengineering/teal.code@main,
insightsengineering/teal.data@main
Comment thread
averissimo marked this conversation as resolved.
Outdated
Config/Needs/verdepcheck: rstudio/bslib, mllg/checkmate,
davidgohel/flextable, rstudio/htmltools, yihui/knitr, r-lib/lifecycle,
r-lib/R6, insightsengineering/rlistings, rstudio/rmarkdown,
davidgohel/flextable, yihui/knitr, r-lib/lifecycle,
r-lib/R6, r-lib/rlang, insightsengineering/rlistings, rstudio/rmarkdown,
insightsengineering/rtables, insightsengineering/rtables.officer,
rstudio/shiny, dreamRs/shinybusy, dreamRs/shinyWidgets,
rstudio/shiny, dreamRs/shinybusy, daattali/shinyjs, dreamRs/shinyWidgets,
rstudio/sortable, insightsengineering/teal.code, insightsengineering/teal.data,
yaml=vubiostat/r-yaml, r-lib/zip, rstudio/DT, yihui/formatR,
insightsengineering/formatters, tidyverse/ggplot2, deepayan/lattice,
cran/png, r-lib/testthat, rstudio/tinytex, r-lib/withr
Expand All @@ -68,3 +82,34 @@ Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Config/testthat/edition: 3
Collate:
'Reporter.R'
'AddCardModule.R'
'ContentBlock.R'
'DownloadModule.R'
'Editor.R'
'FileBlock.R'
'HTMLBlock.R'
'LoadReporterModule.R'
'NewpageBlock.R'
'PictureBlock.R'
'Previewer.R'
'RcodeBlock.R'
'Renderer.R'
'ReportCard.R'
'ResetModule.R'
'SimpleReporter.R'
'TableBlock.R'
'TextBlock.R'
'teal_card.R'
'teal.reporter.R'
'teal_report-class.R'
'teal_report-c.R'
'teal_report-eval_code.R'
'teal_report-extract.R'
'toHTML.R'
'to_rmd.R'
'utils.R'
'yaml_utils.R'
'zzz.R'
30 changes: 25 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
# Generated by roxygen2: do not edit by hand

S3method("[",teal_card)
S3method("[",teal_report)
S3method("metadata<-",ReportCard)
S3method("metadata<-",teal_card)
S3method(c,teal_card)
S3method(c,teal_report)
S3method(length,ReportCard)
S3method(metadata,ReportCard)
S3method(metadata,teal_card)
S3method(print,rmd_yaml_header)
S3method(srv_editor_block,default)
S3method(toHTML,default)
S3method(ui_editor_block,default)
export("metadata<-")
export("teal_card<-")
export(ReportCard)
export(Reporter)
export(add_card_button_srv)
export(add_card_button_ui)
export(as.teal_card)
export(as.teal_report)
export(as_yaml_auto)
export(code_chunk)
export(download_report_button_srv)
export(download_report_button_ui)
export(metadata)
export(report_load_srv)
export(report_load_ui)
export(reporter_previewer_srv)
Expand All @@ -18,9 +36,11 @@ export(rmd_output_arguments)
export(rmd_outputs)
export(simple_reporter_srv)
export(simple_reporter_ui)
export(srv_editor_block)
export(teal_card)
export(teal_report)
export(ui_editor_block)
importFrom(R6,R6Class)
importFrom(checkmate,assert_string)
importFrom(grid,grid.newpage)
importFrom(lifecycle,badge)
importFrom(rmarkdown,render)
importFrom(yaml,as.yaml)
importFrom(teal.code,eval_code)
importFrom(teal.data,teal_data)
importFrom(tools,toHTML)
50 changes: 23 additions & 27 deletions R/AddCardModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
#'
#' @details
#' The `card_fun` function is designed to create a new `ReportCard` instance and optionally customize it:
#' - The `card` parameter allows for specifying a custom or default `ReportCard` instance.
#' - The `teal_card` parameter allows for specifying a custom or default `ReportCard` instance.
#' - Use the `comment` parameter to add a comment to the card via `card$append_text()` - if `card_fun` does not
#' have the `comment` parameter, then `comment` from `Add Card UI` module will be added at the end of the content of the
#' card.
#' - The `label` parameter enables customization of the card's name and its content through `card$append_text()`-
#' if `card_fun` does not have the `label` parameter, then card name will be set to the name passed in
#' `Add Card UI` module, but no text will be added to the content of the `card`.
#' `Add Card UI` module, but no text will be added to the content of the `teal_card`.
#'
#' This module supports using a subclass of [`ReportCard`] for added flexibility.
#' A subclass instance should be passed as the default value of
#' the `card` argument in the `card_fun` function.
#' the `teal_card` argument in the `card_fun` function.
#' See below:
#' ```{r}
#' CustomReportCard <- R6::R6Class(
Expand Down Expand Up @@ -47,9 +47,6 @@ add_card_button_ui <- function(id) {
# Buttons with custom css and
# js code to disable the add card button when clicked to prevent multi-clicks
shiny::tagList(
shiny::singleton(
shiny::tags$head(shiny::includeCSS(system.file("css/custom.css", package = "teal.reporter")))
),
shiny::singleton(
shiny::tags$head(
shiny::tags$script(
Expand All @@ -69,12 +66,8 @@ add_card_button_ui <- function(id) {
),
shiny::actionButton(
ns("add_report_card_button"),
title = "Add Card",
class = "teal-reporter simple_report_button btn-primary",
`data-val` = shiny::restoreInput(id = ns("add_report_card_button"), default = NULL),
shiny::tags$span(
shiny::icon("plus")
)
"Add to Reporter",
`data-val` = shiny::restoreInput(id = ns("add_report_card_button"), default = NULL)
)
)
}
Expand Down Expand Up @@ -118,14 +111,8 @@ add_card_button_srv <- function(id, reporter, card_fun) {
),
shiny::tags$script(
shiny::HTML(
sprintf(
"
$('#shiny-modal').on('shown.bs.modal', () => {
$('#%s').focus()
})
",
ns("label")
)
sprintf("shinyjs.autoFocusModal('%s');", ns("label")), # See extendShinyJs.js
sprintf("shinyjs.enterToSubmit('%s', '%s');", ns("label"), ns("add_card_ok")) # See extendShinyJs.js
)
),
footer = shiny::div(
Expand Down Expand Up @@ -198,14 +185,23 @@ add_card_button_srv <- function(id, reporter, card_fun) {
type = "error"
)
} else {
checkmate::assert_class(card, "ReportCard")
if (!has_comment_arg && length(input$comment) > 0 && input$comment != "") {
card$append_text("Comment", "header3")
card$append_text(input$comment)
}
checkmate::assert_multi_class(card, c("ReportCard", "teal_card"))
if (inherits(card, "ReportCard")) {
if (!has_comment_arg && length(input$comment) > 0 && input$comment != "") {
card$append_text("Comment", "header3")
card$append_text(input$comment)
}

if (!has_label_arg && length(input$label) == 1 && input$label != "") {
card$set_name(input$label)
if (!has_label_arg && length(input$label) == 1 && input$label != "") {
card$set_name(input$label)
}
} else if (inherits(card, "teal_card")) {
if (!has_comment_arg && length(input$comment) > 0 && input$comment != "") {
card <- c(card, "### Comment", input$comment)
}
if (!has_label_arg && length(input$label) == 1 && input$label != "") {
metadata(card, "title") <- input$label
}
}

reporter$append_cards(list(card))
Expand Down
Loading
Loading