-
-
Notifications
You must be signed in to change notification settings - Fork 50
📑 Reporter Refactor: Adds support for new teal_report and teal_card class
#1541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 139 commits
Commits
Show all changes
157 commits
Select commit
Hold shift + click to select a range
96e3945
push local changes
vedhav 7f56567
Merge branch 'main' into test@bslib@main
vedhav 20bb0f0
feat: add additional sidebar toggle buttons
vedhav 2c36c7b
feat: show three different tabs types for different module depths
vedhav 45d0f1e
chore: add bslib package ns
vedhav 52b7fc7
Merge branch 'main' into test@bslib@main
vedhav 85622df
push local style changes
vedhav 4881050
Merge remote-tracking branch 'origin/main' into test@bslib@main
vedhav 8a12408
reposition the validated message div
vedhav 910c26d
bold accordion titles
vedhav 3279b6e
fix unwanted padding created by hidden validation message div
vedhav e7346fd
make sidebar width customizable using options
vedhav a616392
icon changes
vedhav 0716caf
fix: make the filter mapping popup concise
vedhav 813d5b5
Merge branch 'main' into test@bslib@main
vedhav e705f36
improve the sidebar distinction
vedhav 21e3955
user feedback changes
vedhav 486b565
Merge branch 'main' into test@bslib@main
vedhav 3a1b5d6
Merge branch 'main' into test@bslib@main
vedhav 36c2561
fix: remove unused component
vedhav 2d5d3a6
report card handled by teal
gogonzo fe0545e
simplify
gogonzo 333a87c
Merge main to test@bslib@main (#1497)
m7pr 86391e4
feat: add remote dependencies
vedhav 454d49e
revert teal.reporter redesign changes
m7pr 620e5ba
bring back teal.reporter redesign changes
m7pr 17f5a4a
update Remotes branch names
m7pr df3a62a
change add_card_button_srv -> add_document_button_srv
m7pr 9f91260
add dev versions to teal dev dependencies
m7pr 2bf6481
add dev versions to dependencies
m7pr 06f2898
fix: bslib changes
vedhav 59b3a15
bring add_document_button_srv to teal
m7pr c2388eb
make it a named list
m7pr 466f0e7
Merge branch 'test@bslib@main' into redesign@main
vedhav 9990dca
attempt on S3 class directly in teal
m7pr c3538e5
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr c5301ff
compact to_markdown
m7pr ec60f50
bring back load button to reporter previewer
m7pr eb9abf3
change knitr to lenght1
m7pr 72456fc
Merge branch 'main' into redesign@main
m7pr 366def0
Update DESCRIPTION
m7pr 35d4101
unify remotes
m7pr 2667426
element to markdown not needed in teal
m7pr 8729daa
cleanup NAMESPACE
m7pr 7a5e099
extend example_module to handle report_card
m7pr 0022f0d
extend shinytest2 tests for new teal reporter previewer
m7pr c0b9836
prototype of modify_teal_module_report
m7pr 795a246
workout modify_teal_module_output
m7pr 30118ec
introduce reporter parameter, so that you can disable it globally, or…
m7pr 5829d61
Merge branch 'main' into redesign@main
m7pr 4daffe4
bring back comments to addcard modal
m7pr ec5141a
clone reporter
gogonzo ea2c7e5
fix error when report is NULL (no method NULL$clone)
gogonzo 2fad140
- always add report_previewer_module
gogonzo a8201af
disable_report instead of nullify_teal_module_report_card
gogonzo 0201c7a
- rename modifiers
gogonzo 4bf6e99
reload docs
gogonzo 6cf260d
feat: move the reporter button
vedhav 8be8963
prevent adding a card with the existing name
m7pr ef03a5b
fix reactivity
gogonzo 4ae9720
Merge remote-tracking branch 'origin/main' into redesign@main
gogonzo 35d3ae2
restart add card modal becuase the save button gets disabled after a …
m7pr 0396d61
Merge branch 'redesign@main' of https://github.com/insightsengineerin…
m7pr ab96d22
enable add_card button after unsuccessful card addition
m7pr 0372479
documentation and checks for modify_reactive_output
m7pr 18b524e
[skip style] [skip vbump] Restyle files
github-actions[bot] 6c92309
feat: move the reporter button outside the teal module
vedhav d1360e5
Minor changes from PR review
averissimo 93cd49c
feat: use common structure for js autofocus input and enter to submit
averissimo a47a24a
chore: simplification of code into moduleServers
averissimo a6d3a8c
Merge branch 'pr@redesign@main' into redesign@main
averissimo 0857eb2
chore: code trimming
averissimo 8330ddb
fix: use trimmed named to store card
averissimo e90a5d5
revert: back to @ instead of %40 due to pak error
averissimo 835cf0f
collapse subsequent chunks
gogonzo 05c2255
Improves `ReportDocument` editor (#1536)
averissimo a803de7
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] bacf4cc
Merge branch 'teal_data_report' into teal_reportable
gogonzo 21e400a
typo
gogonzo 6c62626
convert teal_data to reportable
gogonzo 40d5147
fix modify_reactive_output
gogonzo daa23ad
rename classes
gogonzo 693c8e5
rename missing
gogonzo 9f6965a
fix srv_reporter_previewer_tab to work with reactive output
gogonzo 3ca11ab
reload docs
gogonzo 45da1b4
after function
gogonzo bcab748
remove docs of modify_reactive_output
gogonzo 8a1e9d3
Don't append filter panel code if no filters applied
gogonzo a19a367
chore: last of consisent naming
averissimo 78ad8b2
fix: revert temporary fix that shouldn't have been pushed
averissimo b7cba1a
fix: revert temporary fix that shouldn't have been pushed
averissimo 329f728
fix: use teal_report object instead of teal_data in signature
averissimo a66fa15
Merge remote-tracking branch 'origin/main' into teal_reportable
gogonzo a31fdaa
Remove unnecessary methods
gogonzo 860edf1
Add "Code preparation" heading
gogonzo 9047461
Merge branch 'main' into redesign@main
averissimo 7c3b571
Merge remote-tracking branch 'origin/redesign@main' into teal_reportable
averissimo a7f76e9
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 33c0ff3
chore: add remotes
averissimo f01ad09
chore: bump deps versions
averissimo 8b48ac0
tests: update test to new method of disabling reporter globaly
averissimo 1516f8f
tests: fix previewer was inserted in teal_slices
averissimo 8b37b72
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] d356591
Naming (#1542)
m7pr 473b987
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 8d2477e
chore: linter errors
averissimo 60d5707
docs: fix spelling
averissimo 82fd605
chore: cleanup for CI
averissimo f4ac12f
chore: rcmdcheck with 0 erros and warnings
averissimo 4f2e06a
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 65e6e04
empty: trigger ci
averissimo 93071a3
chore: fix docs ci
averissimo abb2307
Disable report when error (#1547)
gogonzo 290cbb9
changing sections to h2 as h1 is dedicated to the title
gogonzo cf9c3b4
adding an attribute to start a new chunk for following (no .collapse_…
gogonzo 52e71b1
Merge remote-tracking branch 'origin/main' into teal_reportable
gogonzo b8549a6
don't add a label to teal_card's code_chunk - avoid duplicated label…
gogonzo 4727133
unwrap reactive sooner
gogonzo 16939fe
fix: revert back to main
averissimo 0283942
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 02d3ba6
remotes
gogonzo 29a4cec
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 9307ed7
Update R/module_teal.R
averissimo 23f3d03
cleanup: remove function
averissimo 93074e0
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] dbb46cd
Block removal@teal reportable (#1552)
averissimo 0079d91
Merge remote-tracking branch 'origin/main' into teal_reportable
averissimo 2905443
fix: no longer inserting reporter and remove use of get_var
averissimo 240279f
fix: htmldependency not working
averissimo 0676b08
fix: minor cleanup of todos
averissimo 442a4f3
Merge remote-tracking branch 'origin/main' into teal_reportable
averissimo 3bd290c
fix regression: show reporter buttons unless init is null
averissimo 7d9d80c
extend add_card_button_ui + with Add to Report text
m7pr 4c03222
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] adb99d4
If reporter was provided, reuse it in srv_teal (#1586)
m7pr 04b7951
If reporter is globally disabled, do not show a + sign to add a card …
m7pr 00a7311
chore: move to single if clause
averissimo 2720333
Update R/after.R
m7pr 40c124f
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] fbf8e15
Update NEWS.md
averissimo cbb778b
Update DESCRIPTION
averissimo aa32ff5
team TealSlicesBlock tests
m7pr a6cd26e
[skip style] [skip vbump] Restyle files
github-actions[bot] 48a9d8a
fix tests for teal_reporter
m7pr 8f41cc6
Merge branch 'teal_reportable' of https://github.com/insightsengineer…
m7pr 91e9a06
fix rest of the tests
m7pr 0feee26
Merge branch 'main' into teal_reportable
m7pr 80b3892
fix rcmd check note
m7pr f8e6c0f
Merge branch 'teal_reportable' of https://github.com/insightsengineer…
m7pr daaaaf3
fix pkgdown
m7pr 823b008
remove dispatch_block from TealReportCard afte TealSliceBlock was rem…
m7pr 6b55725
Update DESCRIPTION
m7pr 25f2a0f
Merge branch 'main' into teal_reportable
averissimo 554029f
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 2d15f81
chore: bump teal.reporter dependency
averissimo 073f977
chore: change remotes to main
averissimo f69a898
docs: correct NEWS.md
averissimo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| #' Executes modifications to the result of a module | ||
| #' | ||
| #' Primarily used to modify the output object of module to change the containing | ||
| #' report. | ||
| #' @param x (`teal_module`) | ||
| #' @param ui (`function(id, elem, ...)`) function to receive output (`shiny.tag`) from `x$ui` | ||
| #' @param server (`function(input, output, session, data, ...)`) function to receive output data from `x$server` | ||
| #' @param ... additional argument passed to `ui` and `server` by matching their formals names. | ||
| #' @return A `teal_report` object with the result of the server function. | ||
| #' @export | ||
| after <- function(x, | ||
| ui = function(id, elem) elem, | ||
| server = function(input, output, session, data) data, | ||
| ...) { | ||
| # todo: make a method for teal_app and remove teal_extend_server? | ||
averissimo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| checkmate::assert_multi_class(x, "teal_module") | ||
| if (!is.function(ui) || !all(names(formals(ui)) %in% c("id", "elem"))) { | ||
| stop("ui should be a function of id and elem") | ||
| } | ||
| if (!is.function(server) || !all(names(formals(server)) %in% c("input", "output", "session", "data"))) { | ||
| stop("server should be a function of `input` and `output`, `session`, `data`") | ||
| } | ||
m7pr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| additional_args <- list(...) | ||
| new_x <- x # because overwriting x$ui/server will cause infinite recursion | ||
| new_x$ui <- .after_ui(x$ui, ui, additional_args) | ||
| new_x$server <- .after_server(x$server, server, additional_args) | ||
| new_x | ||
| } | ||
|
|
||
| .after_ui <- function(x, y, additional_args) { | ||
| # add `_`-prefix to make sure objects are not masked in the wrapper functions | ||
| `_x` <- x # nolint: object_name. | ||
| `_y` <- y # nolint: object_name. | ||
| new_x <- function(id, ...) { | ||
| original_args <- as.list(environment()) | ||
| if ("..." %in% names(formals(`_x`))) { | ||
| original_args <- c(original_args, list(...)) | ||
| } | ||
| ns <- NS(id) | ||
| original_args$id <- ns("wrapped") | ||
| original_out <- do.call(`_x`, original_args, quote = TRUE) | ||
|
|
||
| wrapper_args <- c( | ||
| additional_args, | ||
| list(id = ns("wrapper"), elem = original_out) | ||
| ) | ||
| do.call(`_y`, args = wrapper_args[names(formals(`_y`))]) | ||
| } | ||
| formals(new_x) <- formals(x) | ||
| new_x | ||
| } | ||
|
|
||
| .after_server <- function(x, y, additional_args) { | ||
| # add `_`-prefix to make sure objects are not masked in the wrapper functions | ||
| `_x` <- x # nolint: object_name. | ||
| `_y` <- y # nolint: object_name. | ||
| new_x <- function(id, ...) { | ||
| original_args <- as.list(environment()) | ||
| original_args$id <- "wrapped" | ||
| if ("..." %in% names(formals(`_x`))) { | ||
| original_args <- c(original_args, list(...)) | ||
| } | ||
| moduleServer(id, function(input, output, session) { | ||
| original_out <- if (all(c("input", "output", "session") %in% names(formals(`_x`)))) { | ||
| original_args$module <- `_x` | ||
| do.call(shiny::callModule, args = original_args) | ||
| } else { | ||
| do.call(`_x`, original_args) | ||
| } | ||
| original_out_r <- reactive( | ||
| if (is.reactive(original_out)) { | ||
| original_out() | ||
| } else { | ||
| original_out | ||
| } | ||
| ) | ||
| wrapper_args <- utils::modifyList( | ||
| additional_args, | ||
| list(id = "wrapper", input = input, output = output, session = session) | ||
| ) | ||
| reactive({ | ||
| req(original_out_r()) | ||
| wrapper_args$data <- original_out() | ||
| do.call(`_y`, wrapper_args[names(formals(`_y`))], quote = TRUE) | ||
| }) | ||
| }) | ||
| } | ||
| formals(new_x) <- formals(x) | ||
| new_x | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.