-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Improves datanames error message #1297
Improves datanames error message #1297
Conversation
…s_error@669_insertUI@main * origin/669_insertUI@main: [skip style] [skip vbump] Restyle files fix: silent error showing in console restart cicd
Hey @averissimo there is a conflict in req(!inherits(attr(summary_table_out, "condition"), "shiny.silent.error")) |
…s_error@669_insertUI@main * origin/669_insertUI@main: tests: update tests with modified transform code tests: add test for expected behavior on fallback and recovery fix: trigger .fallback when upstream data changes fix: correct the broken test logic chore: fix spellcheck [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update [skip style] [skip vbump] Restyle files Exclude the "_raw" datasets only if the original dataset exists (#1305)
@m7pr thanks! |
list( | ||
string = build_datanames_error_message( | ||
modules$label, | ||
datanames, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We enumerate all available datanames in the included object even those irrelevant for the module. If mod-2
uses only c("iris", "inexisting")
, then listing ADSL
, ADTTE
, etc. seems irrelevant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it as a helpuful debugging information when the app developer is designing the app, but it will be irrelevant for normal users. So, does it:
- Makes sense to keep a second part of the message?
- Or should we keep the valid datanames and say: "
iris
is available" (for your example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with both as far as (1) will be rephrased little bit. available data for 'mod-2', which has:
. It is not straightforward what "which has" is exactly pointing to, module or data?
I'd prefer: Dataset(s) ... is/are missing for tab 'mod-2'. Datasets available in data: ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added messsage exception when there are no datasets available:
No datasets available example
options(
teal.log_level = "TRACE",
teal.show_js_log = TRUE,
# teal.bs_theme = bslib::bs_theme(version = 5),
shiny.bookmarkStore = "server"
)
pkgload::load_all("teal.data")
pkgload::load_all("teal.slice")
pkgload::load_all("teal")
my_transformers <- list(
teal_transform_module(
label = "Add ELO",
ui = function(id) {
ns <- NS(id)
tagList(
div("Some UI for transform (merge)"),
actionButton(ns("btn"), "Reload data")
)
},
server = function(id, data) {
moduleServer(id, function(input, output, session) {
eventReactive(input$btn, {
data() |> within(mtcars <- datasets::mtcars)
})
})
}
)
)
teal::init(
data = teal.data::teal_data(iris = iris),
modules = list(
example_module("mod-1", datanames = c("mtcars"), transformers = my_transformers),
example_module("mod-2", datanames = c("iris"))
)
) |>
runApp()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spennande!
Part of #1253
Changes description
check_modules_datanames
returns a string and HTML generator for:c("one", "two", "three")
renders as "one, two and three" (note the comma andand
)Sample app