diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6684c09a0..347dffa0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/lorenzwalthert/precommit - rev: v0.4.2 + rev: v0.4.3 hooks: - id: style-files name: Style code with `styler` diff --git a/DESCRIPTION b/DESCRIPTION index 0e68e3304..241ddf308 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: teal.modules.general Title: General Modules for 'teal' Applications -Version: 0.3.0.9038 -Date: 2024-06-27 +Version: 0.3.0.9040 +Date: 2024-08-14 Authors@R: c( person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre")), person("Pawel", "Rucki", , "pawel.rucki@roche.com", role = "aut"), @@ -27,7 +27,7 @@ Depends: ggplot2 (>= 3.4.0), R (>= 3.6), shiny (>= 1.6.0), - teal (>= 0.15.1), + teal (>= 0.15.2.9052), teal.transform (>= 0.5.0) Imports: checkmate (>= 2.1.0), @@ -94,8 +94,7 @@ Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2, daroczig/logger, deepayan/lattice, MASS, insightsengineering/nestcolor, r-lib/rlang, rstudio/rmarkdown, insightsengineering/rtables, tidyverse/rvest, sparkline, - rstudio/shinytest2, insightsengineering/teal.data, r-lib/testthat, - r-lib/withr + rstudio/shinytest2, r-lib/testthat, r-lib/withr Config/Needs/website: insightsengineering/nesttemplate Encoding: UTF-8 Language: en-US diff --git a/NEWS.md b/NEWS.md index 029e1412b..d5620160f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,14 +1,17 @@ -# teal.modules.general 0.3.0.9038 +# teal.modules.general 0.3.0.9040 * Removed `Show Warnings` modals from modules. ### Enhancements * Added `teal.logger` functionality for logging changes in shiny inputs in all modules. +### Bug fixes +* Fixed a bug in `tm_missing_data` in "Group by Subject" that was not using reactive data call. + # teal.modules.general 0.3.0 ### Enhancements -* Updated the package docs and vignettes with the new way of specifying data for `teal::init()`. The `data` argument will accept a `teal_data` object +* Updated the package docs and vignettes with the new way of specifying data for `teal::init()`. The `data` argument will accept a `teal_data` object. ### Bug fixes * Outlier labels no longer appear out of bounds in `tm_a_regression`. diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index de72ee834..7af029e74 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -464,8 +464,8 @@ srv_missing_data <- function(id, data, reporter, filter_panel_api, dataname, par data_parent_keys <- reactive({ - if (length(parent_dataname) > 0 && parent_dataname %in% names(data)) { - keys <- teal.data::join_keys(data)[[dataname]] + if (length(parent_dataname) > 0 && parent_dataname %in% teal.data::datanames(data())) { + keys <- teal.data::join_keys(data())[[dataname]] if (parent_dataname %in% names(keys)) { keys[[parent_dataname]] } else { diff --git a/tests/testthat/test-shinytest2-tm_a_regression.R b/tests/testthat/test-shinytest2-tm_a_regression.R index a8e010b32..ee09a7656 100644 --- a/tests/testthat/test-shinytest2-tm_a_regression.R +++ b/tests/testthat/test-shinytest2-tm_a_regression.R @@ -53,11 +53,11 @@ testthat::test_that("e2e - tm_a_regression: Data parameter and module label is p app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Regression" ) - encoding_dataset <- app_driver$get_text("#teal-main_ui-root-regression .help-block") + encoding_dataset <- app_driver$get_text("#teal-teal_modules-regression .help-block") testthat::expect_match(encoding_dataset, "Dataset:[\n ]*CO2", all = FALSE) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_data_table.R b/tests/testthat/test-shinytest2-tm_data_table.R index 91a5b4cc2..c6330d43d 100644 --- a/tests/testthat/test-shinytest2-tm_data_table.R +++ b/tests/testthat/test-shinytest2-tm_data_table.R @@ -27,7 +27,7 @@ test_that("e2e - tm_data_table: Initializes without errors", { app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Data Table" ) diff --git a/tests/testthat/test-shinytest2-tm_file_viewer.R b/tests/testthat/test-shinytest2-tm_file_viewer.R index 1b47cbd00..7a6eb12c6 100644 --- a/tests/testthat/test-shinytest2-tm_file_viewer.R +++ b/tests/testthat/test-shinytest2-tm_file_viewer.R @@ -34,7 +34,7 @@ test_that("e2e - tm_file_viewer: Initializes without errors and shows files tree ) testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "File Viewer Module" ) diff --git a/tests/testthat/test-shinytest2-tm_front_page.R b/tests/testthat/test-shinytest2-tm_front_page.R index 573de7288..c329db949 100644 --- a/tests/testthat/test-shinytest2-tm_front_page.R +++ b/tests/testthat/test-shinytest2-tm_front_page.R @@ -28,7 +28,7 @@ test_that("e2e - tm_front_page: Initializes without errors and check html elemen app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Front page" ) diff --git a/tests/testthat/test-shinytest2-tm_g_association.R b/tests/testthat/test-shinytest2-tm_g_association.R index ac3c73401..a5219639e 100644 --- a/tests/testthat/test-shinytest2-tm_g_association.R +++ b/tests/testthat/test-shinytest2-tm_g_association.R @@ -52,11 +52,11 @@ testthat::test_that("e2e - tm_g_association: Data parameter and module label is app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Association" ) - encoding_dataset <- app_driver$get_text("#teal-main_ui-root-association .help-block") + encoding_dataset <- app_driver$get_text("#teal-teal_modules-association .help-block") testthat::expect_match(encoding_dataset, "Dataset:[\n ]*CO2", all = FALSE) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_g_scatterplotmatrix.R b/tests/testthat/test-shinytest2-tm_g_scatterplotmatrix.R index 1f1b6e7e9..429e67b41 100644 --- a/tests/testthat/test-shinytest2-tm_g_scatterplotmatrix.R +++ b/tests/testthat/test-shinytest2-tm_g_scatterplotmatrix.R @@ -51,11 +51,11 @@ test_that("e2e - tm_g_scatterplotmatrix: Initializes without errors", { app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Scatterplot matrix" ) - encoding_dataset <- app_driver$get_text("#teal-main_ui-root-scatterplot_matrix .help-block") + encoding_dataset <- app_driver$get_text("#teal-teal_modules-scatterplot_matrix .help-block") testthat::expect_match(encoding_dataset, "Datasets.*ADSL.*ADRS", all = FALSE) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_misssing_data.R b/tests/testthat/test-shinytest2-tm_misssing_data.R index b0ac9a212..af35629ab 100644 --- a/tests/testthat/test-shinytest2-tm_misssing_data.R +++ b/tests/testthat/test-shinytest2-tm_misssing_data.R @@ -42,7 +42,7 @@ test_that("e2e - tm_missing_data: Initializes without errors", { app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Missing data" ) diff --git a/tests/testthat/test-shinytest2-tm_outliers.R b/tests/testthat/test-shinytest2-tm_outliers.R index a846c2a8b..33141e7ad 100644 --- a/tests/testthat/test-shinytest2-tm_outliers.R +++ b/tests/testthat/test-shinytest2-tm_outliers.R @@ -56,11 +56,11 @@ testthat::test_that("e2e - tm_outliers: Data parameter and module label is passe app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Outliers Module" ) - encoding_dataset <- app_driver$get_text("#teal-main_ui-root-outliers_module .help-block") + encoding_dataset <- app_driver$get_text("#teal-teal_modules-outliers_module .help-block") testthat::expect_match(encoding_dataset, "Dataset:[\n ]*CO2", all = FALSE) testthat::expect_match(encoding_dataset, "Outlier data points", all = FALSE) diff --git a/tests/testthat/test-shinytest2-tm_t_crosstable.R b/tests/testthat/test-shinytest2-tm_t_crosstable.R index ff47b2ed7..8c55b365d 100644 --- a/tests/testthat/test-shinytest2-tm_t_crosstable.R +++ b/tests/testthat/test-shinytest2-tm_t_crosstable.R @@ -50,11 +50,11 @@ test_that("e2e - tm_t_crosstable: Initializes without errors", { app_driver$expect_no_shiny_error() testthat::expect_equal( - app_driver$get_text("#teal-main_ui-root-active_tab > li.active > a"), + app_driver$get_text("#teal-teal_modules-active_tab > li.active > a"), "Cross Table" ) - encoding_dataset <- app_driver$get_text("#teal-main_ui-root-cross_table .help-block") + encoding_dataset <- app_driver$get_text("#teal-teal_modules-cross_table .help-block") testthat::expect_match(encoding_dataset, "Dataset:\\n *ADSL\\n", all = FALSE) app_driver$stop() diff --git a/tests/testthat/test-shinytest2-tm_variable_browser.R b/tests/testthat/test-shinytest2-tm_variable_browser.R index a81aa2acb..854f1352d 100644 --- a/tests/testthat/test-shinytest2-tm_variable_browser.R +++ b/tests/testthat/test-shinytest2-tm_variable_browser.R @@ -35,7 +35,7 @@ testthat::test_that("e2e - tm_variable_browser: content is displayed correctly." # Test tab name testthat::expect_equal( - trimws(app_driver$get_text("#teal-main_ui-root-active_tab > li.active")), + trimws(app_driver$get_text("#teal-teal_modules-active_tab > li.active")), "Variable browser (e2e)" )