From ab1a996304080d448c423b557f9e9f55589ad422 Mon Sep 17 00:00:00 2001 From: Konrad1991 Date: Wed, 18 Dec 2024 14:42:28 +0100 Subject: [PATCH] testing environment variable LOCAL for js --- app/MainApp.R | 60 +++++++++++++++++++++++++------------------------- bs/R/MainApp.R | 60 +++++++++++++++++++++++++------------------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/app/MainApp.R b/app/MainApp.R index 6328595..779f57e 100644 --- a/app/MainApp.R +++ b/app/MainApp.R @@ -18,22 +18,22 @@ js_scripts <- function() { } upload_fct <- function() { - 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" + 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" + ) ) ) - ) - return(res) - } - return(NULL) + return(res) + } + }) } -uf <- upload_fct() app <- function() { js <- js_scripts() @@ -372,23 +372,23 @@ app <- function() { }) output$conditional_data_ui <- renderUI({ - uf - # if (Sys.getenv("RUN_MODE") != "SERVER") { - # res <- div( - # class = "var-box-output", - # conditionalPanel( - # condition = "input.conditionedPanels == 'Data'", - # fileInput("file", "Choose CSV File", - # accept = c( - # "text/csv", - # "text/comma-separated-values,text/plain", - # ".csv" - # ) - # ) - # ) - # ) - # return(res) - # } + if (Sys.getenv("RUN_MODE") != "SERVER") { + res <- div( + class = "var-box-output", + conditionalPanel( + condition = "input.conditionedPanels == 'Data'", + fileInput("file", "Choose CSV File", + accept = c( + "text/csv", + "text/comma-separated-values,text/plain", + ".csv" + ) + ) + ) + ) + showNotification(as.character(res)) + return(res) + } }) download_file <- reactive({ diff --git a/bs/R/MainApp.R b/bs/R/MainApp.R index 6328595..779f57e 100644 --- a/bs/R/MainApp.R +++ b/bs/R/MainApp.R @@ -18,22 +18,22 @@ js_scripts <- function() { } upload_fct <- function() { - 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" + 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" + ) ) ) - ) - return(res) - } - return(NULL) + return(res) + } + }) } -uf <- upload_fct() app <- function() { js <- js_scripts() @@ -372,23 +372,23 @@ app <- function() { }) output$conditional_data_ui <- renderUI({ - uf - # if (Sys.getenv("RUN_MODE") != "SERVER") { - # res <- div( - # class = "var-box-output", - # conditionalPanel( - # condition = "input.conditionedPanels == 'Data'", - # fileInput("file", "Choose CSV File", - # accept = c( - # "text/csv", - # "text/comma-separated-values,text/plain", - # ".csv" - # ) - # ) - # ) - # ) - # return(res) - # } + if (Sys.getenv("RUN_MODE") != "SERVER") { + res <- div( + class = "var-box-output", + conditionalPanel( + condition = "input.conditionedPanels == 'Data'", + fileInput("file", "Choose CSV File", + accept = c( + "text/csv", + "text/comma-separated-values,text/plain", + ".csv" + ) + ) + ) + ) + showNotification(as.character(res)) + return(res) + } }) download_file <- reactive({