From 1dfb0945a56348a9e17e46262823ef0dd3f28d98 Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:54:51 +0200 Subject: [PATCH 1/4] Update DESCRIPTION (#770) remove duplicated entry from config/needs/verdepcheck Signed-off-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> --- DESCRIPTION | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5c72cdb23..bdd6f8f6a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -94,11 +94,10 @@ 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 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 From 74b71af578cd72e3716caa21e780ac2ea5cfad77 Mon Sep 17 00:00:00 2001 From: pawelru Date: Tue, 6 Aug 2024 15:55:49 +0000 Subject: [PATCH 2/4] [skip actions] Bump version to 0.3.0.9039 --- .pre-commit-config.yaml | 2 +- DESCRIPTION | 4 ++-- NEWS.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 bdd6f8f6a..d7aef173f 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.9039 +Date: 2024-08-06 Authors@R: c( person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre")), person("Pawel", "Rucki", , "pawel.rucki@roche.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 029e1412b..28177aa9a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# teal.modules.general 0.3.0.9038 +# teal.modules.general 0.3.0.9039 * Removed `Show Warnings` modals from modules. From a503250fdb623b91f08f2cd5920d56e7078d8cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:31:59 +0100 Subject: [PATCH 3/4] Fixes data reactivity in `tm_missing_data` (#773) # Pull Request Fixes #772 #### Changes description - Convert `data` -> `data()` - Use `datanames()` instead of `names()` --------- Co-authored-by: vedhav --- DESCRIPTION | 2 +- NEWS.md | 5 ++++- R/tm_missing_data.R | 4 ++-- tests/testthat/test-shinytest2-tm_a_regression.R | 4 ++-- tests/testthat/test-shinytest2-tm_data_table.R | 2 +- tests/testthat/test-shinytest2-tm_file_viewer.R | 2 +- tests/testthat/test-shinytest2-tm_front_page.R | 2 +- tests/testthat/test-shinytest2-tm_g_association.R | 4 ++-- tests/testthat/test-shinytest2-tm_g_scatterplotmatrix.R | 4 ++-- tests/testthat/test-shinytest2-tm_misssing_data.R | 2 +- tests/testthat/test-shinytest2-tm_outliers.R | 4 ++-- tests/testthat/test-shinytest2-tm_t_crosstable.R | 4 ++-- tests/testthat/test-shinytest2-tm_variable_browser.R | 2 +- 13 files changed, 22 insertions(+), 19 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d7aef173f..2b0ce79d8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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), diff --git a/NEWS.md b/NEWS.md index 28177aa9a..4d52780ad 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,10 +5,13 @@ ### 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)" ) From 5ac52a5575b236a4c0e8bd7200fadcdbb1fd7d0c Mon Sep 17 00:00:00 2001 From: averissimo Date: Wed, 14 Aug 2024 14:32:55 +0000 Subject: [PATCH 4/4] [skip actions] Bump version to 0.3.0.9040 --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2b0ce79d8..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.9039 -Date: 2024-08-06 +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"), diff --git a/NEWS.md b/NEWS.md index 4d52780ad..d5620160f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# teal.modules.general 0.3.0.9039 +# teal.modules.general 0.3.0.9040 * Removed `Show Warnings` modals from modules.