Skip to content
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

Pre-release activities #1021

Merged
merged 148 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
3342fa4
replacing main with latest-tag.
kartikeyakirar Jan 2, 2024
339648a
add badges
kartikeyakirar Jan 2, 2024
e12ff93
add --as-cran check
kartikeyakirar Jan 4, 2024
4d1f4ff
remoing :: and ::: from examples.
kartikeyakirar Jan 4, 2024
c21deba
readme update
kartikeyakirar Jan 4, 2024
15a54eb
updating installation
kartikeyakirar Jan 4, 2024
f680ad1
updating wordlist
kartikeyakirar Jan 4, 2024
d0d8739
fixing examples and reduce wordlist
kartikeyakirar Jan 5, 2024
425de76
minor changes in vignettes
kartikeyakirar Jan 5, 2024
1daeda9
Merge branch 'main' into pre-release-cleanup@main
kartikeyakirar Jan 5, 2024
a704000
include parent datasets to the modules (#1030)
gogonzo Jan 8, 2024
be80af7
Update vignettes/blueprint/actors.Rmd
kartikeyakirar Jan 9, 2024
e992876
Update vignettes/including-data-in-teal-applications.Rmd
kartikeyakirar Jan 9, 2024
1673704
Update vignettes/including-data-in-teal-applications.Rmd
kartikeyakirar Jan 9, 2024
57755ea
Update vignettes/filter-panel.Rmd
kartikeyakirar Jan 9, 2024
df1afe7
Update vignettes/data-as-shiny-module.Rmd
kartikeyakirar Jan 9, 2024
1d879db
Update vignettes/bootstrap-themes-in-teal.Rmd
kartikeyakirar Jan 9, 2024
4642e8f
amend suggestion
kartikeyakirar Jan 9, 2024
603c004
Update R/include_css_js.R
kartikeyakirar Jan 9, 2024
356dc9d
resolving conflict
kartikeyakirar Jan 9, 2024
53bec14
reverting backticks for themer
kartikeyakirar Jan 9, 2024
c88e85e
Merge branch 'main' into pre-release-cleanup@main
gogonzo Jan 11, 2024
3a0a92e
Merge remote-tracking branch 'origin/main' into pre-release-cleanup@main
gogonzo Jan 11, 2024
72f0d33
fixing README.rd example.
kartikeyakirar Jan 11, 2024
8e502b0
amend suggestion and title case to sentence case.
kartikeyakirar Jan 12, 2024
2fb015f
removing old rd syntax
kartikeyakirar Jan 12, 2024
416590c
fixing example code.
kartikeyakirar Jan 12, 2024
0e84058
updating teal_data_module rd
kartikeyakirar Jan 12, 2024
03392e5
Merge 0e84058a9bda4b90f98ede76a09d81123720544a into 7538ecb45fdc96c4d…
kartikeyakirar Jan 12, 2024
3b1d6a6
[skip actions] Restyle files
github-actions[bot] Jan 12, 2024
c4d6748
'trigger'
kartikeyakirar Jan 15, 2024
ce0ba73
Removing section about "empty cycle".
gogonzo Jan 15, 2024
ddd1aea
1033 drop support for list filter (#1040)
chlebowa Jan 16, 2024
a7636aa
Merge branch 'main' into pre-release-cleanup@main
Jan 17, 2024
a326078
Merge a7636aa5ec6ec2882b05774c428cce8181dcbb31 into 92301bc3ed46331c1…
kartikeyakirar Jan 17, 2024
db195ef
[skip actions] Restyle files
github-actions[bot] Jan 17, 2024
7278bd5
removing linter_indentation
kartikeyakirar Jan 17, 2024
d03cacc
1031 drop list support (#1051)
chlebowa Jan 17, 2024
80d075e
1009 fix skipped tests (#1038)
chlebowa Jan 18, 2024
99e9cc7
492 user feedback on documentation (#1037)
chlebowa Jan 18, 2024
4b7a79d
Merge 99e9cc7d789ab6481964c4b85b1815001bf82ec2 into 92301bc3ed46331c1…
kartikeyakirar Jan 18, 2024
64af532
[skip actions] Restyle files
github-actions[bot] Jan 18, 2024
ec4e2a8
reverting changes for backticks on ui to server.
kartikeyakirar Jan 19, 2024
9e7a80b
removing backtick in vignette
kartikeyakirar Jan 19, 2024
26095f6
Merge branch 'pre-release-cleanup@main' of https://github.com/insight…
kartikeyakirar Jan 19, 2024
3671984
docs: removes 2 entries from wordlist
averissimo Jan 22, 2024
cf4e04c
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 22, 2024
6dac687
492 user feedback revisited (#1061)
chlebowa Jan 23, 2024
c09a934
Merge branch 'main' into pre-release-cleanup@main
donyunardi Jan 23, 2024
d6fde9e
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 23, 2024
157fd7b
add css to blur out background when using landing popup module (#1064)
donyunardi Jan 23, 2024
557480d
Fix getting-started-with-teal (#1057)
gogonzo Jan 24, 2024
93ab30d
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 24, 2024
5b3a770
'trigger'
kartikeyakirar Jan 24, 2024
1ff3a13
@chlebowa suggestion on create_app_id fn
kartikeyakirar Jan 24, 2024
c73e07a
refining tags in documentation (#1052)
kartikeyakirar Jan 24, 2024
c4b206d
Amend error message when `teal_data` is empty (#1067)
vedhav Jan 24, 2024
c2ac0a4
adding backticks on [pkg] and R keywords
kartikeyakirar Jan 24, 2024
5880bc7
Merge branch 'pre-release-cleanup@main' of https://github.com/insight…
kartikeyakirar Jan 24, 2024
80e0769
fixing within example
kartikeyakirar Jan 24, 2024
b8ebbed
Merge 80e0769877a736fbb64702ba7473cfb16d675e38 into b1bbe12b2e6655db7…
kartikeyakirar Jan 24, 2024
50cf767
[skip actions] Restyle files
github-actions[bot] Jan 24, 2024
90a83ab
'trigger'
kartikeyakirar Jan 24, 2024
a808f0b
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 24, 2024
e4dd8ef
Merge branch 'main' into pre-release-cleanup@main
vedhav Jan 25, 2024
d11315a
chore: remove explicit return
vedhav Jan 25, 2024
a4fde02
chore: fix ci issues
vedhav Jan 25, 2024
01060de
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 25, 2024
53850a2
Trigger CI
vedhav Jan 25, 2024
2b54b2d
adding backticks on references
kartikeyakirar Jan 25, 2024
31b7bc4
Merge branch 'pre-release-cleanup@main' of https://github.com/insight…
kartikeyakirar Jan 25, 2024
9b04432
Adding internal examples (#1026)
kartikeyakirar Jan 25, 2024
8d4d534
Merge 9b0443201c9eed8d8512967bef979cb9c2fbf59c into 364016cea8480ae2b…
kartikeyakirar Jan 25, 2024
da9c7f2
[skip actions] Restyle files
github-actions[bot] Jan 25, 2024
c1e5fc8
updated rd files
kartikeyakirar Jan 25, 2024
f216a46
1032 fix ellipsis documentation for `teal::modules()` (#1053)
m7pr Jan 25, 2024
a640323
1032 continutation on improving documentation of ellipsis in `modules…
m7pr Jan 25, 2024
ab0ba1a
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 25, 2024
a6b7638
reverting sentence case in readme.md
kartikeyakirar Jan 29, 2024
a6b98fe
removing backtics from functions.
kartikeyakirar Jan 29, 2024
91a698e
updating filter description
kartikeyakirar Jan 29, 2024
d432ec2
adding references
kartikeyakirar Jan 29, 2024
bb904f0
amend suggestions
kartikeyakirar Jan 29, 2024
19d8d86
Joins `slices_store` and `slices_restore` documentation (#1072)
averissimo Jan 30, 2024
e441588
Merge 19d8d8650fbde41ae2e1c3bf45228a4593675f66 into 364016cea8480ae2b…
kartikeyakirar Jan 30, 2024
7638a94
[skip actions] Restyle files
github-actions[bot] Jan 30, 2024
3f8cf13
trigger CI
averissimo Jan 30, 2024
d9bc970
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 30, 2024
a2ff091
trigger CI
averissimo Jan 30, 2024
27ed6ae
updated arg `id` description and `ui_teal_with_splash` description. …
kartikeyakirar Jan 31, 2024
9a92037
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Jan 31, 2024
53aa0ee
remove explicit return statements.
kartikeyakirar Feb 2, 2024
cf5accb
merge back from main
kartikeyakirar Feb 2, 2024
094d721
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Feb 2, 2024
bf5ef66
updating return statment.
kartikeyakirar Feb 2, 2024
35e43be
Merge branch 'pre-release-cleanup@main' of https://github.com/insight…
kartikeyakirar Feb 2, 2024
414a49e
1078 padding added (#1083)
chlebowa Feb 2, 2024
3df3fe8
fix argument check
Feb 2, 2024
3bdb09a
1076 reorder formals (#1080)
chlebowa Feb 2, 2024
cccf9da
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Feb 2, 2024
56a6a38
trigger
Feb 2, 2024
8885b8e
remove backticks around `CDISC` (#1055)
gogonzo Feb 5, 2024
e21919b
chore: remove unused non-exported function
vedhav Feb 5, 2024
19d9ecc
chore: remove unwanted :::
vedhav Feb 5, 2024
103a9b5
docs: make minor doc changes
vedhav Feb 5, 2024
f417317
Reduces the size of sub-directories (#1082)
averissimo Feb 5, 2024
1439cda
1074 merge documentation (#1087)
chlebowa Feb 5, 2024
2ea3699
Merge 1439cdada5ad88aca5559ac4347f690892aed08d into db0a420b84feaa9d9…
kartikeyakirar Feb 5, 2024
f57ac4b
[skip actions] Restyle files
github-actions[bot] Feb 5, 2024
5cc3bf7
1077 ensure reproducible app ids (#1085)
chlebowa Feb 5, 2024
edc93b3
Merge 5cc3bf781913ee1b48c8701aec30aeabe5381bc3 into db0a420b84feaa9d9…
kartikeyakirar Feb 5, 2024
3215477
[skip actions] Restyle files
github-actions[bot] Feb 5, 2024
b23ce9f
Update tests/testthat/test-rcode_utils.R
vedhav Feb 6, 2024
460258b
Update vignettes/blueprint/input_data.Rmd
vedhav Feb 6, 2024
e4e4166
Update R/get_rcode_utils.R
chlebowa Feb 6, 2024
a40289b
Update R/tdata.R
chlebowa Feb 6, 2024
4bd2ffe
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Feb 6, 2024
e30464f
break lines
Feb 6, 2024
b3a3d92
suppress styles
Feb 6, 2024
23f24b7
remove tripple colons where possible
Feb 6, 2024
f1ee4ec
add missing prefixes in test files
Feb 6, 2024
2e4d9e5
update get_rcode_str_install
Feb 6, 2024
607c13e
update docs
Feb 6, 2024
ef5815d
build docs
Feb 6, 2024
b21e722
Merge ef5815d8e74bea815d60471aa46715003f521a7c into db0a420b84feaa9d9…
kartikeyakirar Feb 6, 2024
c18d8ba
[skip actions] Restyle files
github-actions[bot] Feb 6, 2024
a53f8b1
Apply suggestions from code review
chlebowa Feb 6, 2024
f4f363d
Apply suggestions from code review
chlebowa Feb 6, 2024
0770fb9
Apply suggestions from code review
chlebowa Feb 6, 2024
e3cd488
Merge 0770fb9eef6028e140d4920867fccbc5f8153796 into db0a420b84feaa9d9…
kartikeyakirar Feb 6, 2024
10fbcd7
[skip actions] Restyle files
github-actions[bot] Feb 6, 2024
9457c3f
Apply suggestions from code review
chlebowa Feb 6, 2024
d661ec3
Apply suggestions from code review
chlebowa Feb 6, 2024
1a99766
apply review comments
Feb 6, 2024
e666295
Update R/landing_popup_module.R
chlebowa Feb 6, 2024
05cd093
Update R/landing_popup_module.R
chlebowa Feb 6, 2024
7f7bd3f
Apply suggestions from code review
chlebowa Feb 6, 2024
a8f4c7e
Apply suggestions from code review
chlebowa Feb 6, 2024
a254a42
Apply suggestions from code review
chlebowa Feb 6, 2024
a45f07f
[skip actions] Roxygen Man Pages Auto Update
dependabot-preview[bot] Feb 6, 2024
f64b997
Update R/validations.R
chlebowa Feb 6, 2024
027ad25
Update R/validate_inputs.R
chlebowa Feb 6, 2024
e1ac2f8
amend docs
Feb 6, 2024
4027faa
update vignette
Feb 6, 2024
7741f1e
apply review
Feb 6, 2024
58ea093
apply review
Feb 6, 2024
e1363b2
linter
Feb 6, 2024
309e581
update vignette
Feb 6, 2024
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
3 changes: 1 addition & 2 deletions .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
object_usage_linter = NULL
)
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated by roxygen2: do not edit by hand

S3method(c,teal_slices)
S3method(format,teal_module)
S3method(format,teal_modules)
S3method(get_metadata,default)
S3method(get_metadata,tdata)
S3method(join_keys,tdata)
Expand All @@ -9,8 +11,6 @@ S3method(print,teal_modules)
S3method(srv_nested_tabs,default)
S3method(srv_nested_tabs,teal_module)
S3method(srv_nested_tabs,teal_modules)
S3method(toString,teal_module)
S3method(toString,teal_modules)
S3method(ui_nested_tabs,default)
S3method(ui_nested_tabs,teal_module)
S3method(ui_nested_tabs,teal_modules)
Expand Down
46 changes: 23 additions & 23 deletions NEWS.md

Large diffs are not rendered by default.

108 changes: 4 additions & 104 deletions R/dummy_functions.R
Original file line number Diff line number Diff line change
@@ -1,81 +1,9 @@
#' Get dummy `CDISC` data
#'
#' Get dummy `CDISC` data including `ADSL`, `ADAE` and `ADLB`.
#' Some NAs are also introduced to stress test.
#'
#' @return `cdisc_data`
#' @keywords internal
example_cdisc_data <- function() { # nolint
ADSL <- data.frame( # nolint
STUDYID = "study",
USUBJID = 1:10,
SEX = sample(c("F", "M"), 10, replace = TRUE),
AGE = stats::rpois(10, 40)
)
ADTTE <- rbind(ADSL, ADSL, ADSL) # nolint
ADTTE$PARAMCD <- rep(c("OS", "EFS", "PFS"), each = 10) # nolint
ADTTE$AVAL <- c( # nolint
stats::rnorm(10, mean = 700, sd = 200), # dummy OS level
stats::rnorm(10, mean = 400, sd = 100), # dummy EFS level
stats::rnorm(10, mean = 450, sd = 200) # dummy PFS level
)

ADSL$logical_test <- sample(c(TRUE, FALSE, NA), size = nrow(ADSL), replace = TRUE) # nolint
ADSL$SEX[c(2, 5)] <- NA # nolint

res <- teal.data::cdisc_data(
ADSL = ADSL,
ADTTE = ADTTE,
code = '
ADSL <- data.frame(
STUDYID = "study",
USUBJID = 1:10,
SEX = sample(c("F", "M"), 10, replace = TRUE),
AGE = rpois(10, 40)
)
ADTTE <- rbind(ADSL, ADSL, ADSL)
ADTTE$PARAMCD <- rep(c("OS", "EFS", "PFS"), each = 10)
ADTTE$AVAL <- c(
rnorm(10, mean = 700, sd = 200),
rnorm(10, mean = 400, sd = 100),
rnorm(10, mean = 450, sd = 200)
)

ADSL$logical_test <- sample(c(TRUE, FALSE, NA), size = nrow(ADSL), replace = TRUE)
ADSL$SEX[c(2, 5)] <- NA
'
)
return(res)
}

#' Get datasets to go with example modules.
#'
#' Creates a nested list, the structure of which matches the module hierarchy created by `example_modules`.
#' Each list leaf is the same `FilteredData` object.
#'
#' @return named list of `FilteredData` objects, each with `ADSL` set.
#' @keywords internal
example_datasets <- function() { # nolint
dummy_cdisc_data <- example_cdisc_data()
datasets <- teal_data_to_filtered_data(dummy_cdisc_data)
list(
"d2" = list(
"d3" = list(
"aaa1" = datasets,
"aaa2" = datasets,
"aaa3" = datasets
),
"bbb" = datasets
),
"ccc" = datasets
)
}

#' An example `teal` module
#'
#' @description `r lifecycle::badge("experimental")`
#' `r lifecycle::badge("experimental")`
#'
#' @inheritParams module
#' @return A `teal` module which can be included in the `modules` argument to [teal::init()].
#' @return A `teal` module which can be included in the `modules` argument to [`teal::init()`].
kartikeyakirar marked this conversation as resolved.
Show resolved Hide resolved
#' @examples
#' app <- init(
#' data = teal_data(IRIS = iris, MTCARS = mtcars),
Expand All @@ -92,7 +20,6 @@ example_module <- function(label = "example teal module", datanames = "all") {
server = function(id, data) {
checkmate::assert_class(data(), "teal_data")
moduleServer(id, function(input, output, session) {
ns <- session$ns
updateSelectInput(session, "dataname", choices = isolate(teal.data::datanames(data())))
output$text <- renderPrint({
req(input$dataname)
Expand All @@ -101,7 +28,7 @@ example_module <- function(label = "example teal module", datanames = "all") {
teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(teal.code::get_code(data())),
title = "Association Plot"
title = "Example Code"
)
})
},
Expand All @@ -118,30 +45,3 @@ example_module <- function(label = "example teal module", datanames = "all") {
datanames = datanames
)
}


#' Get example modules.
#'
#' Creates an example hierarchy of `teal_modules` from which a `teal` app can be created.
#' @param datanames (`character`)\cr
#' names of the datasets to be used in the example modules. Possible choices are `ADSL`, `ADTTE`.
#' @return `teal_modules`
#' @keywords internal
example_modules <- function(datanames = c("ADSL", "ADTTE")) {
checkmate::assert_subset(datanames, c("ADSL", "ADTTE"))
mods <- modules(
label = "d1",
modules(
label = "d2",
modules(
label = "d3",
example_module(label = "aaa1", datanames = datanames),
example_module(label = "aaa2", datanames = datanames),
example_module(label = "aaa3", datanames = datanames)
),
example_module(label = "bbb", datanames = datanames)
),
example_module(label = "ccc", datanames = datanames)
)
return(mods)
}
4 changes: 2 additions & 2 deletions R/get_rcode_utils.R
chlebowa marked this conversation as resolved.
Show resolved Hide resolved
m7pr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ get_rcode_libraries <- function() {
paste0(collapse = "")
}



#' @noRd
#' @keywords internal
get_rcode_str_install <- function() {
chlebowa marked this conversation as resolved.
Show resolved Hide resolved
code_string <- getOption("teal.load_nest_code")

Expand Down
18 changes: 11 additions & 7 deletions R/include_css_js.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' `system.file` should not be used to access files in other packages, it does
#' not work with `devtools`. Therefore, we redefine this method in each package
#' as needed. Thus, we do not export this method
#' as needed. Thus, we do not export this method.
#'
#' @param pattern (`character`) pattern of files to be included
#'
Expand Down Expand Up @@ -48,7 +48,7 @@ include_js_files <- function(pattern = NULL, except = NULL) {
#'
#' `system.file` should not be used to access files in other packages, it does
#' not work with `devtools`. Therefore, we redefine this method in each package
#' as needed. Thus, we do not export this method
#' as needed. Thus, we do not export this method.
#'
#' @param files (`character`) vector of filenames
chlebowa marked this conversation as resolved.
Show resolved Hide resolved
#' @keywords internal
Expand All @@ -60,20 +60,24 @@ run_js_files <- function(files) {
return(invisible(NULL))
}

#' Code to include teal `CSS` and `JavaScript` files
#' Code to include `teal` `CSS` and `JavaScript` files
#'
#' This is useful when you want to use the same `JavaScript` and `CSS` files that are
#' used with the teal application.
#' This is also useful for running standalone modules in teal with the correct
#' used with the `teal` application.
#' This is also useful for running standalone modules in `teal` with the correct
#' styles.
#' Also initializes `shinyjs` so you can use it.
#'
kartikeyakirar marked this conversation as resolved.
Show resolved Hide resolved
#' @return HTML code to include
#' Simply add `include_teal_css_js()` as one of the UI elements.
#' @return A `shiny.tag.list`.
#' @examples
#' # use non-exported function from teal
#' include_teal_css_js <- getFromNamespace("include_teal_css_js", "teal")
#' shiny_ui <- tagList(
#' teal:::include_teal_css_js(),
#' include_teal_css_js(),
#' p("Hello")
#' )
#'
#' @keywords internal
include_teal_css_js <- function() {
tagList(
Expand Down
44 changes: 18 additions & 26 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,43 @@
# error messages.


#' Create the Server and UI Function For the Shiny App
#' Create the server and UI function for the `shiny` app
#'
#' @description `r lifecycle::badge("stable")`
#'
#' End-users: This is the most important function for you to start a
#' teal app that is composed out of teal modules.
#' `teal` app that is composed out of `teal` modules.
#'
#' @details
#' When initializing the `teal` app, if `datanames` are not set for the `teal_data` object,
#' defaults from the `teal_data` environment will be used.
#'
#' @param data (`teal_data`, `teal_data_module`, `named list`)\cr
#' `teal_data` object as returned by [teal.data::teal_data()] or
#' `teal_data_module` or simply a list of a named list of objects
#' (`data.frame` or `MultiAssayExperiment`).
#' @param modules (`list`, `teal_modules` or `teal_module`)\cr
#' @param data (`teal_data` or `teal_data_module`)
#' `teal_data` object as returned by [`teal.data::teal_data()`] or `teal_data_module`.
kartikeyakirar marked this conversation as resolved.
Show resolved Hide resolved
#' @param modules (`list` or `teal_modules` or `teal_module`)
#' nested list of `teal_modules` or `teal_module` objects or a single
#' `teal_modules` or `teal_module` object. These are the specific output modules which
#' will be displayed in the teal application. See [modules()] and [module()] for
#' will be displayed in the `teal` application. See [`modules()`] and [`module()`] for
#' more details.
#' @param title (`shiny.tag` or `character(1)`)\cr
#' @param title (`shiny.tag` or `character(1)`)
#' The browser window title. Defaults to a title "teal app" with the icon of NEST.
#' Can be created using the `build_app_title()` or
#' by passing a valid `shiny.tag` which is a head tag with title and link tag.
#' @param filter (`teal_slices`)\cr
#' Specification of initial filter. Filters can be specified using [teal::teal_slices()].
#' @param filter (`teal_slices`)
#' Specification of initial filter. Filters can be specified using [`teal::teal_slices()`].
pawelru marked this conversation as resolved.
Show resolved Hide resolved
#' Old way of specifying filters through a list is deprecated and will be removed in the
#' next release. Please fix your applications to use [teal::teal_slices()].
#' @param header (`shiny.tag` or `character(1)`) \cr
#' next release. Please fix your applications to use [`teal::teal_slices()`].
pawelru marked this conversation as resolved.
Show resolved Hide resolved
#' @param header (`shiny.tag` or `character(1)`)
#' The header of the app.
#' @param footer (`shiny.tag` or `character(1)`)\cr
#' @param footer (`shiny.tag` or `character(1)`)
#' The footer of the app.
#' @param id (`character`)\cr
#' @param id (`character`)
#' module id to embed it, if provided,
#' the server function must be called with [shiny::moduleServer()];
#' See the vignette for an example. However, [ui_teal_with_splash()]
#' is then preferred to this function.
#'
#' @return named list with `server` and `ui` function
#' @return named list with server and UI function
#'
#' @export
#'
Expand Down Expand Up @@ -119,14 +118,7 @@ init <- function(data,
)
)
}
checkmate::assert(
.var.name = "data",
checkmate::check_multi_class(data, c("teal_data", "teal_data_module")),
checkmate::check_list(data, names = "named")
)
if (is.list(data) && !inherits(data, "teal_data_module")) {
data <- do.call(teal.data::teal_data, data)
}
checkmate::assert_multi_class(data, c("teal_data", "teal_data_module"))

## `modules`
checkmate::assert(
Expand Down Expand Up @@ -217,7 +209,7 @@ init <- function(data,
## `data` - `modules`
if (inherits(data, "teal_data")) {
if (length(teal_data_datanames(data)) == 0) {
stop("`data` object has no datanames and its environment is empty. Specify `datanames(data)` and try again.")
stop("The environment of `data` is empty.")
}
# in case of teal_data_module this check is postponed to the srv_teal_with_splash
is_modules_ok <- check_modules_datanames(modules, teal_data_datanames(data))
Expand All @@ -236,7 +228,7 @@ init <- function(data,

# Note regarding case `id = character(0)`:
# rather than using `callModule` and creating a submodule of this module, we directly modify
# the `ui` and `server` with `id = character(0)` and calling the server function directly
# the UI and server with `id = character(0)` and calling the server function directly
# rather than through `callModule`
res <- list(
ui = ui_teal_with_splash(id = id, data = data, title = title, header = header, footer = footer),
Expand Down
21 changes: 11 additions & 10 deletions R/landing_popup_module.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#' Landing Popup Module
#' Landing popup module
#'
#' @description Creates a landing welcome popup for `teal` applications.
#'
#' This module is used to display a popup dialog when the application starts.
#' The dialog blocks the access to the application and must be closed with a button before the application is viewed.
#'
#' @param label `character(1)` the label of the module.
#' @param title `character(1)` the text to be displayed as a title of the popup.
#' @param label (`character(1)`) the label of the module.
#' @param title (`character(1)`) the text to be displayed as a title of the popup.
chlebowa marked this conversation as resolved.
Show resolved Hide resolved
#' @param content The content of the popup. Passed to `...` of `shiny::modalDialog`. Can be a `character`
#' or a list of `shiny.tag`s. See examples.
chlebowa marked this conversation as resolved.
Show resolved Hide resolved
#' @param buttons `shiny.tag` or a list of tags (`tagList`). Typically a `modalButton` or `actionButton`. See examples.
#' @param buttons (`shiny.tag`) or a list of tags (`tagList`).
#' Typically a `modalButton` or `actionButton`.See examples.
#'
#' @return A `teal_module` (extended with `teal_landing_module` class) to be used in `teal` applications.
#'
#' @examples
#' app1 <- teal::init(
#' app1 <- init(
#' data = teal_data(iris = iris),
#' modules = teal::modules(
#' teal::landing_popup_module(
#' modules = modules(
#' landing_popup_module(
#' content = "A place for the welcome message or a disclaimer statement.",
#' buttons = modalButton("Proceed")
#' ),
Expand All @@ -28,10 +29,10 @@
#' shinyApp(app1$ui, app1$server)
#' }
#'
#' app2 <- teal::init(
#' app2 <- init(
#' data = teal_data(iris = iris),
#' modules = teal::modules(
#' teal::landing_popup_module(
#' modules = modules(
#' landing_popup_module(
#' title = "Welcome",
#' content = tags$b(
#' "A place for the welcome message or a disclaimer statement.",
Expand Down
Loading