From 3590a9e21606f74da9ec5155a95f45ad6df457c2 Mon Sep 17 00:00:00 2001 From: Andreas Gammelgaard Damsbo Date: Mon, 18 Nov 2024 16:50:03 +0100 Subject: [PATCH] formatting --- inst/shiny-examples/casting/server.R | 11 +++++------ inst/shiny-examples/casting/ui.R | 16 ++++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/inst/shiny-examples/casting/server.R b/inst/shiny-examples/casting/server.R index 94c3bd7..9e756f4 100644 --- a/inst/shiny-examples/casting/server.R +++ b/inst/shiny-examples/casting/server.R @@ -32,6 +32,11 @@ server <- function(input, output, session) { # return(!is.null(getData())) # }) + dd <- shiny::reactive({ + shiny::req(input$ds) + v$file <- "loaded" + ds2dd_detailed(data = dat()) + }) output$uploaded <- shiny::reactive({ if (is.null(v$file)) { @@ -43,12 +48,6 @@ server <- function(input, output, session) { shiny::outputOptions(output, "uploaded", suspendWhenHidden = FALSE) - dd <- shiny::reactive({ - shiny::req(input$ds) - v$file <- "loaded" - ds2dd_detailed(data = dat()) - }) - output$data.tbl <- gt::render_gt( dd() |> purrr::pluck("data") |> diff --git a/inst/shiny-examples/casting/ui.R b/inst/shiny-examples/casting/ui.R index b9ae32b..7c5e9b6 100644 --- a/inst/shiny-examples/casting/ui.R +++ b/inst/shiny-examples/casting/ui.R @@ -19,17 +19,17 @@ ui <- ".ods" ) ), - shiny::actionButton( - inputId = "load_data", - label = "Load data", - icon = shiny::icon("circle-down") - ), + # shiny::actionButton( + # inputId = "load_data", + # label = "Load data", + # icon = shiny::icon("circle-down") + # ), shiny::helpText("Have a look at the preview panels to validate the data dictionary and imported data."), # For some odd reason this only unfolds when the preview panel is shown.. - # This has been solved by adding an arbitrary button to load data + # This has been solved by adding an arbitrary button to load data - which was abandoned again shiny::conditionalPanel( - # condition = "output.uploaded=='yes'", - condition = "input.load_data", + condition = "output.uploaded=='yes'", + # condition = "input.load_data", # shiny::helpText("Below you can download the dataset formatted for upload and the # corresponding data dictionary for a new data base, if you want to upload manually."), # Button