Skip to content

Commit

Permalink
Fix broken examples (#351)
Browse files Browse the repository at this point in the history
Closes insightsengineering/teal.slice#492

We don't accept data in module UI anymore & there was a missing dataname
in one example.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Daniel Sabanes Bove <[email protected]>
  • Loading branch information
4 people authored Feb 13, 2024
1 parent 68f3307 commit 24e46bd
Show file tree
Hide file tree
Showing 41 changed files with 104 additions and 203 deletions.
2 changes: 1 addition & 1 deletion R/adtteSpec.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ adtteSpecInput <- function(inputId, # nolint
#' dplyr::mutate(is_event = .data$CNSR == 0)
#' MAE <- hermes::multi_assay_experiment
#' })
#' datanames <- c("ADTTE", "MAE")
#' datanames <- c("ADSL", "ADTTE", "MAE")
#' datanames(data) <- datanames
#' join_keys(data) <- default_cdisc_join_keys[datanames]
#'
Expand Down
31 changes: 17 additions & 14 deletions R/experimentSpec.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,10 @@ h_gene_data <- function(object, name_annotation) {
#'
#' @examples
#' ui <- function(id,
#' data,
#' mae_name) {
#' ns <- NS(id)
#' teal.widgets::standard_layout(
#' encoding = div(
#' experimentSpecInput(
#' ns("my_experiment"),
#' data,
#' mae_name,
#' label_experiments = "Please choose experiment"
#' ),
#' selectInput(
#' ns("property"),
#' "Please choose property",
#' c("data", "name", "genes", "assays")
#' )
#' ),
#' encoding = uiOutput(ns("encoding_ui")),
#' output = div(
#' verbatimTextOutput(ns("summary")),
#' verbatimTextOutput(ns("head"))
Expand All @@ -157,13 +144,29 @@ h_gene_data <- function(object, name_annotation) {
#' filter_panel_api,
#' mae_name) {
#' moduleServer(id, function(input, output, session) {
#' output$encoding_ui <- renderUI({
#' div(
#' experimentSpecInput(
#' session$ns("my_experiment"),
#' data,
#' mae_name,
#' label_experiments = "Please choose experiment"
#' ),
#' selectInput(
#' session$ns("property"),
#' "Please choose property",
#' c("data", "name", "genes", "assays")
#' )
#' )
#' })
#' experiment <- experimentSpecServer(
#' "my_experiment",
#' data,
#' filter_panel_api,
#' mae_name
#' )
#' result <- reactive({
#' req(input$property)
#' switch(input$property,
#' data = experiment$data(),
#' name = experiment$name(),
Expand Down
122 changes: 0 additions & 122 deletions design/cdse_connector_datasets_tests.R

This file was deleted.

2 changes: 1 addition & 1 deletion man/adtteSpecServer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 17 additions & 14 deletions man/experimentSpecServer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/km/km-001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/mac-4.3/pca/pca-010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions tests/testthat/adtteSpec/app.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
library(teal.modules.hermes)

ui <- function(id,
data) {
ui <- function(id) {
ns <- NS(id)

teal.widgets::standard_layout(
encoding = div(
experimentSpecInput(ns("experiment"), data = data, mae_name = "MAE"),
uiOutput(ns("experiment_ui")),
assaySpecInput(ns("assay")),
geneSpecInput(ns("genes"), funs = list(Mean = colMeans)),
adtteSpecInput(ns("adtte"))
Expand All @@ -19,6 +18,9 @@ server <- function(id,
data,
filter_panel_api) {
moduleServer(id, function(input, output, session) {
output$experiment_ui <- renderUI({
experimentSpecInput(session$ns("experiment"), data = data, mae_name = "MAE")
})
experiment <- experimentSpecServer(
"experiment",
data = data,
Expand Down
19 changes: 11 additions & 8 deletions tests/testthat/assaySpec/app.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
library(teal.modules.hermes)

ui <- function(id,
data) {
ui <- function(id) {
ns <- NS(id)

teal.widgets::standard_layout(
encoding = div(
experimentSpecInput(
ns("experiment"),
data = data,
mae_name = "MAE"
),
uiOutput(ns("experiment_ui")),
assaySpecInput(
ns("assay"),
label_assays = "Please choose assay"
Expand All @@ -22,8 +17,16 @@ ui <- function(id,

server <- function(id,
data,
filter_panel_api) {
filter_panel_api,
mae_name) {
moduleServer(id, function(input, output, session) {
output$experiment_ui <- renderUI({
experimentSpecInput(
session$ns("experiment"),
data = data,
mae_name = "MAE"
)
})
experiment <- experimentSpecServer(
"experiment",
data = data,
Expand Down
22 changes: 11 additions & 11 deletions tests/testthat/experimentSpec/app.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
library(teal.modules.hermes)

ui <- function(id,
data,
mae_name) {
ui <- function(id) {
ns <- NS(id)
teal.widgets::standard_layout(
encoding = div(
experimentSpecInput(
ns("my_experiment"),
data,
mae_name,
label_experiments = "Please choose experiment"
),
uiOutput(ns("experiment_ui")),
selectInput(
ns("property"),
"Please choose property",
Expand All @@ -30,6 +23,14 @@ server <- function(id,
filter_panel_api,
mae_name) {
moduleServer(id, function(input, output, session) {
output$experiment_ui <- renderUI({
experimentSpecInput(
session$ns("my_experiment"),
data,
mae_name,
label_experiments = "Please choose experiment"
)
})
experiment <- experimentSpecServer(
"my_experiment",
data,
Expand Down Expand Up @@ -63,9 +64,8 @@ my_app <- function() {
teal::module(
label = "experimentSpec example",
server = server,
server_args = list(mae_name = mae_name),
server_args = list(mae_name = "MAE"),
ui = ui,
ui_args = list(mae_name = mae_name),
datanames = "all"
)
)
Expand Down
4 changes: 1 addition & 3 deletions tests/testthat/geneSpec/app.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
library(teal.modules.hermes)

ui <- function(id,
data,
funs) {
ui <- function(id, funs) {
ns <- NS(id)
teal.widgets::standard_layout(
encoding = div(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/helper-shinytest2.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module_ns_shiny2 <- function(app) {
}

ns2 <- NS("teal-main_ui-filter_panel")
default_app_seed <- 123

# expect_select_screenshot ----
shinytest2::AppDriver$set(
Expand Down
Loading

0 comments on commit 24e46bd

Please sign in to comment.