Skip to content

Commit

Permalink
testing environment variable LOCAL for js
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Dec 18, 2024
1 parent f5f7bec commit 3a59b9e
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 32 deletions.
51 changes: 35 additions & 16 deletions app/MainApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ 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"
)
)
)
return(res)
}
return(NULL)
}
uf <- upload_fct()

app <- function() {
js <- js_scripts()
ui <- fluidPage(
Expand Down Expand Up @@ -354,22 +372,23 @@ app <- function() {
})

output$conditional_data_ui <- renderUI({
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)
}
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)
# }
})

download_file <- reactive({
Expand Down
51 changes: 35 additions & 16 deletions bs/R/MainApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ 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"
)
)
)
return(res)
}
return(NULL)
}
uf <- upload_fct()

app <- function() {
js <- js_scripts()
ui <- fluidPage(
Expand Down Expand Up @@ -354,22 +372,23 @@ app <- function() {
})

output$conditional_data_ui <- renderUI({
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)
}
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)
# }
})

download_file <- reactive({
Expand Down

0 comments on commit 3a59b9e

Please sign in to comment.