Skip to content

Commit

Permalink
data is teal_data
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Oct 2, 2023
1 parent c3adcbf commit b1de788
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ init <- function(data,
footer = tags$p(),
id = character(0)) {
logger::log_trace("init initializing teal app with: data ({ class(data)[1] }).")
if (!inherits(data, c("TealData", "tdata", "ddl"))) {
if (!inherits(data, c("TealData", "teal_data", "ddl"))) {
data <- teal.data::to_relational_data(data = data)
}

checkmate::assert_multi_class(data, c("TealData", "tdata", "ddl"))
checkmate::assert_multi_class(data, c("TealData", "teal_data", "ddl"))
checkmate::assert_multi_class(modules, c("teal_module", "list", "teal_modules"))
checkmate::assert_string(title, null.ok = TRUE)
checkmate::assert(
Expand Down
8 changes: 4 additions & 4 deletions R/module_teal_with_splash.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ ui_teal_with_splash <- function(id,
title,
header = tags$p("Add Title Here"),
footer = tags$p("Add Footer Here")) {
checkmate::assert_multi_class(data, c("TealDataAbstract", "tdata", "ddl"))
checkmate::assert_multi_class(data, c("TealDataAbstract", "teal_data", "ddl"))
ns <- NS(id)

# Startup splash screen for delayed loading
# We use delayed loading in all cases, even when the data does not need to be fetched.
# This has the benefit that when filtering the data takes a lot of time initially, the
# Shiny app does not time out.
splash_ui <- if (inherits(data, "tdata")) {
splash_ui <- if (inherits(data, "teal_data")) {
div()
} else if (inherits(data, "ddl")) {
data$ui(ns("startapp_module"))
Expand Down Expand Up @@ -57,7 +57,7 @@ ui_teal_with_splash <- function(id,
#' @return `reactive`, return value of [srv_teal()]
#' @export
srv_teal_with_splash <- function(id, data, modules, filter = teal_slices()) {
checkmate::assert_multi_class(data, c("TealDataAbstract", "tdata", "ddl"))
checkmate::assert_multi_class(data, c("TealDataAbstract", "teal_data", "ddl"))
moduleServer(id, function(input, output, session) {
logger::log_trace(
"srv_teal_with_splash initializing module with data { paste(data$get_datanames(), collapse = ' ')}."
Expand All @@ -70,7 +70,7 @@ srv_teal_with_splash <- function(id, data, modules, filter = teal_slices()) {
# raw_data contains TealDataAbstract, i.e. R6 object and container for data
# reactive to get data through delayed loading
# we must leave it inside the server because of callModule which needs to pick up the right session
raw_data <- if (inherits(data, "tdata")) {
raw_data <- if (inherits(data, "teal_data")) {
reactiveVal(data)
} else if (inherits(data, "ddl")) {
data$server("startapp_module")
Expand Down

0 comments on commit b1de788

Please sign in to comment.