From 9d239d1245f2d6d46bb74dfb04a1db307a7ed494 Mon Sep 17 00:00:00 2001 From: Konrad1991 Date: Wed, 18 Dec 2024 14:52:49 +0100 Subject: [PATCH] testing environment variable LOCAL for js --- app/MainApp.R | 29 ++++++++++++++--------------- bs/R/MainApp.R | 29 ++++++++++++++--------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/app/MainApp.R b/app/MainApp.R index 779f57e..19bf06e 100644 --- a/app/MainApp.R +++ b/app/MainApp.R @@ -18,25 +18,24 @@ js_scripts <- function() { } upload_fct <- function() { - output$conditional_data_ui <- renderUI({ - if (Sys.getenv("RUN_MODE") != "SERVER") { - res <- conditionalPanel( - condition = "input.conditionedPanels == 'Data'", - fileInput("file", "Choose CSV File", - accept = c( - "text/csv", - "text/comma-separated-values,text/plain", - ".csv" - ) + if (Sys.getenv("RUN_MODE") != "SERVER") { + res <- conditionalPanel( + condition = "input.conditionedPanels == 'Data'", + fileInput("file", "Choose CSV File", + accept = c( + "text/csv", + "text/comma-separated-values,text/plain", + ".csv" ) ) - return(res) - } - }) + ) + return(res) + } } app <- function() { js <- js_scripts() + uf <- upload_fct() ui <- fluidPage( useShinyjs(), @@ -144,7 +143,8 @@ app <- function() { div( conditionalPanel( condition = "input.conditionedPanels == 'Data'", - uiOutput("conditional_data_ui"), + # uiOutput("conditional_data_ui"), + uf, tags$hr() ), conditionalPanel( @@ -386,7 +386,6 @@ app <- function() { ) ) ) - showNotification(as.character(res)) return(res) } }) diff --git a/bs/R/MainApp.R b/bs/R/MainApp.R index 779f57e..19bf06e 100644 --- a/bs/R/MainApp.R +++ b/bs/R/MainApp.R @@ -18,25 +18,24 @@ js_scripts <- function() { } upload_fct <- function() { - output$conditional_data_ui <- renderUI({ - if (Sys.getenv("RUN_MODE") != "SERVER") { - res <- conditionalPanel( - condition = "input.conditionedPanels == 'Data'", - fileInput("file", "Choose CSV File", - accept = c( - "text/csv", - "text/comma-separated-values,text/plain", - ".csv" - ) + if (Sys.getenv("RUN_MODE") != "SERVER") { + res <- conditionalPanel( + condition = "input.conditionedPanels == 'Data'", + fileInput("file", "Choose CSV File", + accept = c( + "text/csv", + "text/comma-separated-values,text/plain", + ".csv" ) ) - return(res) - } - }) + ) + return(res) + } } app <- function() { js <- js_scripts() + uf <- upload_fct() ui <- fluidPage( useShinyjs(), @@ -144,7 +143,8 @@ app <- function() { div( conditionalPanel( condition = "input.conditionedPanels == 'Data'", - uiOutput("conditional_data_ui"), + # uiOutput("conditional_data_ui"), + uf, tags$hr() ), conditionalPanel( @@ -386,7 +386,6 @@ app <- function() { ) ) ) - showNotification(as.character(res)) return(res) } })